Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Another way to integrate Digg  (Read 7031 times)

0 Members and 1 Guest are viewing this topic.

divestoclimb

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 16
Another way to integrate Digg
« on: January 08, 2009, 06:55:25 pm »

I integrated Digg into my gallery with a little help from some old topics on the subject, but also some new ideas. Here's what I did:

  • Copy the entire function theme_html_picture() from themes/sample/theme.php into your theme's theme.php.
  • Find this section:
Code: [Select]
    $params = array('{CELL_HEIGHT}' => '100',
        '{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        '{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        '{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        '{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        );
  • ABOVE it, add this (this lets you generate a permanent link to submit):
Code: [Select]
    $this_page = $_SERVER['REQUEST_URI'];
    if (strpos($this_page, "?") !== false) $this_page = reset(explode("?", $this_page));
(code found in comment on http://us.php.net/manual/en/reserved.variables.server.php)
  • At the end of the list of parameters you found in step 2, add this (UPDATE added the http: part):
Code: [Select]
'{PERMALINK}' => "http://".$_SERVER['SERVER_NAME'].$this_page."?pos=-$pid",
  • Copy and paste the $template_display_media section from themes/sample/theme.php into your theme.php, up until you see "EOT;"
  • Replace the last <table> section with this:
Code: [Select]
                        <table cellpadding="0" cellspacing="0" class="tableb" width="100%">
                                <tr>
<!-- BEGIN img_desc -->
                                        <td class="tableb" width="100%"><center>
<!-- BEGIN title -->
                                                <b>{TITLE}</b><br />
<!-- END title -->
<!-- BEGIN caption -->
                                                {CAPTION}
<!-- END caption -->
</center></td>
<!-- END img_desc -->
<td class="tableb" align="right">
<script type="text/javascript">
digg_url='{PERMALINK}';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</td>
                                </tr>
                        </table>
    « Last Edit: January 08, 2009, 08:27:57 pm by divestoclimb »
    Logged

    Egofreaky

    • Coppermine newbie
    • Offline Offline
    • Posts: 1
    Re: Another way to integrate Digg
    « Reply #1 on: January 11, 2009, 01:58:57 am »

    My hat goes off to you sir for figuring this one out, as I've been looking for a Digg solution to coppermine for ages (and I'm no coder)... However, it's bloody confusing.
    Step 2? What?

    I hate to be picky, but do you think you could possibly rewrite this as step by step instructions? Please? I'd be amazingly grateful if you did.

    Yes, I know I'm a n00b moron for not being able to figure this out.
    Logged
    Pages: [1]   Go Up
     

    Page created in 0.019 seconds with 19 queries.