Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Showing News in 2 Columns in 7.02+

Asked Modified Viewed 15,547 times
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
asked
Veteran Member

Hello Guyz,

One of my Friend requested to have the feature of showing the News on Double Columns on the News page. So I have made some modification to the file news.php to make it work...!

Here is what I have tried and its almost what it should show as Double Column.

[size=24]STEPS :[/size]

1. Backup and open your news.php file.

2. Find these Lines in this File (around Line 22):
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]// Predefined variables, do not edit these values
$i = 0;[/syntaxhighlighter]
3. After these Lines, Add the given below Lines :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]// Counter for Displaying News in 2 Columns
$counter = 3;[/syntaxhighlighter]
4. Now Find this Line :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]// Number of news displayed
$items_per_page = $settings['newsperpage'];[/syntaxhighlighter]
Change this Line to :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]// Number of news displayed
$items_per_page = $settings['newsperpage']+1;[/syntaxhighlighter]
5. Now Find this Line in the File (around Line 51) :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]$numrows = dbrows($result);[/syntaxhighlighter]
6. After these Lines, Add the given below Lines :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]// Table for 2 Columns News
echo "<table cellpadding='2' cellspacing='2' width='100%' border='0'>\n<tr>\n";[/syntaxhighlighter]
7. Now Find these Lines (around Line 83) :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]echo "<!--news_prepost_".$i."-->\n";
render_news($news_subject, $news_news, $news_info);[/syntaxhighlighter]
8. Replace these Lines with :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]echo "<td valign='top' width='20%'>\n";
echo "<!--news_prepost_".$i."-->\n";
render_news($news_subject, $news_news, $news_info);
echo "</td>\n";
if (($counter % 2 == 0) && ($counter != $items_per_page+2))
{
echo "</tr>\n<tr>\n";
}
$counter++;[/syntaxhighlighter]
9. Now just after two Lines, You will Find this Line :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]echo "<!--sub_news_idx-->\n";[/syntaxhighlighter]
10. Add the given below Line before the above given Line :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]echo "</tr>\n</table>";[/syntaxhighlighter]

DONE !!! SAVE YOUR FILE AND TEST IT !!!

[size=24][ MODDED FILE FROM VERSION 7.02.03 ATTACHED ][/size]

Thank You

Regards,
Ankur Thakur
Edited by Ankur on 12-07-2011 11:07,
Ankur attached the following file:
news.zip [No information available / 818 Downloads]
0 replies

20 posts

D
douwe_yntema
D
  • Senior Member, joined since
  • Contributed 667 posts on the community forums.
  • Started 57 threads in the forums
  • Answered 1 question
answered
Senior Member

May this is what you are looking for:

http://www.phpfusionmods.co.uk/downlo...load_id=59
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 20 posts
  • Votes 0 votes
  • Topic users 13 members

13 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
K
K
<3 PHP-Fusion
  • Member, joined since
  • Contributed 160 posts on the community forums.
  • Started 25 threads in the forums
A
A
  • Senior Member, joined since
  • Contributed 725 posts on the community forums.
  • Started 128 threads in the forums
Y
Y
yousef 10
  • Junior Member, joined since
  • Contributed 13 posts on the community forums.
  • Started 2 threads in the forums
G
G
Ex Senior Dev.
  • Member, joined since
  • Contributed 131 posts on the community forums.
J
J
jikaka 10
www.rusfusion.ru - russian nss
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 82 threads in the forums
S
S
  • Junior Member, joined since
  • Contributed 12 posts on the community forums.
  • Started 4 threads in the forums
A
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
R
R
  • Newbie, joined since
  • Contributed 1 post on the community forums.
J
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
M
M
m2t 10
  • Newbie, joined since
  • Contributed 1 post on the community forums.
L
L
Life 10
  • Newbie, joined since
  • Contributed 1 post on the community forums.
D
D
  • Senior Member, joined since
  • Contributed 667 posts on the community forums.
  • Started 57 threads in the forums
  • Answered 1 question

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet