PDA

View Full Version : Signature Image System


dabean
20 Sep 2001, 19:43
Signature Image Management System (file based)

Updated: 27 June 2002, 12:22 AM BST

This hack allows users to upload a image or images that they can then use as part of the thier signature. All uploaded images are private to the user that uploaded them.

The hack requires that you have PHP 4.1.0 or newer for the upload functions to work correctly. PHP 4.0.6 can be used with modifications (not recommended).

The scripts can if enabled also prevent users from externally linking to the images they uploaded, please note this is done by HTTP_REFERER checking not all http servers or browsers support this however is more widely supported than Apache's mod_rewrite. Should you wish to stop deep linking then upload a image called badcontent.gif to your forums directory.

Further more instructions are provided in how to get this hack to work if you are using vBulletin's standard sig editor or a advanced sig editor hack.

Version 2.0 Updates
- remote storage support
- sig.php nolonger appears in online.php
- special [sig] vB code is used instead of [img] tags

Version 1.3 Updates
- fixed display bug
- added removal script to main package
- added test template set


Version 1.11 Updates
- Image width & height checking
- Extension checking
- More useful error messages
- Added a missing function

Current Version 1.3
Released 20th sept 2001

Requirements:
- vBulletin 2.0.3
- PHP 4.0.3+ (this hack has not been tested on PHP 3.0.17, it may or may not work)

Optional:
- HTTP Server that supports HTTP_REFERER, (Apache 1.2+, IIS 4+)
- badcontent.gif in your forum directory


Screenshots can be found in the zip file.

DarkReaper
20 Sep 2001, 20:21
Cool! But could you add support for mod_rewrite? Maybe have an option for one or the other in the Admin CP...or a seperate .php file and install file for each?

dabean
20 Sep 2001, 20:29
umm, if you want to use mod_rewrite there is nothing stopping you just turn on the image serving option which disables the builtin referer checking and add sig.php to your mod_rewrite ruleset.

DarkReaper
20 Sep 2001, 22:37
When I wrote that I was a bit tired from classes:)...forgot how mod_rewrite worked, lol. Alroght, so that answers how to do it...just enable image serving :)

VirtueTech
21 Sep 2001, 00:45
The thing I was always concerned with giving the users the ability to show images in their signatures was the size of the image.

Is there a way to use php to use the GD library to re-size the images to a default size?

maverick1236
21 Sep 2001, 03:14
cant even start the install script..

Parse error: parse error in c:\program files\nusphere\apache\htdocs\upload\admin\sinstall.php on line 37

this is the line
$DB_site->query("INSERT INTO setting VALUES ( NULL, '60', 'Number of images stored per member', 'sigimagesstored', '2', 'The number of uploadable images that are to be stored for each member', '3', '1');");

dabean
21 Sep 2001, 03:30
ack. I've fixed the install script and updated the zip file redownload it.

The fixed version has sinstall.php dated: 21 September 2001, 03:26:32 AM

tkhjosh
21 Sep 2001, 04:22
Parse error: parse error in /home/httpd/www/forums/admin/sinstall.php on line 37

dabean
21 Sep 2001, 04:32
Originally posted by tkhjosh
Parse error: parse error in /home/httpd/www/forums/admin/sinstall.php on line 37

download the updated version, check it is the updated version by A) checking the time stamp on sinstall.php in winzip is 21 September 2001, 03:26:32 AM.

B) That the instructions have the version number 1.01

tkhjosh
21 Sep 2001, 06:09
Originally posted by dabean
Signature Image Management System (file based)

Updated: 21 Sep 2001, 03:26:32 AM BST

This hack allows users to upload a image or images that they can then use as part of the thier signature. All uploaded images are private to the user that uploaded them.

The hack requires that you have PHP 4.0.3 or newer for the upload functions to work correctly.
The scripts can if enabled also prevent users from externally linking to the images they uploaded, please note this is done by HTTP_REFERER checking not all http servers or browsers support this however is more widely supported than Apache's mod_rewrite. Should you wish to stop deep linking then upload a image called badcontent.gif to your forums directory.

Further more instructions are provided in how to get this hack to work if you are using vBulletin's standard sig editor or a advanced sig editor hack.

Users of vBulletin's standard sig editor should follow the instructions in install_vbstandard.txt

Users of a advanced sig editor should follow the instructions in install_advancededitor.txt

Version 1.01
Released 20th sept 2001

Requirements:
- vBulletin 2.0.3
- PHP 4.0.3+ (this hack has not been tested on PHP 3.0.17, it may or may not work)

Optional:
- HTTP Server that supports HTTP_REFERER, (Apache 1.2+, IIS 4+)
- badcontent.gif in your forum directory


Screenshots can be found in the zip file.


i downloaded from here but it does not work. :(

dabean
21 Sep 2001, 16:49
*sigh*

I've downloaded the zip myself to check the installer works fine it does.
Firstly delete the orginal sinstall.php from wherever you exracted and then from the server you uploaded it to. Now extract sinstall.php from the zip file then upload the new freshly extracted file.

If you still can't get it to work then download the file I've attatched to this post. This file is identical to installer in the zip file in allmost all repects (the page title is different is the only change).

Martz
23 Sep 2001, 23:53
I get an javascript error when I click on the image which I have uploaded:

Line 305:
Char: 2
Error: 'document.vbforum.message' is null or not an object
Code: 0
Refer: my site.


:/

Any ideas?

dabean
24 Sep 2001, 00:42
ack. Your using the standard sig editor right?

In the tamplate "sigimage_popup_images" change

opener.document.vbform.message.value += "https://www.vbulletin.org/forum/";

to

opener.document.vbform.signature.value += "https://www.vbulletin.org/forum/";

and in the "modifyprofile" template

document.vbform.message.value += "https://www.vbulletin.org/forum/"
document.vbform.message.focus();

to

document.vbform.signature.value += "https://www.vbulletin.org/forum/"
document.vbform.signature.focus();


The zip file has been updated to refect these changes.

snyx
24 Sep 2001, 04:32
how does it save the images?
based on username, or original file name?
what pervents users from large images, or large file sizes?

Martz
24 Sep 2001, 09:20
Yeah mate, I a using the standard editor - I still get the Javascript error after making the changes above too :(
document.vbform.sigature' is null or is not an object

dabean
24 Sep 2001, 17:09
okay, one more little change and it'll work :)
change
<form action="member.php" method="post">

to
<form action="member.php" method="post" name="vbform">

Now snyx,
The images are saved to disk at the location you specify, you can also set the maximum size (in bytes) for each image. Currently you can not set the maximum dimensions for an image.
Filenames take the format uid<userid>iid<imageid>.<extension>

dabean
24 Sep 2001, 18:29
I've updated the hack to now allow you to set maximum dimensions for an image and to check extensions better.

Additionally more error messages have been added to better inform users.

99SIVTEC
24 Sep 2001, 22:08
Fatal error: Call to undefined function: smallerror() in /home/sites/site2/web/vbulletin/simage.php(60) : eval()'d code on line 1


I get this error when I click to upload an image from the user CP...

dabean
24 Sep 2001, 22:29
oops.

I've updated the zip with a version of simage.php that includes the missing function. Just redownload the archive and upload the fixed simage.php.

c-pr0mpt
25 Sep 2001, 00:13
I did this hack but I dont see any options in my forums....did I do something wrong? No option in user cp to upload, etc.

dabean
25 Sep 2001, 00:29
Inside "edit profile" or the sig editor should you be using one there should be a little table headed "images" click the alter images link to upload/manage images. A popup window should open in that window you can upload, delete & replace images.

The example.png image in the archive should show this better than my pretty bad explaination. :)

Freddie Bingham
25 Sep 2001, 00:38
tkhjosh and dabean do you guys have valid licenses? If so please enter them into your profile.

c-pr0mpt
25 Sep 2001, 00:42
dabean> Yeah, what Im saying is......this does not show in my profile at my site.

Are the templates possibly named wrong?

Check it out, if you will.

My forum link is in my sig below.

dabean
25 Sep 2001, 01:07
freddie: done

now c-prompt,
signed up and checked most strange the only thing i can think of is did you accidentally put the block of code after

eval("dooutput(\"".gettemplate("modifyprofile")."\");");

instead of before it?

If you didn't then I honestly don't know whats wrong (excluding you being missing a template).

c-pr0mpt
25 Sep 2001, 01:35
Where would I find that string? Sorry, I apologize for being annoying.

dabean
25 Sep 2001, 01:39
Inside member.php

c-pr0mpt
25 Sep 2001, 01:39
Ok I found what you were referring to and it is above where it should be.........


The problem is that the edit profile page is not picking up that template at all......

Weird.

c-pr0mpt
25 Sep 2001, 01:40
Its not much but I could pay ya like 10 bucks to fix it for me so it works. lol My members want it but I cant spend any more time on it. I have client work that needs to get done. Or even just take a look and tell me whats wrong.

c-pr0mpt
25 Sep 2001, 01:49
Could it be that the templates are calling for things like, "sigimagebit", but the template is called, "sig_images_bit"?

dabean
25 Sep 2001, 01:51
hehe, I'll fix it for free just um. email me your member.php file and i'll modify it. You should have my email addy from me registering over on your forums.

-- edit didn't see your last post but
every $sigimage<whatever> is eval'd to its correct template by the code.

eg
eval ("\$sigimagebits = \"".gettemplate ("sig_images_none")."\";");

c-pr0mpt
25 Sep 2001, 02:00
gotcha. :)

Email sent. Thanks again man.

c-pr0mpt
25 Sep 2001, 03:10
Ok here is what I get now that its working. I sure do suck today at doing stuff. lol

Russell
25 Sep 2001, 03:12
I'm having the same problem, it's not showing up anywhere in my CP at all....

this isn't because I'm an admin or something?

I've done the install exactly.

my boards: http://forums.buffydownunder.com

help plz.

c-pr0mpt
25 Sep 2001, 03:18
Russell>I think the zip he gave us is bad because mine still didnt work but he then sent me via email his template files for the sig stuff and it worked fine. So somewhere in his instructions something is wrong for the templates.

dabean
25 Sep 2001, 03:19
heh, okay c-prompt the location must be absolute location to somewhere eg. /home/c-prompt/images/sigs or say /home/c-prompt/public_html/images/sigs

dabean
25 Sep 2001, 03:21
For those having trouble with style's I've attached a basic style set with just the sig templates.

Attachment removed now part of the main release package

c-pr0mpt
25 Sep 2001, 03:27
dabean> Thank you for all the help. I do appreciate it. I finally got it work. Although, I lost my original templates because I messed up and am an idiot. lol

Russell
25 Sep 2001, 03:35
Sorry -

How do I use that Style file?

dabean
25 Sep 2001, 03:43
Styles > upload/download

Then "Upload existing style set: (from your computer)"
selecting "no, create a new style"

Now in the admin cp set your style (for YOUR profile only) to the uploaded style. Then go and look in change profile in your cp, too see if the sig image bits appear.

If they do then just check the templates provided against your own templates to see if any are missing. If they are just manually add them (copy paste is quickest).

Russell
25 Sep 2001, 03:48
and if they still don't ? :(

I'm sure I've done this right... is there anything I can send you to check it?

thanks.

dabean
25 Sep 2001, 04:01
If you can't get it to work with the provided style file then something is wrong with code, or alternatively check you are looking at the site via the alternative style set. eg in your case
http://buffy.inscifi.net/forums/index.php?styleid=2

Russell
25 Sep 2001, 04:52
definately something wrong with the code then.. because the 2nd style set is fairly obvious when it's used :)

any suggestions?

dabean
25 Sep 2001, 05:04
check member.php

make sure the code you added is before
eval("dooutput(\"".gettemplate("modifyprofile")."\");");

Check all the templates exist particularlly sig_images, sig_images_alter, sig_images_none & sig_images_bit

If any are missing redownload the first zip file and check I provided them in the instructions.

Russell
25 Sep 2001, 05:16
They're all there... not a template problem I think.. but it should be shouldn't it :(

rmusic
25 Sep 2001, 22:51
im getting the same errors as c was befor i cant figure it out and is there anyway i can uninstall the whole thing

dabean
25 Sep 2001, 23:56
rmusic: okay remove the templates. Remove the block of code from member.php. Delete the extra php files.

Download the attached file and run it from you admin directory this will clean away the extra settings and table added by the installer.

Attachment removed now part of main release package.

rmusic
27 Sep 2001, 02:05
Originally posted by dabean
rmusic: okay remove the templates. Remove the block of code from member.php. Delete the extra php files.

Download the attached file and run it from you admin directory this will clean away the extra settings and table added by the installer.

ok

thanx id really like to use it but it just wont work

c-pr0mpt
27 Sep 2001, 12:38
Just letting you know everything is up and running fine on my board now.

GJ and thank you for the help!

The only thing I suggest is in the instructions, make sure to tell users to make sure that dynamic [img] tags should be set to yes.

Otherwise the image wont show in the sig, just the link. I found this out the hard way and had no idea why it was doing that. lol

Props to Firefly for pointing me in the direction my dumb butt should have looked in the first place. :)

snyx
28 Sep 2001, 01:22
Everything works, except when I upload a picture, it says "uploaded picture" but all I get is red 'x's ? Then when I check the DIR thought my FTP, it uploaded fine. Ideas?

dabean
28 Sep 2001, 03:26
Okay thats a bug.
I have now updated the code to fix that bug in the display script. Download the updated version and it should fix your problem.

You only need to reupload sig.php

snyx
28 Sep 2001, 05:24
im using the advanced editor.
so I changed the old code to the new stuff
still same problem?

dabean
28 Sep 2001, 16:12
You've tried setting image serving to "yes"?
You've tried directly requesting the images eg http://<yourforums>/sig.php?imageid=X ?

and most importantly your using the updated version of sig.php?

If the images are appearing in your ftp then it means the script is correctly uploading the images at least.

snyx
28 Sep 2001, 20:10
still nothing man?
whats wrong :(
sorry to harass ya, I usally can fix these things, but this time im stumped.

dabean
28 Sep 2001, 20:45
Bizare, okay this should help you discover where the problem lies. Attached is debug version of the image display script (sig.php)

Upload it then directly try and access a image via it
http://<yourforums>/sig.php?debug=true&imageid=<imageidnumber>

As it completes each part of the logic the script will echo its progress helping you discover where it failed.

snyx
28 Sep 2001, 23:11
genious, here is what it told me

Image serving is enabled, referer check has not been carried out.
Displaying Image. filename is: images/signature/uid55iid6.gif
Warning: Cannot add header information - headers already sent by (output started at /home/kaos/public_html/forums/sig.php:58) in /home/kaos/public_html/forums/sig.php on line 68

Warning: Cannot add header information - headers already sent by (output started at /home/kaos/public_html/forums/sig.php:58) in /home/kaos/public_html/forums/sig.php on line 69

Warning: Cannot add header

Ideas?

dabean
28 Sep 2001, 23:18
The add headers problem is because its in debug mode,

however images/signature/uid55iid6.gif may indicate the real problem you need to specify the full path eg /home/whereever
:)

snyx
29 Sep 2001, 04:46
damn!
in my Options, I changed the Base Directory to my whole path,
/home/kaos/public_html/forums/images/signature
still won't show up?

hummm.

dabean
29 Sep 2001, 19:24
okay at the bottom of the error messages you should see

"Image Exists. Image has been loaded, if you where not in debug mode it would be downloading now"

or "Image could not be opened. Filename is: $sigimagedir/$filename"

or "Image does not Exist. Filename and path should be: $sigimagedir/$filename"

if you don't then what version of php are you using?

snyx
29 Sep 2001, 21:07
im using 4.0.4pl1 and where would these messages be?
(sorry for the hassle man, just I really like this hack)

dabean
29 Sep 2001, 22:08
Warning: Cannot add header information - headers already sent by (output started at /www/forums/sig.php:36) in /www/forums/sig.php on line 78

Image Exists. filename is: /home/memberdata/uid419iid2.gif
Image Exists. Image has been loaded, if you where not in debug mode it would be downloading now

You should find something similar at the bottom of the debug page.

snyx
29 Sep 2001, 22:10
Image serving is enabled, referer check has not been carried out.
Displaying Image. filename is: images/signature/uid55iid6.gif

Warning: Cannot add header information - headers already sent by (output started at /home/kaos/public_html/forums/sig.php:58) in /home/kaos/public_html/forums/sig.php on line 68

Warning: Cannot add header information - headers already sent by (output started at /home/kaos/public_html/forums/sig.php:58) in /home/kaos/public_html/forums/sig.php on line 69

Warning: Cannot add header

thats all thats on my debug page?

dabean
29 Sep 2001, 22:36
hmm, now this is getting really strange. As the version of php i have installed is 4.0.4pl1

Anyway I've updated the debug script to remove all the header warnings, redownload it and see how far it gets.

snyx
30 Sep 2001, 02:17
white screen now man?
you wanna take a look around by any chance?
may save ya some time, better then me hounding ya here?

dabean
30 Sep 2001, 02:21
if you want to pm/email me a link i'll check it out further for you. Kind of has me interested in whats wrong.

fmoise99
02 Oct 2001, 02:16
That error is popping up again! I think you forgot to include smallerror() function with your update.

I'm getting
Fatal error: Call to undefined function: smallerror()

dabean
02 Oct 2001, 02:26
very possibly it is missing.

I have updated the zip to add the missing function back again.

Make sure the new version was downloaded after this edit, the previous upload was missing the end of the file.

fmoise99
03 Oct 2001, 00:35
Thanks, dabean for cool hack!

I was going to use this for my personal use, but someone else may have use for this also! Maybe dabean may have some use for this also.

This is a little modification to this hack for those that have ImageMagick on their servers. This uses ImageMagick to automatically create thumbnails. If you do not have ImageMagick installed on your servers, DO NOT INSTALL!!! :mad: Also, you must know the path to your ImageMagick convert!

Russ
03 Nov 2001, 03:45
Any made this work in 2.2.0 yet?

ethank
03 Nov 2001, 05:57
Originally posted by Russ
Any made this work in 2.2.0 yet?

No modifications necessary, I just merged it rom my 2.0.3 code onto the 2.2 base and it worked fine.

I do wish people would start using smallfont and normalfont in their hacks though.

Ethan

eg_92901
31 Jan 2002, 15:28
I keep getting an error message. (See attachment)

I'm assuming this is because my server runs in Safe Mode and I can't write to that directory. I've had other issues like this. I'm not certain how to take it off of safe mode and I'm debated on whether I should.

dabean
31 Jan 2002, 18:04
Originally posted by eg_92901
I keep getting an error message. (See attachment)

I'm assuming this is because my server runs in Safe Mode and I can't write to that directory. I've had other issues like this. I'm not certain how to take it off of safe mode and I'm debated on whether I should.

You have to specify the absolute path not the relative path. eg. starting /home

ethank
19 Mar 2002, 16:58
sig.php stopped working on vbulletin 2.2.4

I'm not sure why, but its not sending valid image headers anymore.

Ethan

xug
20 Mar 2002, 20:37
DaBean, could you look at my request at this link?

http://www.vbulletin.org/forum/showthread.php?postid=231133#post231133

Thank you for you time.

dabean
21 Mar 2002, 04:15
Originally posted by ethank
sig.php stopped working on vbulletin 2.2.4

I'm not sure why, but its not sending valid image headers anymore.

Ethan

change
$bbcode = preg_replace("/\[img\](\r\n|\r|\n)*((http|https):\/\/([^;<>\*\(\)\"".iif($allowdynimg,"","\?\&")."]+)|[a-z0-9\/\\\._\- ]+)\[\/img\]/siU", "<img src=\"\\2\" border=\"0\" alt=\"\">", $bbcode);

to

$bbcode = preg_replace("/\[img\](\r\n|\r|\n)*(([^;<>\*\(\)\"".iif($allowdynimg,"","\?\&")."]+)|[a-z0-9\/\\\._\- ]+)\[\/img\]/siU", "<img src=\"\\2\" border=\"0\" alt=\"\">", $bbcode);

inside functions.php.


xug: about your request the simple answer is no, the complex answer is maybe after vb3 is released as this current hack will need rewriting anyway I'd guess.

larryz
21 Mar 2002, 13:59
Correction on dabean's post above!

For v2.2.4 its accually:

Find:

$bbcode = preg_replace("/\[img\](\r\n|\r|\n)*((http|https):\/\/([^;<>\*\(\)\"".iif($allowdynimg,"","\?\&")."]+)|[a-z0-9\/\\\._\- ]+)\[\/img\]/siU", "<img src=\"\\2\" border=\"0\" alt=\"\">", $bbcode);


Replace with:

$bbcode = preg_replace("/\[img\](\r\n|\r|\n)*(([^;<>\*\(\)\"".iif($allowdynimg,"","\?\&")."]+)|[a-z0-9\/\\\._\- ]+)\[\/img\]/siU", "<img src=\"\\2\" border=\"0\" alt=\"\">", $bbcode);


in admin/functions.php

Mutt
21 Mar 2002, 22:16
I love this hack, but hate how it screws up the who's online page. If a thread has a sig image in it, any member viewing that thread shows up with thier location being the sig script instead of that thread. Any fix???

eoc_Jason
09 Apr 2002, 04:22
Forgive me for sounding stupid, but what is the sigimagetext.style file for? There is no mention of it in this thread or in any of the text files....

TECK
09 Apr 2002, 08:53
a quick question. are the images uploaded to database? i didnt have the chance to look at the file.
interesting hack.

eoc_Jason
09 Apr 2002, 19:46
No, you create a directory and it stores the files there (on your hard drive)... Which I think is a better idea IMO...

dabean
11 Apr 2002, 19:52
eoc_Jason, the sigimagetext.style is not really needed, its only provided incase you run into trouble with the template alterations. It is in fact a set of modified templates to test the hack with.

sub
22 Apr 2002, 09:58
Hi dabean,

I really like this hack; since 90% of my users use image siggies they all want me to host their siggie or need help with img tag so it becomes a hassle everyday. Anyhow, I have version 2.2.5 is this hack ok to install or should I forget it? I haven't even looked to see if I can or not. Thanks!

dabean
23 Apr 2002, 03:45
Originally posted by sub
Hi dabean,

I really like this hack; since 90% of my users use image siggies they all want me to host their siggie or need help with img tag so it becomes a hassle everyday. Anyhow, I have version 2.2.5 is this hack ok to install or should I forget it? I haven't even looked to see if I can or not. Thanks!

2.2.3, is the last release of vB this hack is supported and tested on, however I see no reason why it won't work with 2.2.5 as is.

John
23 Apr 2002, 09:51
Sorry for the newbie question, but is this hack actually working? People seem to be having a lot of problems with it :confused: - and where can I find an example of it working? Screenshot?

dabean
23 Apr 2002, 20:47
JohnWarwick: it works upto vB 2.2.4 but I have not tested it past that point. The bulk of problem reports where with the orignal release back in sept of last year, with a few further problems reported thanks to a change in vB 2.2.4 which broke previous versions of this hack.

The zip file contains two example screenshots.

BigJohnson
27 Apr 2002, 04:04
I am getting an erro about this hack when i try to add the images that i want. It says Warning: unable to move the file i want to the correct url that is given in simage.php it says error line 106. I dont no what to do. Please help this hack look amazing and i would love it so much only if it worked. PLease help.

dabean
27 Apr 2002, 04:12
Originally posted by BigJohnson
I am getting an erro about this hack when i try to add the images that i want. It says Warning: unable to move the file i want to the correct url that is given in simage.php it says error line 106. I dont no what to do. Please help this hack look amazing and i would love it so much only if it worked. PLease help.

Firstly are you using safe mode?
Secondly the base directory needs to be set as a APSOLUTE path eg /home/<blah>/<blah>

BigJohnson
28 Apr 2002, 17:04
This is what i get when you add a picture. My server is a unix Plesk server. I dont no what to do please help me out. Thanks.

dabean
28 Apr 2002, 17:28
Originally posted by BigJohnson
This is what i get when you add a picture. My server is a unix Plesk server. I dont no what to do please help me out. Thanks.

chmod the "images" directory 755

Dark_Wizard
10 May 2002, 00:21
Anybody get this working in 2.2.5? I can upload the pics and all and no errors but the image doesn't show in the users signature in thier posts...

ixian
22 May 2002, 01:28
Originally posted by Dark_Wizard
Anybody get this working in 2.2.5? I can upload the pics and all and no errors but the image doesn't show in the users signature in thier posts...

I have the same issue....it only displays a link to sig.php, not the image.

Yes, [img] tags are set for display. It works fine if you link to the actual file, ie http://www.yourhost.com/forums/images/sigs/sig.jpg

Just not if you do http://www.yourhost.com/forums/sig.php?image=1

Those are examples, of course.

Additionally, after I add an image when I click on it to add it to the sig, it only adds the "sig.php?=image=1" part, not the URL. I'm guessing a $bburl is missing somewhere, but I'll be darned if I can find which of the new templates it's supposed to be in.

This is with 2.2.5

ixian
22 May 2002, 02:39
Aha. Forgot about enabling dynamic URL's in img tags. That did the trick.

Still looking through the templates trying to find where to add the $bburl so that when a user clicks the image they get the full url to sig.php, not just sig.php.

ixian
22 May 2002, 04:25
Ok, I now have this GREAT hack working in 2.2.5. I seriously recommend more of you check it out - my members are going insane over it:)

First, thank you Dabean for a great hack. The following are some general instructions for readers of this thread, and a couple minor changes which I hope you will update in your file download.

Second, here's what I got to work:

Now displays correctly in 2.2.5

img tag safety is working

When a user clicks on the image, the correct path gets inserted (suprised no one caught this yet).

Works even with php safe mode.

First things first, if you are running in safe mode, make sure vb is set to that in the control panel options (duh). Create a directory on your server, preferably OUTSIDE your web root so it's not directly accesable (I used the main directory right above root). Chmod this directory 777. Now enter the full path to it (local path, not http obviously) in your safe mode options. Even though this hack uploads the images to another directory, you still need a safe mode directory where vb will temporaraly store it before it moves it to the correct one. Trust me on this.

Next, make sure that in addition to bbcode img tags being enabled on your forums, and set to display in your profile (it defaults to ON, but you never know) you turn Dynamic URL's ON. They aren't by default and a lot of people in this thread missed that.

Next, do NOT make the changes suggested earlier in this thread to functions.php! Very important. In a nutshell, starting with 2.2.3 the vb team implimented checks so that only ? or & characters can be used with dynamic URL's, and only if they come from http or https. Problem is, that broke the display part of sig.php - it would only show a link to the image, not the image. The changes suggested earlier got around this, at the expense of security. If you make them, it's possible (I tested) to link to a file on your own server if the person knows the path (getting that is easier than you think - I can't believe the amount of people who still have "display errors" on in their php ini. With that, everytime a script errors on your web server everyone who sees the error will see the full path on your server to the erroring script). THE SAFETY CHECKS DONE IN 2.2.3 AND 2.2.4 that prevented dynamic url's from completly working WERE FIXED IN 2.2.5. So leave functions.php as it is!:) With 2.2.5 you can use dynamic url's in images (required for this hack) without worrying about some numbnuts trying to execute commands on your server.

Make sure the directory you specify for images (don't use the one you use for safe mode) is chmod to 755, or 777 depending on your server. I also highly recommend putting this directory outside of your web-root as well. If you don't, someone feeling clever could possibly discover the file name sigedit.php gives to their uploaded image. They could then link directly to the image, bypassing, for example, the http_referrer checks (it will also bypass sig.php, if you have mod_rewrite setup to deny hot-linking that way). Putting it outside of your web root in a directory sig.php can read from will effectively stop anyone from having any chance of hot-linking. Of course, if you DO want to serve out images, then don't do this:)

Now, you need to make a minor change to your _editsignature template that was added when you first installed the sig. Find:

document.vbform.message.value += "sig.php?imageid="+sigtext+""

and change it to:

document.vbform.message.value += "$bburl/sig.php?imageid="+sigtext+""

This assumes you have sig.php located in your forums root directory. If not, you can add the correct subdirectory after $bburl or put the entire static path in there, i.e. http://www.yourhost.com/forums/sig.php? etc.

This fixes the error where a user clicks on the image they just uploaded to add it to their sig - before, it would add [ img ]sig.php?imageid="1"[ img ] , which of course isn't a valid link:)

Anyway, like I said I have it working just fine with 2.2.5 and my members love it. Thanks again for a great hack.

sub
07 Jun 2002, 04:48
argh! I installed this hack about a month ago, worked like a charm from the get go. But I moved to a new server last week and ever since then I cannot get it to work. This is the error i get:

Warning: Unable to create '/var/www/html/memberspics/uid2iid40.jpg': No such file or directory in /home/virtual/site1/fst/var/www/html/forum/simage.php on line 106

Warning: Unable to move '/tmp/php6oTYq3' to '/var/www/html/memberspics/uid2iid40.jpg' in /home/virtual/site1/fst/var/www/html/forum/simage.php on line 106


pls help? Thanks!

sub
08 Jun 2002, 17:12
Scratch that last post, I fixed it. :alien:

Something was wrong with the directory, even when set to CHMOD 777 I still cannot write to it. So deleted that directory and created another, ever since then it works. Thanks!!

sub
12 Jun 2002, 16:45
Originally posted by dabean


2.2.3, is the last release of vB this hack is supported and tested on, however I see no reason why it won't work with 2.2.5 as is.

I believe I’ve found a bug (for 2.2.5), I've been getting reports from my members that some images gets the "X" red box, at first I thought they were smoking some really good stuff as I see an image. Anyhow, past couple days ago I started to notice the "X" red box too so I confirmed with some other members that it's a phenomenon but then certain other members can see the image. I looked into it but cannot find the explanation why it would do such a cruel obsession to tease me. Thanks kindly!

dabean
15 Jun 2002, 02:47
Originally posted by sub


I believe I’ve found a bug (for 2.2.5), I've been getting reports from my members that some images gets the "X" red box, at first I thought they were smoking some really good stuff as I see an image. Anyhow, past couple days ago I started to notice the "X" red box too so I confirmed with some other members that it's a phenomenon but then certain other members can see the image. I looked into it but cannot find the explanation why it would do such a cruel obsession to tease me. Thanks kindly!

Posts 72 to 76 cover known problems on vB 2.2.4 onwards. Post 92 has a nice explaination of why the work around is bad.

It is for that reason that 2.2.3+ are not supported by this hack as it exists currently.

xug
20 Jun 2002, 22:18
Originally posted by Mutt
I love this hack, but hate how it screws up the who's online page. If a thread has a sig image in it, any member viewing that thread shows up with thier location being the sig script instead of that thread. Any fix???

I'll second this.

My online page shows only links to the sig.php !!

Is there a fix??? Or could somebody make a fix??

Please help us and many others who have this problem.

dabean
21 Jun 2002, 00:09
Originally posted by xug


I'll second this.

My online page shows only links to the sig.php !!

Is there a fix??? Or could somebody make a fix??

Please help us and many others who have this problem.

you need to change sessions.php
find

if ($templateversion > '2.0.1') { // Use location!
$location1 = ",location='" . addslashes($scriptpath) . "'";
$location2 = ",location";
$location3 = ",'" . addslashes($scriptpath) . "'";

change it to

if ($templateversion > '2.0.1') { // Use location!
// location fix.
if (($updatelocation==True) or (!isset($updatelocation))) {
$location1 = ",location='" . addslashes($scriptpath) . "'";
$location2 = ",location";
$location3 = ",'" . addslashes($scriptpath) . "'";
} else {
$location1 = '';
$location2 = '';
$location3 = '';
}


then open up sig.php and

change

$noheader=1;

to

$noheader=1;
// fix session location
$updatelocation=false;

xug
24 Jun 2002, 02:30
Originally posted by dabean


you need to change sessions.php
find

if ($templateversion > '2.0.1') { // Use location!
$location1 = ",location='" . addslashes($scriptpath) . "'";
$location2 = ",location";
$location3 = ",'" . addslashes($scriptpath) . "'";

change it to

if ($templateversion > '2.0.1') { // Use location!
// location fix.
if (($updatelocation==True) or (!isset($updatelocation))) {
$location1 = ",location='" . addslashes($scriptpath) . "'";
$location2 = ",location";
$location3 = ",'" . addslashes($scriptpath) . "'";
} else {
$location1 = '';
$location2 = '';
$location3 = '';
}


then open up sig.php and

change

$noheader=1;

to

$noheader=1;
// fix session location
$updatelocation=false;


I was talking about online.php (or is this to solve that problem?)

dabean
24 Jun 2002, 02:39
Originally posted by xug


I was talking about online.php

The suggested changes solve the cause of the problem.

The last location is stored in the session table in the "location" field to stop sig.php from appearing you NEED to stop the location field from being updated to contain it, the proposed modification above does just that.

xug
24 Jun 2002, 04:11
I'll get this error :

Parse error: parse error, unexpected $ in /home/xrhyze/public_html/forums/admin/sessions.php on line 400

FYI, I work with vB2.2.6

dabean
24 Jun 2002, 04:18
Originally posted by xug
I'll get this error :

Parse error: parse error, unexpected $ in /home/xrhyze/public_html/forums/admin/sessions.php on line 400

FYI, I work with vB2.2.6

The suggested alteration shouldn't have even touched line 400.


<?php
error_reporting(7);

if ($templateversion > '2.0.1') { // Use location!
// location fix.
if (($updatelocation==True) or (!isset($updatelocation))) {
$location1 = ",location='" . addslashes($scriptpath) . "'";
$location2 = ",location";
$location3 = ",'" . addslashes($scriptpath) . "'";
} else {
$location1 = '';
$location2 = '';
$location3 = '';
}
} else {
$location1 = '';
$location2 = '';
$location3 = '';
}
// ###################### Start sessions #######################


Is how the begining of sessions.php should look after modification.

xug
24 Jun 2002, 04:18
I played with this line :

if ($templateversion > '2.0.1') { // Use location!

and changed it to :

if ($templateversion > '2.0.1') // Use location!

Above mentioned error is gone, but the sig problem is back!

What could this be?

dabean
24 Jun 2002, 05:09
In addition the top of sig.php once modified should look exactly like this:

<?php
/*
sig.php : main sig image display script.
version: 1.3
*/

error_reporting(7);

$noheader=1;
// fix session location
$updatelocation=false;

require("./global.php");


Or just use the ready modified version attached also contains some improvements to other areas :).

dabean
25 Jun 2002, 18:39
v2.0 re-release

Features:
- New [sig=<imagenumber>] syntax. This cures the current problems with 2.2.4/2.2.5/2.2.6 and means dynamic image support no longer needs to be enabled.
- Remotely stored images support.
- register_globals = off support.
- sig.php doesn't appear as a location in who's online
- db update script

Carried over from the current version are:
- Local Image support
- Image size controls
- Control over the number of stored images

Xelation
27 Jun 2002, 02:22
what template is the _editsignature? never heard of it

Xelation
27 Jun 2002, 03:05
I cant seem to find

if ($bbuserinfo[showvbcode]) {
$vbcode_smilies = getclickysmilies();
}


what file is this in?

dabean
27 Jun 2002, 03:05
Originally posted by Xelation
what template is the _editsignature? never heard of it

From a signature editor hack see.
http://www.vbulletin.org/forum/showthread.php?s=&threadid=23933&highlight=editsignature & http://www.vbulletin.org/forum/showthread.php?s=&threadid=12282&highlight=editsignature

dabean
27 Jun 2002, 03:18
Originally posted by Xelation
I cant seem to find

if ($bbuserinfo[showvbcode]) {
$vbcode_smilies = getclickysmilies();
}


what file is this in?

signature.php which will only exist if you have one of forementioned hacks. Part 3 is only for use when those hacks are used. Part 2 is for use when you don't have said hacks installed all part 2 changes are in member.php.

Xelation
27 Jun 2002, 03:24
I know I'm a dumb ass but now I can find this in the editsignature template...


<script language="Javascript" src="vbcode.js" type="text/javascript"></script>
<script language="Javascript" src="vbcode_language.js" type="text/javascript"></script>

dabean
27 Jun 2002, 03:31
Originally posted by Xelation
I know I'm a dumb ass but now I can find this in the editsignature template...


<script language="Javascript" src="vbcode.js" type="text/javascript"></script>
<script language="Javascript" src="vbcode_language.js" type="text/javascript"></script>


roughly they will be below

<body>
$header

The exact lines maybe slightly different

Xelation
27 Jun 2002, 03:49
ok, all added.. in vboptions I get this under signature storage...


Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/xelation/public_html/forum/admin/options.php(72) : eval()'d code on line 1

dabean
27 Jun 2002, 04:22
Originally posted by Xelation
ok, all added.. in vboptions I get this under signature storage...


Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/xelation/public_html/forum/admin/options.php(72) : eval()'d code on line 1

ack typing error in the installer.

IF you have phpmyadmin installed the run the query below.
UPDATE setting SET optioncode='<select name=\"setting[$setting[settingid]]\">
<option value=\"0\" ".iif($setting[value]==0,"selected","").">Local Only</option>
<option value=\"1\" ".iif($setting[value]==1,"selected","").">Remote Only</option>
<option value=\"2\" ".iif($setting[value]==2,"selected","").">Local & Remote</option></select>' WHERE varname='sigstorage'

Alternatively re-download the zip use the uninstaller to remove the database changes then carry out just step 2 of the installation (sinstall.php?action=install&step=2) .

Disturbed
27 Jun 2002, 05:34
uhh hi dabean :P

i'm getting this error

Warning: Unable to create '/home/totalsho/public_html/forums/images/sigs/uid1iid.gif': Permission denied in /home/totalsho/public_html/forums/simage.php on line 129

my sig dir is forums/images/sigs

both images/sigs chmod to 666

anything i'm missing here?

thnx

dabean
27 Jun 2002, 06:00
Originally posted by Disturbed
uhh hi dabean :P

i'm getting this error

Warning: Unable to create '/home/totalsho/public_html/forums/images/sigs/uid1iid.gif': Permission denied in /home/totalsho/public_html/forums/simage.php on line 129

my sig dir is forums/images/sigs

both images/sigs chmod to 666

anything i'm missing here?

thnx

That looks correct, 666 shouldn't cause that problem, um try chmod'ing the directory(s) 777 to see if it cures the problem.

Disturbed
27 Jun 2002, 06:56
yup it uploads now

but it doesn't show in the postbit template

here's the usercp
http://www.totalshock.net/sig1.gif

and heres the postbit
http://www.totalshock.net/sig2.gif

wat am i doing wrong?

dabean
27 Jun 2002, 09:16
Originally posted by Disturbed
yup it uploads now

but it doesn't show in the postbit template

wat am i doing wrong?

roughly you need vB code in signatures turned on. Also the [sig] tag works like [sig=6] and the template set is designed to create tags in that format. In fact if the value after the ='s is anything but a integer you won't see anything. This is by design.

Xelation
27 Jun 2002, 16:05
I added that query and still get..

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/xelation/public_html/forum/admin/options.php(72) : eval()'d code on line 1


after I did that query I did the second thing and still get the above. any ideas?

dabean
27 Jun 2002, 19:53
Originally posted by Xelation
after I did that query I did the second thing and still get the above. any ideas?

You re-downloaded the zip and used the version of sinstall.php included?

As it appears phpmyadmin can not handle the query correctly. Find attached a simple corrective script. Upload to admin directory and run.

Disturbed
27 Jun 2002, 22:56
Originally posted by dabean


roughly you need vB code in signatures turned on. Also the [sig] tag works like [sig=6] and the template set is designed to create tags in that format. In fact if the value after the ='s is anything but a integer you won't see anything. This is by design.

hey thanx for the support dabean, it works perfect :)

but can't i edit the code so when i click on the sig it auto-inserts the code and the id?

Xelation
28 Jun 2002, 16:39
ok, all added... now when someone uploads a sig I get this...




Warning: Unable to create 'devull/uid1iid.gif': No such file or directory in /home/xelation/public_html/forum/simage.php on line 129

Warning: Unable to move '/tmp/phpqbhyGK' to 'devull/uid1iid.gif' in /home/xelation/public_html/forum/simage.php on line 129

Disturbed
29 Jun 2002, 01:52
did u make the folder devull? and did u chmod it?

recheck, maybe thats the problem :P

Xelation
29 Jun 2002, 01:54
where do I put the folder, and what # does it need to be chmoded to?

Disturbed
29 Jun 2002, 01:58
well i simply created a 'sigs' folder in the images folder and changed teh chmod to 777

for u to get it working go to your admincp>>vbulletin options then go to the bottom of the page and change the base directory of the sig editor to
/home/xelation/public_html/forum/images/sigs
u can change that if ya want...

Xelation
29 Jun 2002, 02:03
works, thanks!

Xelation
29 Jun 2002, 02:22
crap, when I upload a sig now its a red x, to get the actual image I need to edit/repace that red x one for it to show up... then if I want to add a sig to the box I click the sig but it shows up as

[sig=]

in the sig text area... anyone know whats wrong?

dabean, if its not to much trouble.. could you take a look at my board? if so please pm me and I will give you access to it. :)

Disturbed
29 Jun 2002, 02:43
well it doesn't enter the sig ID when u click it, u have to do it manually.

check out some of my posts above

dunno about your other problems though

Xelation
29 Jun 2002, 18:24
please any help?

dabean
29 Jun 2002, 19:31
Originally posted by Disturbed
well it doesn't enter the sig ID when u click it, u have to do it manually.


The hack should enter the id when a image is clicked on, ack just noticed a typing error in the installer. Open the sig_images_bit template and change
javascript:sigimg('')
to
javascript:sigimg('$mysigimage[imageid]')

obviously removing the space between java and script :)

dabean
29 Jun 2002, 22:09
bug fixes. Apply the change above.

Open the sigimage_popup_images template
change

function sigimg(sigtext) {
opener.document.vbform.signature.value += "[sig="+sigtext+"]";
//document.vbform.message.focus();
}
to

function sigimg(sigtext) {
opener.document.vbform.signature.value += "[sig="+sigtext+"]\";
}

Download the current version of the zip 2.0_4 and upload the new version of simage.php.

This should correct all reported bugs.

Any images that appear as X's before these changes are made will need to be removed.

Xelation
29 Jun 2002, 22:14
:( didn't work, still does the same thing..

Disturbed
29 Jun 2002, 22:49
thanks dabean!

works like a charm, great hack. :)

dabean
30 Jun 2002, 23:49
ack, i'll actually include the updated files in the zip this time. Anyone that downloaded the "4B" zip has the most current files.

One more minnor correction the post slightly further up should suggest that the change to make is

opener.document.vbform.signature.value += "[sig="+sigtext+"]";

not
opener.document.vbform.signature.value += "[sig="+sigtext+"]\";

eXtremeTim
01 Jul 2002, 03:46
For some reason the upload keeps failing on me i have no errors the image is not to big. Everythings set the way it should be set. Im running into walls here anybody got any ideas.

eXtremeTim
01 Jul 2002, 03:56
Okay its working now all i get is red X boxes every were but the actualy image path itself works.

eXtremeTim
01 Jul 2002, 04:09
hmm this is weird if i put &debug= after the image id stuff it loads the image just fine.

eXtremeTim
01 Jul 2002, 04:13
Sorry about all the posts but i got it. The bug fix for the red x's was not correctly put into the new version aparently becuase i replaced the current with the what you posted minus the \ and it worked perfectly.

dabean
01 Jul 2002, 04:38
Originally posted by eXtremeTim
Sorry about all the posts but i got it. The bug fix for the red x's was not correctly put into the new version aparently becuase i replaced the current with the what you posted minus the \ and it worked perfectly.

You started (intially) with which version? and used which posted fix to correct it?

The most current zip should include all fixes for new installations, older installations will need to use the posted fixed.

eXtremeTim
01 Jul 2002, 04:42
I started with the newest version. It worked perfectly after i did the new line

With

function sigimg(sigtext) {
opener.document.vbform.signature.value += "[sig="+sigtext+"]\";
}

it didn't work till after i did that i must have test 40 images and they were all red x's till i did that. Then when i uploaded they started working.

*AKA*Geo*A*
01 Jul 2002, 19:44
well I have a super easy one, compared to what I ahve been reading,


I just need to know where the vb images are set in the pop up window, my sigs are working fine, its just that the actual vb images are linking to www.classicaka.com........www.classicaka.com/vb/fourms/images

instead of just www.classicaka.com/vb/forum/images

any help would be greatly appreciated

dabean
02 Jul 2002, 02:30
Originally posted by *AKA*Geo*A*
well I have a super easy one, compared to what I ahve been reading,


I just need to know where the vb images are set in the pop up window, my sigs are working fine, its just that the actual vb images are linking to www.classicaka.com........www.classicaka.com/vb/fourms/images

instead of just www.classicaka.com/vb/forum/images

any help would be greatly appreciated

vB images?

All the image paths used by this hack are controlled via the admin cp.

Neopiper
05 Jul 2002, 17:06
How can i get the images uploaded to be owned by my account? all teh files uploaded listed as Owner : Nobody

dabean
05 Jul 2002, 18:02
Originally posted by Neopiper
How can i get the images uploaded to be owned by my account? all teh files uploaded listed as Owner : Nobody

reconfigure apache. :rolleyes:

And no I won't be more helpful than that, as the files are owned by the user account apache runs under. You can't automatically chown them in php as that would require running php as superuser which is bad mmkay. :paranoid:

Neopiper
05 Jul 2002, 20:11
thx dabean, i've fixed the problem :) i changed the apache conf already

Voltron420
21 Jul 2002, 05:14
Forgive me if this has already been asked, but is there a way to regulate this hack so a user has to have a certain number of posts before they can upload sig images?

Giving free reign to upload stuff to ALL users on my board could be a problem. There is too many of them!



***** EDIT *******
Nevermind, I figured it out ;)

Mr_P
28 Jul 2002, 23:39
Installation Part 3 (Advanced Signature Editor):
Code:
Open signature.php
signature.php - lol it does not exsist ??

I dont have this file am i missing something here ?

is there another hack that goes with this

dabean
28 Jul 2002, 23:49
Originally posted by Mr_P
Installation Part 3 (Advanced Signature Editor):
Code:
Open signature.php
signature.php - lol it does not exsist ??

I dont have this file am i missing something here ?

is there another hack that goes with this

I'm lazy so I'll quote the readme.

Installation is split into 4 parts.
- Part 1 covers changes that need to made for new installations.
- Part 2 covers changes that need to made for users of the vBulletin provided Signature Editor.
- Part 3 covers changes that need to made for users of a Advanced Signature Editor.

Yes part 3 is specific to sites with ANOTHER hack installed, no this hack is not required. Thus is in a seperate optional part.

Mr_P
28 Jul 2002, 23:56
cheers for speedy reply dabean.

Will go back to beginning again now as i must ov missed something as when i got to profile under the normal sigi box i see this ALTER IMAGES so i click it and a pop up appears

My Signature Images List
Click a image to insert it into your signature.
Signature Images
You have no stored images.


Where do i store me images ? should i not have a browse button so i can load one ov net or ov comp like the avator does.

dabean
29 Jul 2002, 00:12
Originally posted by Mr_P
cheers for speedy reply dabean.

Will go back to beginning again now as i must ov missed something as when i got to profile under the normal sigi box i see this ALTER IMAGES so i click it and a pop up appears

My Signature Images List
Click a image to insert it into your signature.
Signature Images
You have no stored images.


Where do i store me images ? should i not have a browse button so i can load one ov net or ov comp like the avator does.

You've been into the admin cp and set the configuration options for this hack?

"options > vBulletin Options > signature"

Mr_P
29 Jul 2002, 00:29
yeah sorted that m8

can get link box now but red x`s only i think i set me base path wrong will let u know how i get on

Mr_P
29 Jul 2002, 20:22
ok i sorted it now last night but was tired and went bed.
Just like to say a big thanks m8 - sometimes though when one is stuck it just seems easier to do a post than to actually find out what the prob was and when i finally did it - i was mega p***ed as it was all to do with the path.

Excellant hack m8 and one that im sure a lot of use are glad u made.

CRego3D
02 Sep 2002, 06:02
Instaleld this hack .. using the latest .zip .. everythign works, I can upload the images, I see them in the User CP, I click on it, it does do [sig=6] (6 beeign that sig number I supose) ..

but when I click on "submit modifications" .. I get

Parse error: parse error in /hsphere/local/home/yaxay/yaxay.com/yack/admin/functions.php(821) : regexp code on line 1

Fatal error: Failed evaluating code: in /hsphere/local/home/yaxay/yaxay.com/yack/admin/functions.php on line 821

Any ideas ?

PS - Line 821 is ..

$bbcode=preg_replace($searcharray, $replacearray, $bbcode);

dabean
02 Sep 2002, 11:47
Originally posted by CRego3D
Instaleld this hack .. using the latest .zip .. everythign works, I can upload the images, I see them in the User CP, I click on it, it does do [sig=6] (6 beeign that sig number I supose) ..

but when I click on "submit modifications" .. I get

Parse error: parse error in /hsphere/local/home/yaxay/yaxay.com/yack/admin/functions.php(821) : regexp code on line 1

Fatal error: Failed evaluating code: in /hsphere/local/home/yaxay/yaxay.com/yack/admin/functions.php on line 821

Any ideas ?

PS - Line 821 is ..

$bbcode=preg_replace($searcharray, $replacearray, $bbcode);

What PHP version?

Check, "/vbscript:/si",
"/(\[sig\=)(.*)(\])/esiU" // addition
exists as stated in the readme. (functions.php)

Check
"vbscript :",
"checksigimage('\\2')" // addition
exists also as stated in the readme. (functions.php)

Check the function "checksigimage" exists within functions.php.

CRego3D
02 Sep 2002, 17:56
Thank you .. As it seems I furgot somethign on functions.php :( .. works great now :)

LancerForums
02 Sep 2002, 23:38
This is a great hack! I think there's one bug though:

I just installed v.2.0.4b and everything worked except deleting the image from the image sig list. The delete appeared successful, but when I checked the folder it was still there. It turns out imageid was missing from the query for the image info when deleting an image. The code I had looks like this:

simage.php

// ############################ delete sig image #############################
if ($HTTP_GET_VARS['action']=="remove") {

include("./global.php");

if ($bbuserinfo['userid']==0){
show_nopermission();
exit;
}

if (is_numeric($HTTP_GET_VARS['imageid'])) {
// delete file
$sigimage = $DB_site->query_first("SELECT extension, userid, location FROM sigimage WHERE imageid = $HTTP_GET_VARS[imageid]");
if ($sigimage['userid'] == $bbuserinfo['userid']) {
// local location lets remove it.
if ($sigimage['location']==0) {
// can delete image
@unlink($sigimagedir ."/uid". $bbuserinfo[userid] ."iid". $sigimage['imageid'] .".". $sigimage['extension']);
// delete entry
}
$DB_site->query("DELETE FROM sigimage WHERE imageid=$HTTP_GET_VARS[imageid] AND userid=$bbuserinfo[userid]");

$goto="simage.php?s=$session[sessionhash]&action=alterimg";
eval("standardredirect(\"".gettemplate("redirect_imagedelete")."\",\"$goto\");");
} else {
// no permission
show_nopermission();
exit;
}
} else {
// no permission
show_nopermission();
exit;
}
}

and I just added this to make the delete work:

simage.php

// ############################ delete sig image #############################
if ($HTTP_GET_VARS['action']=="remove") {

include("./global.php");

if ($bbuserinfo['userid']==0){
show_nopermission();
exit;
}

if (is_numeric($HTTP_GET_VARS['imageid'])) {
// delete file
$sigimage = $DB_site->query_first("SELECT imageid, extension, userid, location FROM sigimage WHERE imageid = $HTTP_GET_VARS[imageid]");
if ($sigimage['userid'] == $bbuserinfo['userid']) {
// local location lets remove it.
if ($sigimage['location']==0) {
// can delete image
@unlink($sigimagedir ."/uid". $bbuserinfo[userid] ."iid". $sigimage['imageid'] .".". $sigimage['extension']);
// delete entry
}
$DB_site->query("DELETE FROM sigimage WHERE imageid=$HTTP_GET_VARS[imageid] AND userid=$bbuserinfo[userid]");

$goto="simage.php?s=$session[sessionhash]&action=alterimg";
eval("standardredirect(\"".gettemplate("redirect_imagedelete")."\",\"$goto\");");
} else {
// no permission
show_nopermission();
exit;
}
} else {
// no permission
show_nopermission();
exit;
}
}

The red entry is the missing text.

Mark

Punchak
03 Sep 2002, 23:49
Great hack !
I Just installed 2.0_4b as well (with vb 2.2.6), userCP work just fine, but I've red X in the sig area :confused:

dabean
04 Sep 2002, 04:09
Originally posted by Punchak
Great hack !
I Just installed 2.0_4b as well (with vb 2.2.6), userCP work just fine, but I've red X in the sig area :confused:

Red X's mean you've set the PATH wrong. It must a absolute path to the location of sig images directory. E.g. /home/mysite/myimages

Punchak
04 Sep 2002, 11:31
Thanks dude ;) it works like a charm now !

ferior
08 Sep 2002, 21:59
I'm seeing a problem. When I upload an image, and click delete. The file seems to be still on the server [ different name , same file type ] So shouldn't it delete it off the server too?

dabean
08 Sep 2002, 22:54
Originally posted by ferior
I'm seeing a problem. When I upload an image, and click delete. The file seems to be still on the server [ different name , same file type ] So shouldn't it delete it off the server too?


Define different name?

I have tested that this hack does remove images on all versions of php where the "unlink" function is present. However if your images path has a slash at the end then removal of images can fail.

ferior
08 Sep 2002, 23:40
ok, lets say I upload this
(1.) I click browse
(2) I upload
C:\Documents and Settings\ferior\Desktop\20a3.jpg
(3) I check the ftp and the directory to see any changes
i now see uid1iid12.jpg , which is exactly 20a3.jpg
(4) I click delete - image removed [ in the window panel ]
(5) uid1iid12.jpg is still their on the ftp.
(6) the images path next to [Base Directory
The base directory to store all signature images in] :

/home/<username>/public_html/sigimage

which has no slash @ the end, if thats where you referring to.

dabean
09 Sep 2002, 00:04
Originally posted by ferior
ok, lets say I upload this
(1.) I click browse
(2) I upload
C:\Documents and Settings\ferior\Desktop\20a3.jpg
(3) I check the ftp and the directory to see any changes
i now see uid1iid12.jpg , which is exactly 20a3.jpg
(4) I click delete - image removed [ in the window panel ]
(5) uid1iid12.jpg is still their on the ftp.
(6) the images path next to [Base Directory
The base directory to store all signature images in] :

/home/<username>/public_html/sigimage

which has no slash @ the end, if thats where you referring to.

This is php running on windows or linux/unix?

Your "refreshing" the ftp view after deleting the file?

does changing line 243 in simage.php
"@unlink($sigimagedir ."/uid". $bbuserinfo[userid] ."iid". $sigimage['imageid'] .".". $sigimage['extension']);"

to
unlink($sigimagedir ."/uid". $bbuserinfo[userid] ."iid". $sigimage['imageid'] .".". $sigimage['extension']);

result in a error when deleting images?

ferior
09 Sep 2002, 00:05
let me try right now >^..^< hold on http://www.venturesonline.com/hosting/virtual-hosting.html

Linux red hat from that web host above.

ferior
09 Sep 2002, 00:11
yup

Warning: unlink() failed (No such file or directory) in /home/<username>/public_html/simage.php on line 243

I do the username just as a security thing for myself on the forum.

ferior
09 Sep 2002, 00:26
hahahaha, im stupid the fix is above :) that imageid

BlueVoltage
19 Sep 2002, 22:56
I keep getting these errors:

when loading admin/index.php:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/xelerix/public_html/x/admin/functions.php on line 681

Parse error: parse error, unexpected $ in /home/xelerix/public_html/x/admin/sessions.php on line 442


Lines 667-682 in admin/functions.php:


if (floor($phpversionnum) < 4) {
$searcharray = array(
"/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
"/(\[)(list)(])(.*)(\[\/list\])/siU",
"/(\[\*\])/siU",
"/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4)(.*)(\[\/url\])/siU",
"/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
"/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU",
"/(\[)(url)(])([^\"]*)(\[\/url\])/siU",
"/(\[)(php)(])(\r\n)*(.*)(\[\/php\])/siU",
"/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
"/javascript:/si",
"/about:/si",
"/vbscript:/si"
"/(\[sig\=)(.*)(\])/esiU" // addition
);

____________________________________________________

When loading /index.php:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/xelerix/public_html/x/admin/functions.php on line 681

Parse error: parse error, unexpected $ in /home/xelerix/public_html/x/admin/sessions.php on line 442

Fatal error: Call to undefined function: cachetemplates() in /home/xelerix/public_html/x/global.php on line 284


I am running 2.2.7 (I know the hack has only been tested on 2.2.5 and 2.2.6)

dabean
19 Sep 2002, 23:12
Originally posted by BlueVoltage
I keep getting these errors:
I am running 2.2.7 (I know the hack has only been tested on 2.2.5 and 2.2.6)

Your missing a comma (,) after "/vbscript:/si"

e.g.

$searcharray = array(
"/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
"/(\[)(list)(])(.*)(\[\/list\])/siU",
"/(\[\*\])/siU",
"/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4)(.*)(\[\/url\])/siU",
"/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
"/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU",
"/(\[)(url)(])([^\"]*)(\[\/url\])/siU",
"/(\[)(php)(])(\r\n)*(.*)(\[\/php\])/siU",
"/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
"/javascript:/si",
"/about:/si",
"/vbscript:/si", // <--- comma
"/(\[sig\=)(.*)(\])/esiU" // addition
);


Oh don't copy, paste the above fragment as vB adds additional spaces that stop it from being valid PHP.

BlueVoltage
19 Sep 2002, 23:52
I still get these errors: And i am unable to login to my admin cp

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/xelerix/public_html/x/admin/functions.php on line 826

Parse error: parse error, unexpected $ in /home/xelerix/public_html/x/admin/sessions.php on line 442


Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/xelerix/public_html/x/admin/functions.php on line 826

Parse error: parse error, unexpected $ in /home/xelerix/public_html/x/admin/sessions.php on line 442

Fatal error: Call to undefined function: cachetemplates() in /home/xelerix/public_html/x/global.php on line 284

dabean
20 Sep 2002, 00:00
Originally posted by BlueVoltage
I still get these errors: And i am unable to login to my admin cp




You'll be missing another comma (,) further down between

"vbscript :", // <-- comma
"checksigimage('\\2')" // addition

BlueVoltage
20 Sep 2002, 00:09
no that comma was there

dabean
20 Sep 2002, 00:22
Originally posted by BlueVoltage
no that comma was there

After looking again at the error message you've got I've relised that you've made the changes to the wrong block of code. :surprised:

So I've inlcuded the whole fragment

if (floor($phpversionnum) < 4) {
$searcharray = array(
"/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
"/(\[)(list)(])(.*)(\[\/list\])/siU",
"/(\[\*\])/siU",
"/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4)(.*)(\[\/url\])/siU",
"/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
"/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU",
"/(\[)(url)(])([^\"]*)(\[\/url\])/siU",
"/(\[)(php)(])(\r\n)*(.*)(\[\/php\])/siU",
"/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
"/javascript:/si",
"/about:/si",
"/vbscript:/si"
);

$replacearray = array(
"<ol type=\"\\5\">\\7</ol>",
"<ul>\\4</ul>",
"<li>",
"<a href=\"http://www.\\6\" target=\"_blank\">\\8</a>",
"<a href=\"\\5\" target=\"_blank\">\\7</a>",
"<a href=\"http://www.\\5\" target=\"_blank\">\\5</a>",
"<a href=\"\\4\" target=\"_blank\">\\4</a>",
"</normalfont><blockquote><pre><smallfont>code:</smallfont><hr>\\5<hr></pre></blockquote><normalfont>",
"</normalfont><blockquote><pre><smallfont>code:</smallfont><hr>\\5<hr></pre></blockquote><normalfont>",
"java script:",
"about :",
"vbscript :"
);
} else {
$searcharray = array(
"/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/esiU",
"/(\[)(list)(])(.*)(\[\/list\])/esiU",
"/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/esiU",
"/(\[)(url)(])([^\"]*)(\[\/url\])/esiU",
"/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/esiU",
"/(\[)(php)(])(\r\n)*(.*)(\[\/php\])/esiU",
"/javascript:/si",
"/about:/si",
"/vbscript:/si",
"/(\[sig\=)(.*)(\])/esiU" // addition
);

$replacearray = array(
"createlists('\\7', '\\5')",
"createlists('\\4')",
"checkurl('\\5', '\\7')",
"checkurl('\\4')",
"stripbrsfromcode('\\5')",
"phphighlite('\\5')",
"java script:",
"about :",
"vbscript :",
"checksigimage('\\2')" // addition
);
} // end version check


As with the first fragment don't copy, paste as vB will add additional spaces that prevent it from working.
You'll notice that the readme states the block begining
"/(\[)(php)(])(\r\n)*(.*)(\[\/php\])/esiU",
needs to be modified not the block begining
"/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
which you modified.

BlueVoltage
20 Sep 2002, 00:44
ok now i just get this error:

Parse error: parse error, unexpected $ in /home/xelerix/public_html/x/admin/sessions.php on line 442

dabean
20 Sep 2002, 02:16
Originally posted by BlueVoltage
ok now i just get this error:



The contents of line 442 are?

In fact this hack should not have required modification to anything in the region of that line inside sessions.php
Lines 5 to 20 are the only lines that need modification.

BlueVoltage
20 Sep 2002, 02:41
when i open the file up, line 442 is empty...

BlueVoltage
20 Sep 2002, 02:45
I attached my sessions.php.

dabean
20 Sep 2002, 02:56
Originally posted by BlueVoltage
sessions.php.

Firstly you should edit your post to remove the file :paranoid:

Now to solve your problem you need to replace

if ($templateversion > '2.0.1') { // Use location!
if (($updatelocation==True) or (!isset($updatelocation))) {
$location1 = ",location='" . addslashes($scriptpath) . "'";
$location2 = ",location";
$location3 = ",'" . addslashes($scriptpath) . "'";
} else {
$location1 = '';
$location2 = '';
$location3 = '';
}
} else {
// ###################### Start sessions #######################


with

if ($templateversion > '2.0.1') { // Use location!
// location fix.
if (($updatelocation==True) or (!isset($updatelocation))) {
$location1 = ",location='" . addslashes($scriptpath) . "'";
$location2 = ",location";
$location3 = ",'" . addslashes($scriptpath) . "'";
} else {
$location1 = '';
$location2 = '';
$location3 = '';
}
} else {
$location1 = '';
$location2 = '';
$location3 = '';
}
// ###################### Start sessions #######################


Which is what the instructions stated and then your problems with be solved :bunny:

Dean C
20 Sep 2002, 22:14
what do u mean by the default sig editor and the advanced sig editor???

im confused

- miSt

dabean
20 Sep 2002, 23:47
Originally posted by Mist
what do u mean by the default sig editor and the advanced sig editor???

im confused

- miSt

default sig editor == VBulletin provided "editor"
advanced sig editor == any one of the four or so hacks that make sig editing like writing posts, e.g. advanced.

Dean C
21 Sep 2002, 11:36
im confused... i have the hl_signature hack by NanoEntity installed wich gives a preview pane and does sig limits - but is that an advanced sig editor?

- miSt

dabean
21 Sep 2002, 12:12
Originally posted by Mist
im confused... i have the hl_signature hack by NanoEntity installed wich gives a preview pane and does sig limits - but is that an advanced sig editor?

- miSt

Not aware of that hack and a search on here didn't turn up anything?

Compatible hacks are:-
- "Upgraded Signature-Editor w/ Preview" (re-release vb2)
- "Upgraded Signature-Editor w/ Preview" (original release vb2)
- "signature-editor with preview" (re-release release vb2)
- "signature-editor with preview" (orginal release vb2)
- Original hack by AA (vb1, no longer listed on here)

Only editing hacks orginally released before this hack (sept 2001) are currently compatible. As those four all provide everything a (vb2) sig editor needs I'm not inclined to add support for any additional editors.

Dean C
22 Sep 2002, 14:03
and it says that this hack will only work on phpversion: 4.0.6

Is that a precaution or is there any chance that it will work with phpversion: 4.0.5????

- miSt

dabean
22 Sep 2002, 22:38
Originally posted by Mist
and it says that this hack will only work on phpversion: 4.0.6

Is that a precaution or is there any chance that it will work with phpversion: 4.0.5????

- miSt

Actually the readme states:
PHP 4 >= 4.1.0
PHP 4 4.0.6+Upload Patch can used if the installation script is modifed.

So no 4.0.5 can not be used, and neither is 4.0.6 recommended.

Dean C
23 Sep 2002, 17:47
where is the upload patch located?

- miSt

dabean
23 Sep 2002, 20:03
Originally posted by Mist
where is the upload patch located?

- miSt

php.net under "File Uploads Security Fix". This only applies to PHP 4.0.6.

Naturally to apply the fix you require 4.0.6 installed from source and the pre-requisit privalages on the server.

Additionally using this hack with PHP 4.0.6 without or even with the mentioned patch is completely at your own risk.

All current versions PHP (e.g. 4.2.3) are not affected and do not require this.

Dean C
23 Sep 2002, 20:20
so php 4.0.5 with the security patch cannot be used...

what problems cud this cause on a php with version 4.0.5 or 4.0.6 anyway?

- miSt

dabean
23 Sep 2002, 20:56
Originally posted by Mist
so php 4.0.5 with the security patch cannot be used...

what problems cud this cause on a php with version 4.0.5 or 4.0.6 anyway?

- miSt

Firstly:
http://security.e-matters.de/advisories/012002.html

Secondly:
This hack has not been tested on 4.0.5

Finnally:
The installer won't work on 4.0.6, it requires functions present in 4.1.0 or newer. To get round this you need to manually alter the installer to work on 4.0.6.
No help or support in doing this will be provided.

Dean C
23 Sep 2002, 21:03
damn :(

- miSt

wolfe
23 Sep 2002, 23:24
there is no signiture.php file on vbb 2.2.7 to find this code please help

if ($bbuserinfo[showvbcode]) {
$vbcode_smilies = getclickysmilies(); <<< this line maybe slightly different depending on the editor hack you use.
}

Mutt
28 Sep 2002, 13:35
THANK YOU for fixing the who's online bug!!!!

CRego3D
05 Nov 2002, 07:21
after our latest upgrade this hack stopped workign for me

the old images will onyl work like this

http://forum.yaxay.com/sig.php?id=57

the new ones

http://forum.yaxay.com/sig.php?imageid=57

(id vs imageid) .. what in the world can be causing this ?

dabean
05 Nov 2002, 16:14
Originally posted by CRego3D
after our latest upgrade this hack stopped workign for me

the old images will onyl work like this

http://forum.yaxay.com/sig.php?id=57

the new ones

http://forum.yaxay.com/sig.php?imageid=57

(id vs imageid) .. what in the world can be causing this ?

Which/what version of this hack (sig.php and simage.php contain a version number at the top of the file). Both urls return images for me :ermm:

thenetbox
04 Dec 2002, 16:50
Part 3 covers changes that need to made for users of a Advanced Signature Editor.

Yes part 3 is specific to sites with ANOTHER hack installed, no this hack is not required. Thus is in a seperate optional part.




Originally posted by wolfe
there is no signiture.php file on vbb 2.2.7 to find this code please help

if ($bbuserinfo[showvbcode]) {
$vbcode_smilies = getclickysmilies(); <<< this line maybe slightly different depending on the editor hack you use.
}

ferior1
19 Feb 2003, 01:07
Well im working with version 2.2.9

no errors, uploads fine, abs. perfect install & setup.

Only thing missing that it wont show up in the signature when I post :(

http://www.gaming-forums.com/phpinfo.php
theirs my php information.

ney clues?

dabean
19 Feb 2003, 01:32
Originally posted by ferior1
Well im working with version 2.2.9

no errors, uploads fine, abs. perfect install & setup.

Only thing missing that it wont show up in the signature when I post :(

http://www.gaming-forums.com/phpinfo.php
theirs my php information.

ney clues?

you've made the changes to functions.php?

and you checked that you changed the correct block (the second one), which only the whole fragment matches.

ferior1
19 Feb 2003, 02:33
( 1 ) made changes to functions.php : yes - checked it 3 times.

#2 question, not sure what your referring to, I've attached my functions.php , so you can check it out , I'm pretty confident I did it right.

ferior1
19 Feb 2003, 02:46
sessions.php - I've attached it - edited it exactly to the readme

i've uploaded
sig.php
sigimage.php
did the sinstall.php
edited the template

im using just the vBulletin provided Signature Editor, which is easy to setup.

it worked once before, im not sure where it stopped working, so many forum updates.

the directory is right, the configuration is right under vb options, their has been no errors at all, been a nice install.

i've redid everything, and alot of users are going to be annoyed, heh oh well :)

so im clueless right now :(

dabean
19 Feb 2003, 02:55
Originally posted by ferior1

i've redid everything, and alot of users are going to be annoyed, heh oh well :)

so im clueless right now :(

Are you seeing "[sig=<somenumber>]" inside user signatures, or broken images? or just plain nothing? When reading posts this is.

ferior1
19 Feb 2003, 03:12
when seeing a thread I see nothing, when seeing it in the user cp I see this http://www.gaming-forums.com/sig.php?id=3 so I see it in the user cp

I can see it in the directory & it deletes it from the directory when I delete it , that it resides in that I created, which is 777, so everything is great their.


this is the current modify profile in vbb 2.2.9 - un edited
------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>$bbtitle - Update profile</title>
$headinclude
</head>
<body>
$header

<!-- breadcrumb -->
<table cellpadding="2" cellspacing="0" border="0" width="95%" align="center">
<tr>
<td width="100%"><img src="http://www.vbulletin.org/forum/images/vb_bullet.gif" align="middle" alt="vBulletin">
<normalfont><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a> &gt;
<a href="usercp.php?s=$session[sessionhash]">User Control Panel For $bbuserinfo[username]</a> &gt;
Edit Profile</b></normalfont></td>
</tr>
</table>
<!-- /breadcrumb -->

<br>
$cpnav
<br>

<center>$coppatext</center>

<form action="member.php" method="post" name="vbform">
<input type="hidden" name="s" value="$session[sessionhash]">

<table cellpadding="0" cellspacing="0" border="0" bgcolor="#0A293E" width="95%" align="center"><tr><td>
<table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr>
<td bgcolor="#336D95" background="http://www.vbulletin.org/forum/images/catagory_backing.gif" colspan="2"><normalfont color="#000000"><b>Edit Profile - $bbuserinfo[username]</b></normalfont></td>
</tr>
<tr>
<td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF" class="thtcolor"><b>Registration: Required Information</b></normalfont>
<smallfont color="#EEEEFF" class="thtcolor">All fields are required.</smallfont></td>
</tr>
$parentemail
<tr>
<td bgcolor="#1C5780"><normalfont><b>Email Address:</b></normalfont></td>
<td bgcolor="#1C5780"><normalfont><input type="text" class="bginput" name="email" value="$bbuserinfo[email]" size="30" maxlength="150"></normalfont></td>
</tr>
<tr>
<td bgcolor="#1C5780"><normalfont><b>Confirm Email Address:</b></normalfont></td>
<td bgcolor="#1C5780"><normalfont><input type="text" class="bginput" name="emailconfirm" value="$bbuserinfo[email]" size="30" maxlength="150"></normalfont></td>
</tr>
<tr>
<td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF" class="thtcolor"><b>Optional Information</b></normalfont> <smallfont color="#EEEEFF" class=thtcolor>All information will be viewable by other $bbtitle members.</smallfont></td>
</tr>
<tr>
<td bgcolor="#1C5780"><b><normalfont>Homepage:</normalfont></b></td>
<td bgcolor="#1C5780"><normalfont><input type="text" class="bginput" name="homepage" value="$bbuserinfo[homepage]" size="30" maxlength="200"></normalfont></td>
</tr>
<tr>
<td bgcolor="#13486D"><b><normalfont>ICQ Number:</normalfont></b></td>
<td bgcolor="#13486D"><normalfont><input type="text" class="bginput" name="icq" value="$bbuserinfo[icq]" size="30" maxlength="30"></normalfont></td>
</tr>
<tr bgcolor="#1C5780">
<td><b><normalfont>AOL Instant Messenger Handle:</normalfont></b></td>
<td><normalfont><input type="text" class="bginput" name="aim" value="$bbuserinfo[aim]" size="30" maxlength="30"></normalfont></td>
</tr>
<tr>
<td bgcolor="#13486D"><b><normalfont>Yahoo Messenger Handle:</normalfont></b></td>
<td bgcolor="#13486D"><normalfont><input type="text" class="bginput" name="yahoo" value="$bbuserinfo[yahoo]" size="30" maxlength="30"></normalfont></td>
</tr>
<tr>
<td bgcolor="#1C5780" valign="top"><b><normalfont>Signature:</normalfont></b><br>
<smallfont>Optional signature you may use to appear at bottom of your posts.</smallfont>
<p><smallfont>HTML code is $htmlonoff<br>
<a href="misc.php?s=$session[sessionhash]&action=bbcode">vB Code</A> is $bbcodeonoff<br>
[img] code is $imgcodeonoff<br>
<a href="misc.php?s=$session[sessionhash]&action=showsmilies">Smilies</a> are $smiliesonoff
</smallfont></p></td>
<td bgcolor="#1C5780"><textarea name="signature" rows="6" cols="40">$signature</textarea></td>
</tr>
$birthday
$customtext
<tr>
<td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF" class="thtcolor"><b>Additional Information</b></normalfont></td>
</tr>
$customfields
</table>
</td></tr></table>

<br>

<table cellpadding="2" cellspacing="0" border="0" width="95%" align="center">
<tr>
<td align="center"><normalfont>
<input type="hidden" name="action" value="updateprofile">
<input type="submit" class="bginput" name="Submit" value="Submit Modifications" accesskey="s">
<input type="reset" class="bginput" name="Reset" value="Reset Fields">
</normalfont></td>
</tr>
</table>

</form>

$footer

</body>
</html>
------------------------------------------

so the current readme.html file is out of date, though they upgrade their forum script every friggin month, not your fault.

so this is out of date that asks to be changed in the modifyprofile template, from the readme.html file <textarea name="signature" rows="6" cols="40">$bbuserinfo[signature]</textarea>

ferior1
19 Feb 2003, 03:24
theirs something in 2.2.9 that's not making this work, I just did a fresh install of the forum, http://www.gaming-forums.com/testing/

and still no image in the signature, abs brand new and working, hum, weird :|

this is the edited version for the signature image in vbb 2.2.9 from the above I had to adjust to the new settings in this version from the readme.html

looks right? heh It works, but still no image in the signature in the thread post, so im still shruggin.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>$bbtitle - Update profile</title>
$headinclude
</head>
<body>
$header

<!-- breadcrumb -->
<table cellpadding="2" cellspacing="0" border="0" width="95%" align="center">
<tr>
<td width="100%"><img src="http://www.vbulletin.org/forum/images/vb_bullet.gif" align="middle" alt="vBulletin">
<normalfont><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a> &gt;
<a href="usercp.php?s=$session[sessionhash]">User Control Panel For $bbuserinfo[username]</a> &gt;
Edit Profile</b></normalfont></td>
</tr>
</table>
<!-- /breadcrumb -->

<br>
$cpnav
<br>

<center>$coppatext</center>

<form action="member.php" method="post" name="vbform">
<input type="hidden" name="s" value="$session[sessionhash]">

<table cellpadding="0" cellspacing="0" border="0" bgcolor="#0A293E" width="95%" align="center"><tr><td>
<table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr>
<td bgcolor="#336D95" background="http://www.vbulletin.org/forum/images/catagory_backing.gif" colspan="2"><normalfont color="#000000"><b>Edit Profile - $bbuserinfo[username]</b></normalfont></td>
</tr>
<tr>
<td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF" class="thtcolor"><b>Registration: Required Information</b></normalfont>
<smallfont color="#EEEEFF" class="thtcolor">All fields are required.</smallfont></td>
</tr>
$parentemail
<tr>
<td bgcolor="#1C5780"><normalfont><b>Email Address:</b></normalfont></td>
<td bgcolor="#1C5780"><normalfont><input type="text" class="bginput" name="email" value="$bbuserinfo[email]" size="30" maxlength="150"></normalfont></td>
</tr>
<tr>
<td bgcolor="#1C5780"><normalfont><b>Confirm Email Address:</b></normalfont></td>
<td bgcolor="#1C5780"><normalfont><input type="text" class="bginput" name="emailconfirm" value="$bbuserinfo[email]" size="30" maxlength="150"></normalfont></td>
</tr>
<tr>
<td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF" class="thtcolor"><b>Optional Information</b></normalfont> <smallfont color="#EEEEFF" class=thtcolor>All information will be viewable by other $bbtitle members.</smallfont></td>
</tr>
<tr>
<td bgcolor="#1C5780"><b><normalfont>Homepage:</normalfont></b></td>
<td bgcolor="#1C5780"><normalfont><input type="text" class="bginput" name="homepage" value="$bbuserinfo[homepage]" size="30" maxlength="200"></normalfont></td>
</tr>
<tr>
<td bgcolor="#13486D"><b><normalfont>ICQ Number:</normalfont></b></td>
<td bgcolor="#13486D"><normalfont><input type="text" class="bginput" name="icq" value="$bbuserinfo[icq]" size="30" maxlength="30"></normalfont></td>
</tr>
<tr bgcolor="#1C5780">
<td><b><normalfont>AOL Instant Messenger Handle:</normalfont></b></td>
<td><normalfont><input type="text" class="bginput" name="aim" value="$bbuserinfo[aim]" size="30" maxlength="30"></normalfont></td>
</tr>
<tr>
<td bgcolor="#13486D"><b><normalfont>Yahoo Messenger Handle:</normalfont></b></td>
<td bgcolor="#13486D"><normalfont><input type="text" class="bginput" name="yahoo" value="$bbuserinfo[yahoo]" size="30" maxlength="30"></normalfont></td>
</tr>
<tr>
<td bgcolor="#1C5780" valign="top"><b><normalfont>Signature:</normalfont></b><br>
<smallfont>Optional signature you may use to appear at bottom of your posts.</fsmallfont>
<p><smallfont>HTML code is $htmlonoff<br>
<a href="misc.php?s=$session[sessionhash]&action=bbcode">vB Code</A> is $bbcodeonoff<br>
[img] code is $imgcodeonoff<br>
<a href="misc.php?s=$session[sessionhash]&action=showsmilies">Smilies</a> are $smiliesonoff
</smallfont></p></td>
<td bgcolor="#1C5780"><script language="Javascript" type="text/javascript">
<!--
function myimagepopup(x,y,sessionhash) {
// overflow window.
window.open("simage.php?action=alterimg&s"+sessionhash, "smilies", "toolbar=no,scrollbars=yes,resizable=yes,width="+x+",height="+y);
}

function sigimg(sigtext) {
// inserts smilie text
document.vbform.signature.value += "[sig="+sigtext+"]"
document.vbform.signature.focus();
}
// -->
</script>

<textarea name="signature" rows="6" cols="40">$bbuserinfo[signature]</textarea>

$sigimages</td>
</tr>
$birthday
$customtext
<tr>
<td bgcolor="#1D6AA0" colspan="2"><normalfont color="#EEEEFF" class="thtcolor"><b>Additional Information</b></normalfont></td>
</tr>
$customfields
</table>
</td></tr></table>

<br>

<table cellpadding="2" cellspacing="0" border="0" width="95%" align="center">
<tr>
<td align="center"><normalfont>
<input type="hidden" name="action" value="updateprofile">
<input type="submit" class="bginput" name="Submit" value="Submit Modifications" accesskey="s">
<input type="reset" class="bginput" name="Reset" value="Reset Fields">
</normalfont></td>
</tr>
</table>

</form>

$footer

</body>
</html>

ferior1
19 Feb 2003, 15:26
btw, thanks for the quick replies :classic:

dabean
19 Feb 2003, 15:38
Originally posted by ferior1
when seeing a thread I see nothing, when seeing it in the user cp I see this http://www.gaming-forums.com/sig.php?id=3 so I see it in the user cp


url style signature links are not supported by this hack and have never been offically supported. The version 1.x series of the hack used https://www.vbulletin.org/forum/.

Whilst the current 2.0 series uses [sig=<imageid>], naturally the installation script automatically converts old style https://www.vbulletin.org/forum/ tags into new style [sig] tags.

The fragment below should when placed in a seperate file covert all existing [url] style links into signature links.

<?php
error_reporting(7);

require ("./global.php");

$searcharray = array(
"/(\[url\]".$bburl."sig.php\?imageid\=)(.*)(\[\/url\])/esiU",
"/(\[url\]".$bburl."sig.php\?id\=)(.*)(\[\/url\])/esiU"
);

$replacearray = array(
"'[sig=\\2]'",
"'[sig=\\2]'",
);

$signatures = $DB_site->query("SELECT signature, userid FROM user");

while ($signature = $DB_site->fetch_array($signatures)) {
$newsignature=preg_replace($searcharray, $replacearray, $signature[signature]);
if ($signature[signature]!=$newsignature) {
$DB_site->query("UPDATE user SET signature='$newsignature' WHERE userid=$signature[userid]");
}
}
?>

ferior1
19 Feb 2003, 16:37
hum

i put it in a fix.php - chmod 777

and ran it, got this error

Warning: Unknown modifier '/' in /home/gaming-f/public_html/admin/fix.php on line 19



though, I dont understand your response entirely, im not intending the script to do more than what it was susp to do, I dont want url linking either. I just followed the instructions as is, or as was intended the script to work under vbb.

dabean
19 Feb 2003, 17:32
Originally posted by ferior1
though, I dont understand your response entirely, im not intending the script to do more than what it was susp to do, I dont want url linking either. I just followed the instructions as is, or as was intended the script to work under vbb.

Okay, I'll be clearer no version of this hack has ever used [url] tags to link to signature images. Early versions used [img] tags neither has any version of the hack used [img] tags containing the full path. The current version of the hack uses a special [sig] tag.

img-url-convert.php, attached is provided purely to convert existing signatures using that non-standard format to the [sig] tag format the used by the hack.

Run the script from you admin directory then delete afterwards.

ferior1
19 Feb 2003, 23:16
didn't work either, for the original forum, and the testing forum, i removed the testing forum. This was an awesome script, thanks for keeping up to do with user replies.

I hate to sound like im giving up, but nothing works :dead:

im going to redo another new forum, and go through the steps, then use that fix you had one more time..

I'll post it indetail, you've got a great script, and its basically the only auto install one from that other vb script hehe :)

ferior1
20 Feb 2003, 04:01
Ok, I really want to find out why this isn't working, I WUB THIS hack!!!!!!!!!! AROOOOOOOOOOOO :banana:

I've attached a zip file of the entire process that I go through the signature system 2.0 and vbb 2.2.9, including the img-url-convert.php!

I've tried to document very thoroughly the two, I've hope we dig the bad root out. :rambo: :bandit:

ferior1
22 Feb 2003, 20:41
update dabean? :)

Keyser Söze
13 May 2003, 01:37
did anyone fix the stated problems?

dabean
13 May 2003, 03:52
I could never identify the cause of the problems ferior1 was having neither could I ever replicate such problems on my own copy of vb 2.2.9, . So the exact problem and solution remains unknown.

Keyser Söze
14 May 2003, 02:36
hack works perfectly in 2.3.0, do a new installation

great hack!!

ferior1
16 May 2003, 00:16
yeah, i forgot to get back to this post, its been fixed because I missed a step [ very embarrassing ]

^.^ the hack is awesome!

Keyser Söze
28 Aug 2003, 06:05
ok, well i installed vb 2.3.2, so had to reinstall this hack, worked great in 2.3.0

anyways not sure what the problem is, when i try to upload a image it gives me this error


Warning: move_uploaded_file(/home/virtual/site2/fst/var/www/html/forums/images/vbsigs/uid2230iid15.gif): failed to open stream: Permission denied in /home/virtual/site2/fst/var/www/html/forums/simage.php on line 129

Warning: move_uploaded_file(): Unable to move '/tmp/phpCaITex' to '/home/virtual/site2/fst/var/www/html/forums/images/vbsigs/uid2230iid15.gif' in /home/virtual/site2/fst/var/www/html/forums/simage.php on line 129


and then the image is a little red X, any ideas here?

thanks

dabean
29 Aug 2003, 19:53
Yesterday at 06:05 AM IceMalee said this in Post #211 (http://www.vbulletin.org/forum/showthread.php?postid=429173#post429173)
ok, well i installed vb 2.3.2, so had to reinstall this hack, worked great in 2.3.0

anyways not sure what the problem is, when i try to upload a image it gives me this error


Warning: move_uploaded_file(/home/virtual/site2/fst/var/www/html/forums/images/vbsigs/uid2230iid15.gif): failed to open stream: Permission denied in /home/virtual/site2/fst/var/www/html/forums/simage.php on line 129

Warning: move_uploaded_file(): Unable to move '/tmp/phpCaITex' to '/home/virtual/site2/fst/var/www/html/forums/images/vbsigs/uid2230iid15.gif' in /home/virtual/site2/fst/var/www/html/forums/simage.php on line 129


Does the directory "'/home/virtual/site2/fst/var/www/html/forums/images/vbsigs/" exist on the server?
Does the mentioned directory have the correct permissions to allow this hack/php to read/write/modify files inside it.

The move uploaded file error suggests to me one of those cases above is true.

Keyser Söze
30 Aug 2003, 02:50
yes to all, the folder exsists and permission is set to 666, see attached

dabean
30 Aug 2003, 03:42
Whilst your directory permissions seem correct the error the PHP is giving is definately a permissions related one. The "move_uploaded_file" function mentioned is a PHP built in function for handling file uploads. I'm not sure why PHP is saying you don't have permission. :beard:

What version of PHP?
Is safe mode enabled or disabled?

Keyser Söze
19 Oct 2003, 05:48
this may only be for 2.3.2 i dunno but heres a error in this hack, says in functions.php find
"/(\[)(php)(])(\r\n)*(.*)(\[\/php\])/esiU",
"/javascript:/si",
"/about:/si",
"/vbscript:/si"

and change it to
"/(\[)(php)(])(\r\n)*(.*)(\[\/php\])/esiU",
"/javascript:/si",
"/about:/si",
"/vbscript:/si",
"/(\[sig\=)(.*)(\])/esiU" // addition

THAT IS WRONG SO BE CAREFUL, missing comma, change it to this
"/(\[)(php)(])(\r\n)*(.*)(\[\/php\])/esiU",
"/javascript:/si",
"/about:/si",
"/vbscript:/si",
"/(\[sig\=)(.*)(\])/esiU", // addition

another same file
when u change the next one in functions.php change it to this
"phphighlite('\\5')",
"java script:",
"about :",
"vbscript :",
"checksigimage('\\2')", // addition

ev0lute
01 Nov 2003, 16:55
so has anyone gotten this hack to work fully with 2.3.2? if so can you tell me the changes in the instructions?

MuSuL
20 Nov 2003, 01:03
Im having 2 problems...

#1..No matter what the true path is, it will not upload a pic or banner to the file

#2..Where is it that a user can add a link to the pic or banner? or how can this be added to the program?

Thanks!

GamerzWorld
13 Feb 2004, 13:00
Is it possible you could convert this into vb 3?

Destroyed Soul
05 Mar 2005, 20:36
i get this error:

Warning: Cannot modify header information - headers already sent by (output started at /home/piper/public_html/admin/functions.php:2555) in /home/piper/public_html/admin/functions.php on line 1732

Warning: Cannot modify header information - headers already sent by (output started at /home/piper/public_html/admin/functions.php:2555) in /home/piper/public_html/admin/functions.php on line 1732