Welcome, Guest
Username: Password: Remember me
This is the support for EventList 1.1.x, available here in the downloads section.

For all support requests, please provide your current versions of joomla, and of the extensions.

TOPIC:

Deleting past events from the front end 7 years 9 months ago #8978

The reason for not showing anything is probably due to missing 3 lines within the buildQuery. We are declaring c.published, but ofcourse the category's should be declared.

That can be done by linking the category's by adding a few lines
. ' c.catname, c.id AS catid,'
. ' LEFT JOIN #__eventlist_cats_event_relations AS rel ON rel.itemid = a.id'
. ' LEFT JOIN #__eventlist_categories AS c ON c.id = rel.catid'

Have to find if it's working correctly as expected so will dive into tomorrow some more.

--> sorry for the inconvenience
(won't respond to PM)
==================================================================
running: pre-alpha JEM 4.x (custom version) + Joomla 4.0.0-beta7 + PHP 7.3

Please Log in or Create an account to join the conversation.

Last edit: by Bluefox.

Deleting past events from the front end 7 years 9 months ago #8979

I added the extra but it just totally broke the page, giving me a 500 error. There's not many that require deleting now - I'll just do them manually from the backend. I really appreciate your help, but I'm sure you have better things to do than fiddle with unsupported version modules!

Thanks.
Ian Shere
CitrusKiwi Web Solutions LLC
Putting some "zest" in your business

Please Log in or Create an account to join the conversation.

Deleting past events from the front end 7 years 9 months ago #8980

Hi trogladyte,.

If you added it like the code below it should not give a 500 error.
Did try it with Joomla 1.5 & Eventlist v1.1
/**
	 * Build the query
	 *
	 * @access private
	 * @return string
	 */
	function _buildQuery()
	{
		// Get the WHERE and ORDER BY clauses for the query
		$where		= $this->_buildEventListWhere();
		$orderby	= $this->_buildEventListOrderBy();

		// Get Events from Database ...
		$query = ' SELECT a.id, a.dates, a.enddates, a.times, a.endtimes, a.title, a.created, a.locid, a.datdescription, a.maxplaces, a.waitinglist, '
		       . ' l.venue, l.city, l.state, l.url, l.street, ct.name AS countryname, '
		       	. ' c.catname, c.id AS catid,'
		       . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug,'
		       . ' CASE WHEN CHAR_LENGTH(l.alias) THEN CONCAT_WS(\':\', a.locid, l.alias) ELSE a.locid END as venueslug'
		       . ' FROM #__eventlist_events AS a'
		       . ' LEFT JOIN #__eventlist_venues AS l ON l.id = a.locid'
		       . ' LEFT JOIN #__eventlist_countries AS ct ON ct.iso2 = l.country '
				. ' LEFT JOIN #__eventlist_cats_event_relations AS rel ON rel.itemid = a.id'
				. ' LEFT JOIN #__eventlist_categories AS c ON c.id = rel.catid'
		       . $where
		       . ' GROUP BY a.id'
		       . $orderby
		       ;

		return $query;
	}


and

/**
	 * Build the where clause
	 *
	 * @access private
	 * @return string
	 */
	function _buildEventListWhere()
	{
		$app = & JFactory::getApplication();

		// Get the paramaters of the active menu item
		$params 	= & $app->getParams();

		$task 		= JRequest::getWord('task');
		
		// First thing we need to do is to select only needed events
		if ($task == 'archive') {
			$where = ' WHERE a.published = -1';
		} else {
			$where = ' WHERE a.published = 1';
		}
		
		$where .= ' AND c.published = 1';

		/*
		 * If we have a filter, and this is enabled... lets tack the AND clause
		 * for the filter onto the WHERE clause of the item query.
		 */
		if ($params->get('filter'))
		{
			$filter 		= JRequest::getString('filter', '', 'request');
			$filter_type 	= JRequest::getWord('filter_type', '', 'request');

			if ($filter)
			{
				// clean filter variables
				$filter 		= JString::strtolower($filter);
				$filter			= $this->_db->Quote( '%'.$this->_db->getEscaped( $filter, true ).'%', false );
				$filter_type 	= JString::strtolower($filter_type);

				switch ($filter_type)
				{
					case 'title' :
						$where .= ' AND LOWER( a.title ) LIKE '.$filter;
						break;

					case 'venue' :
						$where .= ' AND LOWER( l.venue ) LIKE '.$filter;
						break;

					case 'city' :
						$where .= ' AND LOWER( l.city ) LIKE '.$filter;
						break;
				}
			}
		}
		return $where;
	}


And you're right, there is much to do and other stuff needs some attention too. But nevertheless this is an issue that is also part of JEM, as it is based on Eventlist v1.1. So resolving the issue would be great.

But like said: will dive into it tomorrow some more
(won't respond to PM)
==================================================================
running: pre-alpha JEM 4.x (custom version) + Joomla 4.0.0-beta7 + PHP 7.3

Please Log in or Create an account to join the conversation.

Last edit: by Bluefox.

Deleting past events from the front end 7 years 9 months ago #8981

Maybe is was busted before, but it doesn't work - still getting the 500 error. I can give you login creds if you want and/or FTP.
Ian Shere
CitrusKiwi Web Solutions LLC
Putting some "zest" in your business

Please Log in or Create an account to join the conversation.

Deleting past events from the front end 7 years 9 months ago #8982

i think that would be a better option.
--> you can send me a pm and will take a look tomorrow
(going to take a nap now :) )

//
also make sure to revert the changes (to the state it was before, without the 500 error)


I've attached some images about how it's over here...
(won't respond to PM)
==================================================================
running: pre-alpha JEM 4.x (custom version) + Joomla 4.0.0-beta7 + PHP 7.3
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by Bluefox.

Deleting past events from the front end 7 years 9 months ago #8983

Goodmorning,.

Hopefully you've resorted the problem..

Well, did try it again,.
locally by using: WAMP/Joomla 1.5/Eventlist 1.1/

It seems to be working correctly but did notice that the category's with special access/registered were calculated with the Quiry. But they did not display that would give a problem too. So did add the code below.
At this point we basically added the code of the function getCategories to the buildQuery.
$where .= ' AND c.access  <= '.$gid;

so the function _buildEventListWhere()
will be something like
/**
	 * Build the where clause
	 *
	 * @access private
	 * @return string
	 */
	function _buildEventListWhere()
	{
		$app = & JFactory::getApplication();

		$user		= & JFactory::getUser();
		$gid		= (int) $user->get('aid');
		
		// Get the paramaters of the active menu item
		$params 	= & $app->getParams();

		$task 		= JRequest::getWord('task');
		
		// First thing we need to do is to select only needed events
		if ($task == 'archive') {
			$where = ' WHERE a.published = -1';
		} else {
			$where = ' WHERE a.published = 1';
		}
		
		$where .= ' AND c.published = 1';
		$where .= ' AND c.access  <= '.$gid;

		/*
		 * If we have a filter, and this is enabled... lets tack the AND clause
		 * for the filter onto the WHERE clause of the item query.
		 */
		if ($params->get('filter'))
		{
			$filter 		= JRequest::getString('filter', '', 'request');
			$filter_type 	= JRequest::getWord('filter_type', '', 'request');

			if ($filter)
			{
				// clean filter variables
				$filter 		= JString::strtolower($filter);
				$filter			= $this->_db->Quote( '%'.$this->_db->getEscaped( $filter, true ).'%', false );
				$filter_type 	= JString::strtolower($filter_type);

				switch ($filter_type)
				{
					case 'title' :
						$where .= ' AND LOWER( a.title ) LIKE '.$filter;
						break;

					case 'venue' :
						$where .= ' AND LOWER( l.venue ) LIKE '.$filter;
						break;

					case 'city' :
						$where .= ' AND LOWER( l.city ) LIKE '.$filter;
						break;
				}
			}
		}
		return $where;
	}
	



And to show the changes i've uploaded the file..
(won't respond to PM)
==================================================================
running: pre-alpha JEM 4.x (custom version) + Joomla 4.0.0-beta7 + PHP 7.3
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.534 seconds

Donate

If you find JEM useful and if you use it on your site, please consider a donation to the project.

Private Messages

You are not logged in.

Follow us......