hi,
this is a code by vbGamer the developer of the SMF Links Mod
This block will give you the last X links posted in the links directory to change the limit change the LIMIT 5 in the code below
Download SSI.php file
and add this code to the end before the ?>
function ssi_links_recent()
{
global $scripturl,$db_prefix;
$dbresult = db_query("SELECT l.ID_LINK, l.rating, l.title,l.date, l.ID_MEMBER, l.description,l.hits FROM {$db_prefix}links AS l WHERE l.approved = 1 ORDER BY l.ID_LINK DESC LIMIT 5", __FILE__, __LINE__);
while($row = mysql_fetch_assoc($dbresult))
{
echo '<a href="' . $scripturl . '?action=links;sa=visit;id=' . $row['ID_LINK'] . '" target="blank">' . $row['title'] . '</a><br />';
}
echo '<br />';
echo '<a href="' . $scripturl . '?action=links">Add Link</a>';
mysql_free_result($dbresult);
}
And then in the TP admin area create a PHP side block and add this to it:
ssi_links_recent();
Activate and enjoy.
The SMF links directory mod can be found on page one of this thread at SMF (http://www.simplemachines.org/community/index.php?topic=98911.msg833689#msg833689)
Please Note: This block will only work if you use the mod!
Awesome thank you! Just wondering if its possible to make the text shown smaller?
how about the random links?
If the links mod has a random links feature, you should ask the author if they could show you the code.
thanks.
now im using
function ssi_links_recent()
{
global $scripturl,$db_prefix;
$dbresult = db_query("SELECT l.ID_LINK, l.rating, l.title,l.date, l.ID_MEMBER, l.description,l.hits FROM {$db_prefix}links AS l WHERE l.approved = 1 ORDER BY l.ID_LINK DESC LIMIT 5", __FILE__, __LINE__);
while($row = mysql_fetch_assoc($dbresult))
{
echo '<a href="' . $scripturl . '?action=links;sa=visit;id=' . $row['ID_LINK'] . '" target="blank">' . $row['title'] . '</a><br />';
}
echo '<br />';
echo '<a href="' . $scripturl . '?action=links">Add Link</a>';
mysql_free_result($dbresult);
}
this code show the latest/recent added links.
How can to make it show recent by category? Like
Recent Links
category 1
Link 1 Link2 Link3 Link4 Link5
category 2
Link 1 Link2 Link3 Link4 Link5
category 3
Link 1 Link2 Link3 Link4 Link5
Since Aku is not here, and I don't know anyone here that uses this mod, I would suggest you seek help from the author of the mod.
Quote from: IchBinâ,,¢ on December 23, 2008, 03:02:43 AM
Since Aku is not here, and I don't know anyone here that uses this mod, I would suggest you seek help from the author of the mod.
tq...
i miss Aku.... where is he now? :2funny:
Quote from: alhaudhie on December 23, 2008, 02:07:12 AM
thanks.
now im using
function ssi_links_recent()
{
global $scripturl,$db_prefix;
$dbresult = db_query("SELECT l.ID_LINK, l.rating, l.title,l.date, l.ID_MEMBER, l.description,l.hits FROM {$db_prefix}links AS l WHERE l.approved = 1 ORDER BY l.ID_LINK DESC LIMIT 5", __FILE__, __LINE__);
while($row = mysql_fetch_assoc($dbresult))
{
echo '<a href="' . $scripturl . '?action=links;sa=visit;id=' . $row['ID_LINK'] . '" target="blank">' . $row['title'] . '</a><br />';
}
echo '<br />';
echo '<a href="' . $scripturl . '?action=links">Add Link</a>';
mysql_free_result($dbresult);
}
this code show the latest/recent added links.
How can to make it show recent by category? Like
Recent Links
category 1
Link 1 Link2 Link3 Link4 Link5
category 2
Link 1 Link2 Link3 Link4 Link5
category 3
Link 1 Link2 Link3 Link4 Link5
Anybody can help for this?