[Mod] Discuss-this-picture for CPG and phpbb [Mod] Discuss-this-picture for CPG and phpbb
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[Mod] Discuss-this-picture for CPG and phpbb

Started by Bruz, February 27, 2004, 10:58:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bruz

This is a mod for coppermine and phpbb.
It creates a new link when viewing a picture which starts a new thread in phpbb with the image-filename as title and the image-link in [img]-Tags as message. Now the user which clicked the link can add his suggestions under the image.

First you need to do a few changes to your phpbb.

open posting.php

find
if ( $mode == 'newtopic' )
   {
      $user_sig = ( $userdata['user_sig'] != '' ) ? $userdata['user_sig'] : '';

      $username = ($userdata['session_logged_in']) ? $userdata['username'] : '';
      $poll_title = '';
      $poll_length = '';
      $subject = '';
      $message = '';
   }


replace with
if ( $mode == 'newtopic' )
        {
                $user_sig = ( $userdata['user_sig'] != '' ) ? $userdata['user_sig'] : '';

                $username = ($userdata['session_logged_in']) ? $userdata['username'] : '';
                $poll_title = '';
                $poll_length = '';
                $subject = ( !empty($HTTP_GET_VARS['subject']) ) ? htmlspecialchars(trim($HTTP_GET_VARS['subject'])) : '';
                $message = ( !empty($HTTP_GET_VARS['message']) ) ? htmlspecialchars(trim($HTTP_GET_VARS['message'])) : '';
        }


save and upload the file.

Now coppermine:

open displayimage.php

find
   $pic_pos = sprintf($lang_img_nav_bar['pic_pos'], $human_pos, $pic_count);

after, add
  // Create the 'Discuss-this-Picture function
    $picture_path = $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'];
    $discuss_name = htmlspecialchars($CURRENT_PIC_DATA['filename']);
    $discuss = "http://www.path_to_your_phpbbforum/posting.php?mode=newtopic&f=[insert the number of the forum where you want to add the Posting without the "[]"]&subject=$discuss_name&message=[img]http://www.path_to_your_album/$picture_path&#91/img]";


find
       '{NEXT_TITLE}' => $next_title,

after, add

       '{DISCUSS_TGT}' => $discuss,

open /your_theme/theme.php (changes for 'fruity', search '// HTML template for the image navigation bar' in your theme and add what you need to call '{DISCUSS_TGT}')

find
<td align="center" valign="middle" class="navmenu" witdh="100%">
                        {PIC_POS}
                </td>


after, add
               <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{DISCUSS_TGT}" title="Discuss this picture"><img src="themes/fruity/images/discuss.gif" width="17" height="17" border="0" align="absmiddle" alt="Discuss this picture"></a>
                </td>

(You need to store a picture called 'discuss.gif' in the /images dir of your theme)

Save all files and upload them. You're done.

Please tell me your thougts about this mod in this thread.
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.kingbruz.de%2FFotos%2Fsignatur_cpg.php&hash=b7bf1fbae41c2d8c534416d10d32fe51619697d7)

get your statistik-hack here

Casper

It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Bruz

Thank you casper!

A small addition for those of you who use the 'standart theme':

open theme.php

find
<td align="center" valign="middle" class="navmenu" witdh="100%">
                        {PIC_POS}
                </td>


after, add
               <td align="center" valign="middle" class="navmenu" width="48">
                        <a href="{DISCUSS_TGT}" title="Discuss this picture"><img src="themes/default/images/discuss.gif" width="16" height="16" border="0" align="absmiddle" alt="Discuss this picture"></a>
                </td>


save and upload the file.
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.kingbruz.de%2FFotos%2Fsignatur_cpg.php&hash=b7bf1fbae41c2d8c534416d10d32fe51619697d7)

get your statistik-hack here

Bruz

And a addition for those who will use the intermediate picture with a link to the big one (creates nice ubb-Code in your Forum)

instead of using the "//Create the 'Discuss-this-Picture function" from above use:
  // Create the 'Discuss-this-Picture function
           if ($CONFIG['make_intermediate'] && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {
        $picture_path = get_pic_url($CURRENT_PIC_DATA, 'normal');
        } else {
        $picture_path = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
        }
        $picture_path_full = $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'];
    $discuss_name = htmlspecialchars($CURRENT_PIC_DATA['filename']);
    $discuss = "http://www.path_to_your_phpbbforum/posting.php?mode=newtopic&f=[insert the number of the forum where you want to add the Posting without the "[]"]&subject=$discuss_name&message=[url=http://www.path_to_your_album/$picture_path_full][img]http://www.path_to_your_album/$picture_path&#91/img][/url]";


If your album contains files with " "'s in the filename you may need to use the "urlencode"-funktion.
Ask me if you have problems.
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.kingbruz.de%2FFotos%2Fsignatur_cpg.php&hash=b7bf1fbae41c2d8c534416d10d32fe51619697d7)

get your statistik-hack here