Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Suspected Bugs and Errors - 8 Subforums

If you suspect you have found a bug or a code error post here.


3939 posts | Last Activity on 06-06-2019 19:26 by Falk
Falk
Falk 06-06-2019 19:26, 18 days ago
Re: Filemanager error It does in deed sound strange since it is just a file uploader that should follow settings, I am out of ideas on that one for now.
douwe_yntema
douwe_yntema 03-06-2019 17:28, 21 days ago
Re: Filemanager error It was all done whitin 5 sec, so I don't think so
Falk
Falk 03-06-2019 17:04, 21 days ago
Re: Filemanager error Perhaps taken to long?
douwe_yntema
douwe_yntema 03-06-2019 14:39, 21 days ago
Re: Filemanager error I tried to upload an file of 6 mb with the the filemanager in PF 8.0.21.

There comes an errror

Quote

Filetype not allowed
.

There are only appox 2 mb uploaded.
The setting in the config.php for the filemanager is set to 10 , this should be 10 mb i.m.o.
The phpinfo() displays 100 mb fileupload limit.

When I make the file (picture) smaller with Gimp (800 kb), everything works ok.

So the errormessage is wrong and the max allowed filezsize does not work.
Falk
Falk 02-06-2019 14:05, 22 days ago
Re: Bug in /forum/viewthread.php post# redirecting wrong. Thank you for the reports!
Wanabo
Wanabo 02-06-2019 09:30, 22 days ago
Re: Bug in /forum/viewthread.php post# redirecting wrong. After fiddling with RSS where I discovered that I needed to add pid to the url of the feed to go to the correct post I also found out that "post redirecting" by clicking on the #number of the post does not function properly. You only can see this problem if you click on a post# when it is not the first page.

I examined the code and the pid part was missing.
Change in viewthread.php


to


Full snippet with comment.
Code

 echo "\n".profile_link($data['user_id'], $data['user_name'], $data['user_status'])."\n";
 echo "\n";
 echo "
";
 echo "".$locale[\n";
 echo " #".($current_row + $_GET['rowstart']).""; // mod Wanabo, added pid for showing the wright post and avoiding problems referring to posts.
 echo " ".$locale[
\n";
 echo "
".$locale['505'].showdate("forumdate", $data['post_datestamp'])."
\n";
 echo "\n";
 echo "\n\n\n";
 if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar']) && $data['user_status'] != 6 && $data['user_status'] != 5) {
Wanabo
Wanabo 02-06-2019 09:11, 23 days ago
Re: Bug in infusions/rss_feeds_panel/feeds/rss_forums.php Found the problem!

Changed LEFT JOIN ".DB_POSTS." p ON t.thread_id = p.post_id
to
LEFT JOIN ".DB_POSTS." p ON t.thread_id = p.thread_id

After that at least the correct thread is shown but not the correct post. Fixed that to. Removed the GROUP BY. Now the latest 10 forum posts are shown.

Experienced programmers please take a look if I did it OK.

Edit in the meantime I found more problems. Code below is updated, put comments where I changed things.
Complete code from rss_forums.php
Code

/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: rss_forums.php
| Author: PHP-Fusion Development Team
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once dirname(__FILE__).'maincore.php';

if (file_exists(INFUSIONS.'rss_feeds_panel/locale/'.LOCALESET.'rss.php')) {
 $locale = fusion_get_locale('', INFUSIONS.'rss_feeds_panel/locale/'.LOCALESET.'rss.php');
} else {
 $locale = fusion_get_locale('', INFUSIONS.'rss_feeds_panel/locale/English/rss.php');
}

require_once INFUSIONS.'rss_feeds_panel/RSS.php';

    $result = dbquery("SELECT f.forum_id, f.forum_name, f.forum_lastpost, f.forum_postcount,
 f.forum_threadcount, f.forum_lastuser, f.forum_access,
 t.thread_id, t.thread_lastpost, t.thread_lastpostid, t.thread_subject, t.thread_postcount, t.thread_views, t.thread_lastuser, t.thread_poll,
 p.post_message, p.post_id
 FROM ".DB_FORUMS." f
 LEFT JOIN ".DB_THREADS." t ON f.forum_id = t.forum_id
 LEFT JOIN ".DB_POSTS." p ON t.thread_id = p.thread_id
 ".(multilang_table('FO') ? "WHERE f.forum_language='".LANGUAGE."' AND" : "WHERE")." f.forum_access=0 AND t.thread_hidden='0'
 ORDER BY p.post_datestamp DESC LIMIT 0,10
   "); // mod Wanabo, added , p.post_id so the link matches the content and is used in line 46. #post_'.$data['post_id']

 header('Content-Type: application/rss+xml; charset='.$locale['charset']);

// $rss = new RSS('forums', $settings['sitename'].' - '.$locale['rss_forums'].(multilang_table('FO') ? $locale['rss_in'].LANGUAGE : ''));
 $rss = new RSS('forums', $settings['sitename'].' - '.$locale['rss_forums']); // mod Wanabo, shorter title.

 if (dbrows($result) != 0) {
 while ($data = dbarray($result)) {
 $rss->AddItem($data['thread_subject'].' ['.$data['forum_name'].']', $settings['siteurl'].'forum/viewthread.php?forum_id='.$data['forum_id'].'&thread_id='.$data['thread_id'].'&pid='.$data['post_id'].'#post_'.$data['post_id'], nl2br(parseubb(parsesmileys(preg_replace('/\[quote.*\].*\[\/quote\]\s+/si', '', $data['post_message']))))); // mod Wanabo, added , p.post_id so I can get content for #post_'.$data['post_id'] and &pid. With &pid jumping to the correct forum post. Added nl2br, parseubb, parsesmiley and strip quotes for more beautyfull and readable feed contents.
 }

 } else {
 $rss->AddItem($settings['sitename'].' - '.$locale['rss_forums'], $settings['siteurl'], $locale['rss_nodata']);
 }

 $rss->Write();


In RSS.php I added some fixes to validate the feed. Pleas see my comments. Especially is important if you want to feed your rss to for example social media.
Code

/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: RSS.php
| Author: RobiNN
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/

// use \PHPFusion\Rewrite\Permalinks;

class RSS {
 private $max_items = 50000;
 private $items_count = 0;
 private $item_count = 0;
 private $buffer_size = 1000;
 private $writer;
 private $title;
 private $feed_url;
 private $description;

 public function __construct($feed_url = '', $title = NULL, $description = NULL) {
 $this->writer = new XMLWriter();
 $this->feed_url = $feed_url;
 $this->title = $title;
 $this->description = $description;

 //if (fusion_get_settings('site_seo') == 1 && !defined('IN_PERMALINK')) {
 // Permalinks::getPermalinkInstance()->handle_url_routing('');
 // }
 }

 private function CreateXML() {
 $this->item_count++;

 $this->writer->openMemory();
 $this->writer->startDocument('1.0', 'UTF-8');
 $this->writer->setIndent(TRUE);
 $this->writer->startElement('rss');
 $this->writer->writeAttribute('version', '2.0');
 $this->writer->writeAttribute('xmlns:content', 'http://purl.org/rss/1.0/modules/content/');
 $this->writer->writeAttribute('xmlns:atom', 'http://www.w3.org/2005/Atom');

 $this->writer->startElement('channel');

 $title = !empty($this->title) ? $this->title : fusion_get_settings('sitename');
 $this->writer->writeElement('title', $title);

 $this->writer->startElement('atom:link');
 $this->writer->writeAttribute('href', fusion_get_settings('siteurl').'infusions/rss_feeds_panel/feeds/rss_'.$this->feed_url.'.php');
 $this->writer->writeAttribute('rel', 'self');
 $this->writer->writeAttribute('type', 'application/rss+xml');
 $this->writer->endElement(); // close atom:link

 $this->writer->writeElement('link', fusion_get_settings('siteurl'));

 $description = !empty($this->description) ? $this->description : fusion_get_settings('description');
 $this->writer->writeElement('description', html_entity_decode($description)); // mod Wanabo, (html_entity_decode) fix for error element should not contain HTML
 }

 private function CloseXML() {
 if ($this->writer !== NULL) {
 $this->writer->endElement(); // close channel
 $this->writer->endElement(); // close rss
 $this->writer->endDocument();
 $this->Flush();
 }
 }

 public function Write() {
 $this->CloseXML();
 }

 private function Flush() {
 echo $this->writer->flush(TRUE);
 }

 public function AddItem($title, $link, $description) {
 if ($this->items_count === 0) {
 $this->CreateXML();
 } else if ($this->items_count % $this->max_items === 0) {
 $this->CloseXML();
 $this->CreateXML();
 }

 if ($this->items_count % $this->buffer_size === 0) {
 $this->Flush();
 }

 $this->writer->startElement('item');

 $this->writer->startElement('title');
 $this->writer->writeCData(html_entity_decode($title));
 $this->writer->endElement(); // close title

 $this->writer->writeElement('link', $link);

 if (!empty($description)) {
 $this->writer->startElement('description');
 $this->writer->writeCData(html_entity_decode($description));
 $this->writer->endElement(); // close description
 }

 $this->writer->writeElement('guid', html_entity_decode($link)); // mod Wanabo, added guid for becoming a valid RSS feed
 $this->writer->endElement(); // close item

 $this->items_count++;
 }
}
Wanabo
Wanabo 01-06-2019 17:53, 23 days ago
Re: Bug in infusions/rss_feeds_panel/feeds/rss_forums.php The RSS feed from the forum is not showing the correct content. My old rss shows it right.
Just open the links from the feed and you'll see that infusions/rss_feeds_panel/feeds/rss_forums.php is not showing the correct content.

  1. https://caiway.gebruikers.eu/infusions/rss_feeds_panel/feeds/rss_forums.php
  2. https://caiway.gebruikers.eu/rss/rss_f.php


Number 1 is the faulty one!
Falk
Falk 06-05-2019 06:44, 2 months ago
Re: Avatar problem in edit profile It is a known issue in Atom-X8 Theme, As you mention all work just the message is wrong.
Harlekin
Harlekin 05-05-2019 23:59, 2 months ago
Re: Avatar problem in edit profile On a new installed 8.00.22 site with english locale i have a problem with the avatar upload. The avatar is uploaded and correct in the profile but there is a message:

Quote

Update failed for the following reason(s):

Your avatar was not uploaded correctly.
Please Try Again.
Wanabo
Wanabo 25-04-2019 07:43, 2 months ago
Re: charset utf8 or utf-8 like
(my previous reply was lost somehow)
Falk
Falk 25-04-2019 05:06, 2 months ago
Re: charset utf8 or utf-8 yeah, https://github.com/php-fusion/PHP-Fusion/commit/986afe561e2d268ec2ddc6e785c1da27799b53b9
Wanabo
Wanabo 24-04-2019 17:20, 2 months ago
Re: PHP error messages Thanks for fixing it.
Wanabo
Wanabo 24-04-2019 17:20, 2 months ago
Re: Typo? foreach ($user_groups as $ket => $user_group) { Thanks for fixing it.
RobiNN
RobiNN 24-04-2019 15:52, 2 months ago
Re: PHP error messages https://github.com/php-fusion/PHP-Fusion/commit/2f9cbfa82f9cc716342911c6d9462e9bffcb7714
RobiNN
RobiNN 24-04-2019 14:06, 2 months ago
Re: Typo? foreach ($user_groups as $ket => $user_group) { https://github.com/php-fusion/PHP-Fusion/commit/c52a2affcf6b7755a963094073013cff4189c317
RobiNN
RobiNN 24-04-2019 14:00, 2 months ago
Re: charset utf8 or utf-8 utf-8 is correct

php example
Code
header('Content-Type: text/html; charset=utf-8');

html
Code

htaccess
Code
AddCharset UTF-8 .php
Wanabo
Wanabo 24-04-2019 13:48, 2 months ago
Re: charset utf8 or utf-8 Upgrade_7.02.07_8.00.22/locale/English/setup.php#L6

Shouldn't $locale['charset'] = "utf8"; not be $locale['charset'] = "utf-8";

See: utf8-or-utf-8

Quote

According to IANA, only "UTF-8" is correct: iana.org/assignments/character-sets/character-sets.xml Giving "UTF8" as charset can lead to serious problems: stackoverflow.com/a/24323842/2733244 – wortwart May 20 '15 at 8:01
Wanabo
Wanabo 24-04-2019 12:53, 2 months ago
Re: Typo? foreach ($user_groups as $ket => $user_group) { Should it be,

foreach ($user_groups as $ket => $user_group) {
or
foreach ($user_groups as $key => $user_group) {



messages.php#L511
Falk
Falk 21-04-2019 09:03, 2 months ago
Re: PHP error messages Good find, !empty would be my first choice since it is cleaner and makes most sense procedural style.
You can view all discussion threads in this forum.
You can start a new discussion thread in this forum.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.