Please login or register.

Login with username, password and session length
Advanced search  

News:

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

Pages: [1] 2

Author Topic: Revolutions from RUI - the best sNews 1.6 fork ever!  (Read 11855 times)

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Revolutions from RUI - the best sNews 1.6 fork ever!
« on: December 01, 2008, 11:40:55 pm »

This little package is based on sNews 1.6 Revolutions made by Rui (and with Joost queries).
Many, many thanks to them.

I think is the best approach. With this fork i was able to obtain a better SEO.

First of all, I "moved" the static pages to "page" category, assigned by default and protected against deleting. Why? To separate them from "home" category (You will see why later).

Now is possible to obtain a real 404. And unique meta description for every page and category with pagination.
Example:
   -  http;//domain.com/cat_news/
   -  http;//domain.com/cat_news/p_1/   <-- this one will lead to 404 to avoid duplicate meta description

   -  http;//domain.com/cat_news/example_article/
   -  http;//domain.com/cat_news/example_article/1/  <-- this one will lead to 404 to avoid duplicate meta description

   -  http;//domain.com/
   -  http;//domain.com/home/  <-- this one will lead to 404 ....

When I implemented "Separated blog page when you have a static page as home page" I had problems with meta desc. duplicates. So, you had to decide from beginning what to have for first page on your blog. Now, is perfectly usable, you can switch anytime. Remember, this mod have implemented a hardcoded category, named 'blog'.
So, you have following situations:

a) When your blog is on home page as usual, any of this:
   -  http;//domain.com/blog/
   -  http;//domain.com/blog/p_2/
   ................................................
   -  http;//domain.com/blog/p_n/
will lead, as expected, to 404.

Lets suppose we have a static page named "Welcome". And the link to it is http;//domain.com/page/welcome. In our actual situation (situation a) ), is a valid link. 
Also these links are valid:
   -  http;//domain.com/
   -  http;//domain.com/home/p_2/
   but this:
   -  http;//domain.com/home/p_1/  will lead to 404

Lets see what is in b) situation

b) When you have the page "Welcome" set as home page and your blog is on "Blog" page (you can't loose blog functionality switching to static page as home page) you have this situations:

Your location for "Welcome" page is virtually changed from "http;//domain.com/page/welcome/" to "http;//domain.com/" .
Good! In this moment, the old location will lead to 404. Cool!
Also, we have now a new page, named  "Blog" where are articles displayed as in home so, our blog is still functional. So we have now:

   -  http;//domain.com/blog/
   -  http;//domain.com/blog/p_1/ <-- This one will lead to 404
   -  http;//domain.com/blog/p_2/
   ............................

Ok, but what with home and home/p_n/ pages? Is not a duplicate description? The answer is:
   No, because now, entire home category and his pages will lead to 404 error. So, no duplicates anymore. And this is the main reason in changing location of static pages.

You can change anytime between a) and b) assigning a static page as home page or setting the home page to None from control panel.


-----------------------------------------------------
The package is here: http://sites.google.com/site/funlw65/software/snews-revolutions
It contains also "keywords and keywords cloud" from Equilni, a fixed CAPTCHA, and Joost mod about future posting. Does include SEF switcher and is still easy to add your own mods...

NOTE:
---------
Thank you to all my testers for a high conduit!
« Last Edit: June 06, 2009, 11:29:36 am by funlw65 »
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #1 on: December 04, 2008, 02:28:00 am »

Updated package.
Repaired db.sql file and "New comments" .

Edit:
----------------------
Is time to make a "Personal Magazine", having this package as a base.

« Last Edit: December 04, 2008, 02:30:05 am by funlw65 »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #2 on: December 04, 2008, 03:36:58 pm »

Thanks for sharing this project Funlw65.
I just installed it on my localhost. The home page displays nicely. When i click the login link I get an "Object not Found" page noting "Error 404" (no "404" in the URL though). So it looks like the login panel is also being blocked out... will dig further in the meantime...

Ahhh... you left the RewriteBase /rev string enabled in the .htacess file ... disabling it let me in.  :)
« Last Edit: December 04, 2008, 03:41:29 pm by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #3 on: December 04, 2008, 10:12:35 pm »

Hello Fun.

I did take a look to your code, you did a good job. Next weekend I will see better because this week was exausted.

Thanks for sharing.

Logged
Need a Job on Europe. Linkdin - Facebook / Group

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #4 on: December 04, 2008, 11:47:55 pm »

Thank you Keys and Rui, I forgot about RewriteBase :( . I like to build on this base of Rui and Joost. It make me feel a little more confident in the final product (even if just blink a green LED :P compared to 1.7 in complexity - anyway, this one still better on SEO :) )...
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #5 on: December 05, 2008, 01:55:44 am »

Oops!!!

One problem (nothing serious, everything is working right until you try to insert Keyword Cloud somewhere on your site... so, not related to Rui package).

The Equilni "Keywords and Keyword Cloud" mod I copy-pasted here, is in strict relation with a mini-mod of mine,  http://snewscms.com/forum/index.php?topic=7142.0.

So, right now, the blue part from EQ mod is working but don't try to use red part  until I will fix it :) . It will look for a field from "settings" table which not exist right now. Really sorry!

EDIT:
-------------------
If you really need to use  "Keyword Cloud" and can't wait, a fast solution is to execute this SQL line in your PHPMyAdmin :
INSERT INTO `settings` (`name`, `value`) VALUES ('tag_step', '1');
This will make the "Keyword Cloud" perfectly usable.

The remaining code is about how to modify that value from control panel, nothing more.
But in one or two days...
« Last Edit: December 05, 2008, 02:46:49 am by funlw65 »
Logged

mosh

  • Hero Member
  • *****
  • Karma: 77
  • Posts: 510
  • Awesome day :)
    • cms-zen
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #6 on: December 05, 2008, 12:34:37 pm »

awesome work vasile  :o
karma ++ 4 u

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #7 on: December 05, 2008, 04:53:03 pm »

Thank you Mosh! :)
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #8 on: December 05, 2008, 09:32:44 pm »

Updated package.
Updated db.sql file and solved "Keyword Cloud" problem... You must change the style for keywords in cloud from image/style.css (at the end of the file). Now, include_file allowed..

This is all... anyone can add what mods need...
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #9 on: December 07, 2008, 04:57:40 pm »

@ Funlw65 or Rui...
What is the purpose of this section of script added to function title? I assume they automatically add their meta description and keywords  into the source code for those specific pages.

Code: [Select]
<?php

//----------------
// Here you can add your own hardcoded page description
//----------------
//end add
if  ($categorySEF == 'blog'){
$dmeta 'Hi, this is my blog page. With the new sNews 1.6 Revolutions fork you have the best blog ever.';
if ($nrpage 0$dmeta .= ' - Page number '.$nrpage;
$kmeta 'blog,journal,weblog,log';
}
if  ($categorySEF == 'archive'){
$dmeta 'This is archive page of '.s('website_title').' site. Here you can see all chronologically listed articles.';
$kmeta 'achive,site archive,article archives';
}
if  ($categorySEF == 'contact'){
$dmeta 'This is contact page of '.s('website_title').' site. Just complete the formula (with a valid email address) and I will contact you soon.' ;
$kmeta 'contact,contact page';
}
if  ($categorySEF == 'sitemap'){
$dmeta 'This is sitemap page of '.s('website_title').' site. You can come here if you forgot the address of a specific page or article.';
$kmeta 'sitemap';
}

?>

« Last Edit: December 07, 2008, 05:00:15 pm by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #10 on: December 08, 2008, 12:47:42 am »

Hello Doug, how are my friend.

That code was develop by Fun, and I agree with him.

I'll explain: In articles you have a dmeta for each article but not for contact, archieve and sitemap.
You can check in this line in title function
Quote
echo '<meta name="description" content="'.(!empty($dmeta) ? $dmeta : s('website_description')).'" />';
This means for contact, archieve and sitemap you have a empty dmeta and show website_description

The purpose is to show a description in Window title (your browser)
Logged
Need a Job on Europe. Linkdin - Facebook / Group

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #11 on: December 08, 2008, 02:44:19 am »

From memory, I think Maxou signaled that first... I will look for a link... <-- Ok, found it in "Suggestions" forum! And first solution was offered by Dom.

Yes, Rui have right, for hardcoded pages like Archive, Contact, Sitemap, and for any hardcoded page (or category) you come up with, you need a hardcoded description and keywords. That's why I left that comment there.

But, for easy internationalization, you need to make language variables. I don't have language variables in that code because is about "official" hardcoded pages and I can't decide alone...

--------------------------
This is just a little package (it needs also Philmoz "insert function" and many other useful mods to be a complete package) which I started for me and to demonstrate how best is this kind of approach (having everything checked and validated before html page generation), as in Rui's Revolutions fork.
« Last Edit: December 08, 2008, 03:34:39 am by funlw65 »
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #12 on: January 19, 2009, 04:18:05 am »

Updated package.
Removed an error from startup function (old function disabled by comment - so, you can compare them).

I'm working to insert SEF switcher mod by Equilni but don't expect it soon... not enough free time for it.
Logged

centered

  • Guest
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #13 on: January 19, 2009, 03:53:13 pm »

Please don't. that idea could be done better.

I started but Joost came up with a better solution about 6 months later.

My old wip solution:
Code: [Select]
define('__site', site()); // Script Location - Use for Home
define('__siteBase', __site.$siteBase); // Link Base - use for all links but Home

function siteBase() {
if (!in_array('mod_rewrite', apache_get_modules()) || !file_exists('.htaccess')) {
$siteBase = 'index.php?page=';
} else {
$siteBase = '';
}
return $siteBase;
}
$siteBase = siteBase();
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Revolutions from RUI - the best sNews 1.6 fork ever!
« Reply #14 on: January 19, 2009, 08:39:13 pm »

Thank you EQ, you saved my life ;D .



Edit:
------------------------------------------
Two variales in settings table:
 - a variable for "automated detection" (if on, try to auto detect; if not, read the second variable)
 - a variable for manual setting of switcher (on/off, as you want)

So, the function can read first variable.
If is on, is trying to autodetect.
Else, read second variable and set the switch accordingly.

Same method can be used for site() function (automated detection or read the path from settings table)
« Last Edit: January 20, 2009, 01:52:35 am by funlw65 »
Logged
Pages: [1] 2