[ Index ] |
|
Code source de CMS made simple 1.0.5 |
1 <?php 2 #CMS - CMS Made Simple 3 #(c)2004 by Ted Kulp (wishy@users.sf.net) 4 #This project's homepage is: http://cmsmadesimple.sf.net 5 # 6 #This program is free software; you can redistribute it and/or modify 7 #it under the terms of the GNU General Public License as published by 8 #the Free Software Foundation; either version 2 of the License, or 9 #(at your option) any later version. 10 # 11 #This program is distributed in the hope that it will be useful, 12 #but WITHOUT ANY WARRANTY; without even the implied warranty of 13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 #GNU General Public License for more details. 15 #You should have received a copy of the GNU General Public License 16 #along with this program; if not, write to the Free Software 17 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 19 function smarty_cms_function_news($params, &$smarty) 20 { 21 global $gCms; 22 $cmsmodules = &$gCms->modules; 23 24 if (isset($cmsmodules)) 25 { 26 $modulename = 'news'; 27 $inline = false; 28 29 foreach ($cmsmodules as $key=>$value) 30 { 31 if (strtolower($modulename) == strtolower($key)) 32 { 33 $modulename = $key; 34 } 35 } 36 37 if (isset($modulename)) 38 { 39 if (isset($cmsmodules[$modulename])) 40 { 41 if (isset($cmsmodules[$modulename]['object']) 42 && $cmsmodules[$modulename]['installed'] == true 43 && $cmsmodules[$modulename]['active'] == true 44 && $cmsmodules[$modulename]['object']->IsPluginModule()) 45 { 46 @ob_start(); 47 $id = 'm' . ++$gCms->variables["modulenum"]; 48 $params = array_merge($params, GetModuleParameters($id)); 49 if ($inline == false || $action == '') 50 $action = 'default'; 51 52 $returnid = ''; 53 if (isset($gCms->variables['pageinfo']) && isset($gCms->variables['pageinfo']->content_id)) 54 { 55 $returnid = $gCms->variables['pageinfo']->content_id; 56 } 57 $result = $cmsmodules[$modulename]['object']->DoActionBase($action, $id, $params, $returnid); 58 if ($result !== FALSE) 59 { 60 echo $result; 61 } 62 $modresult = @ob_get_contents(); 63 @ob_end_clean(); 64 return $modresult; 65 } 66 else 67 { 68 return "<!-- Not a tag module -->\n"; 69 } 70 } 71 } 72 } 73 } 74 75 function smarty_cms_help_function_news() { 76 ?> 77 <h3>What does this do?</h3> 78 <p>This is actually just a wrapper tag for the <a href="listmodules.php?action=showmodulehelp&module=News">News module</a> to make the tag syntax easier. 79 Instead of having to use <code>{cms_module module='News'}</code> you can now just use <code>{news}</code> to insert the module on pages and templates. 80 </p> 81 <h3>How do I use it?</h3> 82 <p>Just put <code>{news}</code> on a page or in a template. For help about the News module, what parameters it takes etc., please refer to the <a href="listmodules.php?action=showmodulehelp&module=News">News module help</a>. 83 <?php 84 } 85 86 function smarty_cms_about_function_news() { 87 ?> 88 <p>Author: Ted Kulp<tedkulp@users.sf.net></p> 89 <p>Version: 1.0</p> 90 <p> 91 Change History:<br/> 92 None 93 </p> 94 <?php 95 } 96 97 98 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Tue Apr 3 18:50:37 2007 | par Balluche grâce à PHPXref 0.7 |