Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Listing users by clicking on a letter of their name  (Read 3554 times)

0 Members and 1 Guest are viewing this topic.

jtorral

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 10
Listing users by clicking on a letter of their name
« on: May 01, 2005, 06:36:14 pm »

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
Logged

Nibbler

  • Guest
Re: Listing users by clicking on a letter of their name
« Reply #1 on: May 01, 2005, 06:38:39 pm »

Logged

jtorral

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 10
Re: Listing users by clicking on a letter of their name
« Reply #2 on: May 01, 2005, 06:42:49 pm »

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.
Logged

jtorral

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 10
Re: Listing users by clicking on a letter of their name
« Reply #3 on: May 01, 2005, 06:47:38 pm »

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>";


?>
Logged
Pages: [1]   Go Up
 

Page created in 0.037 seconds with 15 queries.