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: Page text-links listed by Category & Sub-Category with Article links  (Read 3880 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca

This Mod package carries forward and produces additional functionality (and a bit more) as did the Articles AND PAGES assigned to Categories (1.6 mod) ... in that text-links to all Admin-created pages are now visible in the combined Categories & Subcategories menu list, as well as in other menus and in the Archive & Sitemap pages.

If you are interested in having this added functionality, you can Download the Package Here and install it the same way you would a normal, default sNews 1.7 package.

An explanation of what's what is included at the top of the readme_1st file, also included in the package.

I hope others find is as useful as I will.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Creatium

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 55
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #1 on: November 17, 2009, 08:01:41 PM »

Hello,
thank you for this mod. There is still one problem. I still can't asign page to category. When i select category from drop list in page editing menu and press save it shows that everything was saved perfecly. But page is still not in category. I tried to asign page to category directly through phpmyadmin (mysql) and it worked. But it still would be good, if i could asign web to category through page, not the phpmyadmin.
« Last Edit: November 17, 2009, 08:08:03 PM by Creatium »
Logged
Aurea praxis, sterilis theoria.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #2 on: November 17, 2009, 09:01:42 PM »

Hello,
thank you for this mod. There is still one problem. I still can't asign page to category. When i select category from drop list in page editing menu and press save it shows that everything was saved perfecly. But page is still not in category. I tried to asign page to category directly through phpmyadmin (mysql) and it worked. But it still would be good, if i could asign web to category through page, not the phpmyadmin.

I am not able to replicate your problem.

Did you install the package from the download link?
Are you running it on localhost or online? (not that it should matter)

If your page's category number is set to '0' in the table data, then it should be listed under the "Uncategorized" category and you should see it there when you click the "Uncategorized" category title to expand it in the Categories menu list. This is how it's working on my localhost install.

To be sure, I just made a new page, chose "Uncategorized" from the drop-down and it was saved with category number '0' and showed up under the "Uncategorized" title in the categories menu. I then edited it a few times, re-assigning it to a few other sub-categories and categories. The category number changed accordingly in the articles table, and it appeared where it should have every time.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Creatium

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 55
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #3 on: November 17, 2009, 09:22:55 PM »

I'm running it online. And yes, I installed it from download link (I just replaced old functions with new ones out of this mod). In mysql categories table all categories start with number 5. One category is number 1 and it is news. Other categories that I've just created are 5,6,etc.
Logged
Aurea praxis, sterilis theoria.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #4 on: November 18, 2009, 02:27:03 AM »

(I just replaced old functions with new ones out of this mod). In mysql categories table all categories start with number 5. One category is number 1 and it is news. Other categories that I've just created are 5,6,etc.

A word of caution... it is not enough to just copy over the functions. There are also a number of queries in several other functions that require a change to the position value... changing position = 1 (which returns articles only) to position IN (1,3) ... which returns both articles (1) and pages (3) in the same query.

The package also includes the snews_pic_dev.php file, which has comment notes at every mod location throughout the file. Search the file with Nov.14.09 (as noted at the top of that file) and you will find them all. There is also one additional language variable/value added to the lang/EN.php file - $l['articles_pages'] = 'Articles and Pages'; - which is required in the modded sitemap function.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Creatium

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 55
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #5 on: November 18, 2009, 08:10:08 PM »

I copied all the functions exacly from that snews_pic_dev.php file. Functions who were comented as you say with Nov 14.... . Should i change all the "position = 1" to "position IN (1,3)" in all the snews file?
Logged
Aurea praxis, sterilis theoria.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #6 on: November 18, 2009, 09:06:10 PM »

I copied all the functions exacly from that snews_pic_dev.php file. Functions who were comented as you say with Nov 14.... . Should i change all the "position = 1" to "position IN (1,3)" in all the snews file?

No, just the ones that are noted as changed with a comment. You can search the file for IN (1,3) to find all the ones that have it changed from position = 1
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Creatium

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 55
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #7 on: November 18, 2009, 10:12:19 PM »

Ok, I've changed that thing. It was only in 1 place - menu articles function. But the problem still persists. It looks like the form doesnt make change to mysql. Saying form, I mean only a drop down menu. And I saw that in sitemap I can't see pages asigned to categories and sub-categories (pages asigned through phpmyadmin).
Logged
Aurea praxis, sterilis theoria.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #8 on: November 19, 2009, 02:51:38 AM »

If Sitemap is not showing pages that have been assigned to categories or subcategories, then you probably have not changed your function sitemap accordingly. The sitemap function in the modded package is different than the one normally in a default 1.7 package. This is the function you need to display pages in categories & subcategories:

Code: [Select]
<?php

// SITEMAP - shows links to pages & articles in categories & subcategories: position IN (1,3)
function sitemap() {
echo '<h2>'.l('sitemap').'</h2>';
echo '<p>';
$link '<a href="'._SITE;
echo $link.'"><strong>'.l('home').'</strong></a> '.l('divider').' '// Home is not really a page.
echo $link.'archive/"><strong>'.l('archive').'</strong></a> '.l('divider').' '// archive
echo $link.'contact/"><strong>'.l('contact').'</strong></a>'// contact
echo '</p>';
echo '<h3><strong>'.l('articles_pages').'</strong></h3>';
echo '<ul>';
$art_query 'SELECT title, seftitle, date FROM '._PRE.'articles'.' WHERE position IN (1,3) AND published = 1 AND visible = \'YES\'';
$cat_query 'SELECT id, name, seftitle, description, subcat FROM '._PRE.'categories'.' WHERE published = \'YES\' AND subcat = 0 ORDER BY catorder,id';
$cat_result mysql_query($cat_query);
if (mysql_num_rows($cat_result) == 0) {
    echo '<li>'.l('no_articles').'</li></ul>';
} else {
    while ($c mysql_fetch_array($cat_result)) {
$category_title $c['seftitle'];
echo '<li><strong><a href="'._SITE.$category_title.'/" title="'.$c['description'].'">
'
.$c['name'].'</a></strong>';
$catid $c['id'];
$query $art_query.' AND category = '.$catid.' ORDER BY id DESC';
$result mysql_query($query);
if (mysql_num_rows($result) > 0) {
    echo '<ul>';
}
while ($r mysql_fetch_array($result)) {
    echo '<li>'.l('divider').'  <a href="'._SITE.$category_title.'/'.$r['seftitle'].'/">'.$r['title'].'</a></li>';
}
if (mysql_num_rows($result) > 0) { echo '</ul>'; }
$subcat_result mysql_query('SELECT id, name, seftitle, description, subcat FROM '._PRE.'categories'.' WHERE published = \'YES\' AND subcat = '.$c['id'].' ORDER BY catorder ASC');
if (mysql_num_rows($subcat_result) > 0) {
    echo '<ul>';
}
while ($s mysql_fetch_array($subcat_result)) {
    $subcat_title $s['seftitle'];
    $subcat_name $s['name'];
    echo '<li class="subcat"><strong><a href="'._SITE.$category_title.'/'.$subcat_title.'/" title="'.$s['description'].'">'.$subcat_name.'</a></strong>';
    $subcatid $s['id'];
    $query $art_query.' AND category = '.$subcatid.' ORDER BY id DESC';
    $artresult mysql_query($query);
    if (mysql_num_rows($artresult) > 0) { echo '<ul>'; }
    while ($r mysql_fetch_array($artresult)) {
echo '<li class="subcat">'.l('divider').'<a href="'._SITE.$category_title.'/'.$subcat_title.'/'.$r['seftitle'].'/">'.$r['title'].'</a></li>';
                    }
    if (mysql_num_rows($artresult) > 0) { echo '</ul>'; }
    echo '</li>';
}
if (mysql_num_rows($subcat_result) > 0) { echo '</ul>'; }
echo '</li>';
    }
    echo '</ul>';
}
}

?>

Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Creatium

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 55
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #9 on: November 19, 2009, 10:31:14 AM »

Nop. It still doesnt work. I'll try to install snews on my pc as a host.

Everything is fixed now. I saw, that I missed edited lines in processing function, what coused all the problems. Thank you, Keyrocks, for your help and this mod!
« Last Edit: November 19, 2009, 04:03:58 PM by Creatium »
Logged
Aurea praxis, sterilis theoria.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #10 on: November 19, 2009, 06:33:51 PM »

Everything is fixed now. I saw, that I missed edited lines in processing function, what coused all the problems. Thank you, Keyrocks, for your help and this mod!

I'm glad to see you have it working now. There are quite a few mod/change locations throughout the file.
Definitely, the ones in function processing are the most important because... without them... changes do not get updated in the articles table.  ;D
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

sibas

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 451
    • www.simply4all.net
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #11 on: January 08, 2010, 11:32:19 AM »

This is fantastic mod/package Keyrocks :)
I wonder if is possible this mod to work with Multiple Areas for Categories by Rui Mendes or H.A.C mod for sNews 1.7
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #12 on: January 08, 2010, 02:53:21 PM »

This is fantastic mod/package Keyrocks :)
I wonder if is possible this mod to work with Multiple Areas for Categories by Rui Mendes or H.A.C mod for sNews 1.7

It should work with Rui's Multiple Areas for Categories Mod... I have it working OK with it in a 1.6 package.
I am not sure which of H.A.C.s 1.7 mods you are referring to.
I know it works fine with Bakercad's 1.6.3 MU package.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #13 on: February 04, 2010, 01:09:17 PM »

Just gave a try Doug EDIT: on the downloaded package.
Almost working well.

When I want to see a cat its lists the pages in this cat. Okey
When asking to see a subcat, it prints pages list from the cat too, but
it lists also articles from another category. :o

EDIT: bug in the breadcrumb function?
Sub cats for pages aren't printed as links.

EDIT:
no Show on Home page box in the backend

« Last Edit: February 05, 2010, 08:18:13 AM by Sven »
Logged

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: Page text-links listed by Category & Sub-Category with Article links
« Reply #14 on: January 21, 2011, 07:20:22 PM »

Hi Keyrocks,
I just find your MOD. I was looking for something like that.
I just make a little test with your package and it's working BUT if we want to use name in two part in Categorie like :

First  Category  it's not valid xhtml because there is an id in <ul> (<ul id="First Category  style="display: none;"> and an id cannot be in two words.

Any change possible on this point ? I guess not

Anyway thanks for this.
« Last Edit: January 21, 2011, 09:12:08 PM by stephane »
Logged
Pages: [1] 2