Jump to content

Recommended Posts

Posted

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!

  • Administrators
Posted

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>

  • Administrators
Posted

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; ?>

Posted

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

Posted

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.

  • Administrators
Posted

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?

Posted

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.

  • Administrators
Posted

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?

Posted

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.......

  • Administrators
Posted

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');

  • Administrators
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...