External URL's

Is it possible to do this:

I want to create a php url for an external URL (eg. youtube)

Can you do this –> www.youtube.com translates to <?php echo YOUTUBE_URL?>

and the youtube url entered would go there

hope that makes sense

Thanks!

To do it in php you can do;

<?php echo '<a href="http://www.youtube.com">YouTube</a>'; ?>

but if you are outside of php there is no reason to use it, just use the html command

<a href="http://www.youtube.com">YouTube</a>

edit removed

Ah, if you are trying to use it as a defined value Mark is right, define it in your local config;

define('YOUTUBE_URL', '<a href="http://www.youtube.com">YouTube</a>');

Then in your template;

<?php echo YOUTUBE_URL; ?>

I added that to my site, in local.config.php directly under where it defines the site url… However when i add that it just whites out my site. I dont get an error, i just dont see anything, at all. What am i doing wrong here

Here is where i am currently adding it to when i get the blank site.

Line 22 - local.config.php

define('SITE_URL', '....my url');

I added this code directly below

define('YOUTUBE_URL', '<a href="http://www.youtube.com">YouTube</a>');

If this is incorrect please let me know, and where i should put it.

I just double checked it and it works fine on my test install. My guess is you have dropped or added a character somewhere in the file. Are you getting a headers already sent error as well?

Hm.. i have not changed anything in core/local.config.php. **Everything works fine until i add that code

Am i supposed to simple copy and paste the code given, and add it below SITE_URL?

I also tried it on a completely different server and va, but i get the same result.

And basically what its doing is, i am not getting any error at all. it just displays everything as white.

Simpilot, where are you adding your code in local.config. And are you use the exact code that you posted above?

I put it in the same place you are indicating, right after the SITE_URL definition. Do you get the same problem if you add it but do not add the echo statement in the template?

It’s not the template part that’s giving me the error, it when I add the code to the local config. And again everything works fine before I add this code…

Not sure what to tell you, I have tried it on a WAMP server here on my local machine, on XAMPP installed on a thumb drive, and on my live site which is running on a CENT OS 5.6 base with php 5.2.10.

Try putting a simpler definition in there to see if it works.

define('TEST_TRY', 'testing');

Ok I’ll give that a try, and I don’t know why it’s working… Thanks a lot tho for your help! I really appreciate it

I got it working!!

All i had to do was define it in the index.php of the admin panel, and it works perfect!

I got it working!!

All i had to do was define it in the index.php of the admin panel, and it works perfect!

That will get overridden in updates, try adding it to the very end of you local.config.php file

doesn’t seem to make a difference, it is still giving me a blank site when i add that