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: Multiple things needed, mulitple awards possible.  (Read 3242 times)

Slickwilly789

  • Newbie
  • *
  • Karma: 0
  • Posts: 19
Multiple things needed, mulitple awards possible.
« on: November 30, 2008, 07:33:24 PM »

Hey gents,

I've been using snews to build a site while learning php. To say the least I'm learning it slowly, too slowly to effectively and efficiently create a site in the time alloted to me, thats what happens when you volunteer to do something for your work.... But alas, I will be paying someone, maybe even somebodies, to help me finish up some coding with my snews app.

If anyone is interested, please PM me and we can talk payment options. I'm serious about getting this done, so serious enquirers only need apply. As long as it is alright with whomever takes this/these projects on, I would release the mods/addons to the snews community to further help the development of snews, free of charge.. think of it as a donation to continuing the development of snews. . 

1.) Subpage implementation. I've used several mods already to try and turn snews from a blog cms system to more of "page" cms system.. I still use the article portion in a resource section. However, I cannot list sub pages under pages in the current snews 1.7 base i am using. and it seems that the mods for 1.6 are not available for download anymore. This may be pretty complex, so we might need to discuss this separately.

Examples:
mysite.com/environment/
mysite.com/environment/faq
mysite.com/environment/stocked-paper

2.)On my homepage, I've used the function list latest articles... which is to have a place that shows the latest articles that users can see and click on. Right now, it shows only the title of the article and links it to the article. What I am aiming at is it to A.) List the date of the article published B.) List a set number of characters, or sentences, to display (sort of a intro) C.) list the Read-More Link

Example:
Date Published Article Name  - Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam tristique. Vivamus velit lectus, fringilla sed, bibendum at, venenatis sed, augue. Fusce dui mauris, posuere bibendum, sodales ac, laoreet mattis, nibh.... Read More


I'll have other things to come that need to be done. Once an agreement made between myself and another party, I will zip and release my modded sNews 1.7 package and database.
« Last Edit: November 30, 2008, 07:35:01 PM by Slickwilly789 »
Logged

jlhaslip

  • Sr. Member
  • ****
  • Karma: 16
  • Posts: 374
    • My snews with AEF Forum site
Re: Multiple things needed, mulitple awards possible.
« Reply #1 on: November 30, 2008, 10:17:34 PM »

Have you seen the Lite version by Equilini?

http://snewscms.com/forum/index.php?topic=7720.0
Logged
Yes! I have no siggy.

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: Multiple things needed, mulitple awards possible.
« Reply #2 on: December 01, 2008, 02:50:39 PM »

1. This Tutorial will take you through the steps to modify a 1.6 package so that it will allow you to post both Articles AND Pages by Category.

Example: Create a category called Environment and post pages under it called Saving Water and Weekend Recycling and the URLs to them would be:
- http://mysite.com/environment/saving-water
- http://mysite.com/environment/weekend-recycling

2. Here is a generic function that can be used to display article leads for Articles, or Pages, or Both. It was done for 1.6 but it will work equally well with 1.7.
   Just copy the complete script below into a new PHP file called content_leads.php (or whatever you like) and save it.

Code: [Select]
<?php
/* -----------------------------------------------------------------------
   content_leads.php
   By: keyrocks, Oct.17.07   
-----------------------------------------------------------------------*/

// CONTENT LEADS: ARTICLES or PAGES or BOTH
function content_leads($start$size) {
# THREE QUERY OPTIONS - Only one can be active. Content is ordered by Date in descending order (latest to oldest)
# 1. SELECT PUBLISHED ARTICLES
$query "SELECT * FROM ".db('prefix')."articles WHERE position = 1 AND published = 1 ORDER BY date DESC LIMIT $start$size";
# 2. SELECT PUBLISHED PAGES
$query "SELECT * FROM ".db('prefix')."articles WHERE position = 3 AND published = 1 ORDER BY date DESC LIMIT $start$size";
# 3. SELECT PUBLISHED ARTICLES and PAGES
$query "SELECT * FROM ".db('prefix')."articles WHERE position IN (1,3) AND published = 1 ORDER BY date DESC LIMIT $start$size";
$result mysql_query($query);
if (!$result || !mysql_num_rows($result)) {
        echo '<ul><li>'.l('no_articles').'</li></ul>';
        } else {
$home l('home_sef');
while ($r mysql_fetch_array($result)) {
$text $r['text']; // new string
$date date(s('date_format'), strtotime($r['date']));
$categorySEF find_cat_sef($r['category']);
$title $r['category'] == $home retrieve('name''categories''seftitle'$categorySEF);

# SHOW CONTENT LEADS: title, date published, lead text, and "read more" link.
                
echo '<p class="leads"><strong>'.$r['title'].'</strong>&nbsp;-&nbsp;'.$date.'</p>'.substr($text,0,100).'...'
.'<a href="'.db('website').$categorySEF.'/'.$r['seftitle'].'/" title="Read more about '.$title.'"> read more</a></p>';

}}}

?>


Purpose: - Display the latest content as short leads complete with: title, date-line, intro lead-in text, and a "read more" link.
   
Location: - Locate this file in a mods folder in your site root.
   
Inclusion: - Include this file wherever you are including snews.php by inserting: include ('mods/content_leads.php');

Options: - Three Query options are provided. Only one can be active.
   1. selects and displays only published Articles.
   2. selects and displays only published Pages.
   3. selects and displays both published Articles and Pages.

   You can replicate the function, re-name it, use one for articles only and one for pages only.
   
Display: - Content leads are displayed within the template (index.php) file by inserting (where you want it in the template):
   <ul> <?php content_leads(0,3); ?> </ul>

How Many: - The number values in brackets determine which of the latest entries will be the 1st one shown, followed by the number of
      entries to be shown. By default: lead_articles(0,3); starts with 1st, shows 3.

Lead Length: - The amount of "content lead" text displayed is determined by the number of characters set as the SECOND number in brackets near the end of the first string - ($text,0,100) under # SHOW CONTENT LEADS: - in the function above. In this case it is 100 characters. Increase or decrease as needed.
      
Styling: - You can add css styles to the # SHOW CONTENT LEADS: string as required, ensuring that the style declarations are included in stylesheets for all templates.
« Last Edit: December 01, 2008, 09:58:48 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Fred K

  • Still trying to learn stuff
  • ULTIMATE member
  • ******
  • Karma: 130
  • Posts: 2728
    • Personal
Re: Multiple things needed, mulitple awards possible.
« Reply #3 on: December 01, 2008, 02:57:18 PM »

Regarding point 2) there's this mod for 1.7 that does precisely what you're asking for, and you can pull content from subcategories as well as parent categories. Could be worth looking into, imho.
Logged

Slickwilly789

  • Newbie
  • *
  • Karma: 0
  • Posts: 19
Re: Multiple things needed, mulitple awards possible.
« Reply #4 on: December 04, 2008, 04:43:53 AM »

Thanks Key and Agent! Working on them both now!  ;D
Logged