Topic: a couple of fixes
Hi All.
A couple of years ago, I was met with this engine.
And once, I disassembled it on details for my needs.
Fix a lot of bugs and inaccuracies.
Transferred it to the bootstrap and make couple of modules.
And recently I cleaned up my archives
and came across a site on this engine.
I decided to see, is this project live, and what's new on it.
It seems that the developers have done the same work, which I did in past for myself.
Here are a couple of bugs and suggestions for thinking.
for v2.1.0
[/core/core.php]
Line 1434
Added the LOGIN button in the navigation menu. added button localization
There need a hook to add the menu items for not logged user.
$skin_header = preg_replace("/{menu}/", "<li><a class='nav' href='".PHP_SELF."/?login'>".i18n("LogIn")."</a></li><!--li><a href='".PHP_SELF."'>".VERSION_NAME."</a></li-->", $skin_header);
Line 1439
Was added a global variable $SiteTitle for the title of the site.
Set before inserting the news script
global $SiteTitle;
$skin_header = str_replace('{title}', ($header_text? $header_text.' / ' : '').$SiteTitle, $skin_header);
Line 3866
It is necessary to assign a PHP_SELF constant using a user override $PHP_SELF,
which would make the redirection work correctly.
Without this moment, it is not possible to realize all power of redirection.
if (isset($PHP_SELF)) {
define('PHP_SELF', $PHP_SELF);
} else {
define('PHP_SELF', $_SERVER["SCRIPT_NAME"]);
}
Line 4049
Added Localization for breadcrumbs in Dashboards
if ($kcount == $i) {
$ls[] = '<span class="bcitem">' . i18n($item['name']) . '</span>';
} else {
$ls[] = '<span class="bcitem"><a href="' . $item['url'] . '">' . i18n($item['name']) . '</a></span>';
}
[/core/news.php]
Line 94
removed the red button class for ReedMore.
CSS should be set in skins.
if (isset($bb['target'])&&$bb['target']) $a_opts = 'target="'.cn_htmlspecialchars($bb['target']).'" ';//se agrego la clase class="btn btn-default" de boot strap
Line 256
Wrote the module of the user's questionnaire. Replaced the link of the (user's mail) to the Module.
Here Need to be a hook for the formation of the functions of clicking on the name (nickname).
return '<a href="'.PHP_SELF.'?mod=main&opt=usersabout&user_name='.$e['u'].'">'.$username.'</a>';
Line 672
Fixed URL direction. Replacement of index.php with PHP_SELF
if (test('Cen'))
{
$URL = getoption('http_script_dir').'/'.PHP_SELF.'?mod=editnews&action=editnews&id='.intval($e['id']);
return '<a '.$opts.'href="'.$URL.'">'.$t.'</a>';
}
Line 889
Added </div> at the end of the capcha image. Without was broke the whole footer.
$echo = '<div class="cn_comm_captcha"><a href="#" onclick="cn_get_id(\''.$ID.'\').src = \''.$cpath.'?r=\' + Math.random(); return false;"><img src="'.$cpath.'" alt="CAPTCHA, click to refresh" id="'.$ID.'"/></a></div>';
Line 743
Replacing the link of comments authors on user's module, or email if it was a guest's
Hook shuld be here.
if (db_user_by_name($e['u'])) return '[<a href="'.PHP_SELF.'?mod=main&opt=usersabout&user_name='.$user['name'].'">'.$username.'</a>]';