Joomla! Discussion Forums



It is currently Sun Nov 08, 2009 8:01 am (All times are UTC )

 


Forum rules

Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 6 posts ] 
Author Message
Posted: Mon Jun 25, 2007 11:04 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Thu Aug 18, 2005 1:16 am
Posts: 957
Location: Glendale, CA, USA
I want to insert videos in glossary but glossary doesn't support mambots/plugins, I found a code that can do this but don't know in which file and where in the file I have to insert the code any help is appreciated.

_________________
http://www.virtuemart-extensions.com


Top
  E-mail  
 
Posted: Sat Jul 07, 2007 1:21 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Jul 15, 2006 6:27 pm
Posts: 37
I assume that you want plugins processed for just the term definition.

In glossary.php, look for the showOneTerm function. On line 294, you'll see this line:

Code:
if ($row1) {


Right after that line, add these lines of code:

Code:
global $_MAMBOTS;
$_MAMBOTS->loadBotGroup( 'content' );
$tmp_row = new stdClass();
$tmp_params = new mosParameters('');
$tmp_row->text = $row1->tdefinition;
$_MAMBOTS->trigger( 'onPrepareContent', array( &$tmp_row, &$tmp_params ), true );
$row1->tdefinition = $tmp_row->text;       


I tried this with the mosloadposition plugin - it worked fine. It should work for whatever plugin you have in mind. Good luck.

Greg

_________________
http://www.virtuemart.net
http://www.plainlycode.com


Top
  E-mail  
 
Posted: Sat Jul 07, 2007 5:20 am 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Thu Aug 18, 2005 1:16 am
Posts: 957
Location: Glendale, CA, USA
Thanks Greg the code worked kind of, I say kind of cause now the mambot function instead of showing tags however if definition of a term as a video and that term is been used in other place than I get error, to make it clear see the example and link below.

Term is Scrum, for the definition I use a video to show what a scrum is; now another term is ‘Forward pass’, for the definition I use a sentence that has the word scrum in it, the word scrum gets highlighted (which is fine) but instead of showing the video or not showing I get error http://www.armenianrugby.org/joomnik/glossary

I used AllVideos plugin.

Greg, I know is not your component and you don’t have to however your help is really appreciated, thank you.

_________________
http://www.virtuemart-extensions.com


Top
  E-mail  
 
Posted: Sat Jul 07, 2007 3:20 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Jul 15, 2006 6:27 pm
Posts: 37
Per the glossarbot instructions, you need to ensure that the glossarbot plugin is ordered last of the content plugins. Try this first. (I ordered it right before the Mos Pagination plugin.)

You'll find that the errors go away. But, in the floating div that appears, the definition will still show the {mambotcall... }. What would you like to have happen here? Show the video? Just remove the reference?

Greg

_________________
http://www.virtuemart.net
http://www.plainlycode.com


Top
  E-mail  
 
Posted: Sat Jul 07, 2007 7:26 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Thu Aug 18, 2005 1:16 am
Posts: 957
Location: Glendale, CA, USA
Hi Greg, You are The Man, reordering the plugins solved the problem.

Since you asked, will it be difficult to show the video in the popup window too or remove the tag.

Thanks.

_________________
http://www.virtuemart-extensions.com


Top
  E-mail  
 
Posted: Mon Sep 10, 2007 11:16 am 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Sep 04, 2007 4:24 pm
Posts: 6
Location: Bosna i Hercegovina
Hi!

I follow this post and do the same job as you Aravot.
I tried to create modul that will display random word from glossary component table.
I did it with wery small knowlege about php but two things went wrong.
Code is:

$sql = "SELECT COUNT(*) AS uk FROM jos_glossary WHERE published = 1";
$uk_rijeci = mysql_fetch_array(mysql_query($sql));
$rbr = mt_rand (0, $uk_rijeci['uk']-1);

$sql1 = "SELECT * FROM jos_glossary WHERE published = 1 LIMIT $rbr,1";
$random_red = mysql_fetch_row(mysql_query($sql1));
//echo "Rijeè br: " , $rbr+1 , "

";
echo "" . $random_red[2] . " -

";
//poziv mambotu
global $_MAMBOTS;
$_MAMBOTS->loadBotGroup( 'content' );
$tmp_row = new stdClass();
$tmp_params = new mosParameters('');
$tmp_row->text = $random_red[3];
$_MAMBOTS->trigger( 'onPrepareContent', array( &$tmp_row, &$tmp_params ), true );
$random_red[3] = $tmp_row->text;
echo $random_red[3];

First one, less important is when I use #__glossary in sql query I got error, altough it worked in this construction:

$sql = 'SELECT * FROM #__glossary
WHERE published = 1';
$database->setQuery($sql);
$rows = $database->loadObjectList();
$count = count($rows);
        ...

second one, the real problem, the code show media player only when page with glossary component is loaded. I assume that module code (part of gregdev code) uses something from component code.
So Greg or someone else, would you be so kind to drow me the final solution?

Thanks


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group