Keyword

Advanced Search

Search Results (Searched for: Re Error SQL)

  • Scott Ackerman
  • Scott Ackerman's Avatar
21 Sep 2011 19:21
Error building admin menus was created by Scott Ackerman

Error building admin menus

Category: English K2 Community

I have read in other forum posts that this is 'only' due to a Joomla 1.7 site that has been upgraded to 1.6 that is using Front Page Slideshow. Untrue! I have a fresh Joomla 1.7 install and am not using Front Page Slideshow and am not able to use K2 because of the error. I have the following extensions installed:

Akeebabackup 3.3.4Admin Tools 2.1.6Contact Enhanced 1.6.3Gantry 3.2.11JCE 2.0.14NoNumber Extension Manager with Advanced Module Manager, Articles Anywhere and Cache Cleaner installedVersions 1.851 by Fatica Consulting

 

PHP 2.6.32MySQL 5.1.52

I supposed I could start with a fresh install of 1.7 and iteratively add extensions and see when K2 won't install but I don't have any problem installing any other extensions so it certainly 'sounds' like a K2 installation issue.
  • Andreas Schoeneberg
  • Andreas Schoeneberg's Avatar
20 Sep 2011 14:58
Replied by Andreas Schoeneberg on topic [Solved] Can't build categories

[Solved] Can't build categories

Category: Frontpage Slideshow

Thanks for your quick replay. I tried to install version 3, but I get an error message:

JInstaller::install: SQL-Fehler DB function failed with error number 1064
Fehler in der Syntax bei 'DEFAULT CHARSET=utf8' in Zeile 12. SQL=CREATE TABLE IF NOT EXISTS `jos_fpss_categories` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `published` tinyint(1) unsigned NOT NULL, `ordering` int(11) NOT NULL, `language` char(7) NOT NULL, `params` text NOT NULL, PRIMARY KEY (`id`), KEY `published` (`published`), KEY `ordering` (`ordering`), KEY `language` (`language`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SQL =
CREATE TABLE IF NOT EXISTS `jos_fpss_categories` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `published` tinyint(1) unsigned NOT NULL,
  `ordering` int(11) NOT NULL,
  `language` char(7) NOT NULL,
  `params` text NOT NULL,
  PRIMARY KEY (`id`),
  KEY `published` (`published`),
  KEY `ordering` (`ordering`),
  KEY `language` (`language`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
  • Wesley Daniels
  • Wesley Daniels 's Avatar
15 Sep 2011 00:52
Replied by Wesley Daniels on topic FPSS Won't Let Me Add Any Slides :'( Need Help Please!

FPSS Won't Let Me Add Any Slides :'( Need Help Please!

Category: Frontpage Slideshow

Hi. A blank page indicates a PHP error. Set error reporting to maximum through Joomla! configuration in order to see what's the error. Also make sure that your server meets the requirements for running the Frontpage Slideshow.


Hi mate. How do i set error reporting to maximum? Also I read something about possibly needing to upgrade mySQL to solve this problem. How would I do this?

forum.joomlaworks.net/frontpage-slideshow-v1-v2-(for-joomla!)/(solved)-can-not-configure-new-slides-blank-page/?PHPSESSID=3549a9a38899df8bf52db39ccc81167c

Thanks in advance.

Wesley
  • Matthew Bibby
  • Matthew Bibby's Avatar
11 Sep 2011 08:33
Unable to change the basic menu options for K2 was created by Matthew Bibby

Unable to change the basic menu options for K2

Category: English K2 Community

Hi,

 

I am new to K2 and Joomla, so this may be a user error or perhaps a bug in the SVN.

 

When creating a K2 Categories Menu Item, I am unable to change the options shown in the attached image.  Clicking the dropdown boxes does nothing and I am not able to type in the text fields.

 

Any ideas on what could be causing this?

 

Thanks,

 

Matt

 

Joomla! version: 1.7 | K2 v2.5 (SVN) | PHP version: 5.2.6-1 lenny10 | MySQL version: 5.0.51a | Webserver version: Apache/2.2.9 (Debian) mod_jk/1.2.26 PHP/5.2.6-1 lenny10 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2 mod_ssl/2.2.9 OpenSSL/0.9.8g mod_perl/2.0.4 Perl/v5.10.0 | Joomla! template used: Panacea v1.6.2 (RocketTheme) 

 
  • that library
  • that library's Avatar
08 Sep 2011 18:21

k2_categories table has no language field in db - Joomla 1.6 with K2 SVN 2.5(RC)

Category: English K2 Community

I finally got upgraded (via Jupgrade) from Joomla v1.5.23 to 1.6.6, and installed the K2 SVN 2.5(RC) on the 1.6 site, which, thankfully is now acknowledged by J1.6 within the menu manager. This is a start but I'm having a strange issue that I hope someone can help me with:

 

I want to stress that the K2 content is in the j16_ database tables where it should be, I can see & access it within the admin area of the 1.6 site, but it's just not showing up on the front end at all. I think the major reason for this is because:


Each category's access column in the database j16_k2_categories is set to 0 instead of 1, when I try to change this for the parent category, I get a big db error, because:
There is no column for language, so when I try to change anything in the parent category (from which all others inherit their parameters (or any category), I get the following error:

TableK2Category: :store failedUnknown column 'language' in 'field list' SQL=UPDATE `j16_k2_categories` SET `name`='Library',`alias`='library-main',`description`=' **description went here**

',`parent`='0',`extraFieldsGroup`='1',`published`='1',`access`='1',`params`='{\"inheritFrom\":\"0\",\"theme\":\"\",\"num_leading_items\":\"2\",\"num_leading_columns\":\"1\",\"leadingImgSize\":\"Large\",\"num_primary_items\":\"4\",\"num_primary_columns\":\"2\",\"primaryImgSize\":\"Medium\",\"num_secondary_items\":\"4\",\"num_secondary_columns\":\"1\",\"secondaryImgSize\":\"Small\",\"num_links\":\"4\",\"num_links_columns\":\"1\",\"linksImgSize\":\"XSmall\",\"catCatalogMode\":\"0\",\"catFeaturedItems\":\"1\",\"catOrdering\":\"\",\"catPagination\":\"2\",\"catPaginationResults\":\"1\",\"catTitle\":\"1\",\"catTitleItemCounter\":\"1\",\"catDescription\":\"1\",\"catImage\":\"1\",\"catFeedLink\":\"1\",\"feedLink\":\"1\",\"subCategories\":\"1\",\"subCatColumns\":\"2\",\"subCatOrdering\":\"\",\"subCatTitle\":\"1\",\"subCatTitleItemCounter\":\"1\",\"subCatDescription\":\"1\",\"subCatImage\":\"1\",\"itemImageXS\":\"\",\"itemImageS\":\"\",\"itemImageM\":\"\",\"itemImageL\":\"\",\"itemImageXL\":\"\",\"catItemTitle\":\"1\",\"catItemTitleLinked\":\"1\",\"catItemFeaturedNotice\":\"0\",\"catItemAuthor\":\"1\",\"catItemDateCreated\":\"1\",\"catItemRating\":\"0\",\"catItemImage\":\"1\",\"catItemIntroText\":\"1\",\"catItemIntroTextWordLimit\":\"\",\"catItemExtraFields\":\"0\",\"catItemHits\":\"0\",\"catItemCategory\":\"1\",\"catItemTags\":\"1\",\"catItemAttachments\":\"0\",\"catItemAttachmentsCounter\":\"0\",\"catItemVideo\":\"0\",\"catItemVideoWidth\":\"\",\"catItemVideoHeight\":\"\",\"catItemVideoAutoPlay\":\"0\",\"catItemImageGallery\":\"0\",\"catItemDateModified\":\"0\",\"catItemReadMore\":\"1\",\"catItemCommentsAnchor\":\"1\",\"catItemK2Plugins\":\"1\",\"itemDateCreated\":\"1\",\"itemTitle\":\"1\",\"itemFeaturedNotice\":\"1\",\"itemAuthor\":\"1\",\"itemFontResizer\":\"1\",\"itemPrintButton\":\"1\",\"itemEmailButton\":\"1\",\"itemSocialButton\":\"1\",\"itemVideoAnchor\":\"1\",\"itemImageGalleryAnchor\":\"1\",\"itemCommentsAnchor\":\"1\",\"itemRating\":\"1\",\"itemImage\":\"1\",\"itemImgSize\":\"Large\",\"itemImageMainCaption\":\"1\",\"itemImageMainCredits\":\"1\",\"itemIntroText\":\"1\",\"itemFullText\":\"1\",\"itemExtraFields\":\"1\",\"itemDateModified\":\"1\",\"itemHits\":\"1\",\"itemTwitterLink\":\"1\",\"itemCategory\":\"1\",\"itemTags\":\"1\",\"itemShareLinks\":\"1\",\"itemAttachments\":\"1\",\"itemAttachmentsCounter\":\"1\",\"itemRelated\":\"1\",\"itemRelatedLimit\":\"5\",\"itemVideo\":\"1\",\"itemVideoWidth\":\"\",\"itemVideoHeight\":\"\",\"itemVideoAutoPlay\":\"0\",\"itemVideoCaption\":\"1\",\"itemVideoCredits\":\"1\",\"itemImageGallery\":\"1\",\"itemNavigation\":\"1\",\"itemComments\":\"1\",\"itemAuthorBlock\":\"1\",\"itemAuthorImage\":\"1\",\"itemAuthorDescription\":\"1\",\"itemAuthorURL\":\"1\",\"itemAuthorEmail\":\"0\",\"itemAuthorLatest\":\"1\",\"itemAuthorLatestLimit\":\"5\",\"itemK2Plugins\":\"1\"}',`language`='en-GB' WHERE id='23'


Even with the seo-friendly links turned on, J1.6 has /en/ within the links, so the language field in the k2_categories has to exist.

 

So clearly I need to add another field to not only the K2 categories, but where would it go? What I mean is where should I insert this field within that db table (in between something, at the end)? And would the items be able to be seen (retrieved properly) if it is only in the categories table after that?

Or do I need to execute a SQL query to insert it into the k2_items table as well?

 

It is worth noting that I do have a number of languages installed, but even before I installed them, all Joomla! categories & content are automatically listed as "Language - All." 

 

Can someone please help me out with this?

Bueller? Bueller?
  • warszcz
  • warszcz's Avatar
29 Aug 2011 16:26
import execution timout was created by warszcz

import execution timout

Category: English K2 Community

Hi,

during old joomla content import I received following error:

Fatal error: Maximum execution time of 30 seconds exceeded in /.../public_html/libraries/joomla/utilities/arrayhelper.php on line 163

I have some content to import (more or less 1000 articules, no images at all, largest category contain 4000 articles).

My ecosystem is: Joomla 1.5.23 (updated from initial 1.5.15)  / PHP 5.2.14 / Mysql 5.0.90-community.

Even I tried to archive part of old Joomla content; then import; then unarchive and archieve another part import and so on. But in Joomla! you can only archieve articules not categories, and it seems that even importing categories without any article takes a lot of time.

What advice? Any dimensioning? Any trick?

BTW:

Of course I have no access to php.ini to upper max_execution_time.- this is standard hosting not XAMP instalation.

BTW2: I am novice to K2 so I post it here, may be this is not a proper place - if so: please redirect the topic.

 

Best regards & Thanx in advance!
  • Tim Senft
  • Tim Senft's Avatar
28 Aug 2011 21:04

Error causing site to be sluggish and crash - public_html/components/com_k2/sef_ext/com_k2.php on line 98

Category: English K2 Community

Our site has been running slow since yesterday and is crashing often. We received this error once when navigating the site: DB function failed with error number 2006 MySQL server has gone away SQL=SELECT * FROM jos_k2_categories WHERE id=6 AND published=1 AND trash=0 AND access<=0 Warning: Invalid argument supplied for foreach() in /home/***/public_html/components/com_k2/sef_ext/com_k2.php on line 115 DB function failed with error number 2006 MySQL server has gone away SQL=SELECT * FROM jos_k2_categories WHERE id= AND published=1 AND trash=0 AND access<=0 Warning: Invalid argument supplied for foreach() in /home/****/public_html/components/com_k2/sef_ext/com_k2.php on line 98 DB function failed with error number 2006 MySQL server has gone away SQL=SELECT name, link,id FROM jos_menu WHERE id = 77 AND published='1' I forwarded the error message to our hosting provider and this was his reply: Thank you for contacting Hostgator.com. Mysql appears to be running fine ( if it was offline your site would not display) what seems to be the problem is with the joomla plugin com_k2 on this line of its code. /home/****/public_html/components/com_k2/sef_ext/com_k2.php 98 foreach ($fullPath as $path) { 115 foreach ($fullPath as $path) {' I was unable to login to your admin to test this plugin, you may want to check with the creator of the plugin. do you know what would be the cause of this problem and how to fix it? Thanks,
  • hans zuidinga
  • hans zuidinga's Avatar
23 Aug 2011 13:36 - 23 Aug 2011 13:40
Upgrade to version 3 doesn't work was created by hans zuidinga

Upgrade to version 3 doesn't work

Category: Frontpage Slideshow

a very good to you all,

we installed the upgrade (backup, uninstall version 2, install version 3).
verson worked fine.

www.fotolooman.nl

verson 3 gives these error messages:

Warning: Invalid argument supplied for foreach() in /www/htdocs/fotoloom/templates/theme018/html/mod_fpss/Movies/default.php on line 21

    «

    Warning: Invalid argument supplied for foreach() in /www/htdocs/fotoloom/templates/theme018/html/mod_fpss/Movies/default.php on line 70
    »
    Pause

This info is under the information tab:

Web server: Apache/2.2.17 (Unix) DAV/2 mod_ssl/2.2.17 OpenSSL/1.0.0d FrontPage/5.0.2.2635
PHP version: 5.2.17
MySQL version: 5.0.77
GD Image library: bundled (2.0.34 compatible)
Upload limit: 16M
Memory limit: 32M

is this a server issue or an install issue?

thanks in advance.
  • Edgar Javier Montero C.
  • Edgar Javier Montero C.'s Avatar
17 Aug 2011 20:20
1.6.x to 1.7 upgrade was created by Edgar Javier Montero C.

1.6.x to 1.7 upgrade

Category: Frontpage Slideshow

I have an installation of jommla I upgraded from 1.6.4 to version 1.7 currently I also I have to upgrade components and modules in this update my frontpage slideshow and I have the following error messages.

Warning: Invalid argument supplied for foreach() in /home/content/90/7666090/html/deporpana/libraries/joomla/database/database/mysql.php on line 368

my site is in Spanish not know if that has anything to do with the errors:

Warning: Invalid argument supplied for foreach() in /home/content/90/7666090/html/deporpana/administrator/components/com_fpss/views/slides/view.html.php on line 51

Warning: array_unshift() [function.array-unshift]: The first argument should be an array in /home/content/90/7666090/html/deporpana/administrator/components/com_fpss/helpers/html.php on line 39

Warning: Invalid argument supplied for foreach() in /home/content/90/7666090/html/deporpana/libraries/joomla/html/html/select.php on line 518

Warning: Invalid argument supplied for foreach() in /home/content/90/7666090/html/deporpana/administrator/components/com_fpss/views/slides/tmpl/default.php on line 61

Tengo una instalacion de jommla que he actualizado desde la 1.6.4 hasta actualmente la version 1.7 he igualmente tengo que actualizar los componentes y modulos, en este actualizo mi frontpage slideshow y tengo esos mensajes de error:

No se si afecta que mi web esta en español. y nunca utilizo el fihs
my site is in Spanish not know if that has anything to do with the errors
  • stavroch
  • stavroch's Avatar
11 Aug 2011 14:39

jos_jxfinder_links_terms3' is marked as crashed

Category: English K2 Community

Ι try to delete one category and I get the following error.

 

Table './XXXX/jos_jxfinder_links_terms3' is marked as crashed and should be repaired SQL=UPDATE `jos_jxfinder_terms` AS t INNER JOIN `jos_jxfinder_links_terms3` AS m ON m.term_id = t.term_id SET t.links = t.links - 1 WHERE m.link_id = 543

 

Do I have to run "REPAIR TABLE jos_k2_items" from MySQL as Joe posted on the community.getk2.org/forum/topics/invalid-arguement

 

Thank u.
  • Jerin Mehedi
  • Jerin Mehedi's Avatar
11 Jul 2011 14:31
Replied by Jerin Mehedi on topic Error create categories

Error create categories

Category: English K2 Community

sorry to interfare but my k2 link information say "


 

Web Server


Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635

PHP version
5.2.17

MySQL version
5.0.92-community

GD image library
bundled (2.0.34 compatible)

Multibyte string support
Enabled

Upload limit
2M

Memory limit
50M

Open remote files (allow url fopen)
Yes

 

 

 

 

 

 

 

 

 






But Still i cant create any categories and shows problem "" Fatal error: Call to undefined function mb_regex_encoding() in /home/blogalap/public_html/test/administrator/components/com_k2/tables/k2category.php on line 88 "
  • B_Dark
  • B_Dark's Avatar
31 May 2011 22:12

Is it possible to mass add a tag in all items of one category?!

Category: English K2 Community

  and I  started  thinking that is for php because I had never seen such a code for sql again :P

Andrea Vigato said:
hmm, what are you using to do the code? what file?

 

MySQL said: 
#1064 - 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 '$db =& JFactory::getDBO()' at line 1

 

the $db line is not into the query, so how it's possible mysql said that?

 

are you using the code from phpmyadmin maybe?

 

What i wrote down is to use in a php file, just load the file and then it will start the queries directly from PHP. 

You cannot do it from something else because you need to save variables and cycle.

 

If you want you can pass me the DB and i will do it for you directly now, i'm actually in free time :) or, you have to copy the code in a php file (also the index.php) and just load it. After that remove the code.

 
  • Andrea Vigato
  • Andrea Vigato's Avatar
31 May 2011 22:08

Is it possible to mass add a tag in all items of one category?!

Category: English K2 Community

hmm, what are you using to do the code? what file?

 

MySQL said: 
#1064 - 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 '$db =& JFactory::getDBO()' at line 1

 

the $db line is not into the query, so how it's possible mysql said that?

 

are you using the code from phpmyadmin maybe?

 

What i wrote down is to use in a php file, just load the file and then it will start the queries directly from PHP. 

You cannot do it from something else because you need to save variables and cycle.

 

If you want you can pass me the DB and i will do it for you directly now, i'm actually in free time :) or, you have to copy the code in a php file (also the index.php) and just load it. After that remove the code.

 
  • B_Dark
  • B_Dark's Avatar
31 May 2011 21:37

Is it possible to mass add a tag in all items of one category?!

Category: English K2 Community

Error
There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

ERROR: Unknown Punctuation String @ 5 STR: =& SQL: $db =& JFactory::getDBO();$db =& JFactory::getDBO();$db =& JFactory::getDBO();$db =& JFactory::getDBO();$db =& JFactory::getDBO();$db =& JFactory::getDBO();$db =& JFactory::getDBO();$db =& JFactory::getDBO();$db =& JFactory::getDBO();$db =& JFactory::getDBO();$db =& JFactory::getDBO();$db =& JFactory::getDBO();$db =& JFactory::getDBO();

SQL query:

$db =& JFactory::getDBO();

MySQL said:
#1064 - 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 '$db =& JFactory::getDBO()' at line 1


B_Dark said:
$db =& JFactory::getDBO(); $first_query = "SELECT ID FROM jos_k2_items WHERE catid=8"; $db->setQuery($first_query);$counter = $db->getNumRows(); $column= $db->loadResultArray(); $start_id = 44;for($i=0; $i<=$counter; $i++) {$second_query = "INSERT INTO jos_k2_tags_xref VALUES ($start_id, 40, $column[$i])"; $db->setQuery($second_query); $start_id++;}right?
  • B_Dark
  • B_Dark's Avatar
31 May 2011 19:36

Is it possible to mass add a tag in all items of one category?!

Category: English K2 Community

the right sec teble name is jos_k2_tags_xref#1064 - 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 'INSERT INTO jos_k2_tags_xref VALUES (44, 40, itemID) LIMIT 0, 30' at line 6
SELECT IDFROM jos_k2_itemsWHERE catid =33INSERT INTO jos_k2_tags_xrefVALUES ( [/code]44, 40, itemID ) LIMIT 0 , 30they give me this message, what i write wrong?[/code]
  • Stark Robert
  • Stark Robert's Avatar
24 May 2011 05:56
Error $text was created by Stark Robert

Error $text

Category: Simple Image Gallery PRO

Hi,

I continually get this error:

Undefined property: stdClass::$text in plugins\content\jw_sigpro.php

I am using UniServer 7.0.0 Orion:
Apache 2.2.17
MySQL 5.5.10
PHP 5.3.6 -

I am worried as this extension is used extensively throughout my sites - and rochenhost has announced the phasing out of php 5.2 at the end of this month and a lot of Joomla sites are hosted there: my.rochen.com/publicAnnouncements.php?ann_id=64

Is there a fix?
  • Nick
  • Nick's Avatar
06 May 2011 12:49
Replied by Nick on topic ERROR JUser::_load:

ERROR JUser::_load:

Category: English K2 Community

use a query like this:

 

UPDATE table_name

SET user_id = 77

WHERE user_id = 64

 

you have to run this in phpmyadmin or your mysql admin back-end
  • Gary Grant
  • Gary Grant's Avatar
03 May 2011 16:35

utilties.php error only on front page (but...its the front page)

Category: English K2 Community

Getting the following:  Warning: preg_match() [function.preg-match]: Compilation failed: regular expression is too large at offset 20 in ...components\com_k2\helpers\utilities.php on line 74

 

utilities.php attached

 

Cant go live with this.

 

My configuration is:

 


Web Server
Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0

PHP version
5.3.0

MySQL version
5.1.56-community

GD image library
2.0.35

Multibyte string support
Enabled

Upload limit
128M

Memory limit
128M

Open remote files (allow url fopen)
Yes
  • fjesteban
  • fjesteban's Avatar
26 Apr 2011 13:16

blog calendar doesn't pull from children categories

Category: English K2 Community

Dear Tomasso:

Your last post give me the cue: The URL is probably working right (you can test it by altering the date manually in it), but the date in the calendar is marked as linkable only if there are items in the parent category. You need an additional hack to fix it. Sorry for not giving it at first.

Here's the procedure:

1.- backup your <joomla_root>/modules/mod_k2_tools/helper.php
2.- Search for the class "MyCalendar". In my version it's at line 550
3.- The fuction getDateLink (lines 554 to 587 in my version) looks originally like this:
function getDateLink($day, $month, $year) {

$user = &JFactory::getUser();
$aid = $user->get('aid');
$db = &JFactory::getDBO();

$jnow = &JFactory::getDate();
$now = $jnow->toMySQL();
$nullDate = $db->getNullDate();

$query = "SELECT COUNT(*) FROM #__k2_items WHERE YEAR(created)={$year} AND MONTH(created)={$month} AND DAY(created)={$day} AND published=1 AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." ) AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." ) AND trash=0 AND access<={$aid} AND EXISTS(SELECT * FROM #__k2_categories WHERE id= #__k2_items.catid AND published=1 AND trash=0 AND access<={$aid})";

$catid = $this->category;
if ($catid > 0)
$query .= " AND catid={$catid}";

$db->setQuery($query);
$result = $db->loadResult();
if ($db->getErrorNum()) {
echo $db->stderr();
return false;
}

if ($result > 0) {
$itemID = JRequest::getInt('Itemid');
if ($catid > 0)
return JRoute::_('index.php?option=com_k2&view=itemlist&task=date&year='.$year.'&month='.$month.'&day='.$day.'&catid='.$catid.'&Itemid='.$itemID);
else
return JRoute::_('index.php?option=com_k2&view=itemlist&task=date&year='.$year.'&month='.$month.'&day='.$day.'&Itemid='.$itemID);

} else {
return false;
}
}

4.- And it should be replaced (the entire function) by the following code segment (it adds also the ability to resolve the whole month view with only one query to the database, so it renders 31 times faster) :

var $days_with_data = null;

function getMonthView($month, $year) {
$user = &JFactory::getUser();
$aid = $user->get('aid');
$db = &JFactory::getDBO();

$jnow = &JFactory::getDate();
$now = $jnow->toMySQL();
$nullDate = $db->getNullDate();

$query = "SELECT DISTINCT DAY(created) AS myday FROM #__k2_items WHERE YEAR(created)={$year} AND MONTH(created)={$month} AND published=1 AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." ) AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." ) AND trash=0 AND access<={$aid} AND EXISTS(SELECT * FROM #__k2_categories WHERE id= #__k2_items.catid AND published=1 AND trash=0 AND access<={$aid})";

$catid = $this->category;
if ($catid > 0) {
$categories = modK2ToolsHelper::getCategoryChildren($catid);
$categories[] = $catid;
$categories = @array_unique($categories);
$sql = @implode(',', $categories);
$query .= " AND catid IN ({$sql})";
}

$db->setQuery($query);
$this->days_with_data = $db->loadObjectList();
if ($db->getErrorNum()) {
echo $db->stderr();
}
return parent::getMonthView($month,$year);
}


function getDateLink($day, $month, $year) {
static $array = array();
$itemID = JRequest::getInt('Itemid');
foreach ($this->days_with_data as $day_with_data) {
array_push($array, $day_with_data->myday);
if ($day == $day_with_data->myday) {
$route='index.php?option=com_k2&view=itemlist&task=date&year={$year}&month={$month}&day={$day}";
if($this->category>0)
$route.="&catid={$this->category}";
return JRoute::_($route.'&Itemid='.$itemID);
} //if
} //foreach
return false;

}

And that's all. After this changes, your calendar should show the correct links, and it's also expected to appear faster (you can test it clicking on previous/next month). I've slightly modified the code before posting it to eliminate other hacks in my site. Please report back any problem you get.

Regards.
  • Yuriy Boev
  • Yuriy Boev's Avatar
18 Apr 2011 20:05

Internal Server Error after saving item, even without attached image

Category: English K2 Community

Hi all,

 

I know there are many threads regarding this problem, but I couldn't find any solution.

 

After saving changes to this: evroprogrami.com/minal-priem/myarka-312-podkrepa-za-sazdavane-i-razvitie-na-mikropredpriyatiya and many other articles I get Internal Server Error.

There are no images attached or else. Just plain text as you can see.

 

Changes to article body are committed, but I can't delete any Tag from this article.

 

The site is running:

 

Joomla 1.5.22,

PHP 5.2.12

MySQL 5.0.91

 

I have tried to increase PHP limits but still no success:

error_log=error_loglog_errors=Onerror_reporting = E_ALL & ~E_NOTICEexpose_php = Offmax_execution_time = 90set_time_limit = 0post_max_size = 100Mmax_input_time = 256memory_limit 128Moutput_buffering = Offsafe_mode=offvariables_order = "EGPCS"extension_dir = "./"

 

Thanks in advance for any help.
Displaying 621 - 640 out of 789 results.

Powered by Kunena Forum