1 (edited by Developer 2018-03-22 03:10:25)

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&amp;action=editnews&amp;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>]';

2 (edited by Developer 2018-03-22 02:56:17)

Re: a couple of fixes

[/core/includes/comments.php]
Line 168
Added a bootstrap class for the delete comment button.
but I still think that the style should be set in skins

    echo '<div id="del_btn" class="cn_comment_submit" style="visibility:hidden;"><input class="btn btn-default btn-danger" type="submit" id="btn_delete" value="Delete comments"/></div>'; 


Line 195
Added a bootstrap class for form

     echo '<form class="form-signin" role="form" name="comment_frm" action="'.$comment_url.'" method="POST"/>';

[/core/modules/add_news.php]
Line 10
Fixed links in the breadcrumbs, there was an index.php value

    
    cn_bc_add('Dashboard', PHP_SELF.'?mod=main');
    cn_bc_add('News listing', PHP_SELF.'?mod=editnews');
    cn_bc_add('Add new'); 


[/core/modules/edit_news.php]
Line 26 AND 284
Fixed links in the breadcrumbs, there was an index.php value
Also eliminated unnecessary calls localization func.

 
    cn_bc_add('Dashboard', PHP_SELF.'?mod=main');
    cn_bc_add('News listing', PHP_SELF.'?mod=editnews');


[/core/modules/dashboard.php]
Line 1238
corrected directory name of for USERS on the way in zip-class, otherwise all USERS data took off to NEWS directory.
before restoring the database, it is necessary to manually delete all the contents of the user's and news directory.
Otherwise, there will be problems with users registration, if this users was not overwritten by recovery.
It would be convenient to add pre-cleaning directories when unpacking.

$users = scan_dir(cn_path_construct(SERVDIR,'cdata','users'));
foreach ($users as $file)
  {
   $data = join('', file(cn_path_construct(SERVDIR,'cdata','users').$file));
   $zip->create_file($data, 'users'.DIRECTORY_SEPARATOR.$file);
  } 



Line 2198
Fixed URL direction after deleting words in localization. Replacement of index.php with $PHP_SELF

         if ($relocate_after) {
            cn_relocation(PHP_SELF.'?mod=main&opt=locale&lang='.$lang);
        }


[/skins/base/editnews/list.php]
Line
Added links to news in the news manager for users without the right to edit news.
It will be convenient if we enable browsing all news and archives for the commentators group.

 
    if (getoption('rw_engine'))
    {
          echo '<a href="'.PHP_SELF.cn_put_alias(intval($entry['id'])).'">'.cn_htmlspecialchars($entry['title']).'</a>';
     } else { 
          echo '<a href="'.PHP_SELF.'?id='.cn_put_alias(intval($entry['id'])).'">'.cn_htmlspecialchars($entry['title']).'</a>';
     }

Re: a couple of fixes

A few edited templates for the bootstrap
default - Active news
default - Active news

 
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-12 col-sm-10"><span>[link]{title}[/link]</span></div>
                    <div class="col-xs-12 col-sm-2 text-right">[print][/print]</div>
                </div>
            </div>

            <div class="panel-body">{short-story}<br />
            [full-link target=_blank]<span class="glyphicon glyphicon-eye-open"></span><span>Read more... </span>[/full-link]</div>

            <div class="panel-footer" style="padding:2px;">
                <div class="row">
                    <div class="col-xs-12 col-sm-3">
                        <div class="row">
                            <div class="col-xs-3  text-right">{avatar}</div>

                            <div class="col-xs-9">[{author}] {date}<br />
                            [com-link] <span class="btn btn-default btn-xs"> Count of comments: {comments-num} </span> [/com-link]</div>
                        </div>
                    </div>

                    <div class="col-xs-8 col-sm-6 text-center">{tagline}</div>

                    <div class="col-xs-4 col-sm-3 text-left">
                        <div class="pull-left" style="min-height:30px">{twitter}</div>
                        <div class="pull-left" style="min-height:30px">{gplus}</div>
                        <div class="pull-left" style="min-height:30px">{fb-like}</div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-xs-12 col-sm-12">{fb-comments}</div>
                </div>
            </div>
        </div>
    </div>

deault - Full story

        <div class="container">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="row">
                        <div class="col-xs-12 col-sm-3">
                            <div class="row">
                                <div class="col-xs-3  text-right">{avatar}
                                </div>
                                <div class="col-xs-9">[{author}] {date}<br />[com-link] <span class="btn btn-default btn-xs"> Count of comments: {comments-num} </span> [/com-link]
                                </div>
                            </div>
                        </div>
                        <div class="col-xs-8 col-sm-6 text-center"><span class="lead">[link]{title}[/link]</span>
                        </div>
                        <div class="col-xs-4 col-sm-3 text-right">[print][/print]
                        </div>
                    </div>
                </div>

                <div class="panel-body">{full-story}
                </div>

                <div class="panel-footer">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8">{tagline}
                        </div>

                        <div class="col-xs-12 col-sm-4 text-left">
                            <div class="pull-left" style="min-height:30px">{twitter}
                            </div>

                            <div class="pull-left" style="min-height:30px">{gplus}
                            </div>

                            <div class="pull-left" style="min-height:30px">{fb-like}
                            </div>
                        </div>
                    </div>

                    <div class="row">
                       <div class="col-xs-12 col-sm-12">{fb-comments}
                       </div>
                    </div>
                </div>
            </div>
        </div> 

default - coment

        <div class="container">
            <div class="panel panel-default">
                <div class="panel-heading">[delete]%cbox[/delete] by <strong>{author}</strong> @ {date} [edited](<i>Edited: %edited</i>)[/edited] [edit][Edit comment][/edit]
                </div>

                <div class="panel-body">{comment}
                </div>
            </div>
        </div> 

default - add coment form

 
        <div class="container">
            <div class="panel panel-default panel-footer col-xs-12 col-md-4 col-sm-6 "><br />
                {remember_me}<br />
                &ensp; {input_username} {input_email} {input_commentbox} {smilies}<br />
                <br>[captcha]{captcha}[/captcha]<br />
                [submit]Add comment[/submit]<br />
                &ensp;
            </div>
        </div>

Re: a couple of fixes

I hope this helps a little.
Thanks for your work.

Re: a couple of fixes

Thank you!  The patches will be implemented soon.

Best regards,
CN Support team

6 (edited by reb.eccarobertson121 2021-06-16 05:18:58)

Re: a couple of fixes

Thanks for sharing this information.


lowes employee portal