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: Subpages  (Read 11654 times)

Patrik

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 89
    • http://pawe.se/
Subpages
« on: September 14, 2006, 08:37:16 PM »

Hi!

In version 1.4 you could do "pages" that was'nt vissible in any menu so you could make subpages in that way. Just by linking to "invissible" pages. But is that possible in 1.5 some how?

BTW, I absolutely love 1.5! :)

Cheers!
Logged
Visit me: http://pawe.se/

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Subpages
« Reply #1 on: September 16, 2006, 12:28:20 PM »

am trying to figure this out as well.
Logged
Of all the things I have lost, it is my mind that I miss the most.

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
Subpages
« Reply #2 on: September 16, 2006, 03:28:18 PM »

What if you where to just make an ordinary article and just not publish it ? Copy the link from "view" in the articles list, and violà...

Perhaps, like kinda..sort ;)
Logged
"It's only dead fish that goes with the flow... "
Updated

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Subpages
« Reply #3 on: September 16, 2006, 03:47:00 PM »

nup... didn't work.

What is needed, is where an article assigned as a page has the option of being menu linked or not, then it would enable 'hidden' content to be available as sub-pages.
Logged
Of all the things I have lost, it is my mind that I miss the most.

Patric Ahlqvist

  • Nobodys perfect, but Im pretty effing close
  • ULTIMATE member
  • ******
  • Karma: 65
  • Posts: 4867
  • “I'm a self-made man and worships my creator.”
    • p-ahlqvist.com
Subpages
« Reply #4 on: September 16, 2006, 04:11:30 PM »

Would it work if there was a way to make a new page but uncheck publish, which isn't possible now...
Logged
"It's only dead fish that goes with the flow... "
Updated

Patrik

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 89
    • http://pawe.se/
Subpages
« Reply #5 on: September 16, 2006, 04:18:13 PM »

Quote from: Patric
Would it work if there was a way to make a new page but uncheck publish, which isn't possible now...
For me that would work. Thats exatly what I wanted :) It is'nt hard to do but I want to know if I should do it by my self or if Mika and the gang should do it as a feature for the core sNews? I think I would be very handy...
Logged
Visit me: http://pawe.se/

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Subpages
« Reply #6 on: September 20, 2006, 08:05:57 PM »

Well, for any article, 'page' type or normal, there should perhaps be an option to 'hide' from menu system.
An unpublished article should not be accessible by general user under any circumstances.

What I am currently playing with is the following:
1) have added new field to Articles table called 'display_auto' (values 'On' [default] and 'Off')
2) adding to relevant sql statements :-  AND display_auto = 'On'

TODO
3) alter the admin to provide the means to switch off the display (update table) for each article.
4) provide in admin for article/page, the extended seftitle to make a successful link.
-- eg
seftitle would be-  hidden-page-1
extended seftitle would be-  home/hidden-page-1/
which can then be copied and pasted.


What this does, is allow me to publish an article, but not display it if I choose. That then gives me access to these pages/articles as 'subpages' that I can link to from a different article.
Unless change is made in sitemap(), it will still be present there.
Logged
Of all the things I have lost, it is my mind that I miss the most.

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Subpages
« Reply #7 on: September 23, 2006, 05:06:42 AM »

[removed] removed what was here, as it no longer applies[/removed]
BUT....

I now have it fully functioning.
Any article of type 'article ' can be hidden from new articles, page displays via category links, but can be called and display by setting a link from another article.
Page type links no longer appear in menu

Will now just have to go thru' and document what I did.... then will post changes here.

depending on how complex the changes.
Logged
Of all the things I have lost, it is my mind that I miss the most.

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Subpages
« Reply #8 on: September 23, 2006, 04:52:22 PM »

ok, here goes...
Firstly, this is being done from the bottom up, on an unaltered snews.php -- that way the line numbers will be accurate.. sort of.
--------------------------------------------------
In phpmyadmin, or similar, run the following script to add a new field to the articles table. (this works in my db manager anyway (sqlYog).)
Code: [Select]
alter table articles add column display_auto int(3) Default 1 ;then do the following changes to allow the hiding of articles from everything except sitemap, but still have access to them in order to link them in other articles.
--------------------------------------------------
find  line 1512 which looks like
Code: [Select]
mysql_query($query." keywords_meta='$keywords_meta' ".$query_end);insert the following directly after
Code: [Select]
mysql_query($query." display_auto='$display_auto' ".$query_end);--------------------------------------------------
find  line 1470
Code: [Select]
$query = "INSERT INTO ".db('prefix')."articles(title, seftitle, text, date, category, position, displaytitle, displayinfo, commentable, published, description_meta, keywords_meta) VALUES('$title', '$seftitle', '$text', '$date', '$category', '$position', '$display_title', '$display_info', '$commentable', '$publish_article', '$description_meta', '$keywords_meta')";replace with
Code: [Select]
$query = "INSERT INTO ".db('prefix')."articles(title, seftitle, text, date, category, position, displaytitle, displayinfo, commentable, published, description_meta, keywords_meta, display_auto) VALUES('$title', '$seftitle', '$text', '$date', '$category', '$position', '$display_title', '$display_info', '$commentable', '$publish_article', '$description_meta', '$keywords_meta', '$display_auto')";--------------------------------------------------
find  line 1323
Code: [Select]
$publish_article = ($_POST['publish_article'] == 'on' || $position > 1) ? 1 : 0;insert the following directly after
Code: [Select]
$display_auto = ($_POST['display_auto'] == 'on' || $position > 1) ? 1 : 0;--------------------------------------------------
find  line 1253 to show in admin view, which pages you have hidden
Code: [Select]
echo  l('divider').' '.l('edit').' ';insert the following directly after
Code: [Select]
if ($r['display_auto'] == 0){echo l('divider').l('hidden_page').l('divider');}/* shows hidden in admin*/--------------------------------------------------
find  line 1160 // ARTICLES FORM
Code: [Select]
html_input('checkbox', 'publish_article', 'pu', 'YES', l('publish_article'), '', '', '', '', $frm_publish, '', '', '', '', '');insert the following directly after
Code: [Select]
html_input('checkbox', 'display_auto', 'dy', 'YES', l('make_visible'), '', '', '', '', $frm_visible, '', '', '', '', '');--------------------------------------------------
find  line 1134 // ARTICLES FORM
Code: [Select]
$frm_publish = 'ok';insert the following directly after
Code: [Select]
$frm_visible = 'ok';--------------------------------------------------
find  line 1115 //ARTICLES FORM
Code: [Select]
$frm_publish = $r['published'] == 1 ? 'ok' : '';insert the following directly after
Code: [Select]
$frm_visible = $r['display_auto'] == 1 ? 'ok' : '';--------------------------------------------------
find  line 720 // MENU ARTICLES
Code: [Select]
$query = "SELECT * FROM ".db('prefix')."articles WHERE position = 1 AND published = 1 ORDER BY id DESC LIMIT $start, $size";replace with
Code: [Select]
$query = "SELECT * FROM ".db('prefix')."articles WHERE position = 1 AND published = 1 AND display_auto = 1 ORDER BY id DESC LIMIT $start, $size";--------------------------------------------------
find  line 615 //ARCHIVES
Code: [Select]
$query = "SELECT * FROM ".db('prefix')."articles WHERE position = 1 AND published = 1 ORDER BY date DESC";replace with
Code: [Select]
$query = "SELECT * FROM ".db('prefix')."articles WHERE position = 1 AND published = 1 and display_auto = 1 ORDER BY date DESC";--------------------------------------------------
find  line 440 //CENTER
Code: [Select]
$query_articles .= " AND position <> 3 ORDER BY date DESC";replace with
Code: [Select]
$query_articles .= " AND position <> 3 AND display_auto = 1 ORDER BY date DESC";--------------------------------------------------
find  line 337 // DISPLAY PAGES
Code: [Select]
$query = "SELECT * FROM ".db('prefix')."articles WHERE position = 3 ORDER BY id";replace with
Code: [Select]
$query = "SELECT * FROM ".db('prefix')."articles WHERE position = 3 AND display_auto = 0 ORDER BY id";If you want type "Pages" to display in the menu, omit this change
--------------------------------------------------
find  line 174 //LANGUAGE VARIABLES => ADMINISTRATION LANGUAGE VARIABLES => article structure
Code: [Select]
$l['side'] = 'Extra contents';insert the following directly after
Code: [Select]
$l['make_visible'] = 'Make visible';
$l['hidden_page'] = 'Hidden page';
--------------------------------------------------
Logged
Of all the things I have lost, it is my mind that I miss the most.

Wim van Zijl

  • Newbie
  • *
  • Karma: 0
  • Posts: 39
    • http://iwonttelluntillitsdone.com
Subpages
« Reply #9 on: September 25, 2006, 11:23:52 AM »

whoa, that's quite a guide you wrote there,

At work (yes we have to sometimes don't we) we have a horrible mastodonth of a CMS with one nice feature which does actually just what is asked,
it hides articles from being indexed for search and automatically sitemap by just unchecking the "Index this" part.
from reviewing you code philmoz, i think that what you did comes close.
when 1.5 goes final, i'll implement this to see how this works.
Logged
sessionmedia poorly chosen domainname, my playground
excercise!

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Subpages
« Reply #10 on: September 25, 2006, 07:30:22 PM »

Quote from: luchtkracht
whoa, that's quite a guide you wrote there,

At work (yes we have to sometimes don't we) we have a horrible mastodonth of a CMS with one nice feature which does actually just what is asked,
it hides articles from being indexed for search and automatically sitemap by just unchecking the "Index this" part.
from reviewing you code philmoz, i think that what you did comes close.
when 1.5 goes final, i'll implement this to see how this works.
It wouldn't take much to remove articles from the sitemap with what I have done above, and I would think it would be the same for search.
In fact to hide from search....
find the following in //SEARCH ENGINE
Code: [Select]
$query = "SELECT * FROM ".db('prefix')."articles WHERE SUBSTRING(position, 1, 1) != '2' AND published = 1 AND";and make it like
Code: [Select]
$query = "SELECT * FROM ".db('prefix')."articles WHERE SUBSTRING(position, 1, 1) != '2' AND published = 1 AND display_auto = 1 AND";and to remove from sitemap, find the following in  //SITEMAP
Code: [Select]
$art_query = "SELECT * FROM ".db('prefix')."articles WHERE position = 1 AND published = '1' ";and make like this
Code: [Select]
$art_query = "SELECT * FROM ".db('prefix')."articles WHERE position = 1 AND published = '1'  AND display_auto = 1";Indeed, with some really fancy coding, similar to the publish routine, you could use the new field to set separate levels of hiding, but I'm not even going to attempt that yet :D
Logged
Of all the things I have lost, it is my mind that I miss the most.

Datu Puti

  • Newbie
  • *
  • Karma: 0
  • Posts: 43
Subpages
« Reply #11 on: November 28, 2006, 12:40:02 PM »

So this MOD will allow you to make pages articles etc unpublished and they won't show up in the menu links? but u can still link to them?

For example i made a center article unpublished called nation of china..

It doesn't show up in the center function of snews but when i link to it E.G. Click here ( i got the link from the view URL of sNews from the admin panel) It just says "No Content Yet" so how do i get the article to show up? I just don't want it showing up in the menu links or in the main content of sNews.. Just sort of a hidden page that can only be accessed if i link to it..

thnx
Logged
Regards from the beautiful 7000 Islands of the Philippines! Mabuhay!

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Subpages
« Reply #12 on: November 29, 2006, 11:20:25 AM »

Quote from: ilocoskid
So this MOD will allow you to make pages articles etc unpublished and they won't show up in the menu links? but u can still link to them?

For example i made a center article unpublished called nation of china..

It doesn't show up in the center function of snews but when i link to it E.G. Click here ( i got the link from the view URL of sNews from the admin panel) It just says "No Content Yet" so how do i get the article to show up? I just don't want it showing up in the menu links or in the main content of sNews.. Just sort of a hidden page that can only be accessed if i link to it..

thnx
No, this  doesn't affect the publishing routine.. it simply allows you to hide a published article from the rest of the article engine.

This requires an alteration to the database (first line of long post), and all the additions as mentioned above...

You will then have a NEW check box in the admin, that will allow you to set an article as hidden from the world. This then allows you to link to it, include it.
Logged
Of all the things I have lost, it is my mind that I miss the most.

Vorsoron

  • Newbie
  • *
  • Karma: 0
  • Posts: 25
Subpages
« Reply #13 on: December 04, 2006, 02:03:42 PM »

Anyway of getting this to work with 1.5? (final release)
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Subpages
« Reply #14 on: December 09, 2006, 12:20:20 PM »

Quote from: Vorsoron
Anyway of getting this to work with 1.5? (final release)
will look at it sometime before xmas... I hope... to see what needs to be altered.
Logged
Of all the things I have lost, it is my mind that I miss the most.
Pages: [1] 2