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.

Modifications and Requests - 8

Post your modification and request questions for v7 here.
6,373 posts | Last Activity on 13-12-2019 12:18 by douwe_yntema
douwe_yntema
douwe_yntema 13-12-2019 12:18, 2 days ago
Re: TinyMCE Alternatieve Does anybody know if there is an alternative for the TinyMCE editor which produces responsive code in stead of standard html tables?
Oleg
Oleg 29-10-2019 18:52, 2 months ago
Re: Website language depending on client browser I applied this solution, I hope that it is correct. Maybe someone will come in handy.

Code
$sites = [
"en" => "/?lang=English",
"ru" => "/?lang=Russian",
];

$yaz = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);

if (!in_array($yaz, array_keys($sites))){
 $yaz = 'en';
}

header('Location: ' . $sites[$yaz]);

Oleg
Oleg 28-10-2019 12:47, 2 months ago
Re: Website language depending on client browser Good day. How can I make the site language display depending on the user's browser. For example, this method:
Code
$_SERVER['HTTP_ACCEPT_LANGUAGE']

Grimloch
Grimloch 09-05-2019 14:46, 7 months ago
Re: PHP Versions

Harlekin wrote:

@Harlekin
- I use the the Avatar Studio 2.3 with PHP 7.3.4. It works. What is the problem?

You know it would have been nice when you made this post/statement if you had told me that it was YOUR modified version of my infusion that was working fine for you! At any rate I d/l'ed the RAR file you attached in the previous post and have mine working fine also. Thanks !
Harlekin
Harlekin 09-05-2019 07:02, 7 months ago
Re: PHP Versions You find the avatar_functions.php and avatar_studio.php in the attachment that i use.
Grimloch
Grimloch 08-05-2019 15:20, 7 months ago
Re: PHP Versions No dice... does nothing.
RobiNN
RobiNN 08-05-2019 15:01, 7 months ago
Re: PHP Versions Here is issue: change $avaCats = ""; to $avaCats = [];
Grimloch
Grimloch 08-05-2019 14:32, 7 months ago
Re: PHP Versions That's not really an answer; Google returns thousands of possibilities with a LOT of cryptic code that requires an intimate knowledge of php's inner workings. However, when I do this per your suggestion:
Code
function loadAvaCats()
{
 $ignore = array('.', '..');
 $avaCats = "";
 if ($handle = opendir(AVATAR_FOLDER))
 {
 while (false !== ($file = readdir($handle)))
 {
 if(!in_array($file, $ignore) && !is_file(AVATAR_FOLDER . '/' . $file))
$avaCats = array();
 }
 }

 closedir($handle);
 return $avaCats;
 }

 return false;
}
 {


...it does nothing. But if I add $file like so:
Code
function loadAvaCats()
{
 $ignore = array('.', '..');
 $avaCats = "";
 if ($handle = opendir(AVATAR_FOLDER))
 {
 while (false !== ($file = readdir($handle)))
 {
 if(!in_array($file, $ignore) && !is_file(AVATAR_FOLDER . '/' . $file))
$avaCats = array($file);
 }
 }

 closedir($handle);
 return $avaCats;
 }

 return false;
}
 {


...it almost works but I get only 1 directory and 1 avatar image.
www.whisperwillow.com/my_panels/ava_studio.jpg
RobiNN
RobiNN 08-05-2019 13:23, 7 months ago
Re: PHP Versions OMG people Google still exists....

Code

$avaCats = []; // or $avaCats = array();
$avaCats[] = $file;

Grimloch
Grimloch 08-05-2019 13:10, 7 months ago
Re: PHP Versions @Harlekin

That's very bizarre. I just switched my PHP version from 7.2 to 7.3 and it still won't work. Here is the error I'm getting:
Code
[08-May-2019 08:02:14 America/Chicago] PHP Fatal error: Uncaught Error: [] operator not supported for strings in /home/xxxxxxxx/whisperwillow.com/infusions/avatar_studio/include/avatar_functions.php:14
Stack trace:
#0 /home/xxxxxxxx/whisperwillow.com/infusions/avatar_studio/avatar_studio.php(50): loadAvaCats()
#1 {main}
 thrown in /home/xxxxxxxx/whisperwillow.com/infusions/avatar_studio/include/avatar_functions.php on line 14


It does not like the [ ] operator. Here is the code line:
Code
$avaCats[] = $file;


Any suggestions?
Harlekin
Harlekin 08-05-2019 06:01, 7 months ago
Re: PHP Versions I use the the Avatar Studio 2.3 with PHP 7.3.4. It works. What is the problem?
Wanabo
Wanabo 07-05-2019 17:45, 7 months ago
Re: PHP Versions Well it could work if the server has multiple php versions installed.
Take a look here, https://stackoverflow.com/questions/12561203/how-to-change-php-version-in-htaccess-in-server

You could add an htaccess file with AddHandler application/x-httpd-php56 .php in it and place it in the infusion folder of the infusion you want to run on an older php version.

Or if this infusion is very important, switch back the whole site to php v5.6(latest). A php-fusion v8 site runs ok on php 5.6.
In the mean time look at the error pages for depreciation notices and try to find solutions that are php v7 proof. If you fixed that go back to php v7
Grimloch
Grimloch 07-05-2019 12:21, 7 months ago
Re: PHP Versions Thanks Falk for your reply. I was 99.9% sure it would not work. I have identified the problem areas just can't solve them so far but I will eventually get it. Please mark this as solved/closed.
Falk
Falk 07-05-2019 06:16, 7 months ago
Re: PHP Versions In short no, You need to try to identify problem areas and correct em to work on a higher version.
Grimloch
Grimloch 06-05-2019 19:42, 7 months ago
Re: PHP Versions I have what may be a silly question. When running Fusion v8 under PHP Version7 is it possible to run a script/scripts under PHP 5.6? In other words can you change PHP versions on the fly for a specific infusion? The reason I ask is that my Avatar Studio will not run under PHP Version7 but has been running just fine for years under all PHP versions prior to 7. Until I can figure out how to fix the errors I am getting I'd like to be able to use it.
afoster
afoster 02-05-2019 20:27, 7 months ago
Re: Infusion Installation Problem Thanks douwe_yntena, I will check for that but a quick search did not show either render_favicon() or render_favicons() in any of the infusion files.
douwe_yntema
douwe_yntema 02-05-2019 19:05, 7 months ago
Re: Infusion Installation Problem The name of the function called is render_favicons, so it must be a typo in the infusions panel code. Search for render_favicon and replace with render_favicons.
afoster
afoster 30-04-2019 16:28, 7 months ago
Re: Infusion Installation Problem I came across an infusion (mi_tab_panel) by a developer on a Turkey site that is no longer around and tried to install it on a 8.00.21 version site that I have. It infused fine but when I tried to make any changes to the panels, all I got was a blank page. The error log on my webhost showed an error message that said "Fatal error, undefined function render_favicon()" in the admin_layout.php file in the theme/templates/ folder. I tried to // that particular line but that generated an error message that said "Fatal error, undefined function render_admin page" . There are no entries in the error log of php-fusion admin system module.

Anybody know how this can be fixed?
Cupid
Cupid 19-04-2019 06:28, 8 months ago
Re: using multiple databases Thank you for your response! I think I'm going to focus more on getting my sites up to date first and then worry about this.

It's not necessary right now since I could just use multi site.
Chan
Chan 19-04-2019 02:38, 8 months ago
Re: using multiple databases @cupid


Okay, then you can use the dbconnect() and then tie it to your 2nd's site DB_USERS.

In your 2nd site, see this line https://github.com/php-fusion/PHP-Fus...ss.php#L51

Before Line 51.
Code

$db_host = 'localhost';
$db_user = 'your-site1-db-user';
$db_pass = 'your-site1-db-pass';
$db_name = 'your-site1-dbname';
$db_port = 3306;
dbconnect($db_host, $db_user, $db_pass, $db_name, !empty($db_port) ? $db_port : 3306);
unset($db_host, $db_user, $db_pass, $db_port);



Then, you need to reconnect to back to the previous connection here:
https://github.com/php-fusion/PHP-Fus...e.php#L207
Code

include BASEDIR.'config.php';
$link = @dbconnect($db_host, $db_user, $db_pass, $db_name, !empty($db_port) ? $db_port : 3306);
unset($db_host, $db_user, $db_pass, $db_port);



Now compare both site's config.php file, make sure the site2 one is same as site1
Code

define("COOKIE_PREFIX", "loremipsum_");



This will give your user same persistent login and when they visit the second site, they are continued to be login state.

Multisite is just is not as it seems. Don't be misguided :) That file should read 'constants.php'

To have "multisite" you need - "multi" connections, but as everyone had mentioned here, you can only have 1 active connection. So you need to know where to close a connection and open a new connection line by the process workflow.

Caveat: I have not tested any of this. There are 2 system version 8 and version 9 to look into. I'm just typing this from the back of my head. These are just pointers to get you going. I don't have much room for another side lined test case. I have already 40+ open tabs on my IDE now. I can't lose my focus at this moment :)
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.