Author Topic: I am looking to add browse down latest news on page main  (Read 5701 times)

Offline 7eway

  • Full Member
  • *****
  • Posts: 21
  • Karma: +0/-0
I am looking to add browse down latest news on page main
« on: April 25, 2012, 03:15:35 PM »
phpEnter Web Hosting
Hello,

I am looking to add browse news down on page main or home page

Any help please

Exemp. thumbnail here


[attachment=0]main-brows.jpg[/attachment]

Thank you
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »

Offline Jeremy

  • Full Member
  • *****
  • Posts: 238
  • Karma: +1/-0
Re: I am looking to add browse down latest news on page main
« Reply #1 on: April 26, 2012, 05:05:15 AM »
Hi 7eway, try with this files.
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »
Social Bookmarking Script markerpaper.com

Offline 7eway

  • Full Member
  • *****
  • Posts: 21
  • Karma: +0/-0
Re: I am looking to add browse down latest news on page main
« Reply #2 on: April 26, 2012, 01:04:55 PM »
Quote from: "Jeremy"
Hi 7eway, try with this files.

Thank you Jeremy so so much  :)  :)  :)  :)

It works well  ;)
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »

Offline irshadv

  • Newbie
  • *****
  • Posts: 4
  • Karma: +0/-0
Re: I am looking to add browse down latest news on page main
« Reply #3 on: June 14, 2012, 01:31:30 PM »
How to display specified category in this place
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »

Offline Michael

  • Full Member
  • *****
  • Posts: 115
  • Karma: +0/-0
Re: I am looking to add browse down latest news on page main
« Reply #4 on: June 29, 2012, 09:26:37 PM »
Quote from: "irshadv"
How to display specified category in this place

Code: [Select]
e.g. category id 7


Find this code in your [templates/classic/main.php]

Code: [Select]
{if $newser[newser].editor eq 2}
{$newser[newser].bamess|stripslashes|truncate:160}
{/if}
</div>
{/if}
{/section}


Immediately after this, paste the following code:



Code: [Select]
<br /><span class="ha4">My Category</span><br />
{section name="newser" loop=$newser}
{if $newser[newser].idblog eq 7}
{if $rewrite == 1}
<a href="{$newser[newser].univer}-{$newser[newser].btexty|urlencode|replace:'%':'-'|replace:'/':'-'|wordwrap:14:"n":true}.html"><span class="ha3">{$newser[newser].btexty|stripslashes|truncate:50}</span></a><br />
{/if}
{if $rewrite == 2}
<a href="news.php?name={$newser[newser].univer}"><span class="ha3">{$newser[newser].btexty|stripslashes|truncate:50|wordwrap:14:"n":true}</span></a><br />
{/if}
{if $newser[newser].editor eq 2}
{$newser[newser].bamess|stripslashes|regex_replace:"/[r]/":"<br />"|truncate:988}<br /><br />
{/if}
{if $newser[newser].editor eq 1}
{$newser[newser].bamess|htmlspecialchars_decode|truncate:1310|CloseTags}<br /><br />
{/if}
{/if}
{/section}
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »

Offline irshadv

  • Newbie
  • *****
  • Posts: 4
  • Karma: +0/-0
Re: I am looking to add browse down latest news on page main
« Reply #5 on: July 04, 2012, 06:17:50 PM »
Thanks :)  :)  :)
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »

Offline irshadv

  • Newbie
  • *****
  • Posts: 4
  • Karma: +0/-0
Re: I am looking to add browse down latest news on page main
« Reply #6 on: July 04, 2012, 10:03:34 PM »
its working but its showing all article in the category, how to set 1st 2 articles on specified category in main page
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »

Offline alexa

  • Administrator
  • Full Member
  • *****
  • Posts: 255
  • Karma: +0/-0
Re: I am looking to add browse down latest news on page main
« Reply #7 on: July 05, 2012, 01:24:09 AM »
index.php

find:
Code: [Select]
$resulty = mysql_query("select * from newser order by blogid desc limit 18") or die("A MySQL error has occurred. Error: (" . mysql_errno() . ") " . mysql_error());
while ($nrow = mysql_fetch_array($resulty)) {
    $val[] = $nrow;
}

replace:
Code: [Select]
$resulty = mysql_query("select * from newser order by blogid desc limit 18") or die("A MySQL error has occurred. Error: (" . mysql_errno() . ") " . mysql_error());
while ($nrow = mysql_fetch_array($resulty)) {
$val[] = $nrow;
if($nrow['idblog'] == 7){
$bval[] = $nrow;
}
}

find this code:
Code: [Select]
$smarty->assign('newser', $val);
and put the following code after:
Code: [Select]
$smarty->assign('cat', $bval);
themes/X/main.php
Code: [Select]
{foreach from=$cat item=c}
{if $c@iteration > 2}{break}{/if}
{if $rewrite == 1}
<a href="{$c.univer}-{$c.btexty|urlencode|replace:'%':'-'|replace:'/':'-'|wordwrap:14:"n":true}.html"><span class="ha3">{$c.btexty|stripslashes|truncate:50}</span></a><br />
{/if}
{if $rewrite == 2}
<a href="news.php?name={$c.univer}"><span class="ha3">{$c.btexty|stripslashes|truncate:50|wordwrap:14:"n":true}</span></a><br />
{/if}
{if $c.editor eq 2}
{$c.bamess|stripslashes|regex_replace:"/[r]/":"<br />"|truncate:988}<br /><br />
{/if}
{if $c.editor eq 1}
{$c.bamess|htmlspecialchars_decode|truncate:1310|CloseTags}<br /><br />
{/if}
{/foreach}
:)
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »

Offline irshadv

  • Newbie
  • *****
  • Posts: 4
  • Karma: +0/-0
Re: I am looking to add browse down latest news on page main
« Reply #8 on: July 19, 2012, 10:57:18 PM »
I tryed this but its not have any changes

plz attach
zip file to this settings configured pages
« Last Edit: January 01, 1970, 03:00:00 AM by Guest »

Offline majbah

  • Full Member
  • *****
  • Posts: 43
  • Karma: +0/-0
Re: I am looking to add browse down latest news on page main
« Reply #9 on: May 14, 2013, 07:48:14 PM »
Hi Jeremy,

I would like to do the same on my homepage. Will this file work for the new version 4.2.2? Could you suggest me which file do I replace?

Thanks,

Majbah


Quote from: Jeremy
Hi 7eway, try with this files.

Thank you Jeremy so so much  <!-- s:) -->:)<!-- s:) -->  <!-- s:) -->:)<!-- s:) -->  <!-- s:) -->:)<!-- s:) -->  <!-- s:) -->:)<!-- s:) -->

It works well  <!-- s;) -->;)<!-- s;) -->