Author |
Message |
myrtletrees
Involved


Joined: Sep 13, 2005
Posts: 259
Location: Cornfields of Indiana
|
Posted:
Sun Feb 13, 2011 6:25 pm |
|
I recently upgraded to 2.40 from 2.30 of Raven Nuke. I had no issues that weren't easily solved.
However, I decided to use the colorbox feature in RN for the attachment mod in the Forums.
I've done as the instructed for adding the class="colorbox" to the <img src line in the viewtopic_attach_body.tpl file.
Here's the issue I am having.
If I attach an image to a post in the forums and then preview before submitting. I can click on the thumbnail image in the preview and it opens the full size image in a nice pop up colorbox with a handy dandy Close button.
HOWEVER, when I submit the post, and then try to click the thumbnail it pops up the nice colorbox, but no full size image ever appears or loads. If I wait long enough, it eventually loads what appears to be ascii text of the binary image file.
I know it sounds weird, but I have no idea what the deal is.
Anyone?
Maybe I missed something? |
|
|
|
 |
spasticdonkey
RavenNuke(tm) Development Team

Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA
|
Posted:
Sun Feb 13, 2011 7:22 pm |
|
In Forum Admin -> Extensions -> Extension Groups Control
Make sure images are set to Download Mode -> Physical
If that does not help, take a look at settings in Forum Admin -> Extensions -> Special Categories
we'll start there  |
|
|
|
 |
myrtletrees

|
Posted:
Sun Feb 13, 2011 7:59 pm |
|
spasticdonkey wrote: | In Forum Admin -> Extensions -> Extension Groups Control
Make sure images are set to Download Mode -> Physical
If that does not help, take a look at settings in Forum Admin -> Extensions -> Special Categories
we'll start there |
I changed Download mode for IMAGES to physical and what happens now is the colorbox appears, then disappears and the site loads into a blank page with just the date in the top left corner.
I messed with the Special Categories settings and they made no difference so far.
EDIT: I think part of the issue is when the colorbox works during preview, the link to the image is as such:
http://www.xxxxxxxxxx.com/modules/Forums/files/bottle_187.jpg
But after submitting the post, the link to the image changes to this:
http://www.xxxxxxxxxx.com/modules.php?name=Forums&file=download&id=22
It's almost like the colorbox doesn't know what to do with the second link. |
|
|
|
 |
spasticdonkey

|
Posted:
Sun Feb 13, 2011 9:08 pm |
|
I remember going thru this same issue but it's been so long, having trouble recalling all the details.
open modules/Forums/attach_mod/displaying.php
find this section of code. Code:$template->assign_block_vars('postrow.attach.cat_thumb_images', array(
'DOWNLOAD_NAME' => $display_name,
'S_UPLOAD_IMAGE' => $upload_image,
'IMG_SRC' => append_sid($phpbb_root_path . 'download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id']),
'IMG_THUMB_SRC' => $thumb_source,
'FILESIZE' => $filesize,
'SIZE_VAR' => $size_lang,
'COMMENT' => $comment,
'L_DOWNLOADED_VIEWED' => $lang['Viewed'],
'L_DOWNLOAD_COUNT' => sprintf($lang['Download_number'], $attachments['_' . $post_id][$i]['download_count']))
);
|
try making this change to the IMG_SRC line
Code:'IMG_SRC' => $filename,
|
my TPL file looks like so:
Code:<a href="{postrow.attach.cat_thumb_images.IMG_SRC}" rel="fightbox"><img src="{postrow.attach.cat_thumb_images.IMG_THUMB_SRC}" alt="{postrow.attach.cat_thumb_images.DOWNLOAD_NAME}" border="0" /></a>
|
i use a different method to call colorbox with the rel attribute, but I can't exactly remember why. Calling the colorbox by other methods (class name) should work as well...
see if that helps, make sure you still have img mode "physical" |
|
|
|
 |
myrtletrees

|
Posted:
Mon Feb 14, 2011 12:14 am |
|
The:
Code:'IMG_SRC' => $filename,
|
line(s) has been updated in the RN 2.4.0 files.
I'll try the rel= and let you know what comes about. |
|
|
|
 |
spasticdonkey

|
Posted:
Mon Feb 14, 2011 1:43 am |
|
just so we are clear, you are running 2.4.0 or 2.4.01?
are you saying the line was already changed in your files?
the 2.4.01 im looking at the line looks like
Code: 'IMG_SRC' => append_sid($phpbb_root_path . 'download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id']),
|
you may be looking at the wrong line. on or around line 821
(postrow.attach.cat_thumb_images appears twice in the code)
if you need to use the rel method of launching the colorbox, this is what mine looks like
Code: $(document).ready(function(){
$(".colorbox").colorbox({opacity:0.65, current:"{current} of {total}"});
$("a[rel='fightbox']").colorbox({transition:"fade", width:"85%"});
$(".colorboxSEO").colorbox({opacity:0.50, width:"750", height:"300", iframe:true});
});
|
which I added to includes/jquery/jquery.colorbox.php |
|
|
|
 |
myrtletrees

|
Posted:
Mon Feb 14, 2011 7:07 am |
|
2.40.01
You ever looked at code too long? I think I was there last night.
Went to bed, got up this AM. Read your post and re-checked the displaying.php file. Apparently there is more than one 'IMG_SRC' line in that file...
It's working perfectly now.
While I got ya here. What, if any are the advantages of using the rel method you mention versus just calling the colorbox via a class? |
|
|
|
 |
spasticdonkey

|
Posted:
Mon Feb 14, 2011 8:30 am |
|
I look at code too long all the time I had at one time used the original non-jquery lightbox script with this site, and if memory serves me right, it also used the rel attribute. So it may have been the reason I used rel with colorbox. Using something other than the default colorbox class also allowed me to set the colorbox options differently (wider, etc) |
|
|
|
 |
myrtletrees

|
Posted:
Mon Feb 14, 2011 11:45 am |
|
|
|
 |
spasticdonkey

|
Posted:
Mon Feb 14, 2011 4:56 pm |
|
yes you will have to live with the counter not updating...
and i do not even know where the User Attachment control panel is, lol... did you make edits to that file? |
|
|
|
 |
Palbin
Site Admin

Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Mon Feb 14, 2011 5:33 pm |
|
Just for reference this is the other topic.
http://www.ravenphpscripts.com/postx18708-0-0.html
spasticdonkey, it is in the ACP.
I will give the ACP problem a quick one over. |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
 |
Palbin

|
Posted:
Mon Feb 14, 2011 5:44 pm |
|
|
|
 |
myrtletrees

|
Posted:
Mon Feb 14, 2011 7:30 pm |
|
|
|
 |
myrtletrees

|
Posted:
Mon Feb 14, 2011 7:44 pm |
|
You know what is interesting?
I installed EVO Nuke Extreme the other day for a client as a test site. Their distro uses lytebox instead of colorbox and all the features of the attachment mod works. Counter works and all links to attached files work.
Doesn't make me want to switch, but perhaps it may help us figure out the issues with this distro and the attachment mod and using some sort of lytebox or similar with it. |
|
|
|
 |
myrtletrees

|
Posted:
Tue Feb 15, 2011 10:53 am |
|
I think this is going to end up driving me crazy.
I played some more and actually managed to get a different version of lightbox.colorbox to work too. But I was just curious.
The problems still exists with the current attachment mod and colorbox.
1. Counter does not work (this is OK and not a big deal)
2. Links to attached files is broken in both the Admin Attachment control panel and User Attachment Control panel.
The links appear as:
http://www.xxxxxxxxxx.com/modules.php?name=Forums&file=download&id=20
But the page generated goes to:
http://www.xxxxxxxxxx.com/modules.php?name=ErrorDocuments&file=404&rs=modules/Forums/modules/Forums/files/beach1_151.jpg
If I can just figure out that part of the puzzle, I'll be satisfied.
I'm perplexed as to why I have modules/Forums twice in the broken link. It makes me think I have something configured wrong somewhere or a wrong attachment mod file. |
|
|
|
 |
Palbin

|
Posted:
Tue Feb 15, 2011 11:27 am |
|
Ok you have beat me into submission
I will try and get this fixed up tonight, and if not tonight defiantly tomorrow. |
|
|
|
 |
myrtletrees

|
Posted:
Tue Feb 15, 2011 11:30 am |
|
Palbin wrote: | Ok you have beat me into submission
I will try and get this fixed up tonight, and if not tonight defiantly tomorrow. |
If you would need SFTP access to my site files and Admin access to my site, I would be more than happy to let you at it.
Just let me know. |
|
|
|
 |
Palbin

|
Posted:
Tue Feb 15, 2011 11:34 am |
|
If I can not reproduce the problems I will take a look. I will let you know. |
|
|
|
 |
myrtletrees

|
Posted:
Tue Feb 15, 2011 1:02 pm |
|
WOOT! I think I fixed it.
The culprit file is /modules/Forums/download.php
I started comparing the file from the RN distro against the one from the EVO Nuke Extreme distro. I noticed that in the RN distro's file that lines 394-399 looked like this:
Code: $script_name = preg_replace('/^\/?(.*?)\/?$/', '/\1', trim($board_config['script_path']));
if ($script_name[strlen($script_name)] != '/')
{
$script_name .= '/';
}
|
However, the download.php from EVO looked like this:
Code: //$script_name = preg_replace('/^\/?(.*?)\/?$/', '/\1', trim($board_config['script_path']));
//if ($script_name[strlen($script_name)] != '/')
//{
$script_name .= '/';
//}
|
So, I went ahead and commented out the same lines and then uploaded the changed file and VIOLA! Links to the attachment files both work in AACP and UACP.
Do I win a prize??
Now if I can figure out that pesky Views Count...  |
|
|
|
 |
myrtletrees

|
Posted:
Tue Feb 15, 2011 4:26 pm |
|
Well, I've decided to focus on another little thing with this mod for now.
The link to the User Attachment Control Panel(UACP) and the Upload Limit box with Upload percentage and getting it on other pages of the forums.
As of now, the only way to get to the UACP is by viewing your own profile in the forums. When you do, you see this nice little added feature that looks like so with a handy dandy link to the UACP:
The code that generates that bit of info is this:
Code: <!-- BEGIN switch_upload_limits -->
<table width="175" cellspacing="1" cellpadding="2" border="0" class="bodyline">
<tr>
<td colspan="3" width="175" class="row1" nowrap="nowrap"><span class="gensmall">{L_UPLOAD_QUOTA}</span></td>
</tr>
<tr>
<td colspan="3" width="100%" class="row2">
<table cellspacing="0" cellpadding="1" border="0">
<tr>
<td bgcolor="{T_TD_COLOR2}"><img src="themes/iCGstation/forums/themes/iCGstation/forums/images/spacer.gif" width="{UPLOAD_LIMIT_IMG_WIDTH}" height="8" alt="{UPLOAD_LIMIT_PERCENT}" />f*** ME</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="33%" class="row1"><span class="gensmall">0%</span></td>
<td width="34%" align="center" class="row1"><span class="gensmall">50%</span></td>
<td width="33%" align="right" class="row1"><span class="gensmall">100%</span></td>
</tr>
</table>
<b><span class="genmed">[{UPLOADED} / {QUOTA} / {PERCENT_FULL}]</span> </b><br />
<span class="genmed"><a href="{U_UACP}" class="genmed">{L_UACP}</a></span>
</td>
</tr>
</table>
<!-- END switch_upload_limits -->
|
It's located in the themes/THEME/forums/profile_view_body.tpl
If I copy that code to any other forum .tpl file, nothing appears. If I remove the BEGIN and END switches, the Upload Quota box appears, but no percentages and no link to the UACP.
Why does that only work on profile_view_body.tpl ?? |
|
|
|
 |
spasticdonkey

|
Posted:
Tue Feb 15, 2011 4:36 pm |
|
the tpl files are just templates, and require data from the file calling the template. I would look at usercp_viewprofile.php and see what info they are sending to profile_view_body.tpl
you will have to replicate that in whatever files are calling the tpl file(s) you want to add to. |
|
|
|
 |
myrtletrees

|
Posted:
Tue Feb 15, 2011 5:07 pm |
|
spasticdonkey wrote: | the tpl files are just templates, and require data from the file calling the template. I would look at usercp_viewprofile.php and see what info they are sending to profile_view_body.tpl
you will have to replicate that in whatever files are calling the tpl file(s) you want to add to. |
That's pretty much where I headed to no avail. No big deal. I'll try adding the link to the UACP in some other manner. |
|
|
|
 |
|