Template externalizer with User Tags and Cache problems

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
jurkapavel
New Member
New Member
Posts: 3
Joined: Fri Jan 29, 2010 8:36 pm

Template externalizer with User Tags and Cache problems

Post by jurkapavel »

Hi,

I'm developing a new version of Template Externalizer module with support for Global Content Blocks and User Defined Tags.

I have problem with saving User Defined Tags. When I reload the frontend page, module detects change of file and upload new version of User Defined Tag to database, but the output is old.  When I reload page again the output is new.

I was trying to clear cache with this code but without result.

Code: Select all

	global $gCms;
	$contentops =& $gCms->GetContentOperations();
	$contentops->ClearCache();
This code save user tag to database.

Code: Select all

    $userplugin_name = $tags->fields['userplugin_name'];
    if($ftime > $modified_date && ($fsize = filesize($fname)) != 0) {
      $fsize = filesize($fname);
      $fp = fopen($fname, 'r');
      $code = trim(str_ireplace('<?php', '', fread($fp, $fsize)));
      $uo->SetUserTag($userplugin_name, $code);
      fclose($fp);
    }
Same code is working for Templates, Stylesheets and Global Content Blocks.

Source code is attached. Saving User Tags is on line 283.

Do you have any idea how to fix this bug?
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

Last edited by jurkapavel on Thu Jul 08, 2010 11:04 pm, edited 1 time in total.
Post Reply

Return to “Developers Discussion”