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: Can i create {MY_DATA} in Theme.php ?  (Read 5431 times)

0 Members and 1 Guest are viewing this topic.

synx

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Can i create {MY_DATA} in Theme.php ?
« on: November 05, 2005, 04:31:49 pm »

Hello Guys

How can i create a {MY_DATA} Just like {ADMIN_MENU}
And Put it in my template.html and print some data ?

I Want to do this ?

'{WELCOME_CPG}' => wel_cpg()

and put this data to {WELCOME_CPG}

function wel_cpg()
{
if (USER_ID) {
   echo <<<EOT
   Welcome Guest To CPG Gallery
EOT;
} else {
   echo <<<EOT
   Dear CPG Member
EOT;
}
}


But How Can i do this ???  ???
« Last Edit: November 05, 2005, 05:59:25 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: Can i create {MY_DATA} in Theme.php ?
« Reply #1 on: November 05, 2005, 04:55:22 pm »

Do it as a normal custom header - check the documentation.
Logged

synx

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Can i create {MY_DATA} in Theme.php ?
« Reply #2 on: November 05, 2005, 05:11:25 pm »

Do it as a normal custom header - check the documentation.

Thanks , But i see the Documentation and Manual But  :-[
Can you help me please  :-\\
Logged

Nibbler

  • Guest
Logged

synx

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Can i create {MY_DATA} in Theme.php ?
« Reply #4 on: November 05, 2005, 05:31:28 pm »

http://coppermine.sourceforge.net/faq.php#customHeader

Thanks Man , But i have a problem - Here is my try
Code: [Select]
.....
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
'{WELCOME_PCG}' => wel_pcg(),
        );
    echo template_eval($template_header, $template_vars);
}
function wel_pcg()
{
if (USER_ID) {
echo <<<EOT
Welcome
EOT;
} else {
echo <<<EOT
Welcome 2323
EOT;
}
}

I put {WELCOME_PCG} in a <td> in my header
but when i run it the message i Out of Theme in the top right of my page

I Have move it to other tables BUT even when i remove {WELCOME_PCG} from my html
my message will print out of theme ?

 ???
Logged

Nibbler

  • Guest
Re: Can i create {MY_DATA} in Theme.php ?
« Reply #5 on: November 05, 2005, 05:41:35 pm »

Change echo to return
Logged

synx

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Can i create {MY_DATA} in Theme.php ?
« Reply #6 on: November 05, 2005, 05:49:32 pm »

Change echo to return

Wow , God Save You Man
Thanks A Lot , Work like a charm
Logged

synx

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Can i create {MY_DATA} in Theme.php ?
« Reply #7 on: November 05, 2005, 06:22:01 pm »

And Another Question

How Can i print User Name And llink it to the Loged User profile page

Code: [Select]
if (USER_ID) {
return Welcome ".$user['user_id'] . date(" M j, Y");
} else {

I Try this but , not work
thanks
Logged

Nibbler

  • Guest
Re: Can i create {MY_DATA} in Theme.php ?
« Reply #8 on: November 05, 2005, 06:27:55 pm »

You can use USER_ID and USER_NAME, so a link to the profile page would be like this:

Code: [Select]
return 'Welcome <a href="profile.php?uid=' . USER_ID . '">' . USER_NAME . '</a>';
Logged

synx

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 20
Re: Can i create {MY_DATA} in Theme.php ?
« Reply #9 on: November 05, 2005, 06:49:24 pm »

Thanks MAN  :o

And The final question
I want to put somethings just in My Index.php , i mean just show at index.php
I try this but i got error

Code: [Select]
if ($cat == 0) {
return <<<EOT
<table width="100%" border="0" cellpadding="0" cellspacing="0">
......

Can you help me with this one , it's the final  ::)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Can i create {MY_DATA} in Theme.php ?
« Reply #10 on: November 06, 2005, 02:21:02 pm »

We have a "one question per thread" policy, you agreed to respect it when signing up. Afaik you have already been told that...

[edit]
synx has already created another thread that deals with the issue in his last posting: http://forum.coppermine-gallery.net/index.php?topic=23421.0
Thanks for creating double work for supporters. Learn to play be the rules!
[/edit]
« Last Edit: November 06, 2005, 02:28:00 pm by GauGau »
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.