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.

Pages: [1] 2

Author Topic: Apply sNews for my theme!  (Read 6159 times)

iall

  • Newbie
  • *
  • Karma: 0
  • Posts: 19
Apply sNews for my theme!
« on: September 18, 2007, 08:38:26 pm »

Hello!  ;)

I'm new here and i like sNews very ,very ,very much!
I have one question ,how could i apply sNews for my template?
I tried ,but with no result!

Maybe some sugestions?
Logged
- Amicus verus - rara avis. -

iall

  • Newbie
  • *
  • Karma: 0
  • Posts: 19
Re: Apply sNews for my theme!
« Reply #1 on: September 18, 2007, 08:59:06 pm »

Or ,how could i change this template to sNews 1.6 - http://www.4th-design.com/css_templates_for_snews/002_online_portfolio/

Thanks very much!
Logged
- Amicus verus - rara avis. -

Joost

  • Guest
Re: Apply sNews for my theme!
« Reply #2 on: September 18, 2007, 09:11:15 pm »

Welcome iall,

In general it is very easy to port a template for sNews. Just insert the tags that are needed in the template.
Here is a helpful tutorial: Template Tags
Logged

iall

  • Newbie
  • *
  • Karma: 0
  • Posts: 19
Re: Apply sNews for my theme!
« Reply #3 on: September 18, 2007, 09:13:47 pm »

Thanks i'll try my best!  :)
Logged
- Amicus verus - rara avis. -

iall

  • Newbie
  • *
  • Karma: 0
  • Posts: 19
Re: Apply sNews for my theme!
« Reply #4 on: September 18, 2007, 09:18:34 pm »

Here is my code - http://paste.php.lv/6064 for the index page of the template!

And here is how it looks - http://joker.oo.lv/blog/

Whats wrong?  :-[
Logged
- Amicus verus - rara avis. -

Joost

  • Guest
Re: Apply sNews for my theme!
« Reply #5 on: September 18, 2007, 09:32:35 pm »

This code ďťż is inserted before anything else and it should not be there. You probably won't see it in your (on line?) editor.

The index.php must start with
Code: [Select]
<?php session_start(); include ("snews.php"); ?>

No space or newline is allowed before this code. Even in a plain text editor hidden code can occur, so use a good editor like: Crimson editor, Notepad++ or PHP Designer 2007 - Personal.
If you need to save the file in utf-8 (unicode), make sure to save it without BOM (byte order mark).
« Last Edit: September 18, 2007, 09:44:19 pm by Joost »
Logged

iall

  • Newbie
  • *
  • Karma: 0
  • Posts: 19
Re: Apply sNews for my theme!
« Reply #6 on: September 18, 2007, 09:49:35 pm »

I can't get it to life - i'm a noob!  :-\

P.S. - I use Notepad++
Logged
- Amicus verus - rara avis. -

Joost

  • Guest
Re: Apply sNews for my theme!
« Reply #7 on: September 18, 2007, 09:51:45 pm »

Which editor do you use? Because right now I can see ďťż even two times.

 :-[ Notepad Sorry, missed that. I would start over with a new copy, this one looks corrupted.
« Last Edit: September 18, 2007, 10:00:28 pm by Joost »
Logged

iall

  • Newbie
  • *
  • Karma: 0
  • Posts: 19
Re: Apply sNews for my theme!
« Reply #8 on: September 18, 2007, 09:52:36 pm »

I use Notepad++
Logged
- Amicus verus - rara avis. -

Joost

  • Guest
Re: Apply sNews for my theme!
« Reply #9 on: September 18, 2007, 09:54:55 pm »

Sorry for cross posting
Logged

iall

  • Newbie
  • *
  • Karma: 0
  • Posts: 19
Re: Apply sNews for my theme!
« Reply #10 on: September 18, 2007, 10:01:37 pm »

It's ok  ;)

This is a fresh copy - http://paste.php.lv/6065

I'm not good in html/php ,so sorry that i'm asking you that!I didn't wanted to bother you! :-\
« Last Edit: September 18, 2007, 10:03:51 pm by iall »
Logged
- Amicus verus - rara avis. -

Joost

  • Guest
Re: Apply sNews for my theme!
« Reply #11 on: September 18, 2007, 10:06:09 pm »

Have you tried that one without modifying?
Logged

iall

  • Newbie
  • *
  • Karma: 0
  • Posts: 19
Re: Apply sNews for my theme!
« Reply #12 on: September 18, 2007, 10:08:04 pm »

Yes ,nothing!

It was made for sNews 1.4 i guess.
Logged
- Amicus verus - rara avis. -

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Apply sNews for my theme!
« Reply #13 on: September 18, 2007, 10:14:12 pm »

That's OK... no apologies for being a noob allowed here... we all started with the... first time.  ;D
The best way to get there is to break the process of "template porting" into small steps... going one step at a time... and the first step is getting to know WHAT we are doing and WHY we are doing it... before we start. This makes the task much easier.

EDIT So you've already got a good start... basically you are down to Step 7 (below). Pick it up on Step 8. Move that <?php title(); ?> function-call string up to just under the opening <head> tag... in that position... the rest of the sNews generated parts will display.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Step 1 - read this page to learn how sNews Works.
Step 2 - then read this page on How content is displayed.
Step 3 - then open the index.php file that came with your sNews package... in a good code editor (as Joost suggested) and spend a few minutes looking at the code in it. It is basically structured like a normal html (xhtml) file but it has a number of short strings here and there that start with an opening PHP tag - <?php - and close with a closing PHP tag - ?>. These are what you need to insert into a fresh copy of the new template's index.htm file.

Step 4 - change the name of your existing (default incex.php file to something else for the time being... such as XX_index.php... so the server no longer recognizes it. Then, paste in a copy of the new template's index.htm file.

Step 5 - If your new template's css stylesheet file has a different name than the default sNews style.css file, just copy and paste the new file into the same project root directory as the other one.

Step 6 - Open your index.htm file in your good code editor and re-save it to the root (where the other files are) as index.php.

Step 7 - Copy the first line of the XX-index.php into the very top (no space before it) of the new index.php file.

Step 8 - In the <head> section of your index.php file... replace the <title>the-title-text</title> with the title function string from XX_index.php. Then begin replacing the file's content parts with the  rest of the function strings throughout the file.

You may need to experiment as you go along... so always keep your master files where you can re-copy them (or parts of them) to fix something that doesn't work. You' be humming along in no time.  ;)
« Last Edit: September 18, 2007, 11:14:57 pm by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

iall

  • Newbie
  • *
  • Karma: 0
  • Posts: 19
Re: Apply sNews for my theme!
« Reply #14 on: September 18, 2007, 10:17:33 pm »

Thanks a lot ,i'll try my best!  :-*  ;D
Logged
- Amicus verus - rara avis. -
Pages: [1] 2