forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Miscellaneous => Topic started by: blackmamba on June 30, 2006, 12:48:02 am

Title: Send link to all the Yahoo contacts
Post by: blackmamba on June 30, 2006, 12:48:02 am
Send link to all the Yahoo contacts
This mod will create a link inside the displayimage.php's INFO field specially crafted to pop-up "Send an instant message" window in Yahoo Messenger(windows).
You need this mod as a source of free & effective advertising for your gallery.

files to edit: 1 (displayimage.php)
time needed: ~30 sec
results: priceless advertising



Quote
open:
displayimage.php

find:
Code: [Select]
// with subdomains the variable is $_SERVER["SERVER_NAME"] does not return the right value instead of using a new config variable I reused $CONFIG["ecards_more_pic_target"] no trailing slash in the configure
after add:
Code: [Select]
//send link to all yahoo contacts
$info['Yahoo'] = '<a href="'. "ymsgr:im?+&msg=". $CURRENT_PIC_DATA[title] ."+http://www.yourdomain.com/displayimage.php?pos=-" . $CURRENT_PIC_DATA[pid] . '">' . "<b>send this pic to Yahoo Messenger contacts!</b>" . '</a>';

Important notice:
do remember to replace www.yourdomain.com from the obove line with the propper URL

That's it!

sample of this mod:
http://www.pozehaioase.ro/displayimage.php?pos=-2665

edit (by Paver): This mod works in both 1.3.x and 1.4.x so I removed the 1.4.x tag in the subject.
Title: Re: Send link to all the Yahoo contacts - cpg1.4.x
Post by: Paver on June 30, 2006, 04:35:18 am
You can also avoid modifying a core script by customizing a theme function.

In themes/yourtheme/theme.php, modify the function theme_html_picinfo as shown:
Code: [Select]
function theme_html_picinfo(&$info)
{
    global $lang_picinfo, $CURRENT_PIC_DATA;

    $info['Yahoo'] = '<a href="'. "ymsgr:im?+&msg=". $CURRENT_PIC_DATA[title] ."+http://www.yourdomain.com/displayimage.php?pos=-" . $CURRENT_PIC_DATA[pid] . '">' . "<b>send this pic to Yahoo Messenger contacts!</b>" . '</a>';
    $html = '';

    $html .= "        <tr><td colspan=\"2\" class=\"tableh2_compact\"><b>{$lang_picinfo['title']}</b></td></tr>\n";
    $template = "        <tr><td class=\"tableb_compact\" valign=\"top\" >%s:</td><td class=\"tableb_compact\">%s</td></tr>\n";
    foreach ($info as $key => $value) $html .= sprintf($template, $key, $value);

    return $html;
}
The 2 modifications to the default function are adding the global variable $CURRENT_PIC_DATA and adding the $info line after it.

If your theme.php doesn't have this function already, copy it from themes/sample/theme.php.  The easiest way to make sure you copy it properly is to copy it to a line above the last line ?> in your theme.php.
Title: Re: Send link to all the Yahoo contacts
Post by: augustin on November 05, 2008, 09:12:05 am
I have tried this mod and it seems to not work.

Take a look

http://www.eyescoops.com/displayimage.php?album=lastup&cat=0&pos=1

Any help would be appriciated

Thanks