codersclub / emlog.ml

Emlog.ML is a simple yet powerful blogging engine with multilingual support based on PHP, MySQL and Bootstrap 4
GNU General Public License v3.0
3 stars 0 forks source link

Blank Home Page #2

Open afoster1955 opened 1 week ago

afoster1955 commented 1 week ago

I am running the script on my localhost (laptop) in Windows 10, with a webserver running PHP version 7.4.27 and I keep getting a blank page when trying to run the index.php file. Any ideas what is causing this? There are no error messages from the server.

codersclub commented 1 week ago

You have to look inside the log file of your http server. You can find a detailed error message there...

afoster1955 commented 1 week ago

I have looked in the log file...there are no messages as I stated. Also, I noticed that there is code in the init.php file that should generated any error messages as well, but again there is no error messages. What is also interesting, an earlier version of the script (2.1.9) works just fine and I can access the admin module and make changes there. I just can't get to the home page. Here is the code I am talking about in the init.php file.

error_reporting(E_ALL); } else { error_reporting(1); }

codersclub commented 1 week ago

Try to set error_reporting(E_ALL) in BOTH cases.

afoster1955 commented 1 week ago

Still a blank page.

In the multi-language version 2.3.7 (which is the latest I can find), the code at the beginning of the init.php file looks like this.

`/vot/ if (!is_file('config.php')) { /vot/ @copy('config.sample.php', 'config.php'); /vot/ }

/vot/ define('EMLOG_ROOT', str_replace('\', '/', DIR));

require_once EMLOG_ROOT . '/config.php';

//vot const ENVIRONMENT = 'production'; // Operating environment: production - production environment, develop - development environment if (getenv('EMLOG_ENV') === 'develop' || ENVIRONMENT === 'develop') { error_reporting(E_ALL); /vot/ define('DEV_MODE', true); } else { error_reporting(E_ALL);`

I'm thinking that the EMLOG ROOT is not being defined correctly so it is not finding the config file. My files are in a folder under the root folder and the url looks like this: http://localhost/mynewemlog/

The error log is now showing the following error message:

PHP Parse error: syntax error, unexpected 'endif' (T_ENDIF) in C:\webserver\root\mynewemlog\content\templates\default\module.php on line 516, referer: http://localhost/mynewemlog/install.php?action=install

Here are lines 514-516 of module.php

<?php endif ?> </div> <?php endif ?>

afoster1955 commented 1 week ago

Removing the second <?php endif ?> brought the home page up so at least it is not giving me a blank page anymore. However, I noticed on the links at the top of the home page, I see this: {Home} {Login}

Where/how do I remove the { } from the links?

codersclub commented 1 week ago

Thank you! But NO, you have to remove THE FIRST <?php endif ?> (line 514) not the SECOND one (line 516)! Resulting code must looks like below (start from line 511:

511:                <?php if ($comment['level'] < 4): ?>
512:                    <div class="comment-reply">
513:                        <span class="com-reply comment-replay-btn"><?= lang('reply') ?></span>
514:                    </div>
515:                <?php endif ?>
afoster1955 commented 1 week ago

OK, made the change to the code, however it did not change the Home and Login menu link in the header of the dark theme. It still looks like this: {Home} {Login} How do I remove the { }

In addition, when using the lighter theme, none of the links are visible including the title. I assume this is a css issue, but I can't seem to find where to change the code for it.

codersclub commented 1 week ago

I will check this...

codersclub commented 1 week ago

{Home} {Login} - this appears when keys are not found in the language files! Just add your keys 'Home', 'Login' into the lang/xx/lang_navigation.php: 'Home' => 'Home',//'首页', 'Login' => 'Login',//'.....',

codersclub commented 1 week ago

when using the lighter theme, none of the links are visible including the title. I assume this is a css issue Show me you screenshot. Better yet, give me the URL of your site so I can look at the page code myself.

afoster1955 commented 1 week ago

Thank you, adding the Keys to the lang files fixed the dark theme issue and I have emailed you the link to my site so you can see the issue with the lighter theme.

BTW, where can I find documentation in English that will show me how to add a page and a link for it. I assume that the added page will accept php coding?

codersclub commented 1 week ago

It seems CSS is fixed now...

afoster1955 commented 1 week ago

OK, changing the css file fixed it. Thanks for your help. Still not sure how to create a page with php code in it.