![]() |
|
#1
|
|||
|
|||
|
I know this one is probably gonna be a toughie.
I am setting up an instance that will be used for articles. Each article will have 20+ images attached to it. These need to be displayed in various areas throughout the article, not just lumped at the bottom/top/side. As of right now, Im going to tell my staff to upload, view thread in private Skin with default view of attachments, view source, copy code, paste into custom field -> show up in spot of article needed. However, this can get redundant. Is it possible to add a designation to attachments so that you can use within a template: Various HTML if attachment group 1 then print $group1 Various HTML if attachment group 2 then print $group2 Etc. Second possibility, attachment manager shows HTML for attachments like a photobucket or imageshack situation, copy/paste. I might be able to work that out, but a grouping designation would be best, so they have to do less work to make the page look good. OK, back to coding cave.
|
|
#2
|
||||
|
||||
|
What exactly would determine which "group" an attachment is in?
|
|
#3
|
|||
|
|||
|
Some sort of marker. Manual entry, drop down, check box. Back end CP choices, so you can create groups and variable names once. I don't really care how its done. I would be fine with a drop down offering:
Group 1 Group 2 Group 3 Group 4 Group 5 and so on. In an attachment manager pop up, when viewing already uploaded images, you would see... Current Attachments shade.gif (946 Bytes) - Group 1 - |Drop down Box for Changing| Save Does that make sense? |
|
#4
|
||||
|
||||
|
I like the idea of that, but I'm not sure how widely used it would be, so I might not be able to work something like that into the default code in the immediate future. I'm not sure how familiar you are with PHP, but that's something that probably would not be that hard to hack in. You would mostly just need to add a new column to the 'adv_dyna_attachments' table for the 'groupid', edit the newattachment templates to add your select menus for the groups, change the query in dynamics/newattachment.php to include the groupid, and then modify the dynamics/showentry.php file and ADV_DYNA_SHOWENTRY template so that attachments could be sorted and arranged by their group.
|
|
#5
|
|||
|
|||
|
I may give that a try. I'm pretty sure I understand exactly what you are saying, only reservation is that im on a live enviornment. Have to wait till dead of night to play around in case there are errors.
|
|
#6
|
|||
|
|||
|
Also, if I do these changes, how would the database columns be affected when upgrades are performed down the road? Im assuming file edits will need to be manually put back in, which sucks but not that bad. DB columns is a whole nother story.
|
|
#7
|
||||
|
||||
|
Any reason you can't setup a development board where you can test changes like that first? That's really the best way to go when you're adding new hacks or doing things like that yourself, and you can pretty much get an exact replica of your database and such. I believe there are instructions posted on vb.com or in their forums if you're not familiar with how to set that up.
As for upgrades... You would of course need to re-apply any file changes after upgrading. If you have any comparison programs (Beyond Compare is what I use and recommend), that makes things very easy. It could also be used to compare templates if you just copy the code from your version and the original, save them as files on your computer, and then load them up in the program to compare. As for adding that column, I would recommend naming it something like 'twf_groupid'. That way there would not be any conflicts during an upgrade if we add a 'groupid' column at some point, and it would be easy to transfer things over to the default code. |
|
#8
|
|||
|
|||
|
Quote:
Working on this in a localhost enviornment. Wondering if you could give some feedback whenever not super busy. I added tfw_groupid to the attachment table. I added $tfw_groupid to this block of code in newattachment.php Code:
$db->query_write("
INSERT INTO " . ADV_DYNA_TABLE_PREFIX . "attachments
(entryid, filename, userid, dateline, filesize, hasthumb, valid, extension, posthash, tfw_groupid)
VALUES (
$entryid,
'" . $db->escape_string($vba_image->_info['name']) . "',
'" . $vbulletin->userinfo['userid'] . "',
" . TIMENOW . ",
" . intval($vba_image->_info['filesize']) . ",
" . intval($vba_image->_info['hasthumb']) . ",
" . iif($vba_dyna->check_cat_perms('moderateattach'), 0, 1) . ",
'" . $db->escape_string($vba_image->_info['extension']) . "',
'" . $db->escape_string($posthash) . "',
$tfw_groupid
)
");
Code:
<input type="hidden" name="tfw_groupid" value="$tfw_groupid" /> How and where to apply the select boxes, and exact method needed to pass the variables so that it recognizes and updates it in the DB, im a bit fuzzy. Sorry, not so great with writing PHP from scratch, not even sure if initial steps I did are right. Thanks! |
|
#9
|
||||
|
||||
|
Where exactly are you trying to add the select box to choose the group?
As for passing the tfw_groupid variable, I would just add a new plugin to the 'vba_dyna_newattachment_start' location with the following code: PHP Code:
|
|
#10
|
|||
|
|||
|
Next to the "remove button" on the attachment manager pop-up, after an attachment has been uploaded. Put another "save" button next to the "save category image" button underneath.
|
|
#11
|
||||
|
||||
|
The 'Remove' button should be located in your 'newattachment' template. Since that's used by vB as well, you would just need to wrap any new code you add in an <if condition>.
PHP Code:
The 'Save As Category Image' button is located in the 'adv_dyna_newattachment_set_as_row' template. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can Dyna's attachments be in the vBulletin attachments folder too? | eJM | "How Do I..." Questions | 2 | 08-19-2007 01:31 PM |
| How do I set certain links to certain groups? | unforgotten | "How Do I..." Questions | 9 | 04-14-2007 12:39 AM |
| Phrase Groups... | James Goddard | Feedback & Suggestions | 1 | 10-28-2005 11:32 AM |
| Pre-loading phrase groups | andrewd | "How Do I..." Questions | 1 | 10-02-2005 01:32 PM |
| Stats module, ignore certain groups? | Greebo | Add-On Modules & Modifications | 1 | 04-12-2005 01:10 PM |