Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Auto Add [break] for links only on Home Page?  (Read 2804 times)

Kfact

  • Newbie
  • *
  • Karma: 0
  • Posts: 2
Auto Add [break] for links only on Home Page?
« on: October 10, 2008, 07:18:43 am »

Hello,

I was wondering if there was a way to just get the home page to display a list of links, without any teaser text. Just a straight list of several headlines that link to the full article. (Basically what the New Articles area on the left menu does, only to full effect in the center.)

I am aware of the [break] function, but is there a better way to have this [break] function be automatically put into a new article so it will just display as a link on the front end? I tried a brute force method of just adding the [break] function as a value in the textarea, but it will always then duplicate itself in the textarea, should the user want to edit the page. I'm not a programmer so I can't easily 'clone' or 'create' a new function without a walkthrough.

Any ideas on how this can be accomplished?

Thanks for any help.

Logged

Joost

  • Guest
Re: Auto Add [break] for links only on Home Page?
« Reply #1 on: October 10, 2008, 07:57:04 am »

If you want to replace the teasers on the frontpage with a list, look for function center
In the last line of the first switch, replace

Code: [Select]
case isset($_GET['articleid']): $articleid = get_id('articleid'); break;
with

Code: [Select]
default : menu_articles(0,30); return;
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Auto Add [break] for links only on Home Page?
« Reply #2 on: October 10, 2008, 08:26:06 am »

If you want to replace the teasers on the frontpage with a list, look for function center
In the last line of the first switch, replace

Code: [Select]
case isset($_GET['articleid']): $articleid = get_id('articleid'); break;
with

Code: [Select]
default : menu_articles(0,30); return;


Yes, but it will loose the look of titles and infoline... a good (and fast way) is to prepend [break] string to '$text', when values are collected from add/edit form article, to be put in mysql table... 

In function processing replace this line:
   $text = clean($_POST['text']);
with this
   $text = '[break]'.clean($_POST['text']);

EDIT:
-------------------------------
Not tested, of course...
P.S. I hope MU version does not differ too much from sNews 1.6  .... :P
« Last Edit: October 10, 2008, 08:54:40 am by funlw65 »
Logged

Kfact

  • Newbie
  • *
  • Karma: 0
  • Posts: 2
Re: Auto Add [break] for links only on Home Page?
« Reply #3 on: October 10, 2008, 05:51:32 pm »

I appreciate the quick responses. This solution worked for me, thanks again.
Logged