Please login or register.

Login with username, password and session length
Advanced search  


Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: [MOD] function showwebsiteadress - simple&usefull :)  (Read 2674 times)


  • Newbie
  • *
  • Karma: 0
  • Posts: 19
[MOD] function showwebsiteadress - simple&usefull :)
« on: April 09, 2006, 08:42:52 pm »

well, I'm not PHP-wise but after some time I created new usefull function, it's just showing your site name with url, which both have to be set in the snews.php (snews-txtdb.php) anyway.

you can insert it there in index.php where "Copyright" is and in many many other places :)

this code below just put in snews.php, place doesn't matter, could be in the last lines
Code: [Select]
function showwebsiteadress() {
echo "" .s('website_title'). "";
and insert this one below in index.php where you want your website url to show up

Code: [Select]


  • Full Member
  • ***
  • Karma: 0
  • Posts: 125
[MOD] function showwebsiteadress - simple&usefull :)
« Reply #1 on: April 30, 2006, 11:00:54 am »

Cool, thanks :-)

What I can't understand why this wasn't already in sNews.

George Antoniadis

  • Sr. Member
  • ****
  • Karma: 0
  • Posts: 479
[MOD] function showwebsiteadress - simple&usefull :)
« Reply #2 on: April 30, 2006, 11:22:19 am »

this has been asked one too many times...
the answer is because this is not needed by 99% of the users....
this might be needed maybe once in the template... :/

most users will WANT/ NEED to customize this function in their templates...
it's not worth spending a function to display something most users will HAVE to customize...
it's easier to type this in where you want to display it on your template...

a function like this would be usefull when you could echo the url OR the name...

Code: [Select]
function website_url() {
echo s('website');

function website_name() {
echo s('website_title');

so ppl could write on their template something like:
Code: [Select]
back to home!!!![/url]

This way you are not limited to the the site name and url...

ps. there is a modded version by gnomisan that does this...
How I feel like I'm starless, I'm ready to fade now.
And how I feel like I'm starless, I'm hopeless and greyed out.