Alteczen
09-09-2004, 05:06 PM
I'm trying to create my own custom module and pull some text from a text file.
I have a module file inside my modules folder with:
<?php
$collapseobj_proshop = $vbcollapse['collapseobj_proshop'];
$collapseimg_proshop = $vbcollapse['collapseimg_proshop'];
$file = "/proshop/proshop.txt";
$data = file_get_contents($file);
$sets = explode("&",$data);
foreach($sets as $k => $v){
if($v) {
$d = explode("=",$v);
${$d[0]} = $d[1];
}
}
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_proshop') . '";');
?>
This code is reading 2 variables from a text file call "proshop.txt". Inside the file I have &desc=some text&link=http://www.xyz.com
In my template inside the style manager I am trying to reference the variables &desc / &link but they are not pulling through. I'm using them basically like this:
<a href="$link">$desc</a>
I think I need some kind of eval(...) statement inside my php file but I'm not sure where. Can anyone help me out? Thanks in advance...
I have a module file inside my modules folder with:
<?php
$collapseobj_proshop = $vbcollapse['collapseobj_proshop'];
$collapseimg_proshop = $vbcollapse['collapseimg_proshop'];
$file = "/proshop/proshop.txt";
$data = file_get_contents($file);
$sets = explode("&",$data);
foreach($sets as $k => $v){
if($v) {
$d = explode("=",$v);
${$d[0]} = $d[1];
}
}
eval('$home[$mods[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_proshop') . '";');
?>
This code is reading 2 variables from a text file call "proshop.txt". Inside the file I have &desc=some text&link=http://www.xyz.com
In my template inside the style manager I am trying to reference the variables &desc / &link but they are not pulling through. I'm using them basically like this:
<a href="$link">$desc</a>
I think I need some kind of eval(...) statement inside my php file but I'm not sure where. Can anyone help me out? Thanks in advance...