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]
Honestly I have this problem with 7.02 but honestly I do not know news.php to replace these codes and I think there are many users who would like this lucru.Nu can u make us a new news.php on two collars, that changed? Thank you very much.
Honestly I have this problem with 7.02 but honestly I do not know news.php to replace these codes and I think there are many users who would like this lucru.Nu can u make us a new news.php on two collars, that changed? Thank you very much.
Translated with Google translate. ^^
What he meant to say is that he also has the same problem but doesn't know how to change those lines of code and is asking for a version of news.php already modified.
I am actually making this a panel, so we do not need to edit the core at all. See it in action at http://www.fangree.co.uk/
That Panel looks Awesome Craig... :D Does there any settings using which we can change the Number of News to Display ? Or the panel will take the value from News Items per page setting ?
It's better to use a static file in this case, cause there are normally no changes in the news file and the way you're doing it needs additional ressources. But it's not bad to have both... so everyone is able to choose.
Yeah it's additional resources but I still think that is better than modifying the core news.php ok it does not get updated that often but it will eventually then all users must then tweak again. Like many users still use 7.01 because of Core Mods they can't or don't know how to upgrade without losing their core mods. Using a panel soon resolves that. hehe