forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: synx on November 05, 2005, 04:31:49 pm

Title: Can i create {MY_DATA} in Theme.php ?
Post by: synx 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 ???  ???
Title: Re: Can i create {MY_DATA} in Theme.php ?
Post by: Nibbler on November 05, 2005, 04:55:22 pm
Do it as a normal custom header - check the documentation.
Title: Re: Can i create {MY_DATA} in Theme.php ?
Post by: synx 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  :-\\
Title: Re: Can i create {MY_DATA} in Theme.php ?
Post by: Nibbler on November 05, 2005, 05:12:27 pm
http://coppermine.sourceforge.net/faq.php#customHeader
Title: Re: Can i create {MY_DATA} in Theme.php ?
Post by: synx 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 ?

 ???
Title: Re: Can i create {MY_DATA} in Theme.php ?
Post by: Nibbler on November 05, 2005, 05:41:35 pm
Change echo to return
Title: Re: Can i create {MY_DATA} in Theme.php ?
Post by: synx on November 05, 2005, 05:49:32 pm
Change echo to return

Wow , God Save You Man
Thanks A Lot , Work like a charm
Title: Re: Can i create {MY_DATA} in Theme.php ?
Post by: synx 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
Title: Re: Can i create {MY_DATA} in Theme.php ?
Post by: Nibbler 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>';
Title: Re: Can i create {MY_DATA} in Theme.php ?
Post by: synx 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  ::)
Title: Re: Can i create {MY_DATA} in Theme.php ?
Post by: Joachim Müller 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]