Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives

Reply
 
Thread Tools
Details »»

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

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

Well, it's so simple, it's not even a hack in my book

I'm only giving example code for Location and Interests, but the rest are similar.

1.1.4 compliant

Code:
Find:
-----------
$posts=$DB_site->query("SELECT post.dateline as dateline,post.postid as postid,post.pagetext as pagetext,
                               post.allowsmilie as allowsmilie,post.signature AS showsignature,post.title as title,
                               post.ipaddress as ipaddress,post.iconid as iconid,post.username as fakename,
                               post.userid as userid, 
                               user.userid as userid,user.email as email,user.username as username,
                               user.usertitle as usertitle,user.signature as signature,user.showemail as showemail,
                               user.homepage as homepage,user.icq as icq,user.aim as aim,user.yahoo as yahoo,
                               user.joindate as joindate,user.posts as posts 
                        FROM post 
                        LEFT JOIN user ON (user.userid = post.userid) 
                        WHERE post.threadid=$threadid AND visible=1 
                        ORDER BY dateline $postorder
                        LIMIT $limitlower,$perpage");
-----------

Add to the end of the SELECT portion:
-----------
,user.biography as biography
-----------

Find:
-----------
$userinfo=$post;
-----------

Under it, add:
------------
    $bio = split("\n", trim($userinfo[biography]));
    $location = "";
    $interests = "";
    while(list($key,$val)=each($bio)) {
    	if (strlen(strpos($val, 'Location:'))) {
    		$location = eregi_replace("^Location:([^\\[]*)", "\\1", "$val");
    	} elseif (strlen(strpos($val, 'Interests:'))) {
    		$interests = eregi_replace("^Interests:([^\\[]*)", "\\1", "$val");
    	}
    }
    if ($location) { $location = "Location: $location"; }
    if ($interests) { $interests = "Interests: $interests"; }
------------

Then reference $location and/or $interests in the postbit template.
Now, just reference $location and $interests in the postbit template.

Enjoy!

[Edited by Ed Sullivan on 12-04-2000 at 02:08 PM]

Show Your Support

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

Comments
  #22  
Old 07-17-2000, 02:02 AM
Guest
 
Posts: n/a
Default

Parker - don't replace that part, I didn't tell you to

Only replace what I said to replace there with what I told you to replace it with - no more, no less. If you follow the directions, you will still have the other PM related stuff there.
Reply With Quote
  #23  
Old 07-17-2000, 04:29 PM
Guest
 
Posts: n/a
Default

just thought i'd add

the location/interest hack works on my upgraded 1.1.3 beta 3 forum too

thanks Ed
Reply With Quote
  #24  
Old 07-20-2000, 09:15 AM
Guest
 
Posts: n/a
Default

Ed, can you add a third field into there for me? Let's say I want to add "occupation" to it, how would add that in addition to the other ones?
Reply With Quote
  #25  
Old 07-20-2000, 02:32 PM
Guest
 
Posts: n/a
Default

Code:
  if ($userid!=0) {
    //PM Hack
    //Original: $userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemail,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid");
    //New:
    $userinfo=$DB_site->query_first("SELECT userid,email,biography,username,usertitle,signature,showemail,homepage,icq,aim,yahoo,joindate,posts,receivepm FROM user WHERE userid=$userid");
    $bio = split("\n", trim($userinfo[biography]));
    $location = "";
    $interests = "";
    $occupation = "";
    while(list($key,$val)=each($bio)) {
    	if (strlen(strpos($val, 'Location:'))) {
    		$location = eregi_replace("^Location:([^\\[]*)", "\\1", "$val");
	} elseif (strlen(strpos($val, 'Interests:'))) {
		$interests = eregi_replace("^Interests:([^\\[]*)", "\\1", "$val");
	} elseif (strlen(strpos($val, 'Occupation:'))) {
		$occupation = eregi_replace("^Occupation:([^\\[]*)", "\\1", "$val");
	}
    }
if ($location) { $location = "Location: $location"; }
if ($interests) { $interests = "Interests: $interests"; }
if ($occupation) { $occupation = "Occupation: $occupation"; }
[Edited by Ed Sullivan on 07-20-2000 at 11:34 AM]
Reply With Quote
  #26  
Old 07-31-2000, 03:22 PM
Guest
 
Posts: n/a
Default

okay... how does one reapply the location/interest hack in light of installing rangersfan's avatar hack at http://vbulletin.com/forum/showthread.php?threadid=2127 ?
Reply With Quote
  #27  
Old 07-31-2000, 03:55 PM
Guest
 
Posts: n/a
Default

Don't replace the $userinfo=$DB_site-> line, just add biography to where I told you to add if before. Then just add the rest of the code the same way.
Reply With Quote
  #28  
Old 07-31-2000, 04:28 PM
Guest
 
Posts: n/a
Default

Just add 'iconpath' along side 'biography.
Reply With Quote
  #29  
Old 07-31-2000, 04:44 PM
Guest
 
Posts: n/a
Default

do you mean add to showthread.php ? where ? in the below code ?
Quote:
if ($userid!=0) {
$userinfo=$DB_site->query_first("SELECT userid,email,username,biography,usertitle,signatur e,showemail,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid");
$bio = split("\n", trim($userinfo[biography]));
$location = "";
$interests = "";
while(list($key,$val)=each($bio)) {
if (strlen(strpos($val, 'Location:'))) {
$location = eregi_replace("^Location[^\\[]*)", "\\1", "$val");
} elseif (strlen(strpos($val, 'Interests:'))) {
$interests = eregi_replace("^Interests[^\\[]*)", "\\1", "$val");
}
}
if ($location) { $location = "Location: $location"; }
if ($interests) { $interests = "Interests: $interests"; }
Reply With Quote
  #30  
Old 07-31-2000, 04:56 PM
Guest
 
Posts: n/a
Default

I don't really understand as you appear to have it working on your forum.

If you are trying to get the location back to working. Just add 'iconpath' in the following like this:

$userinfo=$DB_site->query_first("SELECT userid,email,username,biography,usertitle,signatur e,showemail,homepage,icq,aim,y ahoo,joindate,posts,iconpath
Reply With Quote
  #31  
Old 07-31-2000, 05:47 PM
Guest
 
Posts: n/a
Default

yeah i want to bring back location display...the thing is i have this already in showthreads

This is what i have:
[quote]if ($userid!=0) {
$userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemai l,homepage,icq,aim,yahoo,joind ate,posts,iconpath FROM user WHERE userid=$userid");
$bio = split("\n", trim($userinfo[biography]));
$location = "";
$interests = "";
while(list($key,$val)=each($bio)) {
if (strlen(strpos($val, 'Location:'))) {
$location = eregi_replace("^Location[^\\[]*)", "\\1", "$val");
} elseif (strlen(strpos($val, 'Interests:'))) {
$interests = eregi_replace("^Interests[^\\[]*)", "\\1", "$val");
}
}
if ($location) { $location = "Location: $location"; }
if ($interests) { $interests = "Interests: $interests"; }[quote]
Reply With Quote
Reply

Thread Tools

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 01:06 AM.


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.09245 seconds
  • Memory Usage 2,277KB
  • Queries Executed 25 (?)
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
  • (2)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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)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