Thought I'd put this error in here and how I fixed it. Basically because firstly I don't want to have to create an account on someone else's forum just to post my answer and secondly because my solution is a "cowboy fix" rather than the other intelligent solutions on the web.

The issue was that I was building my first Joomla 1.5 component and getting the below error if I put in a menu:

copyraw
Warning: implode() [function.implode]: Invalid arguments passed in /home/.../public_html/includes/router.php on line 325
  1.  Warning: implode() [function.implode]: Invalid arguments passed in /home/.../public_html/includes/router.php on line 325 

Where "..." is the path on your server.

Category: Joomla :: Article: 275

We'd lost the menu/browsing interface button panel (well i had). This is how to make sure it shows on the template style and how to position it on the image slide show module that comes bundled with the extension.{youtube}qOWGxgyoqA4{/youtube}

Basically so that you can set all those SEO settings in the global configuration tab to YES.

Note: you need the permissions to rename the file ("htaccess.txt" to ".htaccess" in your website root folder). You'll need ftp access or a file manager with all your website files in).  Do not continue if you ONLY have control of the Joomla CMS.

joomla_seo_settings_all_yes.png

Watch the youtube video below which shows you how to do it

{youtube}UQkeT0o_U34{/youtube}

I was asked "... how do you find out where the positions are, like USER 1 and TAB 4 etc..."

To open a web-browser window or tab with this preview, type the following in the address bar after your website URL:

http://www.yourdomainname.com/index.php?tp=1&template=thetemplatename

  • where yourdomainname.com is your domain address
  • and thetemplatename is the name of the template (without spaces).
e.g. http://joellipman.com/index.php?tp=1&template=rt_affinity_j15
Or watch this boring video I made showing you how to do it: {youtube}VDEjI75zN3g{/youtube}

Are you getting a lot of spam, or junk messages sent via your Joomla site?

I know certain components of Joomla let you put banned words but I know of even more that don't.  If you find all your forms need extra plugins and captchas (such as JezRecaptcha), then the website security isn't amazing.  I used to have Captcha on my K2 by Joomlaworks but if you did the sound version, it didn't work properly.  I found that sometimes the captcha wouldn't even match what you typed and what it displayed!!!

I have written this article to be another one of those programmer's tweaks.  This is quite a simple fix and I will hopefully be able to keep it simple for non-programmers.  The tweak below will stop any of your pages submitting content containing your banned words.

We're going to modify a file containing 2 lines of code by default.  The file is index2.php in your Joomla root folder.  Make a copy of it, back it up or do whatever you usually do when you modify a server-side file... ahem...

The code by to look for (joomla default) should be as follows:

copyraw
$_REQUEST['tmpl'] = 'component';
include('index.php');
  1.  $_REQUEST['tmpl'] = 'component'
  2.  include('index.php')

There is some more text but it's in /* lines */ which means these are comments.

 

The quick solution is:

copyraw
$_REQUEST['tmpl'] = 'component';
$offensive_words=array("viagra","cialis","[url=","porn","pfizer");
if (is_array($_GET)) $GotVars.=implode(",", $_GET).",";
if (is_array($_POST)) $GotVars.=implode(",", $_POST).",";
for($i=0;$i<count($offensive_words);$i++) { if (stripos($GotVars, $offensive_words[$i])) $offense=true; } 
if (!$offense) include('index.php');
  1.  $_REQUEST['tmpl'] = 'component'
  2.  $offensive_words=array("viagra","cialis","[url=","porn","pfizer")
  3.  if (is_array($_GET)) $GotVars.=implode(",", $_GET).","; 
  4.  if (is_array($_POST)) $GotVars.=implode(",", $_POST).","; 
  5.  for($i=0;$i<count($offensive_words);$i++) { if (stripos($GotVars, $offensive_words[$i])) $offense=true} 
  6.  if (!$offense) include('index.php')

The reporting solution (which tells your visitor what word caused an offense) is:

copyraw
# CREATE AN ARRAY OF BANNED WORDS
$offensive_words=array();
$offensive_words[]="viagra";
$offensive_words[]="cialis";
$offensive_words[]="[url=";
$errors="";
 
# CONVERT THE SUBMITTED DATA INTO STRING(S)
$GotVars="";
if (is_array($_GET)) $GotVars.=strtolower(implode(",", $_GET).",");
if (is_array($_POST)) $GotVars.=strtolower(implode(",", $_POST).",");
 
# NOW CHECK EACH BANNED WORD DOES NOT EXIST IN THE STRING
for ($i=0; $i<count($offensive_words); $i++) {
	$offensive_string.=(stripos($GotVars, $offensive_words[$i])!==false)?"- ".$offensive_words[$i].", ":"";
}
# IF THE OFFENSIVE STRING WAS POPULATED (=FOUND BANNED WORDS) THEN CREATE A MESSAGE
$errors.=(trim($offensive_string)!="")?"You have submitted word(s) that the website administrator has banned:".$offensive_string.".  Please try again without the banned words.":"";
 
# IF THE ERRORS STRING IS EMPTY PROCEED AS NORMAL, IF NOT THEN DISPLAY MESSAGE
if (trim($offensive_string)=="") {
	include('index.php');
} else {
	echo $errors;
}
  1.  # CREATE AN ARRAY OF BANNED WORDS 
  2.  $offensive_words=array()
  3.  $offensive_words[]="viagra"; 
  4.  $offensive_words[]="cialis"; 
  5.  $offensive_words[]="[url="; 
  6.  $errors=""; 
  7.   
  8.  # CONVERT THE SUBMITTED DATA INTO STRING(S) 
  9.  $GotVars=""; 
  10.  if (is_array($_GET)) $GotVars.=strtolower(implode(",", $_GET).",")
  11.  if (is_array($_POST)) $GotVars.=strtolower(implode(",", $_POST).",")
  12.   
  13.  # NOW CHECK EACH BANNED WORD DOES NOT EXIST IN THE STRING 
  14.  for ($i=0$i<count($offensive_words)$i++) { 
  15.      $offensive_string.=(stripos($GotVars, $offensive_words[$i])!==false)?"- ".$offensive_words[$i].", ":""; 
  16.  } 
  17.  # IF THE OFFENSIVE STRING WAS POPULATED (=FOUND BANNED WORDS) THEN CREATE A MESSAGE 
  18.  $errors.=(trim($offensive_string)!="")?"You have submitted word(s) that the website administrator has banned:".$offensive_string.".  Please try again without the banned words.":""; 
  19.   
  20.  # IF THE ERRORS STRING IS EMPTY PROCEED AS NORMAL, IF NOT THEN DISPLAY MESSAGE 
  21.  if (trim($offensive_string)=="") { 
  22.      include('index.php')
  23.  } else { 
  24.      echo $errors
  25.  } 

My comments in the code above are prefixed with #. As you can see I actually tell the user what word they've used that's been banned. You could easily not do this by replacing echo $errors="" with the word Return in the second to last line.

To sum up: my code does the following:

  1. Add words to the "offensive_words" array
  2. Joins any submitted data into 1 long string
  3. Tries to find each "offensive word" (case-insensitive) in the submitted data
  4. Creates a message if there was a banned word found
  5. If no message created, it proceeds as per usual; if not, it does not submit the form

To add more banned words, simply keep adding lines using the following syntax

copyraw
# CREATE AN ARRAY OF BANNED WORDS
$offensive_words=array();
$offensive_words[]="viagra";
$offensive_words[]="cialis";
$offensive_words[]="[url=";
$offensive_words[]="porn";
$offensive_words[]="a banned phrase";
#...
  1.  # CREATE AN ARRAY OF BANNED WORDS 
  2.  $offensive_words=array()
  3.  $offensive_words[]="viagra"; 
  4.  $offensive_words[]="cialis"; 
  5.  $offensive_words[]="[url="; 
  6.  $offensive_words[]="porn"; 
  7.  $offensive_words[]="a banned phrase"; 
  8.  #... 

or

copyraw
# CREATE AN ARRAY OF BANNED WORDS
$offensive_words=array("viagra","cialis","[url=","porn","a banned phrase");
#...
  1.  # CREATE AN ARRAY OF BANNED WORDS 
  2.  $offensive_words=array("viagra","cialis","[url=","porn","a banned phrase")
  3.  #... 

Additional Information: The Open Web Application Security Project (OWASP)

Category: Joomla :: Article: 237

The reason I did this is because AEC is now a commercial package and it is somewhat limited in terms of good customer service.  It only really manages the payment side and the complicated tasks of invoicing, but Community Builder provides more options for your website members.  If Joomlapolis ever complete the CB Subscription component then there is no need for AEC anymore.

For this we're basically going to follow the AEC installation instructions backwards.

1. Go to your admin panel (back-end)
2. Extensions > Plugin Manager
3. Go to the bottom and change the display # dropdown to ALL
4. Disable Authentication - AEC Access
5. Enable Authentication - Joomla
6. Re-enable any other authentication plugin you used to use.
7. Disable System - AEC Routing
8. Disable System - AEC ErrorHandling
9. Extensions > Install/Uninstall > Plugins
10. Tick Authentication - AEC Access
11. Tick System - AEC ErrorHandling
12. Tick System - AEC Routing
13. Tick User - AEC User
14. Click the Uninstall icon at the top of the page
15. Click on the Modules link (to uninstall modules)
16. Tick mod_acctexp (if you installed this) and Uninstall.
17. Click on the Components link (to uninstall components)
18. Select AcctExp and click on the Uninstall icon.

Now install Community Builder
1. Download the latest version from Joomlapolis.com
2. Unzip to a folder
3. Login to your admin panel
4. Go to Extensions > Install/Uninstall
5. Install com_comprofiler.zip (remember to wait till it confirms it says "Installation finished")
6. Go back to Extensions > Install/Uninstall
7. Install mod_cblogin.zip
8. Install mod_comprofilerModerator.zip
9. Install mod_comprofilerOnline.zip
10. Go to Components > Community Builder
11. Click on the Tools link and click on Synchronize Users
12. Go to Extensions > Module Manager
13. Tick next to CB Login, CB Workflows, CB Online and click Enable
14. Return to Components > Community Builder > Configuration
15. Click on the 'Registration' tab
16. Change Allow User Registration to Yes, ...
17. Make your custom configuration and Save the configuration file.
18. Go to Site > Global Configuration > System
19. Select No next to Allow User Registration and click Save
 


After I installed the rokstories module from www.rockettheme.com, if I clicked on one of the articles (rokstory), I would get a page with the article on it but with the following error (3x) above it:

copyraw
Warning: Invalid argument supplied for foreach() in /home/.../components/com_content/helpers/route.php on line 106
  1.  Warning: Invalid argument supplied for foreach() in /home/.../components/com_content/helpers/route.php on line 106 

After googling I found an unlikely solution which is becoming typical of Joomla. I hadn't switched the site to SEF friendly yet but I did this just to follow along with the solution. You need to make a menuitem to just one of the articles. I have a menu called "unused menuitems" (named unusedmenu), which isn't displayed anywhere on my site. I'm guessing the reference in the database is what corrects this.

Category: Joomla :: Article: 230

 It took a few google searches until I could find out how to change the default weblinks order.  A lot of websites showed how to do this via the admin back-end panel in the advanced configuration... I can't see this panel, there is no advanced parameters under a weblinks category.

The issue is that suppose a menuitem links to a category of weblinks, the default sort order (as in the first time you view the page) is the order in the admin panel (not even by most recent).  I'm going to show you how to do this by title in ascending order without installing any 3rd-party extension as well as by any of the database values used by each link.


Malware Detected!

Warning: Visiting this site may harm your computer!

The website at .....ru appears to host malware - software that can hurt your computer or otherwise operate without your consent.  Just viisting a site that hosts malware can infect your computer.

For detailed information about the problems with this site, visit the Google Safe Browsing diagnostic page for this address

I understand that visiting this site may harm my computer.

Continue?

warning_malwaredetected.png


 The issue here is that you have added all your banners, divided between clients and categories and you're looking for a solution which doesn't involve installing a 3rd party applicatoin.

 Unfortunately the Joomla banner module only supports alternating between banners of either the same client OR the same category.  The setting is in your Joomla > Module Manager > Banner... What I do is I don't select a client but instead just select a category.  Set it to only display 1 banner at a time.  

If you want other categories to display, consider setting categories as vertical, horizontal and square banners.  This means that you can have 3 modules each displaying banners from each category and position these as appropriate.


Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

RSS Feed

Related Articles

Joes Revolver Map

Joes Word Cloud

note   find   parameter   first   user   zoho   joomla   added   deluge   file   table   creator   list   name   uploaded   time   server   files   client   data   page   source   would   database   form   need   windows   system   error   following   mysql   used   using   value   field   license   function   date   case   code   order   report   script   create   work   display   version   website   google   where   JoelLipman.Com

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin bc1qf6elrdxc968h0k673l2djc9wrpazhqtxw8qqp4

Ethereum:
Donate to Joel Lipman with Ethereum 0xb038962F3809b425D661EF5D22294Cf45E02FebF
© 2024 Joel Lipman .com. All Rights Reserved.