Language Codes
- Joel Lipman
- Joomla
- Hits: 7203
Basically you've woken up this morning, visited your website, and all your K2 articles are gone !!!!
If you login to your Joomla! administration panel (back-end) and look under k2 items, you should get the following error:
Warning: Invalid argument supplied for foreach() in /home/public_html/administrator/components/com_k2/views/items/tmpl/default.php on line 80
If I went to K2 Comments, I'd get an additional error:
Warning: Invalid argument supplied for foreach() in /home/public_html/administrator/components/com_k2/views/items/tmpl/default.php on line 80 Warning: Invalid argument supplied for foreach() in /home/public_html/administrator/components/com_k2/views/comments/tmpl/default.php on line 145
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:
Warning: implode() [function.implode]: Invalid arguments passed in /home/.../public_html/includes/router.php on line 325
Where "..." is the path on your server.
So this is a comparison chart (at least in my opinion) of 3 major joomla template/extension providers. When I'm less caught up in work I'll try adding to this article. But here's some lazy stats:
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.
Watch the youtube video below which shows you how to do it
{youtube}UQkeT0o_U34{/youtube}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
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:
$_REQUEST['tmpl'] = 'component'; include('index.php');
There is some more text but it's in /* lines */ which means these are comments.
The quick solution is:
$_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');
The reporting solution (which tells your visitor what word caused an offense) is:
# 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; }
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:
To add more banned words, simply keep adding lines using the following syntax
# 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"; #...
or
# CREATE AN ARRAY OF BANNED WORDS $offensive_words=array("viagra","cialis","[url=","porn","a banned phrase"); #...
Additional Information: The Open Web Application Security Project (OWASP)
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:
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.
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?
This took me a while to do so I thought I'd document it for future reference. The Issue See the restore default...
What? This is a quick article to remind me how to move a Joomla administration section and to lock it down to a...
Are you getting a lot of spam, or junk messages sent via your Joomla site? I know certain components of Joomla let you...
What? So I'm getting an error like this: The requested page can't be found. An error has occurred while processing your...
Hide Menu Item from Registered and Special Refer to this link if you want to clean out a front-end admin interface...
What? A quick reminder on how to disable user registration in Joomla! CMS version 1.5.x without using the Joomla! CMS...
Applies to: Joomla! CMS 2.5.x Joomla Filter: Validation OnSave INT Forces the value to be an Integer UINT Forces the...
uploaded table find name case mysql work zoho following note create field date using version system google client time files source added parameter form need function list windows error used page joomla report script code would deluge data database where user order value first server creator website file license display JoelLipman.Com