![]() |
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 Code:
$temps=$DB_site->query("SELECT title,template Find: Code:
$posts=$DB_site->query("SELECT post.dateline as dateline,post.postid as postid,post.pagetext as Code:
$posts=$DB_site->query("SELECT post.dateline as dateline,post.postid as postid,post.pagetext Find: Code:
if ($userinfo[icq]!="") { Code:
if ($userinfo[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 Code:
$DB_site->query("UPDATE user Open the "modifyprofile" template, and put the following code in there somewhere: Code:
<tr bgcolor="#DEDEDE"> 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 |
How about setting a default image for everybody then all they have to do is change it. that way you wouldn't get a red x
|
I could do that, but I want to have it so it only appears if there is a URL specified, like the way the homepage link is setup.
-jim |
Quote:
BTW tnx for this great hack JimF!!!! :thumbup: |
Quote:
Also, instead of the image I got a broken image URL linked to my board url (like "http://www.mydomain.com/forums/"). |
Also
I noticed that the URL image cannot be saved on the profile: everytime I go back to my profile, the "Custom Image URL" field is empty. Maybe does it depend on the missing MySQL table field? |
Is this on your site, or on my demo site?
You need to create the row in MySQL or it won't work. -jim |
Quote:
|
OK, le't say I made clear that the DB is still working properly. I've only a strange phpMyAdmin problem which is not reporting all tables... :confused:
Anyway, I can remember that when I inserted your MySQL command I got a confirm message that everything went fine. :) Now, the only thing is the fact that instead of the image I get that broken img linked to my board index... |
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 |
All times are GMT. The time now is 08:08 PM. |
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:
|