Hi so i post here my first mod :ph34r:
Info : This mod allows you to have an accordion-like news reader (pictures are down)
Disclaimer : - I don't did the accordion by myself i used one provided by Switchroyale and integrated it.
- Tested it on v2.08 -> fully compatable
- There is some text in french inside it, (think there is a "le" & a "à", on same line as comments) ; change "le" to "the" and "à" to "at"
Edit : [url="https://www.torrenttrader.org/index.php?/topic/17646-mod-better-jquery-news-accordion/"]https://www.torrenttrader.org/index.php?/topic/17646-mod-better-jquery-news-accordion/[/url]
Installation :
Go to index.php find :
if you use another theme, folder, aso.. think about renaming the path.


N.B. To download the original &/or see it in action : [url="http://www.switchroyale.com/vallenato/"]http://www.switchroyale.com/vallenato/[/url]
[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6457"]vallenato.rar[/url]
Info : This mod allows you to have an accordion-like news reader (pictures are down)
Disclaimer : - I don't did the accordion by myself i used one provided by Switchroyale and integrated it.
- Tested it on v2.08 -> fully compatable
- There is some text in french inside it, (think there is a "le" & a "à", on same line as comments) ; change "le" to "the" and "à" to "at"
Edit : [url="https://www.torrenttrader.org/index.php?/topic/17646-mod-better-jquery-news-accordion/"]https://www.torrenttrader.org/index.php?/topic/17646-mod-better-jquery-news-accordion/[/url]
Installation :
Go to index.php find :
if ($site_config['NEWSON'] && $CURUSER['view_news'] == "yes"){
Under
if (mysql_num_rows($res) > 0){
Replace this line :
print("<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td>n<ul>");
with this one :
print("<div id="accordion-container">");
Remove this while loop and the print after his end " } " :
while($array = mysql_fetch_assoc($res)){
if (!$array["username"])
$array["username"] = T_('UNKNOWN_USER');
$numcomm = get_row_count("comments", "WHERE news='".$array['id']."'");
// Show first 2 items expanded
if ($news_flag < 1) {
$disp = "block";
$pic = "minus";
} else {
$disp = "none";
$pic = "plus";
}
print("<br /><a href="javascript: klappe_news('a".$array['id']."')"><img border="0" src="".$site_config["SITEURL"]."/images/$pic.gif" id="pica".$array['id']."" alt="Show/Hide" />");
print(" <b>". $array['title'] . "</b></a> - <b>".T_("POSTED").":</b> " . date("d-M-y", utc_to_tz_time($array['added'])) . " <b>".T_("BY").":</b> $array[username]");
print("<div id="ka".$array['id']."" style="display: $disp;"> ".format_comment($array["body"])." <br /><br />".T_("COMMENTS")." (<a href='comments.php?type=news&id=".$array['id']."'>".number_format($numcomm).")</a></div><br /> ");
$news_flag++;
}
print("</ul></td></tr></table>n");
Now paste this loop instead :
while($array = mysql_fetch_assoc($res)){
if (!$array["username"])
$array["username"] = T_('UNKNOWN_USER');
$numcomm = get_row_count("comments", "WHERE news='".$array['id']."'");
print("<h2 class="accordion-header"><span>".$array['title']."</span></h2>");
print("<div class="accordion-content"><br /> ".format_comment($array["body"])."<br /><br /><hr class="accordion-hr"/><p class="accordion-left">".T_("POSTED")." ".T_("BY")." ".$array[username]." à ". date("H:i", utc_to_tz_time($array['added'])) . " le ".date("d-M-y", utc_to_tz_time($array['added']))."</p><p class="accordion-right"><a href='comments.php?type=news&id=".$array['id']."'>".T_("COMMENTS")." (".number_format($numcomm)."</a>)</p><br /></div>");
$news_flag++;
}
print("</div>");
In your themes/NB-TT-3c upload the attached file vallenato (i edited the css to fit with the design, the NB-TT theme, which is in my point of vue very nice) :
Now in the header.php paste those line inside the <head> tag :
<script src="<?php echo $site_config["SITEURL"]; ?>/themes/NB-TT-3c/vallenato/jquery-latest.js" type="text/javascript"></script>
<script src="<?php echo $site_config["SITEURL"]; ?>/themes/NB-TT-3c/vallenato/vallenato.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?php echo $site_config["SITEURL"]; ?>/themes/NB-TT-3c/vallenato/vallenato.css" type="text/css" media="screen">
if you use another theme, folder, aso.. think about renaming the path.
N.B. To download the original &/or see it in action : [url="http://www.switchroyale.com/vallenato/"]http://www.switchroyale.com/vallenato/[/url]
[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6457"]vallenato.rar[/url]
