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: 12-06-2000 Last Update: Never Installs: 0
 
No support by the author.

This hack allows the user to specify an image from anywhere on the internet to appear under their user name. It was initially requested here.

This is my first public hack that serves a purpose, so be gentle. It's a little rough around the edges, possibly my good friends Mike or freddie could take a look and see if I forgot anything.

Here is an example:

http://www.bronx-bombers.com/vb114/s...php?threadid=2

Here is the code:

First, run the following SQL query to create a new field in the user table:

ALTER TABLE user ADD imgurl VARCHAR (100) not null


Next, open showthread.php:


Find:
Code:
$temps=$DB_site->query("SELECT title,template 
                        FROM template 
                        WHERE title='error_invalidid' OR title='error_nopermission' OR 

title='$foruminfo[rulestemplate]' 
                           OR title='forumrules' OR title='error_forumclosed' OR 

title='showthread_numpages' 
                           OR title='postbit_useremail' OR title='icq' OR title='aim' OR 

title='yahoo'
                           OR title='postbit_homepage' OR title='postbit_profile' OR 

title='$usetemplatebit' 
                           OR title='firstunread' OR title='showthread_nextnewestthread' 
                           OR title='showthread_nextoldestthread' OR 

title='$foruminfo[headertemplate]' 
                           OR title='$foruminfo[footertemplate]' OR title='$usetemplate'");
while ($temp=$DB_site->fetch_array($temps)) {
  $templatecache["$temp[title]"]=$temp[template];
}
Replace With:

Code:
$temps=$DB_site->query("SELECT title,template 
                        FROM template 
                        WHERE title='error_invalidid' OR title='error_nopermission' OR 

title='$foruminfo[rulestemplate]' 
                           OR title='forumrules' OR title='error_forumclosed' OR 

title='showthread_numpages' 
                           OR title='postbit_useremail' OR title='icq' OR title='aim' OR 

title='yahoo' OR title='custom_img'
                           OR title='postbit_homepage' OR title='postbit_profile' OR 

title='$usetemplatebit' 
                           OR title='firstunread' OR title='showthread_nextnewestthread' 
                           OR title='showthread_nextoldestthread' OR 

title='$foruminfo[headertemplate]' 
                           OR title='$foruminfo[footertemplate]' OR title='$usetemplate'");
while ($temp=$DB_site->fetch_array($temps)) {
  $templatecache["$temp[title]"]=$temp[template];
}




Find:
Code:
$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");
And Replace With:
Code:
$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.imgurl as imgurl,
                               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");



Find:

Code:
    if ($userinfo[icq]!="") {
      $icqnumber=$userinfo[icq];
      eval("\$icq = \"".gettemplate("icq")."\";");
    } else {
      $icqnumber="";
      $icq="";
    }
And After It, Add This:

Code:
    if ($userinfo[imgurl]!="") {
      $custom_img=$userinfo[imgurl];
      eval("\$imgurl = \"".gettemplate("custom_img")."\";");
    } else {
      $custom_img="";
      $imgurl="";
    }



Save and close showthread.php.

Open member.php


In the "Modify Profile" function, find:

Code:
  $timezoneoffset=$userinfo[timezoneoffset];
After it, add:

Code:
  $imgurl=htmlspecialchars($userinfo[imgurl]);


In the "Update Profile" Section, Find:

Code:
  $DB_site->query("UPDATE user 
                   SET password='".addslashes($password)."',email='".addslashes($email)."',
                      

parentemail='".addslashes($parentemail)."',coppauser=$coppauser,homepage='".addslashes($homepage)."

',
                      

icq='".addslashes($icq)."',aim='".addslashes($aim)."',yahoo='".addslashes($yahoo)."',
                      

biography='".addslashes($biography)."',signature='".addslashes($signature)."',adminemail=$adminemai

l,
                      

showemail=$showemail,invisible=$invisible,cookieuser=$cookieuser,daysprune=$prunedays,
                      timezoneoffset=$timezoneoffset,emailnotification=$emailnotification 
                   WHERE userid=$userid");
And replace with:

Code:
  $DB_site->query("UPDATE user 
                   SET password='".addslashes($password)."',email='".addslashes($email)."',
                      

parentemail='".addslashes($parentemail)."',coppauser=$coppauser,homepage='".addslashes($homepage)."

',
                      

icq='".addslashes($icq)."',aim='".addslashes($aim)."',yahoo='".addslashes($yahoo)."',
                      

biography='".addslashes($biography)."',signature='".addslashes($signature)."',adminemail=$adminemai

l,imgurl='".addslashes($imgurl)."',
                      

showemail=$showemail,invisible=$invisible,cookieuser=$cookieuser,daysprune=$prunedays,
                      timezoneoffset=$timezoneoffset,emailnotification=$emailnotification 
                   WHERE userid=$userid");
Go ahead and update those files, now we have to edit templates:

Open the "modifyprofile" template, and put the following code in there somewhere:

Code:
<tr bgcolor="#DEDEDE">

<td><B><FONT face="verdana, arial, helvetica" size="2" >Custom Image URL:</font></B></td>
<td><INPUT TYPE="TEXT" NAME="imgurl" VALUE="$imgurl" SIZE=30 MAXLENGTH=100></td>

</tr>
Save That.

Open the "postbit" template, and add this wherever you want to put the image, specifying the proper height and width:

Code:
<img src="$custom_img" height="xx" width="xx">
That's it, you're all done.


I just noticed that for users that don't specify an image, you get an red x - I'll try to fix that now.

Other than that, I can't provide a lot of support, because I forgot half of what I did .

-jim

Show Your Support

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

Comments
  #12  
Old 12-07-2000, 09:35 AM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by freddie
There is always my Avatar hack which sets a default of no image, instructions for using it w 1.1.4 are at the end of the thread

http://www.vbulletin.com/forum/showt...?threadid=2127
Oh good. If it's not so difficoult to "recycle" on this hack I'll give it a try.
Anyway, I solved the phpMyAdmin bug. Actually it was selfsolved: when I recalled phpMyAdmin this morning... tja... all tables were shown.

ALSO
the hack is working well...
Dunno maybe the server was getting some problems or there are some ghost around there?
Reply With Quote
  #13  
Old 12-07-2000, 10:06 AM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by freddie
There is always my Avatar hack which sets a default of no image, instructions for using it w 1.1.4 are at the end of the thread

http://www.vbulletin.com/forum/showt...?threadid=2127
Er... I gave a look to that "very short" thread and also to the instructions but as I'm not used to handle properly PHP stuff, could you/someone plz post here what to do to add the "no image" feature?

[Edited by Cr4z33 on 12-07-2000 at 07:09 AM]
Reply With Quote
  #14  
Old 12-07-2000, 10:09 AM
Guest
 
Posts: n/a
Default

Look at the beginning and the end, then if you have any problems with teh hack I am willing to bet that the answer to your question is in pages 1-10
Reply With Quote
  #15  
Old 12-07-2000, 10:09 AM
Guest
 
Posts: n/a
Default

I will add that if I could install this hack with out a prob, than anyone can do it.
Reply With Quote
  #16  
Old 12-07-2000, 01:58 PM
Guest
 
Posts: n/a
Default

Hi! I´ve got a userpic hack by westi at westi.gulli.com

but it user upload insteat links

look for a demo at: board.gulli.com

cu bIGaXE

[Edited by bIGaXE on 12-07-2000 at 11:02 AM]
Reply With Quote
  #17  
Old 12-07-2000, 02:03 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by freddie
There is always my Avatar hack which sets a default of no image, instructions for using it w 1.1.4 are at the end of the thread

http://www.vbulletin.com/forum/showt...?threadid=2127
This is different than the Avatar hack in that the user can specify any image from any website, by providing a URL in their profile.

Possibly I can steal some of your code to set the default to no image...

-jim
Reply With Quote
  #18  
Old 12-07-2000, 02:36 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by bIGaXE
Hi! I?ve got a userpic hack by westi at westi.gulli.com

but it user upload insteat links

look for a demo at: board.gulli.com

cu bIGaXE

[Edited by bIGaXE on 12-07-2000 at 11:02 AM]
No tnx, I'm trying to avoid to overload the db with images data...
Reply With Quote
  #19  
Old 12-07-2000, 03:16 PM
Guest
 
Posts: n/a
Default

thnx JimF! this works great.. but the red cross.. hmm.. mabey if you set a standard pic.. and set it to a transparant pixel gif?
Reply With Quote
  #20  
Old 12-07-2000, 10:10 PM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by JimF
Quote:
Originally posted by freddie
There is always my Avatar hack which sets a default of no image, instructions for using it w 1.1.4 are at the end of the thread

http://www.vbulletin.com/forum/showt...?threadid=2127
This is different than the Avatar hack in that the user can specify any image from any website, by providing a URL in their profile.

Possibly I can steal some of your code to set the default to no image...

-jim
Perhaps you guys can't read but my hack allows you to make the user specify a link for a picture OR allow them to upload a picture OR select a picture from the server. I do really think I covered it all. Perhaps I need to put all my hacks back in my sig as I see requests for stuff I have already done 3 months ago.
Reply With Quote
  #21  
Old 12-08-2000, 06:41 AM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by freddie
[BPerhaps you guys can't read but my hack allows you to make the user specify a link for a picture OR allow them to upload a picture OR select a picture from the server. I do really think I covered it all. Perhaps I need to put all my hacks back in my sig as I see requests for stuff I have already done 3 months ago. [/B]
Perhaps YOU freddie can't read.
If YOU read above you'll notice that I wrote that I don't want to upload images into the db 'cause they dramatically slows it down...
Anyway, I've already seen your hack it and it's a good one
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 04:25 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.04561 seconds
  • Memory Usage 2,305KB
  • 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
  • (12)bbcode_code
  • (7)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
  • (3)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