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
  #12  
Old 04-21-2000, 02:14 PM
Guest
 
Posts: n/a
Default

There are already three templates: aim, yahoo and icq.

John
Reply With Quote
  #13  
Old 04-21-2000, 06:56 PM
Guest
 
Posts: n/a
Default

templates: launching a new era of codehacking
This is cool, though, linking hacks to templates.
It makes 'm flexible
Reply With Quote
  #14  
Old 04-21-2000, 07:01 PM
Guest
 
Posts: n/a
Default

Quote:

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!
I know there's a way to do a direct link with AIM that will pop-up its own message window (or start AIM if you don't have it running) but I don't remember it off the top off my head.
I don't know if such a thing exists for ICQ and/or Yahoo, though...
Reply With Quote
  #15  
Old 04-24-2000, 01:56 AM
Guest
 
Posts: n/a
Default

Found a tiny bug:
In the memberlist template remove: 'Page:', or it will show up twice in memberlist.php
Reply With Quote
  #16  
Old 05-14-2000, 03:48 AM
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #17  
Old 05-26-2000, 02:32 PM
Guest
 
Posts: n/a
Default

well?
Reply With Quote
  #18  
Old 05-27-2000, 01:33 AM
Guest
 
Posts: n/a
Default

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.
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:29 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.06609 seconds
  • Memory Usage 2,261KB
  • Queries Executed 22 (?)
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
  • (1)bbcode_code
  • (1)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
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)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