//Site News
if ($site_config['NEWSON'] && $CURUSER['view_news'] == "yes"){
begin_frame(T_("NEWS"));
$res = SQL_Query_exec("SELECT news.id, news.title, news.added, news.body, users.username FROM news LEFT JOIN users ON news.userid = users.id ORDER BY added DESC LIMIT 10");
if (mysql_num_rows($res) > 0){
print("<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td>n<ul>");
$news_flag = 0;
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 < 2) {
$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");
}else{
echo "<br /><b>".T_("NO_NEWS")."</b>";
}
end_frame();
}
Replace with :
/**********************************************************************************************/
/* JQUERY ACCORDEON MOD */
/**********************************************************************************************/
if ($site_config['NEWSON'] && $CURUSER['view_news'] == "yes"){
begin_frame(T_("NEWS"));
$res = SQL_Query_exec("SELECT news.id, news.title, news.added, news.body, users.username FROM news LEFT JOIN users ON news.userid = users.id ORDER BY added DESC LIMIT 10");
if (mysql_num_rows($res) > 0){
print('<div id="accordion">');
$news_flag = 0;
while($array = mysql_fetch_assoc($res)){
if (!$array["username"]) $array["username"] = T_('UNKNOWN_USER');
$numcomm = get_row_count("comments", "WHERE news='".$array['id']."'");
print("<h3><a href="#">".$array['title']."</a></h3>");
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>');
}else echo "<br /><b>".T_("NO_NEWS")."</b>";
end_frame();
}
?>
<script>
$( "#accordion" ).accordion({
active: false, collapsible: true, heightStyle: "content", alwaysOpen: false
});
</script>
<?php
In your theme header.php, place this :
<link rel="stylesheet" href="<?php echo $site_config["SITEURL"]; ?>/themes/YOURTHMEGOESHERE/accordion/jquery-ui-1.10.1.custom.css">
<script src="<?php echo $site_config["SITEURL"]; ?>/themes/YOURTHMEGOESHERE/accordion/jquery-1.9.1.js"></script>
<script src="<?php echo $site_config["SITEURL"]; ?>/themes/YOURTHMEGOESHERE/accordion/jquery-ui-1.10.1.custom.js"></script>
Extract the attached file to the root of your current theme.
Done
N.B. :
A) Try formatting that line with your taste. The class="accordion-content" , class="accordion-hr" , class="accordion-left", lass="accordion-right" where added after so if you want to dl another theme but keep the formatting add those classes under your downloaded css
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]." at ". date("H:i", utc_to_tz_time($array['added'])) . " the ".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>");

$('.accordion-header').first().toggleClass('active-header').toggleClass('inactive-header');
$('.accordion-content').first().slideDown().toggleClass('open-content');
border: 1px solid #cccccc;
border-top: 0;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
Assure toi que ce code soit bien présent dans .accordion-content{} dans le css. Et si il y est mais c'est pas la même chose remplace les lignes correspondantes par celles ci (tjs dans .accordion-content).
border: 1px solid #cccccc;
border-top: 0;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-radius: 0 0 5px 5px;
border-radius: 0 0 5px 5px;
àtag that means à -> change that tag with "at" and the "le" as "the"
//Site News
if ($site_config['NEWSON'] && $CURUSER['view_news'] == "yes"){
begin_frame(T_("NEWS"));
$res = SQL_Query_exec("SELECT news.id, news.title, news.added, news.body, users.username FROM news LEFT JOIN users ON news.userid = users.id ORDER BY added DESC LIMIT 10");
if (mysql_num_rows($res) > 0){
print("<div id="accordion-container">");
$news_flag = 0;
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">
<td align="center"><a href="admincp.php?action=punished"><img src="images/admin/punished.png" border="0" width="32" height="32" alt=""/><br />Punished Users</a><br /></td>
// Mode Don
$LANG["THANKS_YOU_DONATE"] = "Merci de visiter la page des donations";
$LANG["SUPPORT_DON"] = "Si vous aimez le tracker aidez-nous à le maintenir en vie";
$LANG["DONATE"] = "Faire un don";
$LANG["AND_RECEIVE"] = "Et vous recevrez";
$LANG["WEEKS"] = "Semaines";
$LANG["WEEKS_FREE_DL"] = "Semaines de Téléchargement Gratuit";
$LANG["GB_CREDITS_UP"] = "GB Crédits d'Upload";
$LANG["INVITES_SITE"] = "Invitations sur notre site";
$LANG["STATUS"] = "Status";
$LANG["PM_ADMIN_DON"] = "Si vous ne recevez rien après un don envoyez nous un message";
$LANG["HERE"] = "ICI";
$LANG["CONFIRMED_ACCOUNT"] = "pour confirmation et mise à niveau de votre compte";
$LANG["-IMPORTANT-"] = "- IMPORTANT -";