From: <txm...@us...> - 2012-05-08 08:19:23
|
Revision: 9456 http://xoops.svn.sourceforge.net/xoops/?rev=9456&view=rev Author: txmodxoops Date: 2012-05-08 08:19:13 +0000 (Tue, 08 May 2012) Log Message: ----------- Updated Fixed Bugs Added comments and notification creation files Modified Paths: -------------- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/tables.php Added Paths: ----------- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_include_comments_functions.php XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_include_notification.php XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_user_comments.php Modified: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/tables.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/tables.php 2012-05-08 08:12:27 UTC (rev 9455) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/admin/tables.php 2012-05-08 08:19:13 UTC (rev 9456) @@ -546,7 +546,7 @@ echo '<td>'.$blocs.'</td>'; echo '<td>'.$nb_champs.'</td>'; echo '<td>'; - echo '<a href="tables.php?op=edit_tables&tables_id='.$tables_id.'"><img src='. $pathImageIcon ."/edit.png alt="._AM_TDMCREATE_FORMEDIT.'" title="'._AM_TDMCREATE_FORMEDIT.'"></a> <a href="tables.php?op=edit_champs&tables_id='.$tables_id.'"><img src='. $pathImageIcon ."/fields.png alt="._AM_TDMCREATE_FORMCHAMPS.'" title="'._AM_TDMCREATE_FORMCHAMPS.'"></a> <a href="tables.php?op=delete_tables&tables_id='.$tables_id.'"><img src='. $pathImageIcon ."/delete.png alt="._AM_TDMCREATE_FORMDEL.'" title="'._AM_TDMCREATE_FORMDEL.'"></a>'; + echo '<a href="tables.php?op=edit_tables&tables_id='.$tables_id.'"><img src='. $pathImageIcon ."/edit.png alt="._AM_TDMCREATE_FORMEDIT.'" title="'._AM_TDMCREATE_FORMEDIT.'"></a> <a href="tables.php?op=edit_champs&tables_id='.$tables_id.'"><img src='. $pathImageIcon ."/inserttable.png alt="._AM_TDMCREATE_FORMCHAMPS.'" title="'._AM_TDMCREATE_FORMCHAMPS.'"></a> <a href="tables.php?op=delete_tables&tables_id='.$tables_id.'"><img src='. $pathImageIcon ."/delete.png alt="._AM_TDMCREATE_FORMDEL.'" title="'._AM_TDMCREATE_FORMDEL.'"></a>'; echo '</td>'; echo '</tr>'; } Added: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_include_comments_functions.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_include_comments_functions.php (rev 0) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_include_comments_functions.php 2012-05-08 08:19:13 UTC (rev 9456) @@ -0,0 +1,46 @@ +<?php +/** + * **************************************************************************** + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.xoops.org) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @license TDM GPL license + * @author TDM TEAM DEV MODULE + * + * Version : 1.38 Thu 2012/04/12 14:04:25 : Timgno Exp $ + * **************************************************************************** + */ +include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/const/const_entete.php'; +include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php'; + +function const_include_functions($modules, $modules_name, $table_module_table) +{ + $file = "comment_functions.php"; + $path_file = TDM_CREATE_MURL."/".$modules_name."/include/".$file; + $en_tete = const_entete($modules, 0); + $text = '<?php'.$en_tete.' +// comment callback functions +function '.$modules_name.'_com_update($link_id, $total_num) +{ + $db =& Database::getInstance(); + $sql = \'UPDATE \'.$db->prefix(\''.$table_module_table.'\').\' SET comments = \'.$total_num.\' WHERE aid = \'.$link_id; + $db->query($sql); +} + +function '.$modules_name.'_com_approve(&$comment) +{ + // notification mail here +} +?>'; +createFile($path_file, $text, + _AM_TDMCREATE_CONST_OK_INCLUDES, + _AM_TDMCREATE_CONST_NOTOK_INCLUDES, $file); +} +?> \ No newline at end of file Added: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_include_notification.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_include_notification.php (rev 0) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_include_notification.php 2012-05-08 08:19:13 UTC (rev 9456) @@ -0,0 +1,84 @@ +<?php +/** + * **************************************************************************** + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.xoops.org) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @license TDM GPL license + * @author TDM TEAM DEV MODULE + * + * Version : 1.38 Thu 2012/04/12 14:04:25 : Timgno Exp $ + * **************************************************************************** + */ +include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/const/const_entete.php'; +include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php'; + +function const_include_notification($modules, $modules_name, $table_name, $table_module_table) +{ + $file = "notification.inc.php"; + $path_file = TDM_CREATE_MURL."/".$modules_name."/include/".$file; + $en_tete = const_entete($modules, 0); + $text = '<?php'.$en_tete.' +// comment callback functions +function '.$modules_name.'_notify_iteminfo($category, $item_id) + { + global $xoopsModule, $xoopsModuleConfig, $xoopsConfig; + + if (empty($xoopsModule) || $xoopsModule->getVar(\'dirname\') != \''.$modules_name.'\') + { + $module_handler =& xoops_gethandler(\'module\'); + $module =& $module_handler->getByDirname(\''.$modules_name.'\'); + $config_handler =& xoops_gethandler(\'config\'); + $config =& $config_handler->getConfigsByCat(0,$module->getVar(\'mid\')); + } + else + { + $module =& $xoopsModule; + $config =& $xoopsModuleConfig; + } + + xoops_loadLanguage(\'main\', \''.$modules_name.'\'); + + if ($category==\'global\') + { + $item[\'name\'] = \'\'; + $item[\'url\'] = \'\'; + return $item; + } + + global $xoopsDB; + if ($category==\'category\') + { + // Assume we have a valid category id + $sql = \'SELECT '.$table_name.'_title FROM \' . $xoopsDB->prefix(\''.$modules_name.'_cat\') . \' WHERE '.$table_name.'_cid = \'.$item_id; + $result = $xoopsDB->query($sql); // TODO: error check + $result_array = $xoopsDB->fetchArray($result); + $item[\'name\'] = $result_array[\''.$table_name.'_title\']; + $item[\'url\'] = XOOPS_URL . \'/modules/\' . $module->getVar(\'dirname\') . \'/cat_view.php?'.$table_name.'_cid=\' . $item_id; + return $item; + } + + if ($category==\''.$table_name.'\') + { + // Assume we have a valid link id + $sql = \'SELECT '.$table_name.'_cid, '.$table_name.'_title FROM \'.$xoopsDB->prefix(\''.$table_module_table.'\') . \' WHERE '.$table_name.'_lid = \' . $item_id; + $result = $xoopsDB->query($sql); // TODO: error check + $result_array = $xoopsDB->fetchArray($result); + $item[\'name\'] = $result_array[\'title\']; + $item[\'url\'] = XOOPS_URL . \'/modules/\' . $module->getVar(\'dirname\') . \'/'.$modules_name.'_visit.php?'.$table_name.'_cid=\' . $result_array[\''.$table_name.'_cid\'] . \'&'.$table_name.'_lid=\' . $item_id; + return $item; + } + } +?>'; +createFile($path_file, $text, + _AM_TDMCREATE_CONST_OK_INCLUDES, + _AM_TDMCREATE_CONST_NOTOK_INCLUDES, $file); +} +?> \ No newline at end of file Added: XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_user_comments.php =================================================================== --- XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_user_comments.php (rev 0) +++ XoopsModules/TDMCreate/releases/1.38/modules/TDMCreate/const/const_user_comments.php 2012-05-08 08:19:13 UTC (rev 9456) @@ -0,0 +1,116 @@ +<?php +/** + * **************************************************************************** + * - TDMCreate By TDM - TEAM DEV MODULE FOR XOOPS + * - Licence GPL Copyright (c) (http://www.xoops.org) + * + * You may not change or alter any portion of this comment or credits + * of supporting developers from this source code or any supporting source code + * which is considered copyrighted (c) material of the original comment or credit authors. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * @license TDM GPL license + * @author TDM TEAM DEV MODULE + * + * Version : 1.38 Thu 2012/04/12 14:04:25 : Timgno Exp $ + * **************************************************************************** + */ +include_once XOOPS_ROOT_PATH.'/modules/TDMCreate/include/functions_const.php'; + +function const_user_comments($modules, $modules_name, $tables_name, $tables_module_table, $tables_champs, $tables_parametres) +{ + $file = "comment_edit.php"; + $path_file = TDM_CREATE_MURL."/".$modules_name."/".$file; + $en_tete = const_entete($modules, 0); + + ////Copie des fichiers coms + //comment_edit.php + $text = '<?php'.$en_tete.' +include \'../../mainfile.php\'; +include XOOPS_ROOT_PATH.\'/include/comment_edit.php\'; +?>'; +createFile($path_file, $text, + _AM_TDMCREATE_CONST_OK_COMS, + _AM_TDMCREATE_CONST_NOTOK_COMS, $file); + + + $file = "comment_delete.php"; + $path_file = TDM_CREATE_MURL."/".$modules_name."/".$file; + $en_tete = const_entete($modules, 0); + //comment_delete.php + $text = '<?php'.$en_tete.' +include \'../../mainfile.php\'; +include XOOPS_ROOT_PATH.\'/include/comment_delete.php\'; +?>'; +createFile($path_file, $text, + _AM_TDMCREATE_CONST_OK_COMS, + _AM_TDMCREATE_CONST_NOTOK_COMS, $file); + + $file = "comment_post.php"; + $path_file = TDM_CREATE_MURL."/".$modules_name."/".$file; + $en_tete = const_entete($modules, 0); + //comment_post.php + $text = '<?php'.$en_tete.' +include \'../../mainfile.php\'; +include XOOPS_ROOT_PATH.\'/include/comment_post.php\'; +?>'; +createFile($path_file, $text, + _AM_TDMCREATE_CONST_OK_COMS, + _AM_TDMCREATE_CONST_NOTOK_COMS, $file); + + $file = "comment_reply.php"; + $path_file = TDM_CREATE_MURL."/".$modules_name."/".$file; + $en_tete = const_entete($modules, 0); + //comment_reply.php + $text = '<?php'.$en_tete.' +include \'../../mainfile.php\'; +include XOOPS_ROOT_PATH.\'/include/comment_reply.php\'; +?>'; +createFile($path_file, $text, + _AM_TDMCREATE_CONST_OK_COMS, + _AM_TDMCREATE_CONST_NOTOK_COMS, $file); + + + $file = "comment_new.php"; + $path_file = TDM_CREATE_MURL."/".$modules_name."/".$file; + $en_tete = const_entete($modules, 0); + + //Champs + $champs_total = explode("|", $tables_champs); + $nb_champs = count($champs_total); + //print_r($champs_total); + //Parametres + $parametres_total = explode("|", $tables_parametres); + + //Recuperation des parametres affichage dans le formulaire + for($j=0; $j<$nb_champs; $j++) + { + $champs = explode(":", $champs_total[$j]); + //Afficher dans les elements du formulaire et choisir le type + if( $j != 0 ) + { + $parametres1 = explode(":", $parametres_total[$j-1]); + if ( $parametres1[4] == 1 ) + { + $champs_param_main_field = $champs[0]; + } + } + } + $text = '<?php'.$en_tete.' +include "../../mainfile.php"; +include_once XOOPS_ROOT_PATH."/modules/'.$modules_name.'/class/'.$tables_name.'.php"; +$com_itemid = isset($_REQUEST["com_itemid"]) ? intval($_REQUEST["com_itemid"]) : 0; +if ($com_itemid > 0) { + $'.$tables_name.'Handler =& xoops_getModuleHandler("'.$tables_module_table.'", "'.$tables_name.'"); + $'.$tables_name.' = $'.$tables_name.'handler->get($com_itemid); + $com_replytitle = $'.$tables_name.'->getVar("'.$champs_param_main_field.'"); + include XOOPS_ROOT_PATH."/include/comment_new.php"; +} +?>'; +createFile($path_file, $text, + _AM_TDMCREATE_CONST_OK_COMS, + _AM_TDMCREATE_CONST_NOTOK_COMS, $file); +} +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |