Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [Mod] Discuss-this-picture for CPG and phpbb  (Read 3257 times)

0 Members and 1 Guest are viewing this topic.

Bruz

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 54
[Mod] Discuss-this-picture for CPG and phpbb
« on: February 27, 2004, 10:58:16 am »

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
Code: [Select]
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
Code: [Select]
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
Code: [Select]
   $pic_pos = sprintf($lang_img_nav_bar['pic_pos'], $human_pos, $pic_count);

after, add
Code: [Select]
  // 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
Code: [Select]
       '{NEXT_TITLE}' => $next_title,

after, add

Code: [Select]
       '{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
Code: [Select]
<td align="center" valign="middle" class="navmenu" witdh="100%">
                        {PIC_POS}
                </td>


after, add
Code: [Select]
               <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.
Logged
(http://www.kingbruz.de/Fotos/signatur_cpg.php)

get your statistik-hack here

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
[Mod] Discuss-this-picture for CPG and phpbb
« Reply #1 on: February 27, 2004, 12:01:49 pm »

Hi Bruz,

glad you got it done  :wink:
Logged
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

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 54
[Mod] Discuss-this-picture for CPG and phpbb
« Reply #2 on: February 27, 2004, 12:21:36 pm »

Thank you casper!

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

open theme.php

find
Code: [Select]
<td align="center" valign="middle" class="navmenu" witdh="100%">
                        {PIC_POS}
                </td>


after, add
Code: [Select]
               <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.
Logged
(http://www.kingbruz.de/Fotos/signatur_cpg.php)

get your statistik-hack here

Bruz

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 54
[Mod] Discuss-this-picture for CPG and phpbb
« Reply #3 on: February 27, 2004, 08:08:20 pm »

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:
Code: [Select]
  // 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.
Logged
(http://www.kingbruz.de/Fotos/signatur_cpg.php)

get your statistik-hack here
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.