PDA

View Full Version : New module not working


logan
07-20-2010, 08:25 AM
I am new to vivvo and just finished reading the documentation of module development.
I wanted to test the new module that I have from the documentation and I made a directory in root by the name of my_boxes.
In this directory I have a file box_hello.php with the code :

<?php

/**
* @see 'lib/vivvo/plugin/vivvo_plugin.php'
*/
require_once(VIVVO_FS_FRAMEWORK . 'vivvo_plugin.php');

/**
* Box Hello
*
* @version 0.1
* @author Your name here
*/
class box_hello extends module {

public $_default_template_file = 'system/box_default/box_hello.tpl';

public function generate_output($params = array()) {

$this->set_template($params);

if ( isset($params['string']) ) {
$string = $params['string'];
} else {
$string = 'Hello world!';
}

$this->_template->assign('my_var', $string);
}
}
?>


Then I registered it in configuration table.

Now, when I put the code following in homepage/default.tpl, the desired output is not shown.
<vte:box
module="box_hello">





<vte:params>









<vte:param
name="string"
value="foo"
/>





</vte:params>





<vte:template>









<hr
/>









Output:
<vte:value
select="{my_var}"
/>









<hr
/>





</vte:template>

</vte:box>



Kindly help me.

Logan

logan
07-20-2010, 08:42 AM
After doing some research on the code I found that <vte:box module="box_hello"> is not working.......

any clues???

bobster65
07-20-2010, 05:35 PM
Couple things that stand out..

you really need to pay close attention to spacing with your code...

This is all messed up

<vte:box
module="box_hello">





<vte:params>









<vte:param
name="string"
value="foo"
/>





</vte:params>





<vte:template>









<hr
/>









Output:
<vte:value
select="{my_var}"
/>









<hr
/>





</vte:template>

</vte:box>

should look like this

<vte:box
 module="box_hello">





<vte:params>









<vte:param
 name="string" 
value="foo" 
/>





</vte:params>





<vte:template>

















Output:
<vte:value
 select="{my_var}" 
/>





</vte:template>

</vte:box>


now, In order for more troubleshooting.. can you post your module registration values?

logan
07-21-2010, 05:55 AM
Following is the query I have written to register my module in configuration table.

INSERT
INTO
`configuration`
(`variable_name`,

`variable_property`,
`variable_value`,
`module`,
` domain_id`,

`reg_exp`)
VALUES

('box_hello',
'class_name',
'box_hello',
'modules' ,
1,
''),

('box_hello',
'file',
'box_hello.php',
'modules',
 1,
'')



and I have kept my php file in /my_boxes directory

Kindly help.

bobster65
07-21-2010, 02:47 PM
the path to the file is incorrect.. should have been like this..

INSERT
INTO
`configuration`
(`variable_name`,

`variable_property`,
`variable_value`,
`module`,
` domain_id`,

`reg_exp`)
VALUES

('box_hello',
'class_name',
'box_hello',
'modules' ,
1,
''),

('box_hello',
'file',
'/my_boxes/box_hello.php',
'modules',
1,
'')


logan
07-22-2010, 08:27 AM
the path to the file is incorrect.. should have been like this..

INSERT
INTO
`configuration`
(`variable_name`,

`variable_property`,
`variable_value`,
`module`,
` domain_id`,

`reg_exp`)
VALUES

('box_hello',
'class_name',
'box_hello',
'modules' ,
1,
''),

('box_hello',
'file',
'/my_boxes/box_hello.php',
'modules',
1,
'')




I tried this way as well....
Still not working :confused:

bobster65
07-22-2010, 02:46 PM
did you delete the 2 old rows in the config table? if you just inserted 2 new rows, you'd have 2 sets of dupes..

logan
07-23-2010, 06:09 AM
Yes I deleted the old entries before inserting them.
Do you know any place where I can chat with the vivvo support live?

bobster65
07-23-2010, 05:03 PM
Yes I deleted the old entries before inserting them.
Do you know any place where I can chat with the vivvo support live?

nope.. never have once chatted with them live.. just a few PMs and some posts in the forums. They are busy upgrading the plugins right now.

If you want me to check it out for you, send me a PM.

abhishek
07-27-2010, 08:43 AM
Even I am facing the same issue.
Kindly help.
I am trying to call an sms subscription module. When ever I call it the rest part after that call wont work.
I am following the vivvo custom module development documentation.

:(