vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   [RELEASE] Location, Interests, etc. in post! (https://vborg.vbsupport.ru/showthread.php?t=1776)

07-14-2000 08:59 PM

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]

07-14-2000 09:04 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!

07-15-2000 10:10 AM

thanks great work.. i added it to my forum and it works great :D

07-15-2000 10:20 AM

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 ?

07-15-2000 10:27 AM

it seems that if a member does not have a location field in their profile the previous posts' user's location is added ?

07-15-2000 01:13 PM

ahh - oops. Simple fix.

Code:

change:
if ($location) { $location = "Location: $location"; }
if ($interests) { $interests = "Interests: $interests"; }

to

if ($location) { $location = "Location: $location"; } else { $location = ""; }
if ($interests) { $interests = "Interests: $interests"; } else { $interests = ""; }


07-15-2000 01:34 PM

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:

Hiyoku
Member

Registered: Jul 2000
Location: Location: USA
Posts: 77

-------

Hiyoku
Member

Registered: Jul 2000
Location: Location: Brisbane, Australia
Posts: 77

from this thread
http://www.animeboards.net/forums/sh...p?threadid=539 ?

07-15-2000 01:40 PM

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]

07-15-2000 06:55 PM

Doh! Stupid me. Fixed the glitches in the original code.

Just add this code above the while(... line:
Code:

$location = "";
$interests = "";


07-15-2000 07:03 PM

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]


All times are GMT. The time now is 07:08 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
  • Page Generation 0.01211 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete