The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
Yup, I'm quick. 2 days after the program is released and people (well, me) are already releasing hacks.
This is a port of the memberlist hack from UBB. But it also has a decent search feature too. Copy all the code into memberlist.php and put it in your main vBulletin directory. Here is my demo: http://www.magic-singles.com/cpa/forums/memberlist.php (NOTE: THIS IS THE TEMPLATE-IZED VERSION) Now, here's the code: Code:
<? require("global.php"); //TOP POSTERS AMOUNT $topposternum = 10; if ($numperpage=="") { // NUMBER OF RECORDS PER PAGE $numperpage = 30; } $numperpage2 = $numperpage; $numperpage -= 1; if (isset($action)==0 or $action=="") { $action="getall"; } if ($action=="getall") { $cssinclude = gettemplate("cssinclude"); $condition="1=1"; if ($ausername!="") { $condition.=" AND INSTR(username,'".$ausername."')>0"; } if ($email!="") { $condition.=" AND INSTR(email,'".$email."')>0"; } if ($homepage!="") { $condition.=" AND INSTR(homepage,'".$homepage."')>0"; } if ($icq!="") { $condition.=" AND INSTR(icq,'".$icq."')>0"; } if ($aim!="") { $condition.=" AND INSTR(aim,'".$aim."')>0"; } if ($yahoo!="") { $condition.=" AND INSTR(yahoo,'".$yahoo."')>0"; } if ($biography!="") { $condition.=" AND INSTR(biography,'".$biography."')>0"; } if ($joindateafter!="") { $condition.=" AND joindate>'".$joindate."'"; } if ($joindatebefore!="") { $condition.=" AND joindate<'".$joindatebefore."'"; } if ($postslower!="") { $condition.=" AND posts>$postslower"; } if ($postsupper!="") { $condition.=" AND posts<$postsupper"; } if ($orderby=="") { $orderby="username"; } if ($limitstart=="") { $limitstart=0; } else { $limitstart--; } if ($limitnumber=="") { $limitnumber=($numperpage + 1); } $memberlistbit = ""; $temp = 0; $users=$DB_site->query("SELECT userid,username,email,icq,aim,yahoo,biography,posts,joindate FROM user WHERE $condition ORDER BY $orderby $direction LIMIT $limitstart,$limitnumber"); while ($user=$DB_site->fetch_array($users)) { $temp = $temp + 1; $username = $user[username]; $userid = $user[userid]; $joindate = $user[joindate]; $posts = $user[posts]; $bio = str_replace(",", ", ", $user[biography]); $bio = str_replace("\n", "\n<BR>", $bio); if ($user[icq]!="") { $icqM = "<a href=\"http://wwp.icq.com/$user[icq]#pager\" target=_blank><img src=\"http://online.mirabilis.com/scripts/online.dll?icq=$user[icq]&img=5\" alt=\"$user[username]\'s ICQ status\" border=0></a>"; } else { $icqM = " "; } if ($user[aim]!="") { $aimM = "<a href=\"javascript:aimwindow('$user[aim]')\"><img src=\"images/aim.gif\" alt=\"Send a AIM message to $user[username]\" border=0></a>"; } else { $aimM = " "; } if ($user[yahoo]!="") { $yahooM = "<a href=\"http://edit.yahoo.com/config/send_webmesg?.target=\$yahoohandle&.src=pg\" target=\"_blank\"><img src=\"http://opi.yahoo.com/online?u=$user[yahoo]&m=g&t=1\" alt=\"Send a message to $user[username]\" border=0></a>"; } else { $yahooM = " "; } eval("\$memberlistbit .= \"".gettemplate("memberlistbit")."\";"); } #end while if ($top!="true") { $memberlistpages = "Page: "; $numbersmembers=$DB_site->query_first("SELECT COUNT(userid) AS users FROM user WHERE $condition"); $numbermembers=$numbersmembers[users]; $blah = $numbermembers / $numperpage; $temp2 = intval($blah); if ($numperpage!=1) { $temp2 += 1; } if (($numbermembers % $numperpage)==0) { $temp2 -= 2; } $temp3 = 1; while ($temp3 <= $temp2) { $thisstart = (($temp3 - 1) * $numperpage) + 2; $thisstart2 = $thisstart - 1; if ($thisstart==2) { $thisstart = 1; } #end if 0 if ((($thisstart==1) && ($limitstart==0)) || ($thisstart2==$limitstart)) { $memberlistpages .= "$temp3 \n"; } else { $memberlistpages .= "<a href=\"memberlist.php?action=$action&limitnumber=$limitnumber&limitstart=$thisstart&numperpage=$numperpage2&orderby=$orderby&ausername=$ausername&homepage=$homepage&icq=$icq&aim=$aim&yahoo=$yahoo&biography=$biography&joindateafter=$joindateafter&joindatebefore=$joindatebefore&lastvisitafter=$lastvisitafter&lastvisitbefore=$lastvisitbefore&lastpostafter=$lastpostafter&lastpostbefore=$lastpostbefore&postslower=$postslower&postsupper=$postsupper&direction=$direction\">$temp3</a> \n"; } #end if $temp3++; } #end while } else { $memberlistpages = "Page: 1"; } #end if ($top!="true) eval("echo dovars(\"".gettemplate("memberlist")."\");"); } #end if ($action=="getall") if ($action=="search") { $cssinclude = gettemplate("cssinclude"); eval("echo dovars(\"".gettemplate("memberlistsearch")."\");"); } #end if ($action=="search") ?> //TOP POSTERS AMOUNT $topposternum = 10; and // NUMBER OF RECORDS PER PAGE $numperpage = 30; ----- Now, I know some of this code isn't real efficient -- I did somethings, forgot I did them, then compensated in other places. Anyway, hopefully I'll be able to release some updates. Enjoy! Give me feedback please! [Edited by Ed Sullivan on 04-20-2000 at 03:38 PM] [Edited by Ed Sullivan on 04-20-2000 at 05:28 PM] [Edited by Ed Sullivan on 04-21-2000 at 09:37 PM] Show Your Support
|
Comments |
#12
|
|||
|
|||
There are already three templates: aim, yahoo and icq.
John |
#13
|
|||
|
|||
templates: launching a new era of codehacking
This is cool, though, linking hacks to templates. It makes 'm flexible |
#14
|
|||
|
|||
Quote:
I don't know if such a thing exists for ICQ and/or Yahoo, though... |
#15
|
|||
|
|||
Found a tiny bug:
In the memberlist template remove: 'Page:', or it will show up twice in memberlist.php |
#16
|
|||
|
|||
This is a very nice hack. Can you please tell me how I would go about adding another three columns -- with an e-mail icon, a homepage icon and a search icom -- the same ones that appear under the post of a user. If I'm to offer the users a full "yellow pages" of my BB's members, I might as well give them the full thing
Thanks |
#17
|
|||
|
|||
well?
|
#18
|
|||
|
|||
I'll look at it when I get a chance.
Email is already there, somewhat. Try changing your template to use $user[email] in it. The other 2 involve some simple script changes. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|