The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Details »» | |||||||||||||||||||||||||
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]; } 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"); 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=""; } 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]; 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"); 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"); 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> 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"> 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
|
Comments |
#22
|
|||
|
|||
You either set it to allow the user to UL an image OR you set it to allow them to type in an URL, not both at the same time. It is all a moot point as John has put Avatars in v2.0.
|
#23
|
|||
|
|||
You're misunderstanding me. I'm not refusing the Avatar hack just 'cause I thought it doesn't have the img URL or 'cause it's too heavy for my db (even if my hoster db su*). I'm refusing it as I'm not a PHP profi and dunno which parts to cut/use/delete/etc.
Anyway, the hack by JimF is just OK for me. I've only to wait as I dunno how to crop the noimage code from the Avatar hack... |
#24
|
|||
|
|||
Quote:
I think what you should have said was "Perhaps you guys didn't read past page 27 of the Avatar hack thread". Freddie, take a deep breath. Count to 10. We all feel better now, don't we? Why didn't you mention your hack in the thread requesting this? You can read, right? If you had, I wouldn't have had to spend an afternoon working on a hack that I'll never use. -jim [Edited by JimF on 12-08-2000 at 11:53 AM] |
#25
|
|||
|
|||
Um because by the time I saw that thread you had already done it. I don't always come here every day as I am in a down period waiting for 2.0 to be released so I am not hacking 1.1.4 anymore.
|
#26
|
|||
|
|||
Okay, cuz JimF was so kind to post the code
to have a picture under the username, without having to install the bloated Avatar hack, I wanted to do something back With JimF's hack, when a user doesn't select a picture, there's a red cross. I've fixed it Open showthread.php Find: Code:
$useremail=""; Code:
$custom_img=""; Code:
if ($userinfo[imgurl]!="") { $custom_img=$userinfo[imgurl]; eval("\$imgurl = \"".gettemplate("custom_img")."\";"); } else { $custom_img=""; $imgurl=""; } Code:
if ($userinfo[imgurl]!="") { $custom_img=($userinfo[imgurl]); $custom_img="<img src=\"$custom_img\" height=\"60\" width=\"60\" border=\"1\">"; eval("\$imgurl = \"".gettemplate("custom_img")."\";"); } else { $custom_img=""; $imgurl=""; } and if you don't want a border just remove the border=\"1\" bit. Save and Close showthread.php. Open the postbit template Find: Code:
<img src="$custom_img" height="xx" width="xx"> just search for a part of this line, but do REPLACE THE WHOLE LINE!! and replace it with: Code:
$custom_img No ugly red crosses, not even with guest users Feel free to comment, cuz this is the first time i've coded in php Greetz. [edit] I've tested it on my board, and it works fine there, but i KNOW there MUST be some programming flaws in there, so if you see one, please post the fix... Thnx.. [/edit] [Edited by X-PhoeniX on 12-11-2000 at 05:21 PM] |
#27
|
|||
|
|||
Tnx man!
I didn't want to disturb JimF too and was waiting for a fix. I'm gonna test it right now and if there're bugs I'll report it into 5 mins... |
#28
|
|||
|
|||
Quote:
|
#29
|
|||
|
|||
[QUOTE]Originally posted by X-PhoeniX
Quote:
BTW do you know the syntax to use on phpMyAdmin to fix it? I only know that I've to use isamchk as the corrupted file is "forumpermission.ISM"... |
#30
|
|||
|
|||
[QUOTE]Originally posted by Cr4z33
Quote:
(BTW: does anyone have the fix for this irritating quote bug, as you can see? when i quote someone who has quoted someone who has quoted someone etc.. there are like 3 quotes... they suck... but back to the point ) euh.. nope, sorry... never dealed with a corrupted db be4.. can't help ya m8.. |
#31
|
|||
|
|||
Quote:
Could someone tell me if I can safely delete and recreate the table "forumpermission" without troubles on the board? Note that's the test board so I'm the only user there. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|