vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Ed - help with Location, Interests Hack (https://vborg.vbsupport.ru/showthread.php?t=5218)

12-04-2000 03:32 PM

Ed, would it be too much to ask to give me this hack for 1.1.4? I'd really appreciate it! The first part of the code no longer exists :(

http://vbulletin.com/forum/showthread.php?threadid=1776

in showthread.php.

find:
Code:

if ($userid!=0) {
      $userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemail,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid");

replace with:

Code:

if ($userid!=0) {
      $userinfo=$DB_site->query_first("SELECT userid,email,username,biography,usertitle,signature,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"; }


12-04-2000 05:04 PM

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.


12-04-2000 05:29 PM

Yeah!!

01-03-2001 04:58 AM

Is there any way that you can simplify that for me?
You see I am a new licensed user and before my board/database gets populated...

I would like to add a place from City, State, Zip
in the database.

On the page the user signs up appropriate code would be needed.

Then under their name in a post.. I would like to display their city, state.

Now when it's time to send a mass email.. I can accurately send messages.

Is that too much to ask ? :-(

Thanks for your reply,

JackG

01-05-2001 06:36 PM

Works on 1.1.5 in case anyone is interested!

01-05-2001 06:44 PM

Quote:

Originally posted by JackG
Is there any way that you can simplify that for me?
You see I am a new licensed user and before my board/database gets populated...

I would like to add a place from City, State, Zip
in the database.

On the page the user signs up appropriate code would be needed.

Then under their name in a post.. I would like to display their city, state.

Now when it's time to send a mass email.. I can accurately send messages.

Is that too much to ask ? :-(

Thanks for your reply,

JackG

This does not add any extra fields to the user profile. Instead it parses the existing Biography field. If you don't know how to alter your tables and work in PHP, it will be safer to wait until 2.0 where you can create as many fields as you want.


All times are GMT. The time now is 09:38 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.01126 seconds
  • Memory Usage 1,730KB
  • 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)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete