![]() |
Attachmentstyle, choose where to place your Attachments
Hello,
Some of you have used eBay before. On every auction you can select where the pictures you have uploaded should be displayed. Since many of us use the vB attachment function to publish pictures there should be the possibility of doing exactly the same thing with your attachments. :) This hack allows you (and your users) to select wether the attachments should be displayed: * At the end of your posting (vB3 default setting) * Above your posting * At the left hand side of your posting This hack is using phrases so it's very easy to translate. The setting can be changed for every post so you can decide which one is the best for your attachments. Why is this hack 'beta'? Well, it works.. But is has only been tested by me ;) It has no installer yet and the markup could be a bit better but I hope you'll help me with that. Is there an Online Demo? No I don't think so but I'll provide you with screenshots :) Have fun with it and please help me fixing errors so that this hack can be moved to 'Full Releases' as soon as possible :) THIS HACK IS BETA..! PLEASE BACKUP YOUR DATABASE :devious: https://vborg.vbsupport.ru/ Changes: * Instructions are updated to v.02 and nexialys' Fix is in. Thank you :) * Instructions are updated again and the current version is V0.3 :) |
This is a very good idea: well structured...
Nice job! |
I was anoyed by that exact issue just last night. Right on!
|
@Mr Nase.. the default language id is not 0, but -1...
so it is [sql]INSERT INTO `phrase` VALUES ('', -1, 'attachstyle', 'Attachment Style:', 1);[/sql] |
This is awesome - when I finally upgrade I'll install!
|
Thank you nexialys, I updated the instructions. :)
|
Beautiful!!!
/me Installs and does a backflip. |
This error after a new post:
Invalid SQL: INSERT INTO thread(title, lastpost, forumid, open, replycount, postusername, postuserid, lastposter, dateline, iconid, visible, attach, attachstyle, similar) VALUES ('test334', 1097513223, 22, 1, 0, 'name', 1, 'name', 1097513223, 0, 1, 1, '') mysql error: Column count doesn't match value count at row 1 |
Are you sure you made the database modification?
You need to do that by using the following query: Code:
ALTER TABLE `post` ADD `attachstyle2` TINYINT( 2 ) DEFAULT '1' NOT NULL; You may have to replace post with vb3_post or something like that according to the database prefix you have chosen during the installation. |
Yes, the db modifications are correct. Also i've no prefix for the tables. :(
In editpost.php there are 2 lines of this code: attach = attach + $newattachments The first one is for 'UPDATE " . TABLE_PREFIX . "thread SET..' The second one is in here: UPDATE " . TABLE_PREFIX . "post SET title = '" . addslashes(htmlspecialchars_uni($edit['title'])) . "', pagetext = '" . addslashes($edit['message']) . "', allowsmilie = $edit[allowsmilie], showsignature = $edit[signature], iconid = $edit[iconid], attach = attach + $newattachments WHERE postid = $postid "); |
Well ok, give me a couple of minutes. Iam rewriting the instructions :)
The Instructions are up-to-date. You should read them again, I changed the lines for functions_newpost.php and editpost.php and now it should work for you. You are right, you need to replace the second one both in editpost.php and functions_newpost.php (where it says: INSERT INTO " . TABLE_PREFIX . "post and not INSERT INTO " . TABLE_PREFIX . "thread) Excuse me, I thought nobody would edit the files with a simple texteditor which has no numbered lines :) |
Ok tnx :) I'll try it and report asap
|
Very cool job :thumbsup:
|
Hm..same errors remain in new post and reply ..
|
Well I checked the instructions twice and I couldn't find any error. The others didn't say it doesn't work so I don't know what has gone wrong with your installations.
Do you have a backup of editpost.php and functions_newpost.php? Take the old files and modify them again to make sure you have the right code. You could even send those files to me and I'll take a look at it. Use dienase [at] gmail.com please :) |
Actually i did just that, doing the hack over again by the new instructions. There is no feedback from others if this is working or making an error somewhere. I will send unmodified editpost and functions_newpost.php if it takes to long to look if it works by others.
|
Hello and sorry for the late reply. Iam sick and try to stay at home and not in the office :)
I can't see why it doesn't work for you, I tested my installation with your files and it worked perfectly. What happens if you run the query again? The others: Please reply and tell me if it's working for you :) |
|
Hey very cool, I've been on vacation and couldn't check vb.org but I like what i see :)
So does that hack work for you? NuclioN had some trouble with it and I couldn't find any error :( |
if i installed it and made a hack for it, i suppose it's because it's working.. ;)
btw, i don't know if it's your tool or the other, but i see a icon instead of the thumbnail on that blocks... |
if i using postbit_legacy template then i can how make ?
|
same thing, the postbit/postbit_legacy are built the same way.. you search the same detail, replace it the same way...
|
no, i see postbit_legacy ! but in beetween <!-- / icon and title --> and <if condition="$post['signature']"> is :
Code:
<td><img src="$stylevar[imgdir_misc]/pcon.gif" border="0" /></td> |
this is what you have to change... did you compared with the original postbit ?!
is your style modified or personalised ?! |
now i can how change it ??? help me !
|
the hacks works great, but for 1 thing, if a new thread is posted, it doesn't check the default checkbox, so the attachment doesn't show...where would I change the default value??
|
Quote:
|
Oh boy....I really did it this time.... I installed this mod but couldn't post without getting a error that gave me this error:
Code:
Database error in vBulletin 3.0.7: So I uploaded my backup copies of the files that I altered for this mod. Now I can post but I cannot edit as this is the error I get: Code:
Database error in vBulletin 3.0.7: I have already beat myself with a wet noodle. Thanks in advance for any help I can get . |
look like you didn't restore the backup of editpost.php
|
I am getting the same error as reported above:
Quote:
|
All times are GMT. The time now is 12:20 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|