March 19, 2010, 08:37:38 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Private messages disabled
Caused by the massive abuse of the PM system in the past, the sending of personal messages has been disabled for all regular users on the Coppermine forum.
[more]
   Home   Help Search Board rules Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Another way to integrate Digg  (Read 1797 times)
0 Members and 1 Guest are viewing this topic.
divestoclimb Topic starter
Contributor
***
Posts: 16


« on: January 08, 2009, 05: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:
    $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:
    $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:
'{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:
                        <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, 07:27:57 pm by divestoclimb » Logged
    Egofreaky
    Coppermine newbie

    Australia Australia

    Posts: 1


    « Reply #1 on: January 11, 2009, 12: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
      Print  
     
    Jump to:  

    Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
    Page created in 0.064 seconds with 17 queries.