Using this code in theme.inc.php Using this code in theme.inc.php
 

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]

Main Menu

Using this code in theme.inc.php

Started by falarious, December 05, 2005, 02:24:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

falarious

I would like to use this code

<a href="aim:goim?screenname=Friends+Screen+Name&message=Check+This+Out!+http://www.domain.com<? echo $_SERVER['PHP_SELF'];?>">My TExt </a>
But, after i place it, a white page come up.

How can i fix it?

Joachim Müller

where exactly did you put this code to accomplish what? Don't edit themes.inc.php unless you really, really know what you're doing. Edit themes/yourtheme/theme.php instead!

falarious

This code will be so that a peron will be able to AOL Instant Message the current link to someone on AIM. Kinda like the "Send this page to a friend" thing.

<? echo $_SERVER['PHP_SELF'];?>

Once i remove that piece of code from the theme.inc.php file, the hyperlink comes up, but not the exact way i want it.

I am guessing that the code above determines what comes after the URL.
e.g
www.mydoamin/STUFF_HERE

I tried using the code the same way the {CUSTOM_HEADER} works, but the link doesnt come out the way i want it to.




Joachim Müller


falarious

QuoteEOT;
// HTML template for intermediate image display
if (!isset($template_display_media))  //{THEMES}
$template_display_media = <<<EOT
        <tr>
                <td align="center" class="display_media" nowrap="nowrap">
                        <table cellspacing="2px" cellpadding="0px" class="imageborder">
                                <tr>
                                        <td align="center">
                                                {IMAGE}

                                        </td>
                                </tr>
                        </table>
                </td></tr>
                <tr><td>
                                                <table width="100%" cellspacing="2px" cellpadding="0px" class="tableb">
                                <tr>
                                        <td align="center">

                                                {ADMIN_MENU}
                                        </td>
                                </tr>
                        </table>





<!-- BEGIN img_desc -->
                        <table cellpadding="0px" cellspacing="0px" class="tableb" width="100%">
<!-- BEGIN title -->
                                <tr>
CODE HERE
                                        <td class="tableb"><center><b>
                                                {TITLE}
                                        </b></center></td>
                                </tr>
<!-- END title -->
<!-- BEGIN caption -->
                                <tr>
                                        <td class="tableb"><center>
                                                {CAPTION}<br><br>




                                        </center></td>
                                </tr>
<!-- END caption -->
                        </table>
<!-- END img_desc -->
                </td>
        </tr>

EOT;

There

donnoman

the code you posted will not work in a heredoc block. Since it's already being expanded for variables you should just be able to do:


<a href="aim:goim?screenname=Friends+Screen+Name&message=Check+This+Out!+http://www.domain.com{$_SERVER['PHP_SELF']}">My TExt </a>

falarious

Quote from: donnoman on December 09, 2005, 05:50:57 AM
the code you posted will not work in a heredoc block. Since it's already being expanded for variables you should just be able to do:


<a href="aim:goim?screenname=Friends+Screen+Name&message=Check+This+Out!+http://www.domain.com{$_SERVER['PHP_SELF']}">My TExt </a>


This code ALMOST works.

This is the link http://mydomain.com/displayimage.php?pos=-686

but it comes out like this  http://mydomain.com/displayimage.php


donnoman

Well the code you posted did precisely what you had asked for.

but why don't we convert this thing to a plugin.

this is the meat of the codebase:

if (defined('DISPLAYIMAGE_PHP')) {
    $thisplugin->add_action('page_start','goaim_pagestart');
    $thisplugin->add_filter('post_breadcrumb','goaim_mod_block');
}

function goaim_mod_block()
{
    global $CURRENT_PIC_DATA, $CONFIG, $picture;
       
    $title=<<<EOT
        <div class="alblink">
            <a href="aim:goim?screenname=Friends+Screen+Name&message=Check+This+Out!+{$CONFIG['ecards_more_pic_target']}{$_SERVER['PHP_SELF']}?pos=-{$CURRENT_PIC_DATA['pid']}">AIM Buddy Notify!</a>
        </div>
EOT;
   
    $picture=str_replace('{GOAIM}',$title,$picture);
}

function goaim_pagestart()
{
  global $template_display_media;
  $template_display_media = str_replace('{ADMIN_MENU}','{GOAIM}{ADMIN_MENU}',$template_display_media);
}


plugin attached, modify to suit.

Note that I am actually placing the HREF slightly above where you specified because the image description section is only displayed on images that have a title or description and wouldn't be shown on images that didn't have at least one of those.  By co-opting the admin menu space you will see it on every image.

falarious

Thanks Don!!

This plugin works fantastic!!