Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: [MOD] MyPosts, or Vasile's Menu Articles With Intro Text for 1.7 with subcats  (Read 5537 times)

MartinJoph

  • Newbie
  • *
  • Karma: 0
  • Posts: 17

Okie doke..

this is really starting to work out now:) I have all that code implemented and have managed to make some progress with the site:).

I was just wondering though, is there a way to make the comments link clickable so it takes you to the comment?.. I tried searching through the code, but I don't understand some of the syntax.

Thanks

Martin
Logged

Keyrocks

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

To make the word 'Comments" a link to the comments for a given article in the // LEAD ARTICLES function:


1. In your lang/EN.php language file, locate $l['comment'] = 'Comment';
   and under it, copy and paste in $l['comments_for'] = 'comments for';

2. If you are using the // LEAD ARTICLES function I posted on the previous page,
   Locate the second last echo string in the function:
   echo '<div class="artinfo">'.$date.'&nbsp;-&nbsp;<span class="uline">'.$comments_num.' '.l('comments').'</span></div>';

   Comment it out (put // at the start) and above it, copy and paste (excluding the PHP tags):
Code: [Select]
<?php

# Link to Comments:
echo '<p class="lead-info">'.$date.'&nbsp;|&nbsp;'.$comments_num.' <a href="'._SITE.$link.'/'.$r['asef'].'/#'.l('comment').'1" title="'.l('view').' '.$comments_num.' '.l('comments_for').' '.$r['title'].'">'.l('comments').'</a></p>';


?>

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

MartinJoph

  • Newbie
  • *
  • Karma: 0
  • Posts: 17

Thanks KeyRocks:)

I've been getting on really well with it, since I implemented the other code you gave. I will go and hack this one in now.. THANKS!.:).  I think this is probably the furthest I've got with it so far..

Many thanks for this..

M
Logged

jander

  • Newbie
  • *
  • Karma: 0
  • Posts: 12
Menu Articles With Intro Text for 1.7 with subcats HELP!!
« Reply #18 on: October 01, 2011, 11:27:08 AM »

Hello
I am playing and working with snews, the 1.7.1.  version
I am trying to make menu article (latetsest news with a small intro) for snews 1.71

Implanted the //MENU INCAT (JOOST) ( http://snewscms.com/forum/index.php?topic=7854.0)
but with all the suggestions of mypost.php and lead_articles.php the making of a lead of 200 signs does"n"t seem to wrk
Can some some one explain (mayabe again) how to implant this mod to create teh lead in article as shows in
http://snewscms.com/forum/index.php?topic=5780.msg46814#msg46814 written by Keyrocks (see image)

I made a file calles myposts.php
I put --include('myposts.php'); include('snews.php');-- in the index.php
I put <?php myposts(1,0,5); > in my template
What it show is only the article lead of the "home" page
If I want to se the other categories in this lists but nothing shows except the firts - home-  page!!
f.e.<?php myposts(2,0,5); >

How can I get the other categories visitible in this lists?

jander
 ???
« Last Edit: October 26, 2011, 07:02:12 PM by jander »
Logged

jander

  • Newbie
  • *
  • Karma: 0
  • Posts: 12

anyone  ?
who can help me with the question above?

jander

 :'(
« Last Edit: October 26, 2011, 07:02:30 PM by jander »
Logged

mosh

  • Hero Member
  • *****
  • Karma: 77
  • Posts: 510
  • Awesome day :)
    • cms-zen

Hi jander,
Did you close the php tags correct

In your post you wrote --  <?php myposts(1,0,5); >

Should be like this --  <?php myposts(1,0,5); ?>

jander

  • Newbie
  • *
  • Karma: 0
  • Posts: 12

Hello Mosh
For a moment i hoped you were right but sorrie i made a typing error in this forum
Ik have it in the website as you wrote it with -?- at the end


strangley when i put
<?php myposts(0,0,5); ?> in my text after following all the instructions as explained above I do get de firset (home) page)
but changinging  in
<?php myposts(0,1,5); ?> or
<?php myposts(1,0,5); ?>
i don't get anything of my text

so it does work but it takes only the homepage item

So I started all over again (effort 12) and YES!!!
the problem was within the category ID in the dbase
the first number..
I looked it up in the dbase and put the number which is showing in the table catgories..... yes
it works!!

jander
« Last Edit: November 01, 2011, 10:26:22 AM by jander »
Logged

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa

It's a little confuse what you want.
I put myposts function and tried, and works fine.

I don't know if you have a bug or if your mysql is old, I rewrite this function and tell me if this works
Quote
function myposts($cat, $start, $size) {
   $catQuery = 'SELECT c.id
      FROM '._PRE.'categories'.' AS c '.$join.'
      WHERE c.subcat = '.$cat.' AND c.published = \'YES\'
      GROUP BY c.id
      ORDER BY c.catorder,c.id';
   $catResult = mysql_query($catQuery);
   $count = mysql_num_rows($catResult);
   if ($count > 0) {
      $cR = mysql_fetch_assoc($catResult);
      $cR = implode(',',$cR);
      $cat = $cat.','.$cR;
   }
   $cat = str_replace(',',' OR category =',$cat);
   $cat = !empty($cat) ? ' AND (category = '.$cat.')' : '';

$query = '
   SELECT
      title,a.seftitle AS asef,date,text,
      c.name AS name,   c.seftitle AS csef,
      x.name AS xname,x.seftitle AS xsef
   FROM '._PRE.'articles AS a
...
« Last Edit: November 01, 2011, 12:59:33 PM by Rui Mendes »
Logged
Need a Job on Europe. Linkdin - Facebook / Group

roie

  • Newbie
  • *
  • Karma: 1
  • Posts: 32

Trying this now, thanks!
Logged
Pages: 1 [2]