Random Content Blob Tag

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
Kavrick

Random Content Blob Tag

Post by Kavrick »

Hi - I'm trying to use the Random Content Blob and it's not working. It Throws this error where the random blob should be.

Fatal error: Class 'HtmlBlobOperations' not found in plugins/function.random_blob.php on line 20

I have 2 content blobs that start with the prefix "random_" as suggested.

Any help would be great.

Thanks,

David
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Random Content Blob Tag

Post by Dr.CSS »

Where did you get the Random Content Blob, I've looked around, forge/downloads, in 3 diff. ver. installs, Documentation, and can't find any mention of it, sounds interesting.
Kavrick

Re: Random Content Blob Tag

Post by Kavrick »

Sorry Mark - It's a tag... Sounded perfect for me too except it doesn't work. I think it's for an old version but I don't know Smarty well enough to see what's going on.

http://dev.cmsmadesimple.org/projects/randomblob

David
Kavrick

Re: Random Content Blob Tag

Post by Kavrick »

Bump - Anybody know how to fix this? Thanks in advance!

David
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: Random Content Blob Tag

Post by Dee »

Change the first line of the function smarty_cms_function_random_blob (on line 20 of function.random_blob.php)
from

Code: Select all

        $blobs = HtmlBlobOperations::LoadHtmlBlobs();
to

Code: Select all

	global $gCms;
	$global_content_ops =& $gCms->getGlobalContentOperations();
	$blobs = $global_content_ops->LoadHtmlBlobs();	
Kavrick

Re: Random Content Blob Tag

Post by Kavrick »

Brilliant - Thanks Dee. That fixed it...

David  ;D
Last edited by Kavrick on Mon Oct 09, 2006 4:40 pm, edited 1 time in total.
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: Random Content Blob Tag

Post by Dee »

Kavrick wrote: Any chance you'd know how to update the tag so it doesn't show duplicate Content Blobs on a given page?
You mean if you use the tag more than once on a page?
Hmm, that wouldn't be very easy. You'd have to create a global (Smarty) variable to contain the blobs included already and handle the situation where you include the tag more than the number of random blocks.
Kavrick

Re: Random Content Blob Tag

Post by Kavrick »

Yeah - Sorry Dee... I wasn't thinking that through very well.

I solved it by creating two random content blob calls with a different prefix and then just made sure there wasn't duplicate content in each of the prefix types.

Thanks again for your help...

David
Signex

Re: Random Content Blob Tag

Post by Signex »

Thank you, Dee. That fix helped me out also.
twiz
Forum Members
Forum Members
Posts: 13
Joined: Tue Dec 12, 2006 8:56 pm

Re: Random Content Blob Tag

Post by twiz »

This replacement code did the trick for me also.  Thank you Dee!  :)
Locked

Return to “CMSMS Core”