![]() |
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: Enjoy! [Edited by Ed Sullivan on 12-04-2000 at 02:08 PM] |
Thank you, thank you, thank you!!!!!!
This works perfectly! It was so important for me to have the interest & location fields on the posts, and now they are there! |
thanks great work.. i added it to my forum and it works great :D
|
i have a problem in this thread is an example
http://www.animeboards.net/forums/sh...p?threadid=565 my location display is repeated as the thread goes down ? |
it seems that if a member does not have a location field in their profile the previous posts' user's location is added ?
|
ahh - oops. Simple fix.
Code:
change: |
thanks ed, but it didn't work ?
in this thread http://www.animeboards.net/forums/sh...p?threadid=539 user called Hiyoku keeps on displaying the previous poster's location with an added 'Location:' in it i.e. Quote:
http://www.animeboards.net/forums/sh...p?threadid=539 ? |
oh yeah the exact same thing occurs with the interest info
where a user does not have an interest in their profile, they take the previous poster's interests i.e. in the last post in http://www.animeboards.net/forums/sh...p?threadid=571 sorry not last post but further up [Edited by eva2000 on 07-15-2000 at 10:50 AM] |
Doh! Stupid me. Fixed the glitches in the original code.
Just add this code above the while(... line: Code:
$location = ""; |
but it's already there ? :confused:
whoops... sorry i didn't realise you edited and corrected the original post [Edited by eva2000 on 07-15-2000 at 04:08 PM] |
[post now null and void. But I don't feel like deleting it so nah!]
[Edited by Ed Sullivan on 07-15-2000 at 04:16 PM] |
well thanks Ed... it works perfectly now https://vborg.vbsupport.ru/
|
Yay!
|
Remove this part
Code:
if ($location) { $location = "Location: $location"; } |
No John, that's intentional.
Otherwise, user's without a $location or $interests, will show up as: Quote:
|
Even cleaner:
Old: if ($location) { $location = "Location: $location"; } New: if ($location) { $location = "Location: $location<br>"; } That way, if there's no location, there's no linefeed. [Ed's Edit: Sorry, you missed a "$", fixed now] [Edited by Ed Sullivan on 07-15-2000 at 10:47 PM] |
Ah, that makes sense. :)
|
Quote:
|
Ed:
Don't you want to include: if ($userinfo[receivepm]=="1") { $pmlink = "<a href=\"private.php?action=newmessage&toid=$userinf o[userid]\"><img src=\"images/pm.gif\" border=0></a> "; } else { $pmlink = ""; } in this if you are using Private Messages 1.2? Parker |
By "no linefeed" I mean no blank line.
|
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. |
just thought i'd add
the location/interest hack works on my upgraded 1.1.3 beta 3 forum too :D thanks Ed :D |
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?
|
Code:
if ($userid!=0) { |
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 ?
|
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.
|
Just add 'iconpath' along side 'biography.
|
do you mean add to showthread.php ? where ? in the below code ?
Quote:
|
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 |
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] |
You need to stick "biography" back in the field list. Add ",biography" after "iconpath"
|
yep, that worked adding ,biography after iconpath, line :D
yipee :D thanks guys :) |
This is a really nice hack, but it looks like the code changed in 1.14. I can't find anything that resembles this in showthread.php:
$userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemai l,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid"); Any plans on updating this, or is it better to wait until version 2.0? Thanks, TigerLily:) |
Yep. Line has changed to:
$posts=$DB_site->query("SELECT post.dateline as dateline,post.postid as etc... |
Tack this:
,user.biography as biography to the end of the SELECT section. |
Thanks, Ed, but I still can't get it to show up. I'm sure I'm doing something wrong! Since the code is different, where do you put this part?
$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"; } I've tried putting the code right beneath the changed line and farther down. I've called the $location in the templates, but nothing shows up. Not sure what I'm doing wrong! TigerLily:) |
Put that under
$userinfo = $post; |
Thanks so much, Ed! Works like a charm now!
TigerLily:) |
<bump>
Instructions for 1.1.4 in original post now. |
Just thaught I would bring this back to the top and say it works fine with 1.1.5
just installed it on my test board http://www.clubbers.ws/forums/showthread.php?threadid=1 |
All times are GMT. The time now is 04:45 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|