Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: [MOD - mini] Copyright  (Read 7218 times)

centered

  • Guest
[MOD - mini] Copyright
« on: June 08, 2007, 10:06:51 AM »

Very simple mod

Add the following to global variables:
Code: [Select]
$s['copyright'] = " Copyright";Add the following somewhere, I put mine after website functions
Code: [Select]
function copyright() {
echo (s('copyright'));
echo ' <a href="'.s('website').'" title="'.s('website_title').'">'.s('website_title').'</a>';
}
In index.php add:
Code: [Select]
<? copyright(); ?>
« Last Edit: September 11, 2007, 01:00:51 PM by centered effect »
Logged

piXelatedEmpire

  • MIA
  • Thread Moderator
  • ULTIMATE member
  • *****
  • Karma: 37
  • Posts: 1454
  • currently MIA
[MOD - mini] Copyright
« Reply #1 on: June 09, 2007, 03:08:11 AM »

hey this is neat!  :D Cheers
Logged
my apologies to the sNews crew, but I will be MIA for the forseeable future

Aysseline

  • Jr. Member
  • **
  • Karma: 4
  • Posts: 66
Re: [MOD - mini] Copyright
« Reply #2 on: November 05, 2007, 06:27:49 AM »

Hello,
I'm interested to put this MOD but I'm on 1.6 version and I can find a "global variables" in snews.php
Where I need to put this, please
Code: [Select]
$s['copyright'] = " Copyright";
Logged
sNews 1.6_patched - localhost, Xampp 1.6.2 - XPSP2

Joost

  • Guest
Re: [MOD - mini] Copyright
« Reply #3 on: November 05, 2007, 11:08:42 AM »

In sNews1.6 SITE LANGUAGE VARIABLES is used instead of 'global variables'. Hardcoding the copyright in the template makes more sense, something like:

Code: [Select]
<div> Copyright </div>
Logged

Keyrocks

  • Doug
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 451
  • Posts: 6230
  • Semantically Challenged
    • snews.ca
Re: [MOD - mini] Copyright
« Reply #4 on: November 05, 2007, 03:58:40 PM »

Welcome to sNews Aysseline. Your question prompted me to explain how you can create new Admin Panel settings for any purpose in sNews 1.6... including copyright information... so you can change them easily from within the Site Settings admin panel... and display them anywhere using the "S" variable.  :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Aysseline

  • Jr. Member
  • **
  • Karma: 4
  • Posts: 66
Re: [MOD - mini] Copyright
« Reply #5 on: November 06, 2007, 04:48:58 AM »

Thanks for your answers  :)
@ Keyrocks: I read your post, very interesting, now I know what is the "S" variable !

I don't use your MOD because I find this a little complicated for just one line in the template but I want to understand some things
what is the "L" variable used here for example:
Code: [Select]
l('site_copyright_date')
and why you put all this quotes at the end (for additive data ?)
Code: [Select]
echo html_input('text', 'copyright_date', 'webcopydate', s('copyright_date'), l('site_copyright_date'), '', '', '', '', '', '', '', '', '', '');
I'm agree with Joost answer and I do that:
Code: [Select]
<div class="right">Copyright &copy; 1995-<?php echo date("Y"); ?> <a href="http://www.aysseline.com/" title="Design owner">Aysseline H.</a></div>
Logged
sNews 1.6_patched - localhost, Xampp 1.6.2 - XPSP2

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 391
    • My snews with AEF Forum site
Re: [MOD - mini] Copyright
« Reply #6 on: November 06, 2007, 06:20:20 AM »

Language array
Logged
Yes! I have no siggy.

Keyrocks

  • Doug
  • Administrator
  • ULTIMATE member
  • ******
  • Karma: 451
  • Posts: 6230
  • Semantically Challenged
    • snews.ca
Re: [MOD - mini] Copyright
« Reply #7 on: November 06, 2007, 02:05:29 PM »

For a little more explanation... we put all hard-coded text into language variables in one location. This makes it easier for users to create additional language arrays (or files containing complete arrays) so that all hard-coded text in the site will display in another language. It also allows us to display the same text in any number of function locations in any engine files... by inserting the variable name in functions where we want the text to display.

All variables start with a $-sign. As an example, we create the following variable string within the language array... to display the word "home" The part to the left of the = sign contains the variable name, and the part to the right contains the variable value... the text to be displayed:
Quote
$l['home'] = 'Home';

And, we insert the variable into code with - l('home') or '.l('home').' depending on where the variable is to be located within code strings. It then displays the value wherever it is located.

A language variable can contain large amounts of text... several paragraphs... provided it is all contained within the single-quotes. You can make up your own language variables for any purpose.  :)

On your second question, you can learn more about the structure of the html_input strings by downloading the sNews 1.6 Developers' Edition of the snews.php (engine) file. Mika, who worked with Luka and contributed significantly to the development of version 1.6, was very generous in adding lots of comments to the file to explain what goes on within each function. When you open the file in your 'good' code editor, search for // FORM GENERATOR and that will take you to function html_input. You will see... in the first string of the function... that it contains a total of 15 variables. Every html_input in the snews.php file contains 15 value containers, and each of them relates to a variable in the noted function. If some are not used in a given string, they are left empty and only those used have values in them.
« Last Edit: November 06, 2007, 03:19:22 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Aysseline

  • Jr. Member
  • **
  • Karma: 4
  • Posts: 66
Re: [MOD - mini] Copyright
« Reply #8 on: November 08, 2007, 01:07:32 AM »

First, thanks to take time to answer me Keyrocks.
I have learning more with your very good and clear answer and after hard work to understand, I have implemented your MOD with small add. Thanks for your help !  :)
Logged
sNews 1.6_patched - localhost, Xampp 1.6.2 - XPSP2

henrich

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 405
  • Passion for quality and excellence!
    • My personal blog and portofolio
Re: [MOD - mini] Copyright
« Reply #9 on: January 31, 2008, 08:09:14 AM »

Quote
<b><a href="http://en.wikipedia.org/wiki/Copyright" target="_new" title="Copyright">&copy;</a></b> 2007 - <?php echo date("Y"); ?> site name
Logged
By(e) Henrich :)
------------------------------
IT related blog