Listing users by clicking on a letter of their name Listing users by clicking on a letter of their name
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Listing users by clicking on a letter of their name

Started by jtorral, May 01, 2005, 06:36:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jtorral

Is there a way of seeing all users based on an alphabet selection? For example a list of a to z. if I click on say, D , I get a list of user whos names begin with D.  This would be very useful. Especially since I have nearly 2k users.

Thanks


jtorral

Could not get it going on cpg133. Thats why i asked again.  Hope its available in th enext version.

I actually created a dropdown list of the users where you can just select the user by name. But I cannot get it working on the templates.html

I wouldnt mind getting it to display near the top.  Think you could do it?  I will post the code in a minute.

jtorral

here is the code.  This shoud work with any site. I just need to get this on the template.html file some how.


<?php

include('/path/to/your/vb/config.php');

$connectstring = mysql_connect("$servername", "$dbusername", "$dbpassword");
mysql_select_db(rangefinder);

echo "<form method='get' name = 'albform' action='http://www.rangefinderforum.com/cpg/index.php?cat=$cat'>";

$query = "SELECT userid + 10000, username FROM user ORDER by username";

   $result = mysql_query($query, $connectstring);

   echo "<SELECT NAME='cat'>";
      while ( $fetched_row  = mysql_fetch_row($result) )
         {
            $cat = $fetched_row[0];
            $owner = strtoupper($fetched_row[1]);
           
            echo "<OPTION VALUE='$cat'>$owner</OPTION>";

         }

  echo "</SELECT>";

  echo "<INPUT TYPE='SUBMIT' VALUE='Go to Gallery'>";
  echo "</form>";


?>