Untitled diff

Created Diff never expires
25 removals
101 lines
27 additions
102 lines
<?php
<?php


/*!
/*!
* Teo Tutorials Block
* Teo Tutorials Block
* -------------------------------------------------------
* -------------------------------------------------------
* @author Teo
* @author Teo
* @copyright (c) 2015 Teo. All Rights Reserved
* @copyright (c) 2015 Teo. All Rights Reserved
* @date 09 June, 2015
* @date 09 June, 2015
* @license GNU/GPL (General Public License)
* @license GNU/GPL (General Public License)
* @notes n/a
* @notes n/a
* @version 1.0.0
* @version 1.0.0
*/
*/
//*************************** Config
//*************************** Config
$count = 5;
$count = 5;
$count2 = 20;
$count2 = 20;
// *************************
// *************************
if (!defined('NUKE_EVO')) {
if (!defined('NUKE_EVO')) {
exit('You can\'t access this file directly');
exit('You can\'t access this file directly');
}
}


global $prefix, $db;
global $prefix, $db;


$result = $db->sql_query("select tc_id from ".$prefix."_tutorials_categories");
$result = $db->sql_query("select tc_id from ".$prefix."_tutorials_categories");
$cats = $db->sql_numrows($result);
$cats = $db->sql_numrows($result);


$result = $db->sql_query("select t_id from ".$prefix."_tutorials_tutorials");
$result = $db->sql_query("select t_id from ".$prefix."_tutorials_tutorials");
$tutorials = $db->sql_numrows($result);
$tutorials = $db->sql_numrows($result);
$content .= "<style>
$content .= "<style type=\"text/css\">
#tabella {
.tabella {
border:1px solid #161616;
border:1px solid #161616;
background:#161616;
background:#161616;
border-radius:5px;
border-radius:5px;
-webkit-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-moz-border-radius: 5px;
-khtml-border-radius:5px;margin:2px;
-khtml-border-radius:5px;margin:2px;
padding:2px;}
padding:2px;
}
.aligncenter{
text-align:center;
}
</style>";
</style>";
$content .= "<center><h2>We have <b>$tutorials</b> Tutorials in <b>$cats</b> Categories</h2></center>";
$content .= "<span class=\"aligncenter\"><h2>We have <b>$tutorials</b> Tutorials in <b>$cats</b> Categories</h2></span>";
$content .= "<center><b>$count&nbsp;Latest Tutorials</b></center>";
$content .= "<span class=\"aligncenter\"><b>$count&nbsp;Latest Tutorials</b></span>";
$a = 1;
$a = 1;




$res = $db->sql_query('SELECT a.t_id AS topic_id, a.tc_id AS TUT_ID, a.t_title AS titolo, a.t_date AS data, a.t_counter AS letture, a.author AS autore, a.totalvotes AS tot_voti, a.totalcomments AS tot_commenti, b.tc_id AS CAT_ID, b.tc_title AS cattitolo FROM ' . $prefix . '_tutorials_tutorials a LEFT JOIN ' . $prefix . '_tutorials_categories b ON a.tc_id = b.tc_id ORDER BY a.t_date DESC LIMIT 0, ' . $count);
$res = $db->sql_query('SELECT a.t_id AS topic_id, a.tc_id AS TUT_ID, a.t_title AS titolo, a.t_date AS data, a.t_counter AS letture, a.author AS autore, a.totalvotes AS tot_voti, a.totalcomments AS tot_commenti, b.tc_id AS CAT_ID, b.tc_title AS cattitolo FROM ' . $prefix . '_tutorials_tutorials a LEFT JOIN ' . $prefix . '_tutorials_categories b ON a.tc_id = b.tc_id ORDER BY a.t_date DESC LIMIT 0, ' . $count);


if ($db->sql_numrows($res)) {
if ($db->sql_numrows($res)) {
while ($row = $db->sql_fetchrow($res)) {
while ($row = $db->sql_fetchrow($res)) {
// Remove any underscores from the download title
// Remove any underscores from the download title
$id = $row['CAT_ID'];
$id = $row['CAT_ID'];
$pid = $row['topic_id'];
$pid = $row['topic_id'];
$title2 = str_replace('_', ' ', $row['titolo']);
$title2 = str_replace('_', ' ', $row['titolo']);
$category = str_replace('_', ' ', $row['cattitolo']);
$category = str_replace('_', ' ', $row['cattitolo']);
$date = $row['data'];
$date = $row['data'];
$time = date('F j, Y', strtotime($date));
$time = date('F j, Y', strtotime($date));
$votes = $row['tot_voti'];
$votes = $row['tot_voti'];
$comments = $row['tot_commenti'];
$comments = $row['tot_commenti'];
$counter = $row['letture'];
$counter = $row['letture'];
$author = $row['autore'];
$author = $row['autore'];
$content .= "<div id=\"tabella\">$a- <a href=\"modules.php?name=Tutorials&amp;t_op=showtutorial&amp;pid=$pid\">$title2</a><br><small>In <a href=\"modules.php?name=Tutorials&t_op=viewtutorial&tc_id=$id\"><i>$category</i></a> Category, Posted on $time By <i>$author</i><br>[<b>$counter</b> Reads | <b>$votes</b> Votes | <b>$comments</b> Comments]</small></div>";
$content .= "<div class=\"tabella\">$a- <a href=\"modules.php?name=Tutorials&amp;t_op=showtutorial&amp;pid=$pid\">$title2</a><br><small>In <a href=\"modules.php?name=Tutorials&t_op=viewtutorial&tc_id=$id\"><i>$category</i></a> Category, Posted on $time By <i>$author</i><br>[<b>$counter</b> Reads | <b>$votes</b> Votes | <b>$comments</b> Comments]</small></div>";
$a++;
$a++;
}
}


}
}
$content .= "<br><center><b>$count2&nbsp;Most Popular Tutorials</b></center>";
$content .= "<br><span class=\"aligncenter\"><b>$count2&nbsp;Most Popular Tutorials</b></span>";
$a = 1;
$a = 1;


$res = $db->sql_query('SELECT a.t_id AS topic_id, a.tc_id AS TUT_ID, a.t_title AS titolo, a.t_date AS data, a.t_counter AS letture, a.author AS autore, a.totalvotes AS tot_voti, a.totalcomments AS tot_commenti, b.tc_id AS CAT_ID, b.tc_title AS cattitolo FROM ' . $prefix . '_tutorials_tutorials a LEFT JOIN ' . $prefix . '_tutorials_categories b ON a.tc_id = b.tc_id ORDER BY a.t_counter DESC LIMIT 0, ' . $count2);
$res = $db->sql_query('SELECT a.t_id AS topic_id, a.tc_id AS TUT_ID, a.t_title AS titolo, a.t_date AS data, a.t_counter AS letture, a.author AS autore, a.totalvotes AS tot_voti, a.totalcomments AS tot_commenti, b.tc_id AS CAT_ID, b.tc_title AS cattitolo FROM ' . $prefix . '_tutorials_tutorials a LEFT JOIN ' . $prefix . '_tutorials_categories b ON a.tc_id = b.tc_id ORDER BY a.t_counter DESC LIMIT 0, ' . $count2);


if ($db->sql_numrows($res)) {
if ($db->sql_numrows($res)) {
while ($row = $db->sql_fetchrow($res)) {
while ($row = $db->sql_fetchrow($res)) {
// Remove any underscores from the download title
// Remove any underscores from the download title
$id = $row['CAT_ID'];
$id = $row['CAT_ID'];
$pid = $row['topic_id'];
$pid = $row['topic_id'];
$title2 = str_replace('_', ' ', $row['titolo']);
$title2 = str_replace('_', ' ', $row['titolo']);
$category = str_replace('_', ' ', $row['cattitolo']);
$category = str_replace('_', ' ', $row['cattitolo']);
$date = $row['data'];
$date = $row['data'];
$time = date('F j, Y', strtotime($date));
$time = date('F j, Y', strtotime($date));
$votes = $row['tot_voti'];
$votes = $row['tot_voti'];
$comments = $row['tot_commenti'];
$comments = $row['tot_commenti'];
$counter = $row['letture'];
$counter = $row['letture'];
$author = $row['autore'];
$author = $row['autore'];
$content .= "<div id=\"tabella\">$a- <a href=\"modules.php?name=Tutorials&amp;t_op=showtutorial&amp;pid=$pid\">$title2</a><br><small>In <a href=\"modules.php?name=Tutorials&t_op=viewtutorial&tc_id=$id\"><i>$category</i></a> Category, Posted on $time By <i>$author</i><br>[<b>$counter</b> Reads | <b>$votes</b> Votes | <b>$comments</b> Comments]</small></div>";
$content .= "<div class=\"tabella\">$a- <a href=\"modules.php?name=Tutorials&amp;t_op=showtutorial&amp;pid=$pid\">$title2</a><br><small>In <a href=\"modules.php?name=Tutorials&t_op=viewtutorial&tc_id=$id\"><i>$category</i></a> Category, Posted on $time By <i>$author</i><br>[<b>$counter</b> Reads | <b>$votes</b> Votes | <b>$comments</b> Comments]</small></div>";
$a++;
$a++;
}
}
if (!is_user($user)) {
if (!is_user($user)) {
$content .= "<hr><div id=\"tabella\"><center>[ <a href=\"modules.php?name=Your_Account\">Log in</a> to submit a new tutorial ]</center></div>";
$content .= "<hr><div class=\"tabella\"><span class=\"aligncenter\">[ <a href=\"modules.php?name=Your_Account\">Log in</a> to submit a new tutorial ]</span></div>";


} else {
} else {
$content .= "<hr><div id=\"tabella\"><center>[ <a href=\"modules.php?name=Tutorials&file=submit\">Submit</a> NEW | My <a href=\"modules.php?name=Tutorials&t_op=FavoriteTutorials\">favorites</a> ]</center></div>";
$content .= "<hr><div class=\"tabella aligncenter\">[ <a href=\"modules.php?name=Tutorials&file=submit\">Submit</a> NEW | My <a href=\"modules.php?name=Tutorials&t_op=FavoriteTutorials\">favorites</a> ]</div>";
}
}
}
$content .= "<table width=\"100%\" border=\"0\">";
}
$content .= "<tr>\n";
$content .= "<div style=\"width:100%; border:0px solid #000\">";
$content .= "<td align=\"right\" Valign=\"bottom\" colspan=\"3\" height=\"18\">\n";
$content .= "<span class=\"gensmall\" style=\"float:right; height:18px;\">&copy; <a href=\"http://www.sof2.org\" target=\"_blank\">Teo</a></span>\n";
$content .= " <span class=\"gensmall\">&copy; <a href=\"http://www.sof2.org\">Teo</a></span></a></td>\n";
$content .= "</div>\n";
$content .= "</tr>\n";

$content .= "</table>";


?>
?>