forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Visuals => Topic started by: divestoclimb on January 08, 2009, 06:55:25 pm

Title: Another way to integrate Digg
Post by: divestoclimb 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:

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']),
        );
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)
Code: [Select]
'{PERMALINK}' => "http://".$_SERVER['SERVER_NAME'].$this_page."?pos=-$pid",
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>
Title: Re: Another way to integrate Digg
Post by: Egofreaky 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.