itdevil
03-24-2007, 11:37 AM
Hi, I am trying to add "Recent Zoints Blog Entries" using the beta hack given at dev.zoints.com (http://dev.zoints.com/showthread.php?p=781#post781) but due to some reason it is not working. Even the module is active it showing me nothing regrading blog. Can anyone help me in sorting it out.
Thank you
modules/zoints_newblogs.php
<?php
// ++================================================ =========================++
if (@require_once('/home/xxxxx/xxxxstuf/xxxforums.com/z/includes/localsettings.php'))
{
if ($config['mod rewrite'])
{
$zlinkstyle = 'rewrite';
}
else
{
$zlinkstyle = 'normal';
}
$zlink = mysql_connect($config['master_server']['host'], $config['master_server']['user'], $config['master_server']['pass']);
mysql_select_db($config['server_database']);
$getentries = mysql_query("
SELECT entry.*, user.userid, user.usertoken, user.avatar
FROM " . $config['table prefix'] . "blog_entry AS entry
LEFT JOIN " . $config['table prefix'] . "user AS user ON (entry.masterid = user.userid)
WHERE groups = ''
ORDER BY dateline DESC
LIMIT 5
", $zlink);
while ($entry = mysql_fetch_array($getentries))
{
exec_switch_bg();
$entry['zurl'] = $config['site url'] . sprintf($config['profile'][$zlinkstyle]['url'], $entry['usertoken']);
$entry['entryurl'] = $config['site url'] . sprintf($config['profile'][$zlinkstyle]['path'], $entry['usertoken'], 'blog') . ($zlinkstyle == 'rewrite' ? '?' : '&') . 'cmd=viewentry&entryid=' . $entry['entryid'];
if ($entry['avatar'])
{
$entry['avatar_path'] = $config['site url'] . 'user/' . implode('/', array_reverse(preg_split("##", $entry['userid'], -1, PREG_SPLIT_NO_EMPTY))) . '/avatar.' . $entry['avatar'];
}
$entry['dateline'] = vbdate($vbulletin->options['dateformat'] . ' ' . $vbulletin->options['timeformat'], $entry['dateline']);
// Strip characters and add "read more"
if ($mod_options['portal_zoints_blog_maxchars'] AND strlen($entry['comment_parsed']) > $mod_options['portal_zoints_blog_maxchars'])
{
$entry['comment_parsed'] = substr($entry['comment_parsed'], 0, strrpos(substr($entry['comment_parsed'], 0, $mod_options['portal_zoints_blog_maxchars']), ' '));
$entry['comment_parsed'] = check_string_html($entry['comment_parsed'], '<div', '</div>');
$entry['comment_parsed'] = check_string_html($entry['comment_parsed'], '<td', '</td>');
$entry['comment_parsed'] = check_string_html($entry['comment_parsed'], '<tr', '</tr>');
$entry['comment_parsed'] = check_string_html($entry['comment_parsed'], '<table', '</table>');
$entry['comment_parsed'] = check_string_html($entry['comment_parsed'], '<table', '</table>');
$entry['comment_parsed'] .= '... [<a href="' . $entry['entryurl'] . '">Read More</a>]';
}
eval('$home[$mods[modid]][content] .= "' . fetch_template('adv_portal_zoints_newblog') . '";');
}
mysql_free_result($getentries);
}
?>
Template: adv_portal_zoints_newblog
<tr>
<td class="thead"><a href="$entry[entryurl]">$entry[title]</a></td>
</tr>
<tr>
<td class="$bgclass">
<div style="padding: 4px">Posted on $entry[dateline] by <a href="$entry[zurl]">$entry[username]</a></div>
<if condition="$entry['avatar']">
<a href="$entry[zurl]"><img align="left" src="$entry[avatar_path]" alt="$entry[username]'s Avatar" border="0" /></a>
</if>
$entry[comment_parsed]
</td>
</tr>
How can i make it work on vB 3.6.5 with vBA CMPS 2.2.1.
Thank You!
Thank you
modules/zoints_newblogs.php
<?php
// ++================================================ =========================++
if (@require_once('/home/xxxxx/xxxxstuf/xxxforums.com/z/includes/localsettings.php'))
{
if ($config['mod rewrite'])
{
$zlinkstyle = 'rewrite';
}
else
{
$zlinkstyle = 'normal';
}
$zlink = mysql_connect($config['master_server']['host'], $config['master_server']['user'], $config['master_server']['pass']);
mysql_select_db($config['server_database']);
$getentries = mysql_query("
SELECT entry.*, user.userid, user.usertoken, user.avatar
FROM " . $config['table prefix'] . "blog_entry AS entry
LEFT JOIN " . $config['table prefix'] . "user AS user ON (entry.masterid = user.userid)
WHERE groups = ''
ORDER BY dateline DESC
LIMIT 5
", $zlink);
while ($entry = mysql_fetch_array($getentries))
{
exec_switch_bg();
$entry['zurl'] = $config['site url'] . sprintf($config['profile'][$zlinkstyle]['url'], $entry['usertoken']);
$entry['entryurl'] = $config['site url'] . sprintf($config['profile'][$zlinkstyle]['path'], $entry['usertoken'], 'blog') . ($zlinkstyle == 'rewrite' ? '?' : '&') . 'cmd=viewentry&entryid=' . $entry['entryid'];
if ($entry['avatar'])
{
$entry['avatar_path'] = $config['site url'] . 'user/' . implode('/', array_reverse(preg_split("##", $entry['userid'], -1, PREG_SPLIT_NO_EMPTY))) . '/avatar.' . $entry['avatar'];
}
$entry['dateline'] = vbdate($vbulletin->options['dateformat'] . ' ' . $vbulletin->options['timeformat'], $entry['dateline']);
// Strip characters and add "read more"
if ($mod_options['portal_zoints_blog_maxchars'] AND strlen($entry['comment_parsed']) > $mod_options['portal_zoints_blog_maxchars'])
{
$entry['comment_parsed'] = substr($entry['comment_parsed'], 0, strrpos(substr($entry['comment_parsed'], 0, $mod_options['portal_zoints_blog_maxchars']), ' '));
$entry['comment_parsed'] = check_string_html($entry['comment_parsed'], '<div', '</div>');
$entry['comment_parsed'] = check_string_html($entry['comment_parsed'], '<td', '</td>');
$entry['comment_parsed'] = check_string_html($entry['comment_parsed'], '<tr', '</tr>');
$entry['comment_parsed'] = check_string_html($entry['comment_parsed'], '<table', '</table>');
$entry['comment_parsed'] = check_string_html($entry['comment_parsed'], '<table', '</table>');
$entry['comment_parsed'] .= '... [<a href="' . $entry['entryurl'] . '">Read More</a>]';
}
eval('$home[$mods[modid]][content] .= "' . fetch_template('adv_portal_zoints_newblog') . '";');
}
mysql_free_result($getentries);
}
?>
Template: adv_portal_zoints_newblog
<tr>
<td class="thead"><a href="$entry[entryurl]">$entry[title]</a></td>
</tr>
<tr>
<td class="$bgclass">
<div style="padding: 4px">Posted on $entry[dateline] by <a href="$entry[zurl]">$entry[username]</a></div>
<if condition="$entry['avatar']">
<a href="$entry[zurl]"><img align="left" src="$entry[avatar_path]" alt="$entry[username]'s Avatar" border="0" /></a>
</if>
$entry[comment_parsed]
</td>
</tr>
How can i make it work on vB 3.6.5 with vBA CMPS 2.2.1.
Thank You!