Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
myrtletrees
Involved
Involved



Joined: Sep 13, 2005
Posts: 259
Location: Cornfields of Indiana

PostPosted: Sun Feb 13, 2011 6:25 pm Reply with quote

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?
 
View user's profile Send private message
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Sun Feb 13, 2011 7:22 pm Reply with quote

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 Wink
 
View user's profile Send private message Visit poster's website
myrtletrees







PostPosted: Sun Feb 13, 2011 7:59 pm Reply with quote

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 Wink


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: [ Only registered users can see links on this board! Get registered or login! ]

But after submitting the post, the link to the image changes to this: [ Only registered users can see links on this board! Get registered or login! ]

It's almost like the colorbox doesn't know what to do with the second link.
 
spasticdonkey







PostPosted: Sun Feb 13, 2011 9:08 pm Reply with quote

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. Embarassed 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







PostPosted: Mon Feb 14, 2011 12:14 am Reply with quote

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







PostPosted: Mon Feb 14, 2011 1:43 am Reply with quote

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







PostPosted: Mon Feb 14, 2011 7:07 am Reply with quote

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... Embarassed

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







PostPosted: Mon Feb 14, 2011 8:30 am Reply with quote

I look at code too long all the time Smile 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







PostPosted: Mon Feb 14, 2011 11:45 am Reply with quote

So as of now.

# of Views/Downloads counter no longer works.
I'm guessing it is because the script no longer understands the old link to the image: [ Only registered users can see links on this board! Get registered or login! ]

Links to attachment files in the User Attachment control panel no longer work Generates a Error 404 page not found.
With this link: [ Only registered users can see links on this board! Get registered or login! ]

Question Seems I have modules/Forums twice?

I think I recall reading in another related topic about having to live with the counter not working anymore. But I did not see any mention of the link to the attachment in the UACP not working anymore.
 
spasticdonkey







PostPosted: Mon Feb 14, 2011 4:56 pm Reply with quote

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

PostPosted: Mon Feb 14, 2011 5:33 pm Reply with quote

Just for reference this is the other topic. [ Only registered users can see links on this board! Get registered or login! ]

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. 
View user's profile Send private message
Palbin







PostPosted: Mon Feb 14, 2011 5:44 pm Reply with quote

myrtletrees, have you done what I state here? If not give it a try and let me know how it goes.
[ Only registered users can see links on this board! Get registered or login! ]
 
myrtletrees







PostPosted: Mon Feb 14, 2011 7:30 pm Reply with quote

Palbin wrote:
Just for reference this is the other topic. [ Only registered users can see links on this board! Get registered or login! ]

spasticdonkey, it is in the ACP.

I will give the ACP problem a quick one over.



It's the UACP, not the ACP where the links to images are broken.


Example: If I go to my User Attachments Control panel, it lists all the attachments I have uploaded to topics. Each attachment is a link to the file, whether it is an image or file.

It shows this link, which is correct: [ Only registered users can see links on this board! Get registered or login! ]

However, upon clicking that link it takes me to: [ Only registered users can see links on this board! Get registered or login! ]

Also, the link you gave to edit modules/Forums/admin/admin_attachments.php would have no effect on modules/Forums/uacp.php I don't think. Even though, the link to the images/files in Admin ACP are broken too.
 
myrtletrees







PostPosted: Mon Feb 14, 2011 7:44 pm Reply with quote

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







PostPosted: Tue Feb 15, 2011 10:53 am Reply with quote

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







PostPosted: Tue Feb 15, 2011 11:27 am Reply with quote

Ok you have beat me into submission Wink

I will try and get this fixed up tonight, and if not tonight defiantly tomorrow.
 
myrtletrees







PostPosted: Tue Feb 15, 2011 11:30 am Reply with quote

Palbin wrote:
Ok you have beat me into submission Wink

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







PostPosted: Tue Feb 15, 2011 11:34 am Reply with quote

If I can not reproduce the problems I will take a look. I will let you know.
 
myrtletrees







PostPosted: Tue Feb 15, 2011 1:02 pm Reply with quote

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?? Very Happy

Now if I can figure out that pesky Views Count... Rolling Eyes
 
myrtletrees







PostPosted: Tue Feb 15, 2011 4:26 pm Reply with quote

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:
Image

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







PostPosted: Tue Feb 15, 2011 4:36 pm Reply with quote

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







PostPosted: Tue Feb 15, 2011 5:07 pm Reply with quote

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.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©