![]() |
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 |
Quote:
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? :confused: |
Quote:
[Edited by Cr4z33 on 12-07-2000 at 07:09 AM] |
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
|
I will add that if I could install this hack with out a prob, than anyone can do it.
|
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] |
Quote:
Possibly I can steal some of your code to set the default to no image... -jim |
Quote:
|
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?
|
Quote:
|
Quote:
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 https://vborg.vbsupport.ru/ |
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.
|
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... |
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] |
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.
|
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]!="") { Code:
if ($userinfo[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] |
Tnx man!
I didn't want to disturb JimF too and was waiting for a fix. :D I'm gonna test it right now and if there're bugs I'll report it into 5 mins... |
Quote:
|
[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"... |
[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.. |
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. :) |
Quote:
Euh... yeah, ya can.. i think..:) but you must reproduce it the same as it was before (without the corruption ofcourse;)), and there can't be any other users on your board as i know of, cuz mabey it'll be corrupted again then... |
Quote:
Tnx again to you and JimF! https://vborg.vbsupport.ru/ |
Quote:
Thnx JimF, for the original code :) |
i can't find this code in showthread
Code:
$temps=$DB_site->query("SELECT title,template |
ReMaZ:
What version do you have? 1.1.4? Then just look for Code:
$temps=$DB_site->query("SELECT title,template Code:
OR title='custom_img' Code:
OR title='yahoo' |
Thanks X-Phoenix, I was going to make a fix this weekend, but I had to go out of town unexpectedly.
-jim |
Quote:
|
Quote:
|
Then I can't help you, sorry.. (cuz i'm currently running 1.1.4)
|
Quote:
-jim |
All times are GMT. The time now is 12:12 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|