Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 04-20-2000 Last Update: Never Installs: 0
 
No support by the author.

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 = "&nbsp;";
	}
	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 = "&nbsp;";
	}
	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 = "&nbsp;";
	}
	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")

?>
There are 2 variables you need to set:
//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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-20-2000, 06:07 AM
Guest
 
Posts: n/a
Default

I just realized the AIM javascript doesn't work. I looked at it and didn't really see anything wrong. Now, I'm not real good at javascript, so if someone could take a look at it, that'd be great!

[edit: I fixed this too!! ]

[Edited by Ed Sullivan on 04-20-2000 at 05:29 PM]
Reply With Quote
  #3  
Old 04-20-2000, 06:11 AM
Guest
 
Posts: n/a
Default

Dammit! I just accidently killed another feature -- the paging doesn't work on any page other than the first. *sigh*

[edit: I fixed this feature and changed the line of code up there --^]

[Edited by Ed Sullivan on 04-20-2000 at 03:39 PM]
Reply With Quote
  #4  
Old 04-20-2000, 06:27 AM
Guest
 
Posts: n/a
Default

Well done - I have not tried it yet, but I'm sure it will be good. As hacks come in, I will try to include a template-ised version of it in the next major release - accredited to the author of course. BTW, how much of that code did you borrow from the control panel

Keep 'em coming,
John
Reply With Quote
  #5  
Old 04-20-2000, 06:32 AM
Guest
 
Posts: n/a
Default

Control panel? What control panel?

I borrowed entirely too much -- but hey, if its there for ya, why not use it
Reply With Quote
  #6  
Old 04-20-2000, 06:14 PM
Guest
 
Posts: n/a
Default

LOL

I like the hack very much
a great job sofar. It looks alot cleaner then the ubb one, I must say
Reply With Quote
  #7  
Old 04-20-2000, 11:57 PM
Guest
 
Posts: n/a
Default

Quote:

Dammit! I just accidently killed another feature -- the paging doesn't work on any page other than the first. *sigh*

[edit: I fixed this feature and changed the line of code up there --^]

[Edited by Ed Sullivan on 04-20-2000 at 03:39 PM]
That's the way programming goes ya added a new feajure and kill another one someplace! HEHEHEHE
Reply With Quote
  #8  
Old 04-21-2000, 12:34 PM
Guest
 
Posts: n/a
Default

Quote:

Well done - I have not tried it yet, but I'm sure it will be good. As hacks come in, I will try to include a template-ised version of it in the next major release - accredited to the author of course.
You want a template-ized version? You got it! I was bored today so I template-ized it I will edit the code above, but here are the directions for templates.

Create template memberlist -
Code:
{htmldoctype}
<html><head><title>Members List</title>
$cssinclude
<script language="javascript">
<!--
function aimwindow(aimid) {
window.open("member.php?action=aimmessage&aim="+aimid,"_blank","toolbar=no,location=no,menubar=no,scrollbars=no,width=175,height=275,resizeable=yes,status=no")
}
// -->
</script></head><BODY>
<table border=0 width=99% cellspacing=1 cellpadding=3>
<tr>
<td align="left"><a href="index.php"><img src="$titleimage" border=0></a></td><td align="center" width=225> <b><largefont>Members List</b></largefont> <BR>
<center><smallfont><a href="memberlist.php?action=search">advanced search</a> |
 <a href="memberlist.php?action=getall&orderby=posts&direction=DESC&numperpage=10&top=true">top 10 posters</a> |
 <a href="memberlist.php">alphabetical</a> |
 <a href="memberlist.php?action=getall&orderby=joindate&direction=DESC">date joined</a></smallfont></td>
</tr>
</table><br><table border=0 width=99% cellspacing=1 cellpadding=3>
<tr>
<td align="center"><font face="Arial" size=2><B>User Name</B></font></td>
<td align="center"><font face="Arial" size=2><B>ICQ</b></font></td>
<td align="center"><font face="Arial" size=2><B>AIM</b></font></td>
<td align="center"><font face="Arial" size=2><B>Yahoo!</b></font></td>
<td align="center"><font face="Arial" size=2><B>Biography</b></font></td>
<td width=68 align="center"><font face="Arial" size=2><B>Join Date</b></font></td>
<td align="center"><font face="Arial" size=2><B>Posts</b></font></td>
</tr>
$memberlistbit
</table>
<div align="right"><smallfont>Page: $memberlistpages</smallfont></div>
</body>
</html>
Put all the code in that one, and now make template memberlistbit -
Code:
<tr>
<td bgcolor="{firstaltcolor}"><font face="Arial" size=2><a href="member.php?action=getinfo&userid=$userid">$username</a></font></td>\n<td bgcolor="{secondaltcolor}" align="center">$icqM</td>
<td bgcolor="{firstaltcolor}" align="center">$aimM</td>
<td bgcolor="{secondaltcolor}" align="center">$yahooM</td>
<td bgcolor="{firstaltcolor}"><font face="Arial" size=2>$bio</font></td>
<td bgcolor="{secondaltcolor}" align="center"><font face="Arial" size=2>$joindate</font></td>
<td bgcolor="{firstaltcolor}" align="center"><font face="Arial" size=2>$posts</font></td>
</tr>
Same thing as above. Now create memberlistsearch -
Code:
{htmldoctype}
<html>
<head>
<title>Members List - Advanced Search</title>
$cssinclude
</head>
<BODY>
<table border=0 width=99% cellspacing=1 cellpadding=3>
<tr>
<td align="left"><a href="index.php"><img src="images/ubb/bbtitle5v3.jpg" border=0></a></td>
<td align="center" width=225><largefont>Members List</largefont> <BR>
<center>
<smallfont>advanced search | <a href="memberlist.php?action=getall&orderby=posts&direction=DESC&numperpage=10&top=true">top 10 posters</a> | <a href="memberlist.php">alphabetical</a> | <a href="memberlist.php?action=getall&orderby=joindate&direction=DESC">date joined</a></smallfont></td>
</tr>
</table>
<br><form action="memberlist.php" method="post">
<input type="hidden" name="action" value="getall">
<table border=0><tr>
<td><font face="Arial" size=2>User Name contains</font></td>
<td><input type="text" size="35" name="ausername" value=""></td>
</tr>
<tr>
<td><font face="Arial" size=2>and homepage contains</font></td>
<td><input type="text" size="35" name="homepage" value=""></td>
</tr>
<tr>
<td><font face="Arial" size=2>and ICQ Number contains</font></td>
<td><input type="text" size="35" name="icq" value=""></td>
</tr>
<tr>
<td><font face="Arial" size=2>and AIM Handle contains</font></td>
<td><input type="text" size="35" name="aim" value=""></td>
</tr>
<tr>
<td><font face="Arial" size=2>and Yahoo Messenger Handle contains</font></td>
<td><input type="text" size="35" name="yahoo" value=""></td>
</tr>
<tr>
<td><font face="Arial" size=2>and Biography contains</font></td>
<td><input type="text" size="35" name="biography" value=""></td>
</tr>
<tr>
<td><font face="Arial" size=2>and Join Date is after<br>(Format yyyy-mm-dd, leave blank for today)</font></td>
<td><input type="text" size="35" name="joindateafter" value=""></td>
</tr>
<tr>
<td><font face="Arial" size=2>and Join Date is before<br>(Format yyyy-mm-dd, leave blank for today)</font></td>
<td><input type="text" size="35" name="joindatebefore" value=""></td>
</tr>
<tr>
<td><font face="Arial" size=2>and Last Visit is after<br>(Format yyyy-mm-dd hh:mm:ss, leave blank for today)</font></td>
<td><input type="text" size="35" name="lastvisitafter" value=""></td>
</tr>
<tr>
<td><font face="Arial" size=2>and Last Visit is before<br>(Format yyyy-mm-dd hh:mm:ss, leave blank for today)</font></td>
<td><input type="text" size="35" name="lastvisitbefore" value=""></td>
</tr>
<tr>
<td><font face="Arial" size=2>and Last Post is after<br>(Format yyyy-mm-dd hh:mm:ss, leave blank for today)</font></td>
<td><input type="text" size="35" name="lastpostafter" value=""></td>
</tr>
<tr>
<td><font face="Arial" size=2>and Last Post is before<br>(Format yyyy-mm-dd hh:mm:ss, leave blank for today)</font></td>
<td><input type="text" size="35" name="lastpostbefore" value=""></td>
</tr>
<tr>
<td><font face="Arial" size=2>and Number of Posts is greater than</font></td>
<td><input type="text" size="35" name="postslower" value=""></td>
</tr>
<tr>
<td><font face="Arial" size=2>and Number of Posts is less than</font></td>
<td><input type="text" size="35" name="postsupper" value=""></td>
</tr>
<tr><td colspan=2><hr></td></tr>
<tr><td><font face="Arial" size=2>Order by:</font></td><td>
<select name="orderby">
<option selected>username</option>
<option>joindate</option>
<option>lastpost</option>
<option>posts</option>
</select>
<select name="direction">
<option value="">in ascending order</option>
<option value="DESC">in descending order</option>
</select>
</td></tr>
<tr>
<td><font face="Arial" size=2>Number of records per page:</font></td>
<td><input type="text" size="35" name="numperpage" value="30"></td>
</tr>
</table>
<div align="center"><center>
<table border="0">
<tr>
<td><p align="center"><input type="submit" name="submit" value="Submit"></p></td>
<td><p align="center"><input type="reset" name="reset" value="Reset"></p></td>
</tr>
</table>
</center></div>
</form>
</body></html>
Feel free to edit those
Reply With Quote
  #9  
Old 04-21-2000, 01:18 PM
Guest
 
Posts: n/a
Default

but...

the javascript is a killer. People on WebTV have no support for Javascript, nor do Mac people using iCab. Looking at the code, it doesn't seem that it would be too hard to change.

(I prefer the javascript version, personally)
Reply With Quote
  #10  
Old 04-21-2000, 01:44 PM
Guest
 
Posts: n/a
Default

About the javascript: hmm... could I do an OS/Browser check in PHP and change the links like that? Might work.

But how should I make the links them? To the profile? Not links, just display the AIM Name?

Hmm.. that brings up another thing, I might want to add a template for AIM, ICQ, and Yahoo!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:42 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04356 seconds
  • Memory Usage 2,306KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete