Jump to content


alexp999

Member Since 06 Dec 2010
Offline Last Active Today, 10:59 AM
-----

#2290123 Suggestion - Cache Query but not Block

Posted by alexp999 on 23 July 2012 - 11:13 AM

Ive since written my own plugin using the IP.Content blocks, basically:
  • Cached Feed Block, grabs all the latest content, etc (resource intensive query), and the output is a serialized $records array.
  • My custom plugin then grabs the feed block output from above (non intensive query) and unserializes it.
  • The template for my plugin is the generic feed template (modified slightly for my site), and shows the cached content, but generated on every page load to have the correct time for the user (and time difference, i.e. 5 mins ago).
It works as the original (cached) query only outputs timestamps, so my block later on which isnt cached can always display the correct time and zone for the user.

Thats why I started this thread, I think IP.Content should have a caching system for the query. It basically means I dont have to do resource intensive queries every page load, its dramatically sped up my site.


#2265755 Mobile skin?

Posted by alexp999 on 10 May 2012 - 12:29 PM

Right, well I use the following for my main index page, you will need to make sure the page is set to Raw PHP though:

if ( $this->registry->output->skin['set_key'] == 'mobile' ) {
	echo '{parse articles}';
} else {
	echo '
<div class="ipsLayout ipsLayout_withright ipsLayout_largeright clearfix">
	<div class="ipsLayout_right">
		{parse block="latest_posts"}
   	 ...
   	 ... // More blocks here
   	 ...
	</div>
	<div class="ipsLayout_content">
	   {parse articles}
	</div>
</div>';
}

Then in the article/database/page/block templates, I use the following to control whether certain parts get shown:

<if test="$this->registry->output->skin['set_key'] == 'mobile'">...Stuff Here to only Show on Mobile...</if>

<if test="$this->registry->output->skin['set_key'] != 'mobile'">...Stuff Here to NOT Show on Mobile...</if>



#2256956 Suggestion - Cache Query but not Block

Posted by alexp999 on 19 April 2012 - 03:28 AM

I think there should be an option to cache the query used in feed blocks, not just the whole block.

For example, lets say you have some latest content feed blocks like latest posts, downloads, articles, comments, etc. You want these cached to reduce server load (my page loads start to lag having say 4 of these types of blocks on a page not cached).

The problem is, the block needs to be processed on a per member basis to set the correct timezone for the user.

So I think it would be great to have an option to cache the query used for the block, without having to cache the html output. That way you could set the cache query to say 5 mins, to reduce server load, and then just process the html template on demand using the cached query.


#2121614 Features removed from 3.1.4

Posted by alexp999 on 12 June 2011 - 05:06 AM

They have also removed the latest news feature from the board index. But a hook has been made here already:

http://community.inv...on-board-index/


#2067823 Need more Ad placement control:

Posted by alexp999 on 14 January 2011 - 10:14 AM

All you need to do is not select any location, then you can put:

{parse advertisement=X}

Where "X" is the ID of the ad.

Anywhere you want in your templates, wrap them in an <if test....(etc)> statement if you dont want them shown all the time.


#2066962 Page-title is not honored when using {parse articles}

Posted by alexp999 on 12 January 2011 - 04:02 PM

Right I have done a bit of digging and come up with a fix/hack. This will allow you to have: {Current IP.Content generated title}{Some custom text}. For my front page (with page name set to Home) I have: "Home - domain.com"

1, First we need a place to set what we want as our custom title, as this is a quick fix we will be using the IP.Board config file to define our text.

OPEN:
/initdata.php

FIND:
/* Min PHP version number */
define( 'MIN_PHP_VERS', '5.1.0' );

ADD AFTER:

/* Custom Title for CCS */
define( 'CCS_CUSTOM_TITLE', 'Some Custom Text' );

Note:
You can place the text you want in place of
Some Custom Text
I simply used
define( 'CCS_CUSTOM_TITLE', ' - domain.com' );
If you want to include apostrophes (e.g. Bob's Site), you must escape them with a
\
i.e.
define( 'CCS_CUSTOM_TITLE', 'Bob\'s Site' );

2, Now we need to tell IP.Content to use our custom text when it writes the html titles.

OPEN:
/admin/applications_addon/ips/ccs/sources/articles.php

FIND:
if( $category['category_name'] )
		{
			$this->registry->output->setTitle( $category['category_name'] );
		}

REPLACE WITH:
if( $category['category_name'] )
		{
			$this->registry->output->setTitle( $category['category_name'] . CCS_CUSTOM_TITLE );
		}

FIND:
if( $this->categoryLimit )
		{
			$this->registry->output->setTitle( $this->categories->categories[ $this->categoryLimit ]['category_name'] );
		}
		else
		{
			$this->registry->output->setTitle( $this->database['database_name'] );
		}

REPLACE WITH:
if( $this->categoryLimit )
		{
			$this->registry->output->setTitle( $this->categories->categories[ $this->categoryLimit ]['category_name'] . CCS_CUSTOM_TITLE );
		}
		else
		{
			$this->registry->output->setTitle( $this->database['database_name'] . CCS_CUSTOM_TITLE );
		}

FIND:
if( $category['category_name'] )
		{
			$this->registry->output->setTitle( $category['category_name'] );
		}
		else
		{
			$this->registry->output->setTitle( $this->database['database_name'] );
		}

REPLACE WITH:
if( $category['category_name'] )
		{
			$this->registry->output->setTitle( $category['category_name'] . CCS_CUSTOM_TITLE );
		}
		else
		{
			$this->registry->output->setTitle( $this->database['database_name'] . CCS_CUSTOM_TITLE );
		}

FIND:
$this->registry->output->setTitle( $record[ $this->database['database_field_title'] . '_value' ] );

REPLACE WITH:
$this->registry->output->setTitle( $record[ $this->database['database_field_title'] . '_value' ] . CCS_CUSTOM_TITLE );

I have done this on my own site and it all works fine, I do not warrant the correctness of the above instructions, you use them at your own risk, I advise taking a backup first and then putting the site into offline mode while you make the changes. If you do not feel confident editing these files, then DO NOT DO IT.

I hope this helps some people,

Cheers.