Page 1 of 1
Random Content Blob Tag
Posted: Fri Oct 06, 2006 6:24 pm
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
Re: Random Content Blob Tag
Posted: Sun Oct 08, 2006 3:40 am
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.
Re: Random Content Blob Tag
Posted: Sun Oct 08, 2006 5:31 am
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
Re: Random Content Blob Tag
Posted: Mon Oct 09, 2006 3:06 pm
by Kavrick
Bump - Anybody know how to fix this? Thanks in advance!
David
Re: Random Content Blob Tag
Posted: Mon Oct 09, 2006 3:39 pm
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();
Re: Random Content Blob Tag
Posted: Mon Oct 09, 2006 3:56 pm
by Kavrick
Brilliant - Thanks Dee. That fixed it...
David

Re: Random Content Blob Tag
Posted: Mon Oct 09, 2006 4:41 pm
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.
Re: Random Content Blob Tag
Posted: Mon Oct 09, 2006 4:45 pm
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
Re: Random Content Blob Tag
Posted: Tue Nov 21, 2006 11:03 pm
by Signex
Thank you, Dee. That fix helped me out also.
Re: Random Content Blob Tag
Posted: Sat Dec 22, 2007 4:02 pm
by twiz
This replacement code did the trick for me also. Thank you Dee!
