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.

Site & Forum Issues - 8

General issues related to site and forum management
923 posts | Last Activity on 08-05-2020 13:15 by Chan
C
Chan 08-05-2020 13:15, 24 days ago
Re: Maintenance mode redirects First, open config.php - note down your DB_PREFIX.

Now go to your hosting PHPMyAdmin, and in your database, click on the the SQL tab. Now, run the code below and click Go.

Code
UPDATE `[replace-your-db-prefix]_settings` SET `maintenance`=0

Falk
Falk 08-05-2020 13:13, 24 days ago
Re: Maintenance mode redirects I can not replicate that error , Did you replace index.php with your own content?
Anyway, to fix it you need PHPMyAdmin find settings table, find maintenance and set it to 0.
I
Ironman1M 07-05-2020 14:16, 25 days ago
Re: Maintenance mode redirects Hello, I am a noob in coding websites so I installed php fusion 8 and created basic things for the website, it worked but after turning on maintenance mode and logging out my website redirects me from maintenance.php to index.php and loops so I am kicked from website for too many redirects and I dont know how to solve this issue. How to disable maintenance with FTP? Thanks for answers and have a good day! smile
songiuno
songiuno 07-10-2019 20:33, 8 months ago
Re: Search function broken I finally got around to trying your solution for searching photos and entire site searches. I'm seeing no difference.
Harlekin
Harlekin 17-09-2019 12:27, 9 months ago
Re: Search function broken Not the best solution, but that's enough for me.

Code

/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| https://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: search.php
| Author: Robert Gaudyn (Wooya)
+--------------------------------------------------------+
| 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 __DIR__."/maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."search.php";
add_to_title($locale['global_202']);
if (!isset($_REQUEST['rowstart']) || !isnum($_REQUEST['rowstart'])) {
 $_REQUEST['rowstart'] = 0;
}
if (isset($_REQUEST['stext'])) {
 if (is_array($_REQUEST['stext'])) {
 redirect(FUSION_SELF);
 } else {
 $_REQUEST['stext'] = urlencode(stripinput($_REQUEST['stext']));
 }
} else {
 $_REQUEST['stext'] = "";
}
if (isset($_REQUEST['method'])) {
 $_REQUEST['method'] = ($_REQUEST['method'] == "OR" || $_REQUEST['method'] == "AND") ? $_REQUEST['method'] : "OR";
} else {
 $_REQUEST['method'] = "OR";
}
if (isset($_REQUEST['datelimit'])) {
 $_REQUEST['datelimit'] = isnum($_REQUEST['datelimit']) ? $_REQUEST['datelimit'] : 0;
} else {
 $_REQUEST['datelimit'] = 0;
}
if (isset($_REQUEST['fields'])) {
 $_REQUEST['fields'] = isnum($_REQUEST['fields']) ? $_REQUEST['fields'] : 2;
} else {
 $_REQUEST['fields'] = 2;
}
if (isset($_REQUEST['sort'])) {
 $_REQUEST['sort'] = in_array($_REQUEST['sort'], ["datestamp", "subject", "author"]) ? $_REQUEST['sort'] : "datestamp";
} else {
 $_REQUEST['sort'] = "datestamp";
}
if (isset($_REQUEST['order'])) {
 $_REQUEST['order'] = isnum($_REQUEST['order']) ? $_REQUEST['order'] : 0;
} else {
 $_REQUEST['order'] = 0;
}
if (isset($_REQUEST['chars'])) {
 $_REQUEST['chars'] = isnum($_REQUEST['chars']) ? ($_REQUEST['chars'] > 200 ? 200 : $_REQUEST['chars']) : 50;
} else {
 $_REQUEST['chars'] = 50;
}
if (isset($_REQUEST['forum_id'])) {
 $_REQUEST['forum_id'] = isnum($_REQUEST['forum_id']) ? $_REQUEST['forum_id'] : 0;
} else {
 $_REQUEST['forum_id'] = 0;
}
$radio_button = [];
$form_elements = [];
$available = [];
$dh = opendir(INCLUDES."search");
while (FALSE !== ($entry = readdir($dh))) {
 if ($entry != "." && $entry != ".." && preg_match("/include_button.php/i", $entry)) {
 $available[] = str_replace("search_", "", str_replace("_include_button.php", "", $entry));
 }
}
closedir($dh);
$available[] = "all";
if (isset($_REQUEST['stype'])) {
 $_REQUEST['stype'] = in_array($_REQUEST['stype'], $available) ? $_REQUEST['stype'] : "all";
}
if (!isset($_REQUEST['stype'])) {
 $_REQUEST['stype'] = $settings['default_search'];
}
$c_available = count($available);
for ($i = 0; $i < $c_available - 1; $i++) {
 include(INCLUDES."search/search_".$available[$i]."_include_button.php");
}
sort($radio_button);
opentable($locale['400']);
// maybe rewrite with jQuery
$search_js = "\n/* $search_js .= "function display(val) {\nswitch (val) {\n";
foreach ($form_elements as $type => $array1) {
 $search_js .= "case '".$type."':\n";
 foreach ($array1 as $what => $array2) {
 foreach ($array2 as $elements => $value) {
 if ($what == "enabled") {
 $search_js .= "document.getElementById('".$value."').disabled = false;\n";
 } else if ($what == "disabled") {
 $search_js .= "document.getElementById('".$value."').disabled = true;\n";
 } else if ($what == "display") {
 $search_js .= "document.getElementById('".$value."').style.display = 'block';\n";
 } else if ($what == "nodisplay") {
 $search_js .= "document.getElementById('".$value."').style.display = 'none';\n";
 }
 }
 }
 $search_js .= "break;\n";
}
$search_js .= "case 'all':\n";
$search_js .= "document.getElementById('datelimit').disabled = false;\n";
$search_js .= "document.getElementById('fields1').disabled = false;\n";
$search_js .= "document.getElementById('fields2').disabled = false;\n";
$search_js .= "document.getElementById('fields3').disabled = false;\n";
$search_js .= "document.getElementById('sort').disabled = false;\n";
$search_js .= "document.getElementById('order1').disabled = false;\n";
$search_js .= "document.getElementById('order2').disabled = false;\n";
$search_js .= "document.getElementById('chars').disabled = false;\n";
$search_js .= "break;\n}\n}\n/*]]>*/\n";
add_to_footer($search_js);
echo "
\n";
echo "\n\n";
echo "\n";
echo "\n\n";
echo "\n";
echo "\n";
echo "\n\n";
echo "\n";
echo "\n";
echo "\n\n";
echo "\n";
echo "\n\n
".$locale['401']."
\n";
echo "\n";
echo "\n
\n";
echo "
\n";
echo "
".$locale['405']."".$locale['406']."
\n";
echo "\n";
foreach ($radio_button as $key => $value) {
 echo "\n\n\n";
}
echo "\n";
echo "\n";
echo "\n
".$value."
\n
\n";
echo "\n\n";
echo "\n";
echo "\n";
echo "\n\n";
echo "\n";
echo "\n";
echo "\n\n";
echo "\n";
echo "\n";
echo "\n\n";
echo "\n";
echo "\n";
echo "\n\n";
echo "\n";
echo "\n";
echo "\n
".$locale['420']."
 
\n";
echo "
\n";
echo "
".$locale['440']." 
 
\n";
echo "
".$locale['460']." ".$locale['461']."
\n";
echo "
\n
\n";
closetable();
function search_striphtmlbbcodes($text) {
 $text = preg_replace("[\[(.*?)\]]", "", $text);
 $text = preg_replace("<\<(.*?)\>>", "", $text);
 return $text;
}
function search_textfrag($text) {
 if ($_REQUEST['chars'] != 0) {
 $text = nl2br(stripslashes(substr($text, 0, $_REQUEST['chars'])."..."));
 } else {
 $text = nl2br(stripslashes($text));
 }
 return $text;
}
function search_stringscount($text) {
 global $swords;
 $count = 0;
 if (is_array($swords)) {
 $c_swords = count($swords); //sizeof($swords)
 for ($i = 0; $i < $c_swords; $i++) {
 $count += substr_count(strtolower($text), strtolower($swords[$i]));
 }
 }
 return $count;
}
function search_querylike($field) {
 global $swords;
 $querylike = "";
 $c_swords = number_format(count((array)$swords)); //sizeof($swords)
 for ($i = 0; $i < $c_swords; $i++) {
 $querylike .= $field." LIKE '%".(!empty($swords[$i]) ? $swords[$i] : ' ')."%'".($i < $c_swords - 1 ? " ".$_REQUEST['method']." " : "");
 }
 return $querylike;
}
function search_fieldsvar() {
 $fieldsvar = "(";
 $numargs = func_num_args();
 for ($i = 0; $i < $numargs; $i++) {
 $fieldsvar .= func_get_arg($i).($i < $numargs - 1 ? " || " : "");
 }
 $fieldsvar .= ")";
 return $fieldsvar;
}
function search_globalarray($search_result) {
 global $search_result_array, $global_string_count, $memory_limit;
 $global_string_count += strlen($search_result);
 if ($memory_limit > $global_string_count) {
 $search_result_array[] = $search_result;
 $memory_exhaused = FALSE;
 } else {
 $memory_exhaused = TRUE;
 }
 return $memory_exhaused;
}
function search_navigation($rows) {
 global $site_search_count, $composevars;
 $site_search_count += $rows;
 $navigation_result = "
\n".makePageNav($_REQUEST['rowstart'], 20, $site_search_count, 3, BASEDIR."search.php?stype=".$_REQUEST['stype']."&stext=".urlencode($_REQUEST['stext'])."&".$composevars)."\n
\n";
 return $navigation_result;
}
$composevars = "method=".$_REQUEST['method']."&datelimit=".$_REQUEST['datelimit']."&fields=".$_REQUEST['fields']."&sort=".$_REQUEST['sort']."&order=".$_REQUEST['order']."&chars=".$_REQUEST['chars']."&forum_id=".$_REQUEST['forum_id']."&";
$memory_limit = str_replace("m", "", strtolower(ini_get("memory_limit"))) * 1024 * 1024;
$memory_limit = !isnum($memory_limit) ? 8 * 1024 * 1024 : $memory_limit < 8 * 1024 * 1024 ? 8 * 1024 * 1024 : $memory_limit;
$memory_limit = $memory_limit - ceil($memory_limit / 4);
$global_string_count = 0;
$site_search_count = 0;
$search_result_array = [];
$navigation_result = "";
$items_count = "";
$_REQUEST['stext'] = urldecode($_REQUEST['stext']);
if ($_REQUEST['stext'] != "" && strlen($_REQUEST['stext']) >= 3) {
 add_to_title($locale['global_201'].$locale['408']);
 opentable($locale['408']);
 $fswords = explode(" ", $_REQUEST['stext']);
 $swords = [];
 $iwords = [];
 $c_fswords = count($fswords); //sizeof($fswords)
 for ($i = 0; $i < $c_fswords; $i++) {
 if (strlen($fswords[$i]) >= 3) {
 $swords[] = $fswords[$i];
 } else {
 $iwords[] = $fswords[$i];
 }
 }
 unset($fswords);
 $c_swords = count($swords);
 if ($c_swords == 0) {
 redirect(FUSION_SELF);
 } //sizeof($swords)
 $higlight = "";
 $i = 1;
 foreach ($swords as $hlight) {
 $higlight .= "'".$hlight."'";
 $higlight .= ($i < $c_swords ? "," : "");
 $i++;
 }
 add_to_head("");
 $highlight_js = "";
 $highlight_js .= "/*  $highlight_js .= "jQuery(document).ready(function(){";
 $highlight_js .= "jQuery('.search_result').highlight([".$higlight."],{wordsOnly:true});";
 $highlight_js .= "jQuery('.highlight').css({backgroundColor:'#FFFF88'});"; //better via theme or settings
 $highlight_js .= "});";
 $highlight_js .= "/*]]>*/";
 $highlight_js .= "";
 add_to_footer($highlight_js);
 if ($_REQUEST['stype'] == "all") {
 $dh = opendir(INCLUDES."search");
 while (FALSE !== ($entry = readdir($dh))) {
 if ($entry != "." && $entry != ".." && preg_match("/include.php/i", $entry)) {
 include(INCLUDES."search/".$entry);
 }
 }
 closedir($dh);
 } else {
 include INCLUDES."search/search_".$_REQUEST['stype']."_include.php";
 }
 $c_iwords = count($iwords);
 if ($c_iwords) {
 $txt = "";
 for ($i = 0; $i < $c_iwords; $i++) {
 $txt .= $iwords[$i].($i < $c_iwords - 1 ? ", " : "");
 }
 echo "
".sprintf($locale['502'], $txt)."

";
 }
 if ($_REQUEST['stype'] == "all") {
 $navigation_result = search_navigation(0);
 echo "
".$items_count."
".THEME_BULLET." ".$site_search_count." ".$locale['510']."

";
 } else {
 echo $items_count."
";
 }
 $c_search_result_array = count($search_result_array);
 if ($_REQUEST['stype'] == "all") {
 $from = $_REQUEST['rowstart'];
 $to = ($c_search_result_array - ($_REQUEST['rowstart'] + 10)) <= 0 ? $c_search_result_array : $_REQUEST['rowstart'] + 10;
 } else {
 $from = 0;
 $to = $c_search_result_array < 10 ? $c_search_result_array : 10;
 }
 echo "
\n";
 foreach ($search_result_array as $search_result_all) {
      echo $search_result_all."
";
   }
 echo "
\n";
 if ($_REQUEST['stype'] != "all") {
      echo $navigation_result;
   }
 closetable();
} else if (isset($_REQUEST['stext'])) {
 add_to_title($locale['global_201'].$locale['408']);
 opentable($locale['408']);
 echo $locale['501'];
 closetable();
}
require_once THEMES."templates/footer.php";

E
Ernst74 15-09-2019 07:34, 9 months ago
Re: Search function broken I also have problems with the search.
Wanabo
Wanabo 11-09-2019 15:32, 9 months ago
Re: Search function broken Same here. Not attempted to fix it. I consider removing searching entire site, because it looks like mysql times out.
songiuno
songiuno 09-09-2019 19:17, 9 months ago
Re: Search function broken I have v8.00.21 installed in two instances (2 sites) and in both, the search function seems to work correctly only for forum, news, but not for entire site, photos, etc.. Has anyone noticed/found a fix for this?
Falk
Falk 26-07-2019 18:42, 10 months ago
Re: Number format for counter Label added for 8 aswell.
D
DK666 26-07-2019 15:51, 10 months ago
Re: Resizing pictures in forum

Falk wrote:

@Falk
- See your theme for the classes forum-img-wrapper & forum-img, otherwise it is controlled with img_bbcode_include.php where you can apply Bootstrap html to it if you have Bootstrap enabled.


I am using Ddraig theme and tried to look in the css sheet, but yet couldn't find anything close enough that could help fix the problem... I don't really want apply bootstrap as it messes up theme a bit, which causes more pain in the bum. Any ideas what exactly i need to look in the theme? Perhaps there is a code that I can change..

TIA


.·´`·.·´¯`·.› ‹.·´¯`·.·´`·..·´`·.·´¯`·.› ‹.·´¯`·.·´`·..·´`·.·´¯`·.› ‹.·´¯`·.·´`·..·´`·.·´¯`·.› ‹.·´¯`·.·´`·.


Ok I managed to change the code in img_bbcode_include.php
In case someone wants to try here is the code :)

Code
if (!defined("IN_FUSION")) { die("Access Denied"); }
 
if (!function_exists("img_bbcode_callback")) {
function img_bbcode_callback($matches) {
if (substr($matches[3], -1, 1) != "/") {
return "".$matches[3].$matches[4]."";
} else {
return $matches[0];
}
}
}
 
$text = preg_replace_callback("#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#si", "img_bbcode_callback", $text);
?>

Wanabo
Wanabo 26-07-2019 14:46, 10 months ago
Re: Number format for counter Any chance this will be available for v8 as well?
Falk
Falk 24-07-2019 19:31, 10 months ago
Re: Resizing pictures in forum See your theme for the classes forum-img-wrapper & forum-img, otherwise it is controlled with img_bbcode_include.php where you can apply Bootstrap html to it if you have Bootstrap enabled.
D
DK666 24-07-2019 03:34, 10 months ago
Re: Resizing pictures in forum Hi guys!
Maybe someone could shed a light for me. When I make a thread and include a picture with [img][/img] bbcode, the image resizes to much smaller version than I need. How do I leave image in its original size? I have been trying to look in the forum for similar threads and tried to do some steps like changing in img_bbcode_include.php as well as jscript.js files but nothing really helps. Perhaps, I am doing something wrong.

Any help or directions would be appreciated.

Thank you in advance. smile
C
Chan 18-07-2019 03:25, 11 months ago
Re: Number format for counter Added Issue: https://github.com/php-fusion/PHP-Fusion/issues/2238
Wanabo
Wanabo 21-05-2019 18:55, 1 year ago
Re: Number format for counter I think like the date and time format there is also a setting needed for the number format.
My counter shows 1,000,000 (Anglo America notation), but I want it European style notation like so: 1.000.000

Quick fix:
Open \includes\theme_functions_include.php and find around line 427
Code
function showcounter() {
 global $locale, $settings;
 if ($settings['visitorcounter_enabled']) {
 return "".number_format($settings['counter'])." ".($settings['counter'] == 1 ? $locale['global_170'] : $locale['global_171']);
 } else {
 return "";
 }
}



Change to:
Code
function showcounter() {
 global $locale, $settings;
 if ($settings['visitorcounter_enabled']) {
 return "".number_format($settings['counter'],0,",",".")." ".($settings['counter'] == 1 ? $locale['global_170'] : $locale['global_171']);
 } else {
 return "";
 }
}



Please add this option.
songiuno
songiuno 24-08-2018 23:03, 2 years ago
Re: How to Share profile avatar among multi-sites It works, thanks!
douwe_yntema
douwe_yntema 24-08-2018 21:43, 2 years ago
Re: How to Share profile avatar among multi-sites The only thing I know what works is manual copy the pictures. Same for pictures in news or custom pages. You can share database tables but not other files.
songiuno
songiuno 24-08-2018 21:21, 2 years ago
Re: How to Share profile avatar among multi-sites Hello,

Does anyone know how to get profile avatars to display/show across PHP-Fusion V7.02.07 multi-sites from the avatar set in the profile of the main site? I've been running two sites for a few years and am trying to tweak them until I'm ready to jump to v9.x. My main site's DB prefix is fusionrsl15.

Following the v7 manual, the multisite_include.php on my second site looks like this:

Code
// Database table definitions
define("DB_ADMIN", DB_PREFIX."admin");
define("DB_ADMIN_RESETLOG", DB_PREFIX."admin_resetlog");
define("DB_ARTICLE_CATS", DB_PREFIX."article_cats");
define("DB_ARTICLES", DB_PREFIX."articles");
define("DB_BBCODES", DB_PREFIX."bbcodes");
define("DB_BLACKLIST", DB_PREFIX."blacklist");
define("DB_CAPTCHA", DB_PREFIX."captcha");
define("DB_COMMENTS", DB_PREFIX."comments");
define("DB_CUSTOM_PAGES", DB_PREFIX."custom_pages");
define("DB_DOWNLOAD_CATS", DB_PREFIX."download_cats");
define("DB_DOWNLOADS", DB_PREFIX."downloads");
define("DB_EMAIL_VERIFY", DB_PREFIX."email_verify");
define("DB_ERRORS", DB_PREFIX."errors");
define("DB_FAQ_CATS", DB_PREFIX."faq_cats");
define("DB_FAQS", DB_PREFIX."faqs");
define("DB_FLOOD_CONTROL", DB_PREFIX."flood_control");
define("DB_FORUM_ATTACHMENTS", DB_PREFIX."forum_attachments");
define("DB_FORUM_POLL_OPTIONS", DB_PREFIX."forum_poll_options");
define("DB_FORUM_POLL_VOTERS", DB_PREFIX."forum_poll_voters");
define("DB_FORUM_POLLS", DB_PREFIX."forum_polls");
define("DB_FORUM_RANKS", DB_PREFIX."forum_ranks");
define("DB_FORUMS", DB_PREFIX."forums");
define("DB_INFUSIONS", DB_PREFIX."infusions");
define("DB_MESSAGES", DB_PREFIX."messages");
define("DB_MESSAGES_OPTIONS", DB_PREFIX."messages_options");
define("DB_NEW_USERS", DB_PREFIX."new_users");
define("DB_NEWS", DB_PREFIX."news");
define("DB_NEWS_CATS", DB_PREFIX."news_cats");
define("DB_ONLINE", DB_PREFIX."online");
define("DB_PANELS", DB_PREFIX."panels");
define("DB_PHOTO_ALBUMS", DB_PREFIX."photo_albums");
define("DB_PHOTOS", DB_PREFIX."photos");
define("DB_POLL_VOTES", DB_PREFIX."poll_votes");
define("DB_POLLS", DB_PREFIX."polls");
define("DB_POSTS", DB_PREFIX."posts");
define("DB_RATINGS", DB_PREFIX."ratings");
define("DB_SETTINGS", DB_PREFIX."settings");
define("DB_SETTINGS_INF", DB_PREFIX."settings_inf");
define("DB_SITE_LINKS", DB_PREFIX."site_links");
define("DB_SMILEYS", DB_PREFIX."smileys");
define("DB_SUBMISSIONS", DB_PREFIX."submissions");
define("DB_SUSPENDS", DB_PREFIX."suspends");
define("DB_THREAD_NOTIFY", DB_PREFIX."thread_notify");
define("DB_THREADS", DB_PREFIX."threads");
define("DB_USER_FIELD_CATS", "fusionrsl15_user_field_cats");
define("DB_USER_FIELDS", "fusionrsl15_user_fields");
define("DB_USER_GROUPS", "fusionrsl15_user_groups");
define("DB_USER_LOG", "fusionrsl15_user_log");
define("DB_USERS", "fusionrsl15_users");
define("DB_WEBLINK_CATS", DB_PREFIX."weblink_cats");
define("DB_WEBLINKS", DB_PREFIX."weblinks");
?>



My multi-site setup has been running fine far as I can see, with this one profile avatar exception.

Any help is appreciated.
M
matsta1 06-08-2018 15:06, 2 years ago
Re: Jpg's not showing in photogallery Yes, I ended up working out the issue. Turned out to be as simple as a setting on FileZilla that was corrupting my images as I uploaded them. ASCII vs Binary like
Falk
Falk 06-08-2018 14:59, 2 years ago
Re: Jpg's not showing in photogallery It looks ok to me now (?) , I guess you boosted sizes some in the settings. Usually the issue. Yeah wait for next release until upgrading. 9.03!
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.