View Full Version : Custom BOX (block)
jessenco
10-20-2006, 10:21 PM
Is Vivvo providing a way to create our own custom "block" (or "box" as Vivvo refer to them)?
I don't think it is possible without creating custom Tags and individual Templates (.tpl) files and adding some php statements somewhere.
So, what would be the correct procedure for me to create a custom box?
(In which I could add my own content (html, swf, javascript, etc...), and where I could put or reuse anywhere in templates by simply adding his associated Tags)
tx
boccio
10-24-2006, 01:01 PM
This one is rather easy, here is the short how-to for creating custom tags and boxes.
1. First you need to assign the custom tag to the system in templates_script/default.php and templates_script/framework.php by adding the line defining your custom tag at the end of the file. In this example, we call it {CUSTOM_BOX}:
$template_manager->assign($custom_box,'/{CUSTOM_BOX}/');
2. Next, in include/toolboxes.php, somewhere bellow line 13 you need to place the line of code that assigns a function that will handle the action related to this tag. In this example, we call it test_custom_box()
$custom_box = test_custom_box();
3. In HTML_function.php file add the implementation of test_custom_box() function. The most convinient place is at the bottom of the file. Here is a test version of this function with HelloWorld output:
function test_custom_box(){
global $url, $tpl_folder;
$text = "Hello, World!";
$filename="$tpl_folder/custom_box.tpl";
$subject=file_get_contents($filename);
$pattern=array('{ROOT}','{HELLO}');
$replacement=array($url,$text);
$custom_box = my_str_replace($pattern, $replacement, $subject);
return $custom_box;
}
4. Create the box template, and store it in the /templates folder. In the example, we'll call it custom_box.tpl. You can also use language and global tags in your custom template (i.e. {LNG_SUBMIT_BUTTON}, {ROOT}, etc.).
<form name = "custom_box" action="{ROOT}index.php" >
{HELLO}
<br /><input type="submit" value="{LNG_SUBMIT_BUTTON}" />
</form>
<br />This is a global tag:
<br />LNG_SUBMIT_BUTTON = {LNG_SUBMIT_BUTTON}
<br />ROOT = {ROOT}
<br /><br />This is a custom tag for this template:
<br/>{HELLO}</font>
5. Finally, place the tag {CUSTOM_BOX} anyplace you want - in index.tpl, article_Full.tpl, etc.
IrishGuinea
02-07-2007, 03:41 AM
edit: Moved off of sticky to new thread....
apocan
04-22-2007, 06:47 PM
is it possible for 3.5 or is there any solutions for the custom box for 3.5. I really need it..
Micha
04-23-2007, 08:14 AM
You can find how to create custom box for vivvo 3.5 on this thread:
http://www.vivvo.net/forums/showthread.php?t=674
MemoBony
07-18-2007, 12:13 PM
Hi Micha and every body here,
It's just looking at how boccio explain how to creat a custom box and then look at how (utvara) has explain his manner to creat the custom box!!?
Sorry! But I think what utvara did is completely not clear, however I am good in php programming, but I think the most of us need nice explain, how? and where? and what? all that has boccio been done it with his explain about how to creat a custom box.
So, I am a greedy to see boccio explain how can you creat a custom box with Vivvo 3.5?
Thank you too much boccio :p
pcoskat
07-18-2007, 04:39 PM
So, I am a greedy to see boccio explain how can you creat a custom box with Vivvo 3.5?
Boccio is on vacation at the moment...
BTW, you really need to look here: http://www.vivvo.net/forums/showthread.php?t=674
apocan
07-18-2007, 06:04 PM
I dont understand anything on that page either :D
MemoBony
08-06-2007, 04:22 PM
So, I am a greedy to see boccio explain how can you creat a custom box with Vivvo 3.5?
Thank you too much boccio :p
boccio my dear, I think you coming back from your holiday, fresh, so, will you help us to write how can we make a cutom box for 3.5? or you will let that explain to the new verssion 4.0? :eek:
apocan
08-07-2007, 11:57 PM
http://www.vivvo.net/forums/showthread.php?t=1110
MemoBony
08-08-2007, 10:41 AM
I dont understand anything on that page either :D
And then you put a link where is't also not clear! :D
apocan
08-09-2007, 10:59 AM
for me that link is simple :D but you I m not sure :D
MemoBony
08-09-2007, 11:19 AM
Come on man, I know that is not simple for me, and I wrote that already, and no body want to help me, so I asked you if you can do that. PLEASE!
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.