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: Using this code in theme.inc.php  (Read 6088 times)

0 Members and 1 Guest are viewing this topic.

falarious

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Using this code in theme.inc.php
« on: December 05, 2005, 02:24:04 am »

I would like to use this code

Code: [Select]
<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?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Using this code in theme.inc.php
« Reply #1 on: December 05, 2005, 08:06:06 am »

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!
Logged

falarious

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Using this code in theme.inc.php
« Reply #2 on: December 06, 2005, 04:07:31 am »

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.

Code: [Select]
<? 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.



Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Using this code in theme.inc.php
« Reply #3 on: December 06, 2005, 10:11:50 am »

where exactly did you put this code
Logged

falarious

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Using this code in theme.inc.php
« Reply #4 on: December 07, 2005, 01:47:46 am »

Quote
EOT;
// 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
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Using this code in theme.inc.php
« Reply #5 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:

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

falarious

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Using this code in theme.inc.php
« Reply #6 on: December 12, 2005, 12:04:30 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:

Code: [Select]
<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

Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Using this code in theme.inc.php
« Reply #7 on: December 12, 2005, 02:44:07 am »

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:
Code: [Select]
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.
Logged

falarious

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Using this code in theme.inc.php
« Reply #8 on: December 12, 2005, 06:22:58 am »

Thanks Don!!

This plugin works fantastic!!

Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.