Author Topic: 3rd party mambots doesn't work.  (Read 49238 times)

RaXa

  • Beginner
  • *
  • Posts: 5
3rd party mambots doesn't work.
« on: June 17, 2006, 21:25:16 pm »
Hi! I just installed 3rd party mabots in my site RaXa Digital Mexico one of them is tooltips who display a text when the cursor is over the word or text, in my content shows perfectly but in the VM products layout don't show is there any possibilities to work, thanks sorry for the bad english and greetings from Mexico.

RaXa Digital Mexico

relume

  • Beginner
  • *
  • Posts: 21
Re: 3rd party mambots doesn't work.
« Reply #1 on: June 20, 2006, 23:20:38 pm »
Hello

I would like also to have standard or 3rd party mambots designed for dynamic or static content to be parsed for vm product descriptions and vm product categories. I am very grateful for any hint/suggestion pointing to the appropriate vm files/classes where I could start with code modifications.

Many thanks in advance, best regards, relume

gregdev

  • Full Member
  • ***
  • Posts: 968
    • PlainlyCode
Re: 3rd party mambots doesn't work.
« Reply #2 on: June 21, 2006, 05:16:19 am »
I am using Joomla 1.0.8 and VM 1.0.4. If you are using a different version of VirtueMart, the line numbers will still get you close. You want to look for the areas that fill in the templates.

Try shop.browse.php (starting at line 398) and shop.product_details.php (starting at line 357). There may be other files, but these seem to be the right places to start.

To insert the mambot calling code, first you'll want to get a hold of the global mambot processing object:

Code: [Select]
global $_MAMBOTS;
Then, to indicate that you want to call the content mambots, do this:

Code: [Select]
$_MAMBOTS->loadBotGroup( 'content' );
Finally, you'll need to trigger the necessary event. Most content mambots respond to the onPrepareContent event:

Code: [Select]
$results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$row, &$params, $page ), true );
You can look through, for example, the Joomla file, content.html.php, to see how the content mambots are called to process standard content.

I hope this helps.

If you find other places in the VirtueMart code where it makes sense to trigger mambot events, please post that back here. I've been inserting event triggers into various places in my hacked version of the code. It would be nice to know of other good places to trigger events.


relume

  • Beginner
  • *
  • Posts: 21
Re: 3rd party mambots doesn't work.
« Reply #3 on: June 21, 2006, 11:54:58 am »
Hello

Thank you very much for you hints!! I was able to insert mambots parsing in a few minutes to the appropriate vm code. At the moment for my purposes only the files shop.browse.php for the category description and the file shop.product_details.php are of interest. For the file shop.product_details.php I was some bit lazy and applied the mambots parsing on the entire template output.

Thank you very much again, best regards:

For other users interested in the modifications, please find the modifications in the code samples below:

shop.browse.php : around line 76

Code: [Select]

    /**
    * CATEGORY DESCRIPTION
    */
$desc =  $ps_product_category->get_description($category_id);
/* Prepend Product Short Description Meta Tag "description" when applicable */
if( @$_REQUEST['output'] != "pdf") {
$mainframe->prependMetaTag( "description", substr(strip_tags($desc ), 0, 255) );
}

    //***** start : modifcation for mambot parsing

    global $_MAMBOTS;
    $_MAMBOTS->loadBotGroup( 'content' );
    $row->text = $desc;
    $results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$row, &$params, $page ), true );
    $desc = $row->text;

    //***** end : modifcation for mambot parsing



if( trim(str_replace( "<br />", "" , $desc)) != "" ) {
echo '<div style="width:100%;float:left;">';
echo $desc;
echo '</div>
            <br style="clear:both;" /><br />';


shop.product_details.php : at the very end of the file

Code: [Select]
...
$template = str_replace( "{back_url}", $back_url, $template );
$template = str_replace( "{product_content_heading}", "" ,$template);
$template = str_replace( "{product_sku_lable}", $VM_LANG->_PHPSHOP_CART_SKU ,$template);
$template = str_replace( "{product_price_lable}", $VM_LANG->_PHPSHOP_CART_PRICE ,$template);
$template = str_replace( "{product_tax_lable}", $VM_LANG->_PHPSHOP_CART_TAX ,$template);
$template = str_replace( "{product_tax}", $product_tax ,$template);

    //***** start : modifcation for mambot parsing
global $_MAMBOTS;
$_MAMBOTS->loadBotGroup( 'content' );
$row->text = $template;
$results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$row, &$params, $page ), true );
$template = $row->text;

   //***** end : modifcation for mambot parsing

/* Finish and Print out the Page */
echo $template;


dixiemax

  • Beginner
  • *
  • Posts: 3
Re: 3rd party mambots doesn't work.
« Reply #4 on: June 22, 2006, 00:25:30 am »

Hi Raxa,
what tooltip ar you using for this specifc issue  ?!

Thank you
Dixie

sirmrmatt

  • Beginner
  • *
  • Posts: 19
    • MonShiShi.com - Gothic Clothing
Re: 3rd party mambots doesn't work.
« Reply #5 on: July 07, 2006, 15:58:26 pm »
Would like to confirm that this fix works with mmp3 (mini-mp3 player) in VirtueMart 1.0.5 and Joomla 1.0.10! Thank you!

- Matt

dforce

  • Beginner
  • *
  • Posts: 9
Re: 3rd party mambots doesn't work.
« Reply #6 on: July 07, 2006, 19:40:19 pm »
... it also works perfectly with the mgmediabot, that was exactly the tip i needed !!!

many thanx, especially to relume for the code examples. very helpful for me as an newbie.

oliver

donmas

  • Beginner
  • *
  • Posts: 48
Re: 3rd party mambots doesn't work.
« Reply #7 on: July 11, 2006, 15:58:05 pm »
... it also works perfectly with the mgmediabot, that was exactly the tip i needed !!!

many thanx, especially to relume for the code examples. very helpful for me as an newbie.

oliver

Hi, I'm actually looking to do exactly the same thing with mgmediabot, but after i modified shop.browse.php and shop.product_details.php and entered the code {mgmediabot} ...cm.mp3|true|300|300{/mgmediabot} it's not showing up in the discription.

Oliver, do you think you could give me a hint on how to get this to work??

sonya713

  • Beginner
  • *
  • Posts: 4
Re: 3rd party mambots doesn't work.
« Reply #8 on: July 12, 2006, 07:29:24 am »
 8) :D Thanks for this MOST helpful tip .. I would like to share that anyone still using MOS Thumb will need to unpublish it and find an updated thumbnail bot. I recommend dynamicImage. Additionally I was able to get mgMediaBot(0.0.9) to work without a hitch. However, even though I prefered Mini-MP3-Player v1.2 it would not work for me. And after spending several hours researching this problem prior to finding this solution, I was just all to happy to settle for mgMediaBot(0.0.9). The second option is not quite as "pretty" but hey ... IT WORKS!

dforce

  • Beginner
  • *
  • Posts: 9
Re: 3rd party mambots doesn't work.
« Reply #9 on: July 20, 2006, 15:18:40 pm »
@donmas,

make sure that the mgmediabot is published in mambotmanager!

i use joomla 1.0.10 + virtuemart 1.0.6: works.

best oliver

sirmrmatt

  • Beginner
  • *
  • Posts: 19
    • MonShiShi.com - Gothic Clothing
Re: 3rd party mambots doesn't work.
« Reply #10 on: October 09, 2006, 16:54:31 pm »
Had this working above, but then updated to virtuemart 1.0.7 and joomla 1.0.11 and now it no longer works. Have verified code is in same place, etc. Any ideas, please?

sirmrmatt

  • Beginner
  • *
  • Posts: 19
    • MonShiShi.com - Gothic Clothing
Re: 3rd party mambots doesn't work.
« Reply #11 on: October 11, 2006, 21:47:26 pm »
Errgg...anyone?

Have this code:

Code: [Select]
    //***** start : modifcation for mambot parsing
global $_MAMBOTS;
$_MAMBOTS->loadBotGroup( 'content' );
$row->text = $template;
$results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$row, &$params, $page ), true);
$template = $row->text;
   //***** end : modifcation for mambot parsing

in my shop.browse.php and shop.product_details.php files.

Was working on 1.0.9, but now is not on 1.0.11!

Any ideas?

Mini-mp3-player is published.

Also, jogadgets was published as well but doing the same thing: not showing up.

Please help...

- Matt

http://www.thecastleclothing.com

Fotis Evangelou

  • Beginner
  • *
  • Posts: 20
  • Pro Joomla! Developer
    • JoomlaWorks
Re: 3rd party mambots doesn't work.
« Reply #12 on: October 12, 2006, 11:10:53 am »
Very sweet mod!

My congrats to you guys!

Works like a charm in Joomla 1.0.11 and VirtueMart 1.0.7!

This post should become a sticky...  ;D
JoomlaWorks | The Joomla! Professionals
Developers of K2, Frontpage Slideshow, AllVideos, Simple Image Gallery (free/pro), SuperBlogger, Tabs & Slides, UCD & many more!
Visit: joomlaworks.gr (Extensions/Downloads/Demos/Forum) | getk2.org (Community/Demos)

sirmrmatt

  • Beginner
  • *
  • Posts: 19
    • MonShiShi.com - Gothic Clothing
Re: 3rd party mambots doesn't work.
« Reply #13 on: October 12, 2006, 18:47:09 pm »
Where did you put the code to get it to work? It was working for me, but now is not!

Please help.


sirmrmatt

  • Beginner
  • *
  • Posts: 19
    • MonShiShi.com - Gothic Clothing
Re: 3rd party mambots doesn't work.
« Reply #14 on: October 12, 2006, 18:57:48 pm »
SOLVED:

Ok, I used the EXACT code in relume's post above, in the EXACT places, and now it works. Holy she-bang. Good golly. THANK YOU!!!

- Matt