Syntax question for the skin wizards

ecoutez

Well-Known Member
May 23, 2002
152
0
316
Hey folks,

I'm trying to use an include which will bring up a file which has the account owner as part of the file name. ie - if the account is owned by root, then it would bring up /tables/root-support.html If it were owned by joe, then it would grab /tables/joe-support.html

I did something similar to give resellers their own logo based on the owner variable, and that has worked fine. Now I want to add a custom table for support links... online payments, support center, account upgrades, etc -- all things which the reseller would generally have on his own website, but which would ideally be linked from in CPanel as well.

So I tried this... (replace hard brackets [ and ] with appropriate & and & of course)

[cpanel include=&tables/[cpanel print=&$CPDATA{'OWNER'}&]-support.html&]

It fails because it sees the second set of quotes and closes the include, and then displays something like &root-support.html& as text on the screen. I assume it wasn't happy with a cpanel link being embedded in another one. So I also tried several variations of this...
[cpanel include=&tables/$CPDATA{'OWNER'}-support.html&]

Also no luck.

FWIW, if anyone is curious about my syntax for the logo display, the above should be a good hint... but here's what I used:
[cpanel print=&$CPDATA{'OWNER'}&]-cp.gif&]

Any help would be appreciated!

Thanks,
Jason
 

parag

Well-Known Member
Aug 16, 2001
115
0
316
[quote:3885f56dca][i:3885f56dca]Originally posted by ecoutez[/i:3885f56dca]

Hey folks,

I'm trying to use an include which will bring up a file which has the account owner as part of the file name. ie - if the account is owned by root, then it would bring up /tables/root-support.html If it were owned by joe, then it would grab /tables/joe-support.html

I did something similar to give resellers their own logo based on the owner variable, and that has worked fine. Now I want to add a custom table for support links... online payments, support center, account upgrades, etc -- all things which the reseller would generally have on his own website, but which would ideally be linked from in CPanel as well.

So I tried this... (replace hard brackets [ and ] with appropriate & and & of course)

[cpanel include=&tables/[cpanel print=&$CPDATA{'OWNER'}&]-support.html&]

It fails because it sees the second set of quotes and closes the include, and then displays something like &root-support.html& as text on the screen. I assume it wasn't happy with a cpanel link being embedded in another one. So I also tried several variations of this...
[cpanel include=&tables/$CPDATA{'OWNER'}-support.html&]

Also no luck.

FWIW, if anyone is curious about my syntax for the logo display, the above should be a good hint... but here's what I used:
[cpanel print=&$CPDATA{'OWNER'}&]-cp.gif&]

Any help would be appreciated!

Thanks,
Jason
[/quote:3885f56dca]


Hi Jason

You did the correct thing but you forgot to have the hyperlink tag

[a href=&tables/[cpanel print=&$CPDATA{'OWNER'}&]-support.html&] [cpanel include=&tables/$CPDATA{'OWNER'}-support.html&] [/a]

this will work

this will print the & tables/root-support.html & and also have a link to it. There is a better way to do it - so that it will print &Support Text& and have a link to root-support.html -

=======================================
This is the better way
=======================================
[a href=&/tables/[cpanel print=&$CPDATA{'OWNER'}&]-support.html&] Support Link [/a]

=======================================

enjoy... mail me if you need any other help ;)

best regards,
Parag
 

kosmo

Well-Known Member
Verifed Vendor
Aug 12, 2001
400
0
316
All over Europe
[cpanel include=&tables/$CPDATA{'OWNER'}-support.html&]

This will not work. A CPanel command can not contain another CPanel command. I had this problem myself and didn't find a solution.

kosmo
 

ecoutez

Well-Known Member
May 23, 2002
152
0
316
Thanks Parag and Kosmo

I didn't forget the [a href] part - I was trying to include a html file. Take a look at the include statements in the bluelagoon index.html file. All those tables are included from seperate files. I wanted to add another table with a handfull of hardcoded links, and have the index.html file pull up the approriate table based on the owner/reseller of the account. That would give me the ability to give the reseller his own area for a few links based on his particular need - be it billing links, contact information, use policies, support forum, etc.

I suspect I could do something like, [a href=&[cpanel print=&$CPDATA{'OWNER'}&]-support-redirect.html&]Hosting Support[/a]

The only downside with this is that I would have to decide on the links for everyone. I'll have to take a look at how that CPanel &If& stuff works - maybe that can be helpful. That or find a way to dump the owner information to another variable that I could pull up without having to embed another [cpanel] command.

Thanks again,
Jason