Author Topic: Random Items addon that works partially!!!  (Read 2328 times)


  • Confirmed Member
  • **
  • Posts: 6
  • Karma: +0/-0
Random Items addon that works partially!!!
« on: May 05, 2014, 05:40:15 AM »

I purchased your great clean slate template, and love it, great extras and addons you have done.
All installed by following the install instructions from the template package.

Also installed the "Random Items" addon.

These modules are installed on my site:
Module Name    Type
Basic Features (1.23)    Core
Default User Preferences (1.02)    Core
Blogs (1.01)    Core
Photo Album (1.02)    Core
Advanced Features (1.01)    Core
Random Items (1.04)    Core
2CheckOut (1.01)    Payment
Paypal (1.01)    Payment
Maxmind (1.01)    Fraud Check
Datemill Admin Feed (1.01)    Widget
Latest Blog Comments (1.01)    Widget
Original Signal Tech Feed (1.01)    Widget
Default Skin (1.03)    Skin

All the site working fine except the 'Random Items' that works partially.

When i try to customize the index page and add the configuration Option #3:
Featured Members -  Quick Search - Newest Members

It's not working and get an error:
index.php redirects me to info.php and a message, "Sorry, there has been an error processing your request. Please try again or notify the webmaster about the


here is the error log from the admin panel:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 20' at line 1
<br /><pre>Array
  • => Array

       (... more

only the code line with the 'members' and the 'mode'=>'rand' not working, all other combination modes working fine.

When I add the default Configuration Option #1:
Latest Blogs - Quick Search - Newest Members
all get to normal and working fine.

Should I reinstall the "Random Items" addon? and how to do that?
not see any option on the admin panel to remove addons.



  • Administrator
  • Veteran Member
  • *****
  • Posts: 3146
  • Karma: +212/-7
    • Maverick Webworks
Re: Random Items addon that works partially!!!
« Reply #1 on: May 05, 2014, 01:08:14 PM »

After installing the random item addon, possibly you uploaded and ovewrote the following file from the Etano default package.

A few people have done this which caused errors and random items not to work.

When you install the random items addon it makes changes to this file and if you upload the file from the Etano default package it won't have the changes that were made for the random items.

In the installation instructions that came with the template includes this statement:

Important Final Step - Once you have uploaded the template files to your server and checked to see if things look and work properly, you then need to have the complete updated version that's on your server downloaded and installed in a folder on your computer that you use to edit and upload from. The orginal default files that came with Etano are now redundant.

If you open and look at the following file on your server plugins/widget/members/members.class.php you should find some lines of code that were added from the random items installation, such as:
Code: [Select]
case 'rand':
$query="SELECT a.`fk_user_id`,UNIX_TIMESTAMP(a.`last_changed`) as `last_changed` FROM `{$dbtable_prefix}user_profiles` a WHERE a.`_photo`!='' AND a.`status`=".STAT_APPROVED." AND a.`del`=0";
if (isset($this->config['cmp_field']) && isset($this->config['cmp_to']) && !preg_match('/[^a-z0-9_]/',$this->config['cmp_field'])) {
if (!isset($this->config['cmp']) || !in_array($this->config['cmp'],array('=','>','<','>=','<=','like'))) {
$query.=" AND `".$this->config['cmp_field']."`".$this->config['cmp']."'".$this->config['cmp_to']."'";
$query.=" ORDER BY RAND(".mt_rand(0,1000).")";

If you don't see any code references regarding the random items (such as the code shown above), you can try replacing it with one that has already been configured by downloading the following file. Just unzip it and replace the included plugins/widget/members/members.class.php file with the one on your server.

Also try regenerating your skin in the Skin Settings section of your admin.

Fusion Responsive Template & Free Mods
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.


  • Confirmed Member
  • **
  • Posts: 6
  • Karma: +0/-0
Re: Random Items addon that works partially!!!
« Reply #2 on: May 05, 2014, 02:42:36 PM »
Thank you very very much, maverick.

My fault, lack of attention.  :x

The file fixed and all working great.


  • Veteran Member
  • *****
  • Posts: 265
  • Karma: +0/-0
Re: Random Items addon that works partially!!!
« Reply #3 on: November 09, 2018, 11:25:44 AM »
Thanks to Mr. Maverick

I was having the same issue and got confused while migrating the host.  But finally this post helped to resolve the issues.

Thanks Again.