|
From: <be...@us...> - 2013-09-20 23:10:43
|
Revision: 12071
http://sourceforge.net/p/xoops/svn/12071
Author: beckmi
Date: 2013-09-20 23:10:40 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
xGarage old Beta 2
Modified Paths:
--------------
XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php
XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php
XoopsModules/xgarage/trunk/xgarage/garage.php
XoopsModules/xgarage/trunk/xgarage/include/functions.php
XoopsModules/xgarage/trunk/xgarage/index.php
XoopsModules/xgarage/trunk/xgarage/language/english/main.php
XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html
XoopsModules/xgarage/trunk/xgarage/xoops_version.php
Added Paths:
-----------
XoopsModules/xgarage/trunk/xgarage/install.txt
XoopsModules/xgarage/trunk/xgarage/license.txt
XoopsModules/xgarage/trunk/xgarage/readme.txt
Removed Paths:
-------------
XoopsModules/xgarage/trunk/xgarage/admin/MI_1_index.php
Deleted: XoopsModules/xgarage/trunk/xgarage/admin/MI_1_index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/MI_1_index.php 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/admin/MI_1_index.php 2013-09-20 23:10:40 UTC (rev 12071)
@@ -1,355 +0,0 @@
-<?php
-include_once '../../../include/cp_header.php';
-include_once("functions.php");
-
-settype($op,"string");
-//$op = isset($_GET['op']) ? $_GET['op'] : $_POST['op'];
-$op = !isset($_GET['op'])? NULL : $_GET['op'];
-//$op = isset($_POST['op']) ? $_POST['op'] : '';
-//$cid = isset($_GET['cid']) ? $_GET['cid'] : $_POST['cid'];
-$cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
-$pick = isset($_POST['pick']) ? intval($_POST['pick']) : 0;
-$statussel = isset($_POST['statussel']) ? intval($_POST['statussel']) : 0;
-$sortsel = isset($_POST['sortsel']) ? $_POST['sortsel'] : 'id';
-$ordersel = isset($_POST['ordersel']) ? $_POST['ordersel'] : 'DESC';
-$gid = isset($_GET['gid']) ? intval($_GET['gid']) : 0;
-$self = $_SERVER['PHP_SELF'];
-global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
-
-
-$myts = &MyTextSanitizer::getInstance();
-
-//echo("Hellow World.");
-
-switch($op){
- case "approve":
-
- //if($userIsAdmin) {
- $success = approveGarage($gid);
- if($success) redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_APPROVESUCCESS);
- else redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_APPROVEFAILURE);
- //}
-
- break;
-
- case "disable":
- //if($userIsAdmin) {
- $success = disableGarage($gid);
- if($success) redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_GARAGEDISABLED);
- else redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_DISBALEFAILURE);
- //} redirect_header("index.php",2,_MD_XG_MUSTLOGADMIND);
- break;
-
- case "enable":
- //if($userIsAdmin) {
- $success = enableGarage($gid);
- if($success) redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_GARAGEENABLED);
- else redirect_header(xoops_getenv('HTTP_REFERER'),2,_AM_ENBALEFAILURE);
- //} redirect_header("index.php",2,_MD_XG_MUSTLOGADMINE);
- break;
-
- case "delgarage":
-
-
- //verify delete
- if (isset($_GET['gid'])) {
- $gid = $_GET['gid'];
- }
- if (isset($_POST['gid'])) {
- $gid = $_POST['gid'];
- }
- if (isset($_POST['subop'])) {
- $subop = $_POST['subop'];
- }
- if ($subop == "delok") {
-
- $sql = sprintf("DELETE FROM %s WHERE id = %u", $xoopsDB->prefix("garage"), $gid);
-
- if ($xoopsDB->query($sql)) {
- // delete comments for the garage being deleted
- xoops_comment_delete($xoopsModule->getVar('mid'), $gid);
- redirect_header("index.php", 3, _AM_ITEMDELETED);
- //echo "deleted";
- } else {
- redirect_header("index.php", 3, _AM_ITEMNOTDELETED);
- //echo "not deleted";
- }
- } // end if
- else {
- xoops_cp_header();
- adminMenu(1, _AM_GARAGES_INDEX);
- echo "<div style='height:25px;'> </div>";
- xoops_confirm(array('op' => 'delgarage', 'gid' => $gid, 'subop' => 'delok'), 'index.php', _AM_CONFIRMDELETE);
- }
- echo "</p>";
- break;
-
-
- case "view_new":
- xoops_cp_header();
- adminMenu(2, _AM_GARAGES_APPROVE);
- //get list of all diabled garage
- $names = getNewGarages();
-
- //print them out with links
- if(count($names) > 0)
- for($x=0;$x<count($names);$x++){
- echo("<div style=\"margin-left:100px;\"><a href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
- }
- else echo "<div>"._AM_NONENEW."</div>";
- break;
-
- case "view_disabled":
- xoops_cp_header();
- adminMenu(3, _AM_GARAGES_DISABLED);
- //get list of all diabled garage
- $names = getDisabledGarages();
-
- //print them out with links
- if(count($names) > 0)
- for($x=0;$x<count($names);$x++){
- echo("<div style=\"margin-left:100px;\"><a href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
- }
- else echo("<div>"._AM_NONEDISABLED."</div>");
- break;
- case "add_cat":
- //echo("testing123");
- //adminMenu(4, _AM_GARAGES_CATEGORIES);
- if($_POST['catname']){
- $success = addCat('',$_POST['catname'],$_POST['gid']);
- if($success){
- redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDED);
- exit;
- } else {
- redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDERROR);
- }
- }
- break;
- case "move_cat":
- //echo("testing123");
- //adminMenu(4, _AM_GARAGES_CATEGORIES);
- if($_POST['gid'] != $_POST['cid']){
- include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
- $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
- $children = $cattree->getChildTreeArray($_POST['cid']);
- //var_dump($children);
- foreach($children as $child){
- $cc[] = $child['cid'];
- }
- if(!in_array($_POST['gid'],$cc)){
- $success = moveCat($_POST['cid'],$_POST['gid']);
- if($success){
- redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYMOVED);
- exit;
- } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYMOVEERROR);
- } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYMOVEINTO);
- } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_MOVENO);
-
- break;
- case "rename_cat":
- //echo("testing123");
- //adminMenu(4, _AM_GARAGES_CATEGORIES);
- $success = renameCat($_POST['cid'],$_POST['catname']);
- if($success){
- redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYRENAMED);
- exit;
- } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYRENAMEERROR);
- break;
-
- case "del_cat":
-
-
- //verify delete
-
- if (isset($_POST['cid'])) {
- $cid = $_POST['cid'];
- }
- if (isset($_POST['subop'])) {
- $subop = $_POST['subop'];
- }
- if (isset($subop) && $subop == "delok") {
- //get all cats
-
- include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
- $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
- $cats = $cattree->getChildTreeArray($cid,"name");
- $WHERE = "WHERE cid = $cid";
- foreach($cats as $cat){
- $WHERE .= " OR cid=".$cat['cid'];
- }
-
- $sql = sprintf("DELETE FROM %s %s", $xoopsDB->prefix("garage_cats"), $WHERE);
-
- if ($xoopsDB->query($sql)) {
- // delete comments for the garage being deleted
- //xoops_comment_delete($xoopsModule->getVar('mid'), $gid);
- redirect_header("index.php", 3, _AM_CATDELETED);
- //echo "deleted";
- } else {
- redirect_header("index.php", 3, _AM_CATNOTDELETED);
- //echo "not deleted";
- }
- } // end if
- else {
- include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
- $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
- $cats = $cattree->getChildTreeArray($cid,"name");
- $catlist[] = getName($cid);
- $content = 0;
- $c = check4Content($cid);
- $content = $content + $c;
-
- foreach($cats as $cat){
- $c = check4Content($cat['cid']);
- $content = $content + $c;
- $catlist[] = getName($cat['cid']);
- }
- if($content){
- $msg = sprintf(_AM_CONTENTEXISTS,$content);
- redirect_header("index.php?op=cats&cid=$cid", 5, $msg);
- exit;
- } else {
- xoops_cp_header();
- adminMenu(4, _AM_GARAGES_CATEGORIES);
- echo("<div style='height:25px;'> </div>");
-
- $clist = join($catlist,", ");
- $delmsg = _AM_CONFIRMDELCATS."<br/>".$clist;
- xoops_confirm(array('op' => 'del_cat', 'cid' => $cid, 'subop' => 'delok'), 'index.php', $delmsg);
- }
- }
- break;
-
- case "cats":
- xoops_cp_header();
- adminMenu(4, _AM_GARAGES_CATEGORIES);
- include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
-
- $cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
-
- //if(!$cid) {$cid = '0';}
- //$cid = isset($_POST['cid']);
- $cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
- $path = $cattree->getNicePathFromId($cid, "name", "index.php?op=cats");
- echo "<a href='index.php?op=cats&cid='0''><img src='../images/icons/index.png' align='middle' title='"._AM_GARAGES_INDEX."' alt='"._AM_GARAGES_INDEX."'></a> ".$path;
-
- $cats = getCats($cid);
- //echo("<table width='100%' align='center'>");
- //echo("");
- //echo("<form method='post'>");
- for($x=0;$x < count($cats);$x++){
- //echo("<div style='left-margin:50px;'><input type='checkbox' name='cats[]' value='".$cats[$x]['cid']."'><a href='index.php?op=cats&cid=".$cats[$x]['cid']."'>".$cats[$x]['name']."</a></div>");
- echo "<div style='left-margin:50px;'><a href='index.php?op=cats&cid=".$cats[$x]['cid']."'>".$cats[$x]['name']."</a></div>";
- }
- //echo("<input type='hidden' name='op' value='delcats'>");
- //echo("<input type='submit' value='"._AM_DELETE."'>");
- //echo("</form>");
- //echo("</table>");
- // add new cat
- echo "<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>";
- echo "<form method='post' action='index.php'>";
- echo ""._AM_NEWCATNAME."<input type='text' name='catname' /><br/>"._AM_PARENT."";
- $cattree->makeMySelBox("name","",$cid,true,"gid");
- echo "<input type='hidden' name='cid' value='$cid' />";
- echo "<input type='hidden' name='op' value='add_cat' />";
- echo "<br/><input type='submit' value='"._AM_ADDNEWCAT."' />";
- echo "</form>" ;
- echo "</div>" ;
- echo "<br/>" ;
-
- if($cid){
- echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
- echo("<form method='post' action='index.php'>");
- echo(_AM_MOVECAT."<br/>"._AM_PARENT);
- $cattree->makeMySelBox("name","",$cid,true,"gid");
- echo("<input type='hidden' name='cid' value='$cid'>");
- echo("<input type='hidden' name='op' value='move_cat'>");
- echo("<br/><input type='submit' value='"._AM_MOVECATSUBMIT."'>");
- echo("</form>");
- echo("</div>");
- echo("<br/>");
- echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
- echo("<form method='post' action='index.php'>");
- echo(_AM_RENAMECAT);
- $catname = getName($cid);
- echo("<input type='text' name='catname' value='$catname'>");
- echo("<input type='hidden' name='cid' value='$cid'>");
- echo("<input type='hidden' name='op' value='rename_cat'>");
- echo("<br/><input type='submit' value='"._AM_RENAME."'>");
- echo("</form>");
- echo("</div>");
- echo("<br/>");
- echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
- echo("<form method='post' action='index.php'>");
- echo(_AM_DELETECAT);
- $catname = getName($cid);
- echo(" $catname");
- echo("<input type='hidden' name='cid' value='$cid'>");
- echo("<input type='hidden' name='op' value='del_cat'>");
- echo("<br/><input type='submit' value='"._AM_DELETE."'>");
- echo("</form>");
- echo("</div>");
- }
- break;
- case "documentation":
- xoops_cp_header();
- adminMenu(5, _AM_GARAGES_DOCUMENTATION);
-
- echo("<div style='text-align:center;'>"._AM_DOCS."<br/><br/><br/>");
-
- echo("<br/><br/><br/><a href='http://www.xgarage.org'>Live Docs and support at X-Garage</a>");
-
-
- echo("</div>");
-
- break;
-
- case "support":
- xoops_cp_header();
- adminMenu(5, _AM_GARAGES_SUPPORT);
-
- echo("<div style='text-align:center;'>"._AM_SUPPORT."<br/><br/><br/>"._AM_SUPPORT_REGISTERED);
-
- echo("<br/><br/><br/><a href='http://www.xgarage.org/modules/newbb/'>Garages Module for XOOPS Support Forum</a>");
-
-
- echo("</div>");
-
- break;
-
- case "donations":
- xoops_cp_header();
- adminMenu(6, _AM_GARAGES_DONATIONS);
-
- echo "<div style='text-align:center;'>"._AM_INTRO."<br/><br/><br/>";
-
- echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
-<input type="hidden" name="cmd" value="_s-xclick">
-<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!">
-<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
-<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCZmz/XmGv7WnRc0ND7eT96YucKR8egScEksr5lNOx5twxsrVHkWOsnGXvUB8ui3lS7zzDEz7N57qLp88Ak7AvtmAqmO9AbWXxL8MkRMamEyKnTX0ojnYiP6cuBZOvTJpqTPWa4s+LF3T2xVkvAZLB0Ckg8jT38K884OvjDJvr8YjELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIV9Sm7q0bdyaAgaBlgupZIGnHBs8cFmeTf2KMFnmG/T1mHohV7TnjlaFwF58JZo0igwwzUOe6rX8K1vS5R8CO1kvFeLjRKGa8ZdTT1O2SC0m0B181r267Vn673jJkmj6HrthlEbuSWcuFaFBSEkGsvMKyuwN8seu9a5AF1HjwOOwCE/vkehbvtrmUgGiHyP0zIsGisYJ/ToGVgzyIpHO0mkZekybT/PuhRfl/oIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDcwNzIyMDYwMTE3WjAjBgkqhkiG9w0BCQQxFgQU3qLpIBvssWlAVXz8/tJC1ImH5vAwDQYJKoZIhvcNAQEBBQAEgYBFGGw8eKVvfwsZJiWLYdSVzWnhkiypXitE4pdFXIb972yj0b+CtMpwoRG09qJCuHmExOGzSGo6EXXLeC44cDfbhb4S3DbSNBlrtbUJfMszejfCqYRmcOqi2KBGThze4KHpey8/R0TxMYsrIccLpO3HHpvL1/uWYuRwJOfeUwQDnA==-----END PKCS7-----
-">
-</form>';
-
-
-
-
- break;
-
- default:
- xoops_cp_header();
- adminMenu(1, _AM_GARAGES_INDEX);
-
- $names = getActiveGarages();
- if(count($names) > 0)
- for($x=0;$x<count($names);$x++){
- if($names[$x]['viewable']) $viewable="color:#000000;";
- else $viewable="color:#cccccc;";
- echo "<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>";
- }
- else echo "<div>"._AM_NONEACTIVE."</div>";
- break;
-
-}
-xoops_cp_footer();
-?>
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php 2013-09-20 23:10:40 UTC (rev 12071)
@@ -13,19 +13,19 @@
<p>XOOPS - <a href="http://www.xoops.org/">http://www.xoops.org/ </a></p>
<p>Script_fu - for his encouragement to get this module done. </p>
<p>gtop00 - thanks for the debaits, on how we should get this working. </p>
-<p>exbanious - You inspired many to make or ask for a agarage module. </p>
+<p>exbanious - You inspired many to make or ask for a garage module. </p>
<p>Mudnuts4x4 - he was the original person to ask for a module like the phpBB garage,<br>
Sorry, its not phpbb, but its close, without a lawsuite. and its original to xoops, and no-one else.</p>
<p><br>
- <strong>Translators:</strong></p>
+<strong>Translators:</strong></p>
<p>English - Northern <br>
- German - <br>
- Japanese - <br>
+German - <br>
+Japanese - <br>
Portuguese - <br>
Greek - <br>
French - <br>
-Dutch -<br>
+Dutch - <br>
Danish - <br>
</p>
<p> </p>
Modified: XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php 2013-09-20 23:10:40 UTC (rev 12071)
@@ -7,11 +7,11 @@
</head>
<body>
-<h1>Garages Module for XOOPS 2.0 User's Manual </h1>
+<h1>Garage Module for XOOPS 2.0 User's Manual </h1>
<hr>
<p>Add new garage: </p>
<p>Name and Description are required.<br>
- To upload an image, edit your garage afer its adde, if site allows image uploads. </p>
+ To upload an image, edit your garage afer its added, if site allows image uploads. </p>
<p>Edit Garage:</p>
<p>In some web sites, changes must be requested.</p>
<p> </p>
Modified: XoopsModules/xgarage/trunk/xgarage/garage.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:10:40 UTC (rev 12071)
@@ -9,7 +9,7 @@
settype($name, "string");
settype($image, "string");
settype($location, "string");
-settype($mark, "string");
+settype($make, "string");
settype($model, "string");
settype($year, "string");
settype($engine, "string");
@@ -24,7 +24,7 @@
settype($quartm, "string");
settype($list, "string");
settype($mengine, "string");
-settype($meterior, "string");
+settype($mexterior, "string");
settype($minterior, "string");
settype($mrims, "string");
settype($maudio, "string");
@@ -79,7 +79,7 @@
$url = $myts->makeTboxData4Save($_POST['url']);
$location = $myts->makeTboxData4Save($_POST['location']);
- $mark = $myts->makeTboxData4Save($_POST['mark']);
+ $make = $myts->makeTboxData4Save($_POST['make']);
$model = $myts->makeTboxData4Save($_POST['model']);
$year = $myts->makeTboxData4Save($_POST['year']);
$engine = $myts->makeTboxData4Save($_POST['engine']);
@@ -94,7 +94,7 @@
$quartm = $myts->makeTboxData4Save($_POST['quartm']);
$list = $myts->makeTboxData4Save($_POST['list']);
$mengine = $myts->makeTareaData4Save($_POST['mengine']);
- $meterior = $myts->makeTareaData4Save($_POST['meterior']);
+ $mexterior = $myts->makeTareaData4Save($_POST['mexterior']);
$minterior = $myts->makeTareaData4Save($_POST['minterior']);
$mrims = $myts->makeTareaData4Save($_POST['mrims']);
$maudio = $myts->makeTareaData4Save($_POST['maudio']);
@@ -106,7 +106,7 @@
include("image_uploader.php");
- $success = addGarage($a,$uid,$cid,$name,$image,$imageupload,$imagechoice,$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$meterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ $success = addGarage($a,$uid,$cid,$name,$image,$imageupload,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
if($success) redirect_header("index.php",2,_MD_XG_ADDSUCCESS);
else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
} else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
@@ -133,7 +133,7 @@
if(!$imagechoice) $imagechoice = "0";
$url = $myts->makeTboxData4Save($_POST['url']);
$location = $myts->makeTboxData4Save($_POST['location']);
- $mark = $myts->makeTboxData4Save($_POST['mark']);
+ $make = $myts->makeTboxData4Save($_POST['make']);
$model = $myts->makeTboxData4Save($_POST['model']);
$year = $myts->makeTboxData4Save($_POST['year']);
$engine = $myts->makeTboxData4Save($_POST['engine']);
@@ -148,7 +148,7 @@
$quartm = $myts->makeTboxData4Save($_POST['quartm']);
$list = $myts->makeTboxData4Save($_POST['list']);
$mengine = $myts->makeTareaData4Save($_POST['mengine']);
- $meterior = $myts->makeTareaData4Save($_POST['meterior']);
+ $mexterior = $myts->makeTareaData4Save($_POST['mexterior']);
$minterior = $myts->makeTareaData4Save($_POST['minterior']);
$mrims = $myts->makeTareaData4Save($_POST['mrims']);
$maudio = $myts->makeTareaData4Save($_POST['maudio']);
@@ -163,8 +163,8 @@
if($errmsg) $wtime = 15;
else $wtime = 3;
if(($uid == $puid && $xoopsModuleConfig['canuseredit']) || $userIsAdmin){
- if($msg) $success = updateGaragePlusUpload($gid,$ouid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice,$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$meterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
- else $success = updateGarage($gid,$ouid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$meterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ if($msg) $success = updateGaragePlusUpload($gid,$ouid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ else $success = updateGarage($gid,$ouid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
if($success) redirect_header("index.php?op=view&gid=$gid",$wtime,_MD_XG_UPDATESUCCESS.$errmsg.$msg);
else redirect_header("index.php?op=view&gid=$gid",$wtime,_MD_XG_UPDATEFAILURE.$errmsg.$msg);
@@ -227,7 +227,7 @@
}
$sform->addElement(new XoopsFormText(_MD_XG_URL, 'url', 50, 255, $url), false);
$sform->addElement(new XoopsFormText(_MD_XG_LOCATION, 'location', 50, 75, $location), false);
- $sform->addElement(new XoopsFormText(_MD_XG_MARK, 'mark', 50, 75, $mark), false);
+ $sform->addElement(new XoopsFormText(_MD_XG_MAKE, 'make', 50, 75, $make), false);
$sform->addElement(new XoopsFormText(_MD_XG_MODEL, 'model', 50, 75, $model), false);
$sform->addElement(new XoopsFormText(_MD_XG_YEAR, 'year', 50, 75, $year), false);
$sform->addElement(new XoopsFormText(_MD_XG_ENGINE, 'engine', 50, 75, $engine), false);
@@ -242,7 +242,7 @@
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_METERIOR, 'meterior', $meterior, 20, 40), true);
+ $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), true);
@@ -276,7 +276,7 @@
$imagechoice = $garage['imagechoice'];
$url = $garage['url'];
$location = $garage['location'];
- $mark = $garage['mark'];
+ $make = $garage['make'];
$model = $garage['model'];
$year = $garage['year'];
$engine = $garage['engine'];
@@ -291,7 +291,7 @@
$quartm = $garage['quartm'];
$list = $garage['list'];
$mengine = $garage['mengine'];
- $meterior = $garage['meterior'];
+ $mexterior = $garage['mexterior'];
$minterior = $garage['minterior'];
$mrims = $garage['mrims'];
$maudio = $garage['maudio'];
@@ -335,7 +335,7 @@
}
$sform->addElement(new XoopsFormText(_MD_XG_URL, 'url', 50, 255, $url), false);
$sform->addElement(new XoopsFormText(_MD_XG_LOCATION, 'location', 50, 75, $location), false);
- $sform->addElement(new XoopsFormText(_MD_XG_MARK, 'mark', 50, 75, $mark), false);
+ $sform->addElement(new XoopsFormText(_MD_XG_MAKE, 'make', 50, 75, $make), false);
$sform->addElement(new XoopsFormText(_MD_XG_MODEL, 'model', 50, 75, $model), false);
$sform->addElement(new XoopsFormText(_MD_XG_YEAR, 'year', 50, 75, $year), false);
$sform->addElement(new XoopsFormText(_MD_XG_ENGINE, 'engine', 50, 75, $engine), false);
@@ -350,7 +350,7 @@
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), true);
- $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_METERIOR, 'meterior', $meterior, 20, 40), true);
+ $sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), true);
Modified: XoopsModules/xgarage/trunk/xgarage/include/functions.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:09:39 UTC (rev 12070)
+++ XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:10:40 UTC (rev 12071)
@@ -16,7 +16,7 @@
function getGarage($gid){
global $xoopsDB;
- $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,mark,model,year,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,meterior,minterior,mrims,maudio,mfuture,descript2,linkGarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = $gid";
+ $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,make,model,year,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getGarage()");
}
@@ -27,31 +27,31 @@
return $Garage;
}
-function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$meterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
+function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$make,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
global $xoopsDB;
- $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,mark,model,year,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,meterior,minterior,mrims,maudio,mfuture,descript2,linkGarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$mark','$model','$year','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$meterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkGarage')";
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,make,model,year,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$make','$model','$year','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkGarage')";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$mark,$model,$year,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$...
[truncated message content] |
|
From: <be...@us...> - 2013-09-20 23:11:31
|
Revision: 12072
http://sourceforge.net/p/xoops/svn/12072
Author: beckmi
Date: 2013-09-20 23:11:28 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
xGarage old Beta 3
Modified Paths:
--------------
XoopsModules/xgarage/trunk/xgarage/admin/functions.php
XoopsModules/xgarage/trunk/xgarage/admin/index.php
XoopsModules/xgarage/trunk/xgarage/docs/EN/credits.php
XoopsModules/xgarage/trunk/xgarage/docs/EN/user.php
XoopsModules/xgarage/trunk/xgarage/garage.php
XoopsModules/xgarage/trunk/xgarage/include/functions.php
XoopsModules/xgarage/trunk/xgarage/index.php
XoopsModules/xgarage/trunk/xgarage/language/english/admin.php
XoopsModules/xgarage/trunk/xgarage/language/english/main.php
XoopsModules/xgarage/trunk/xgarage/language/english/modinfo.php
XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
XoopsModules/xgarage/trunk/xgarage/templates/cat_index.html
XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html
XoopsModules/xgarage/trunk/xgarage/xoops_version.php
Added Paths:
-----------
XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php
XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php
XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php
XoopsModules/xgarage/trunk/xgarage/blocks/index.html
XoopsModules/xgarage/trunk/xgarage/class/index.html
XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php
XoopsModules/xgarage/trunk/xgarage/images/icons/index.html
XoopsModules/xgarage/trunk/xgarage/images/index.html
XoopsModules/xgarage/trunk/xgarage/images/uploads/index.html
XoopsModules/xgarage/trunk/xgarage/include/gtickets.php
XoopsModules/xgarage/trunk/xgarage/include/index.html
XoopsModules/xgarage/trunk/xgarage/include/notification.inc.php
XoopsModules/xgarage/trunk/xgarage/language/english/index.html
XoopsModules/xgarage/trunk/xgarage/language/english/mail_template/
XoopsModules/xgarage/trunk/xgarage/language/english/mail_template/index.html
XoopsModules/xgarage/trunk/xgarage/language/english/mail_template/listing_newpost_notify.tpl
XoopsModules/xgarage/trunk/xgarage/language/index.html
XoopsModules/xgarage/trunk/xgarage/notification_update.php
XoopsModules/xgarage/trunk/xgarage/sql/index.html
XoopsModules/xgarage/trunk/xgarage/templates/blocks/index.html
XoopsModules/xgarage/trunk/xgarage/templates/index.html
Removed Paths:
-------------
XoopsModules/xgarage/trunk/xgarage/admin/error_log
Added: XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1,26 @@
+<?php
+include("../../../mainfile.php");
+include_once(XOOPS_ROOT_PATH."/class/xoopsmodule.php");
+include(XOOPS_ROOT_PATH."/include/cp_functions.php");
+
+ $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
+
+ require_once( XOOPS_ROOT_PATH."/modules/$mydirname/include/gtickets.php" ) ;
+
+if ( $xoopsUser ) {
+ $xoopsModule = XoopsModule::getByDirname("garage");
+ if ( !$xoopsUser->isAdmin($xoopsModule->mid()) ) {
+ redirect_header(XOOPS_URL."/",3,_NOPERM);
+ exit();
+ }
+} else {
+ redirect_header(XOOPS_URL."/",3,_NOPERM);
+ exit();
+}
+if ( file_exists("../language/".$xoopsConfig['language']."/admin.php") ) {
+ include("../language/".$xoopsConfig['language']."/admin.php");
+} else {
+ include("../language/english/admin.php");
+}
+$myts =& MyTextSanitizer::getInstance();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/admin_header.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: XoopsModules/xgarage/trunk/xgarage/admin/error_log
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/error_log 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/admin/error_log 2013-09-20 23:11:28 UTC (rev 12072)
@@ -1,3 +0,0 @@
-[09-Sep-2007 17:21:09] PHP Parse error: syntax error, unexpected ':' in /home/connectu/public_html/dev/modules/garage/admin/index.php on line 9
-[09-Sep-2007 17:21:47] PHP Parse error: syntax error, unexpected ';' in /home/connectu/public_html/dev/modules/garage/admin/index.php on line 262
-[09-Sep-2007 17:22:26] PHP Parse error: syntax error, unexpected ')' in /home/connectu/public_html/dev/modules/garage/admin/index.php on line 265
Modified: XoopsModules/xgarage/trunk/xgarage/admin/functions.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/functions.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/admin/functions.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -1,7 +1,7 @@
<?php
function getCats($gid){
global $xoopsDB;
- $sql = ("SELECT cid,name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE gid = '$gid' ORDER BY name");
+ $sql = "SELECT cid,name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE gid = '$gid' ORDER BY name";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getCats($gid)");
} else {
@@ -14,7 +14,7 @@
}
function getName($cid){
global $xoopsDB;
- $sql = "SELECT name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE cid = $cid";
+ $sql = "SELECT name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE cid = '$cid'";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getName($cid)");
} else {
@@ -23,20 +23,21 @@
return ($name);
}
}
-function addCat($name,$gid) {
+function addCat($name,$gid){
global $xoopsDB;
- $sql = $xoopsDB->query("INSERT INTO ".$xoopsDB->prefix("garage_cats")." VALUES ('','$name','$gid')");
- if (!$result = $sql) {
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage_cats") . " (name,gid) VALUES ('$name',$gid)";
+ if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: addCat($name,$gid)");
return 0;
- }else{
+ } else {
return 1;
}
+
}
function moveCat($cid,$gid){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET gid = $gid WHERE cid = $cid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET gid = $gid WHERE cid = '$cid'";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: moveCat($cid,$gid)");
return 0;
@@ -48,7 +49,7 @@
function check4Content($cid){
global $xoopsDB;
- $sql = "SELECT count(*) as count FROM " . $xoopsDB->prefix("garage") . " WHERE cid = $cid";
+ $sql = "SELECT count(*) as count FROM " . $xoopsDB->prefix("garage") . " WHERE cid = '$cid'";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: check4Content($cid)");
return 0;
@@ -61,7 +62,7 @@
function renameCat($cid,$catname){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET name = '$catname' WHERE cid = $cid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage_cats") . " SET name = '$catname' WHERE cid = '$cid'";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: renameCat($cid,$catname)");
return 0;
@@ -72,7 +73,7 @@
function approveGarage($gid){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET approved=1 WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET approved=1 WHERE id = '$gid'";
if ( !$result = $xoopsDB->queryF($sql) ) {
exit("$sql > SQL Error in function :: approveGarage($gid)");
} else {
@@ -82,7 +83,7 @@
function disableGarage($gid){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=1 WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=1 WHERE id = '$gid'";
if ( !$result = $xoopsDB->queryF($sql) ) {
exit("$sql > SQL Error in function :: disableGarage($gid)");
} else {
@@ -92,7 +93,7 @@
function enableGarage($gid){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=0 WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET disabled=0 WHERE id = '$gid'";
if ( !$result = $xoopsDB->queryF($sql) ) {
exit("$sql > SQL Error in function :: enableGarage($gid)");
} else {
@@ -101,7 +102,7 @@
}
function getActiveGarages(){
global $xoopsDB;
- $sql = ("SELECT id,name,viewable FROM " . $xoopsDB->prefix("garage") . " WHERE disabled=0 AND approved=1 ORDER BY name");
+ $sql = ("SELECT id,name,viewable FROM " . $xoopsDB->prefix("garage") . " WHERE disabled='0' AND approved='1' ORDER BY name");
$result=$xoopsDB->query($sql);
$rows = array();
while($row = $xoopsDB->fetchArray($result)) {
@@ -112,7 +113,7 @@
function getNewGarages(){
global $xoopsDB;
- $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE approved=0 ORDER BY name");
+ $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE approved='0' ORDER BY name");
$result=$xoopsDB->query($sql);
$rows = array();
while($row = $xoopsDB->fetchArray($result)) {
@@ -123,7 +124,7 @@
function getDisabledGarages(){
global $xoopsDB;
- $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE disabled=1 ORDER BY name");
+ $sql = ("SELECT id,name FROM " . $xoopsDB->prefix("garage") . " WHERE disabled='1' ORDER BY name");
$result=$xoopsDB->query($sql);
$rows = array();
while($row = $xoopsDB->fetchArray($result)) {
@@ -177,6 +178,7 @@
echo "<li id='" . $tblColors[2] . "'><a href=\"index.php?op=view_new\"><span>" . _AM_GARAGES_APPROVE . "</span></a></li>";
echo "<li id='" . $tblColors[3] . "'><a href=\"index.php?op=view_disabled\"><span>" . _AM_GARAGES_DISABLED . "</span></a></li>";
echo "<li id='" . $tblColors[4] . "'><a href=\"index.php?op=cats\"><span>" . _AM_GARAGES_CATEGORIES . "</span></a></li>";
+ echo "<li id='" . $tblColors[5] . "'><a href=\"garageperms.php\"><span>" . _AM_GARAGES_PERMISSIONS . "</span></a></li>";
echo "</ul></div>";
}
Added: XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1,93 @@
+<?php
+// $Id$
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System //
+// Copyright (c) 2000 XOOPS.org //
+// <http://www.xoops.org/> //
+// ------------------------------------------------------------------------ //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation; either version 2 of the License, or //
+// (at your option) any later version. //
+// //
+// 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. See the //
+// GNU General Public License for more details. //
+// //
+// You should have received a copy of the GNU General Public License //
+// along with this program; if not, write to the Free Software //
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
+// ------------------------------------------------------------------------ //
+include_once("admin_header.php");
+include_once("functions.php");
+include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
+include_once XOOPS_ROOT_PATH . "/modules/".$xoopsModule->getVar("dirname")."/class/mygrouppermform.php";
+
+
+xoops_cp_header();
+adminMenu(5, _AM_GARAGES_PERMISSIONS);
+
+
+$permtoset= isset($_POST['permtoset']) ? intval($_POST['permtoset']) : 1;
+$selected=array('','','');
+$selected[$permtoset-1]=' selected';
+echo "<br /><br />";
+echo "<form method='post' name='gselperm' action='garageperms.php'><div><select name='permtoset' onChange='javascript: document.gselperm.submit()'><option value='1'".$selected[0].">"._AM_GARAGES_VIEWFORM."</option><option value='2'".$selected[1].">"._AM_GARAGES_SUBMITFORM."</option></select></div></form>";
+$module_id = $xoopsModule->getVar('mid');
+
+switch($permtoset)
+{
+ case 1:
+ $title_of_form = _AM_GARAGES_VIEWFORM;
+ $perm_name = "garage_view";
+ $perm_desc = _AM_GARAGES_VIEWFORM_DESC;
+ $item_list_view = array();
+ $block_view = array();
+ $result_view = $xoopsDB->query("SELECT cid, name FROM " . $xoopsDB->prefix("garage_cats") . " ");
+ if ($xoopsDB->getRowsNum($result_view)) {
+ while ($myrow_view = $xoopsDB->fetcharray($result_view)) {
+ $item_list_view['cid'] = $myrow_view['cid'];
+ $item_list_view['name'] = $myrow_view['name'];
+ $permform = new MyXoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc);
+ $block_view[] = $item_list_view;
+ foreach ($block_view as $itemlists) {
+ $permform->addItem($itemlists['cid'], $myts->displayTarea($itemlists['name']));
+ }
+ }
+}
+ break;
+
+ case 2:
+ $title_of_form = _AM_GARAGES_SUBMITFORM;
+ $perm_name = "garage_submit";
+ $perm_desc = _AM_GARAGES_SUBMITFORM_DESC;
+ $item_list_view = array();
+ $block_view = array();
+ $result_view = $xoopsDB->query("SELECT cid, name FROM " . $xoopsDB->prefix("garage_cats") . " ");
+ if ($xoopsDB->getRowsNum($result_view)) {
+ while ($myrow_view = $xoopsDB->fetcharray($result_view)) {
+ $item_list_view['cid'] = $myrow_view['cid'];
+ $item_list_view['name'] = $myrow_view['name'];
+ $permform = new MyXoopsGroupPermForm($title_of_form, $module_id, $perm_name, $perm_desc);
+ $block_view[] = $item_list_view;
+ foreach ($block_view as $itemlists) {
+ $permform->addItem($itemlists['cid'], $myts->displayTarea($itemlists['name']));
+ }
+ }
+}
+ break;
+
+}
+
+echo $permform->render();
+echo "<br /><br /><br /><br />\n";
+unset ($permform);
+
+xoops_cp_footer();
+?>
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: XoopsModules/xgarage/trunk/xgarage/admin/index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/index.php 2013-09-20 23:10:40 UTC (rev 12071)
+++ XoopsModules/xgarage/trunk/xgarage/admin/index.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -3,20 +3,14 @@
include_once("functions.php");
settype($op,"string");
-if(!isset($_POST['op']) && isset($_GET['op']) ) {
- $op = $_GET['op'] ;
-}
-if (!isset($op)) {
- $op = '';
-}
-
+if(isset($_GET['op'])) $op = $_GET['op'];
+if(isset($_POST['op'])) $op = $_POST['op'];
//$op = isset($_GET['op']) ? $_GET['op'] : $_POST['op'];
-if(!isset($_POST['cid']) && isset($_GET['cid']) ) {
- $cid = intval($_GET['cid']);
+//$op = isset($_POST['op']) ? $_POST['op'] : '';
+if (!isset($_POST['cid']) && isset($_GET['cid']) ) {
+ $cid = $_GET['cid'];
}
-//$op = isset($_POST['op']) ? $_POST['op'] : '';
//$cid = isset($_GET['cid']) ? $_GET['cid'] : $_POST['cid'];
-//$cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
$pick = isset($_POST['pick']) ? intval($_POST['pick']) : 0;
$statussel = isset($_POST['statussel']) ? intval($_POST['statussel']) : 0;
$sortsel = isset($_POST['sortsel']) ? $_POST['sortsel'] : 'id';
@@ -24,11 +18,9 @@
$gid = isset($_GET['gid']) ? intval($_GET['gid']) : 0;
$self = $_SERVER['PHP_SELF'];
+global $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
+global $xoopsDB;
-
-global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule, $cattree;
-
-
$myts = &MyTextSanitizer::getInstance();
//echo("Hellow World.");
@@ -90,10 +82,10 @@
else {
xoops_cp_header();
adminMenu(1, _AM_GARAGES_INDEX);
- echo "<div style='height:25px;'> </div>";
+ echo("<div style='height:25px;'> </div>");
xoops_confirm(array('op' => 'delgarage', 'gid' => $gid, 'subop' => 'delok'), 'index.php', _AM_CONFIRMDELETE);
}
- echo "</p>";
+ echo("</p>");
break;
@@ -108,7 +100,7 @@
for($x=0;$x<count($names);$x++){
echo("<div style=\"margin-left:100px;\"><a href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
}
- else echo "<div>"._AM_NONENEW."</div>";
+ else echo("<div>"._AM_NONENEW."</div>");
break;
case "view_disabled":
@@ -127,15 +119,14 @@
case "add_cat":
//echo("testing123");
//adminMenu(4, _AM_GARAGES_CATEGORIES);
- if($_POST['catname']) {
+ if($_POST['catname']){
$success = addCat($_POST['catname'],$_POST['gid']);
- if ($success) {
- redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDED);
+ if($success){
+ redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDED);
exit;
- } else {
- redirect_header("index.php?op=cats&cid=$cid", 5, _AM_CATEGORYADDERROR);
- }
+ } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDERROR);
}
+
break;
case "move_cat":
//echo("testing123");
@@ -236,10 +227,10 @@
xoops_cp_header();
adminMenu(4, _AM_GARAGES_CATEGORIES);
include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
-
$cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
- if(!$cid) $cid = '0';
+
+ $cid = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
$path = $cattree->getNicePathFromId($cid, "name", $self."?op=cats");
echo "<a href='index.php?op=cats&cid=0'><img src='../images/icons/index.png' align='middle' title='"._AM_GARAGES_INDEX."' alt='"._AM_GARAGES_INDEX."'></a> ".$path;
@@ -258,11 +249,11 @@
// add new cat
echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
echo("<form method='post' action='index.php'>");
- echo(""._AM_NEWCATNAME."<input type='text' name='catname'><br/>"._AM_PARENT);
- $cattree->makeMySelBox("name","",$cid, true,"gid");
- echo("<input type='hidden' name='cid' value='$cid' />");
- echo("<input type='hidden' name='op' value='add_cat' />");
- echo("<br/><input type='submit' value='"._AM_ADDNEWCAT."' />");
+ echo(_AM_NEWCATNAME."<input type='text' name='catname'><br/>"._AM_PARENT);
+ $cattree->makeMySelBox("name","",$cid,true,"gid");
+ echo("<input type='hidden' name='cid' value='$cid'>");
+ echo("<input type='hidden' name='op' value='add_cat'>");
+ echo("<br/><input type='submit' value='"._AM_ADDNEWCAT."'>");
echo("</form>");
echo("</div>");
echo("<br/>");
@@ -270,7 +261,7 @@
if($cid){
echo("<div style='padding:10px;width:50%;text-align:right;background-color:#cccccc;border-right: 1px solid #000000;border-top: 1px solid #000000;border-left: 1px solid #000000;border-bottom: 1px solid #000000;'>");
echo("<form method='post' action='index.php'>");
- echo(""._AM_MOVECAT."<br/>"._AM_PARENT."");
+ echo(_AM_MOVECAT."<br/>"._AM_PARENT);
$cattree->makeMySelBox("name","",$cid,true,"gid");
echo("<input type='hidden' name='cid' value='$cid'>");
echo("<input type='hidden' name='op' value='move_cat'>");
@@ -331,15 +322,15 @@
xoops_cp_header();
adminMenu(6, _AM_GARAGES_DONATIONS);
- echo "<div style='text-align:center;'>"._AM_INTRO."<br/><br/><br/>";
+ echo("<div style='text-align:center;'>"._AM_INTRO."<br/><br/><br/>");
- echo '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+ echo('<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCZmz/XmGv7WnRc0ND7eT96YucKR8egScEksr5lNOx5twxsrVHkWOsnGXvUB8ui3lS7zzDEz7N57qLp88Ak7AvtmAqmO9AbWXxL8MkRMamEyKnTX0ojnYiP6cuBZOvTJpqTPWa4s+LF3T2xVkvAZLB0Ckg8jT38K884OvjDJvr8YjELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIV9Sm7q0bdyaAgaBlgupZIGnHBs8cFmeTf2KMFnmG/T1mHohV7TnjlaFwF58JZo0igwwzUOe6rX8K1vS5R8CO1kvFeLjRKGa8ZdTT1O2SC0m0B181r267Vn673jJkmj6HrthlEbuSWcuFaFBSEkGsvMKyuwN8seu9a5AF1HjwOOwCE/vkehbvtrmUgGiHyP0zIsGisYJ/ToGVgzyIpHO0mkZekybT/PuhRfl/oIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDcwNzIyMDYwMTE3WjAjBgkqhkiG9w0BCQQxFgQU3qLpIBvssWlAVXz8/tJC1ImH5vAwDQYJKoZIhvcNAQEBBQAEgYBFGGw8eKVvfwsZJiWLYdSVzWnhkiypXitE4pdFXIb972yj0b+CtMpwoRG09qJCuHmExOGzSGo6EXXLeC44cDfbhb4S3DbSNBlrtbUJfMszejfCqYRmcOqi2KBGThze4KHpey8/R0TxMYsrIccLpO3HHpvL1/uWYuRwJOfeUwQDnA==-----END PKCS7-----
">
-</form>';
+</form>');
@@ -355,9 +346,9 @@
for($x=0;$x<count($names);$x++){
if($names[$x]['viewable']) $viewable="color:#000000;";
else $viewable="color:#cccccc;";
- echo "<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>";
+ echo("<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
}
- else echo "<div>"._AM_NONEACTIVE."</div>";
+ else echo("<div>"._AM_NONEACTIVE."</div>");
break;
}
Added: XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1,70 @@
+<?php
+// $Id$
+
+include '../../../include/cp_header.php';
+$modid = isset($_POST['modid']) ? intval($_POST['modid']) : 0;
+
+// we dont want system module permissions to be changed here
+if ($modid <= 1 || !is_object($xoopsUser) || !$xoopsUser->isAdmin($modid)) {
+ redirect_header(XOOPS_URL.'/index.php', 1, _NOPERM);
+ exit();
+}
+$module_handler =& xoops_gethandler('module');
+$module =& $module_handler->get($modid);
+if (!is_object($module) || !$module->getVar('isactive')) {
+ redirect_header(XOOPS_URL.'/admin.php', 1, _MODULENOEXIST);
+ exit();
+}
+$member_handler =& xoops_gethandler('member');
+$group_list =& $member_handler->getGroupList();
+if (is_array($_POST['perms']) && !empty($_POST['perms'])) {
+ $gperm_handler = xoops_gethandler('groupperm');
+ foreach ($_POST['perms'] as $perm_name => $perm_data) {
+ if (false != $gperm_handler->deleteByModule($modid, $perm_name)) {
+ foreach ($perm_data['groups'] as $group_id => $item_ids) {
+ foreach ($item_ids as $item_id => $selected) {
+ if ($selected == 1) {
+ // make sure that all parent ids are selected as well
+ if ($perm_data['parents'][$item_id] != '') {
+ $parent_ids = explode(':', $perm_data['parents'][$item_id]);
+ foreach ($parent_ids as $pid) {
+ if ($pid != 0 && !in_array($pid, array_keys($item_ids))) {
+ // one of the parent items were not selected, so skip this item
+ $msg[] = sprintf(_AM_GARAGES_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>').' ('._AM_GARAGES_PERMADDNGP.')';
+ continue 2;
+ }
+ }
+ }
+ $gperm =& $gperm_handler->create();
+ $gperm->setVar('gperm_groupid', $group_id);
+ $gperm->setVar('gperm_name', $perm_name);
+ $gperm->setVar('gperm_modid', $modid);
+ $gperm->setVar('gperm_itemid', $item_id);
+ if (!$gperm_handler->insert($gperm)) {
+ $msg[] = sprintf(_AM_GARAGES_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
+ } else {
+ $msg[] = sprintf(_AM_GARAGES_PERMADDOK, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
+ }
+ unset($gperm);
+ }
+ }
+ }
+ } else {
++ $msg[] = sprintf(_AM_GARAGES_PERMRESETNG, $module->getVar('name').'('.$perm_name.')');
+ }
+ }
+}
+
+$backlink = XOOPS_URL.'/admin.php';
+if ($module->getVar('hasadmin')) {
+ $adminindex = isset($_POST['redirect_url']) ? $_POST['redirect_url'] : $module->getInfo('adminindex');
+ if ($adminindex) {
+ $backlink = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/admin/garageperms.php';
+ }
+}
+
+$msg[] = '<br /><br /><a href="'.$backlink.'">'._BACK.'</a>';
+xoops_cp_header();
+xoops_result($msg);
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/mygroupperm.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/blocks/index.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/blocks/index.html (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/blocks/index.html 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xgarage/trunk/xgarage/class/index.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/class/index.html (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/class/index.html 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1 @@
+<script>history.go(-1);</script>
\ No newline at end of file
Added: XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/class/mygrouppermform.php 2013-09-20 23:11:28 UTC (rev 12072)
@@ -0,0 +1,323 @@
+<?php
+// $Id$
+// ------------------------------------------------------------------------ //
+// XOOPS - PHP Content Management System //
+// Copyright (c) 2000-2003 XOOPS.org //
+// <http://www.xoops.org/> //
+// ------------------------------------------------------------------------ //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation; either version 2 of the License, or //
+// (at your option) any later version. //
+// //
+// 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. See the //
+// GNU General Public ...
[truncated message content] |
|
From: <be...@us...> - 2013-09-20 23:12:06
|
Revision: 12073
http://sourceforge.net/p/xoops/svn/12073
Author: beckmi
Date: 2013-09-20 23:12:04 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
xGarage old Beta 4
Modified Paths:
--------------
XoopsModules/xgarage/trunk/xgarage/garage.php
XoopsModules/xgarage/trunk/xgarage/include/functions.php
XoopsModules/xgarage/trunk/xgarage/index.php
XoopsModules/xgarage/trunk/xgarage/language/english/main.php
XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html
XoopsModules/xgarage/trunk/xgarage/xoops_version.php
Modified: XoopsModules/xgarage/trunk/xgarage/garage.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:12:04 UTC (rev 12073)
@@ -1,8 +1,10 @@
<?php
require('header.php');
+global $xoopsModuleConfig, $xoopsUser;
+//Group Perms added by jlm69
+if ($xoopsModuleConfig['usecats']) {
-//Group Perms added by jlm69
$module_id = $xoopsModule->getVar('mid');
if (is_object($xoopsUser)) {
@@ -20,7 +22,8 @@
if (!$gperm_handler->checkRight("garage_submit", $perm_itemid, $groups, $module_id)) {
redirect_header(XOOPS_URL."/index.php", 3, _NOPERM);
exit();
-}
+ }
+ }
// End Group Perms
@@ -139,6 +142,7 @@
if($success) {
$notification_handler =& xoops_gethandler('notification');
$id = $xoopsDB->getInsertId();
+$cid = $_POST['cid'];
$tags=array();
$tags['YEAR'] = $year;
$tags['MAKE'] = $make;
@@ -158,7 +162,7 @@
}
- if($success) redirect_header("index.php",2,_MD_XG_ADDSUCCESS);
+ if($success) redirect_header("index.php",8,_MD_XG_ADDSUCCESS);
else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
} else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
break;
@@ -293,12 +297,12 @@
$sform->addElement(new XoopsFormText(_MD_XG_QUART, 'quart', 50, 75, $quart), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
- $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 10, 40), true);
- $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 10, 40), true);
- $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 10, 40), true);
- $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 10, 40), true);
- $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 10, 40), true);
- $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 10, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 10, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 10, 40), false);
if($xoopsModuleConfig['usedescript2']) $sform->addElement(getEditor(_MD_XG_DESCRIPT2, 'descript2', $descript2, 10, 40), false);
if($xoopsModuleConfig['linkgarage']){
$linkgarage_choice = new XoopsFormRadio(_MD_XG_LINKGARAGE,'linkgarage',$linkgarage);
@@ -403,12 +407,12 @@
$sform->addElement(new XoopsFormText(_MD_XG_QUART, 'quart', 50, 75, $quart), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
$sform->addElement(new XoopsFormText($xoopsModuleConfig['listname'], 'list', 50, 255, $list), false);
- $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), true);
- $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), true);
- $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), true);
- $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), true);
- $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), true);
- $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 20, 40), true);
+ $sform->addElement(getEditor(_MD_XG_MENGINE, 'mengine', $mengine, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MEXTERIOR, 'mexterior', $mexterior, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MINTERIOR, 'minterior', $minterior, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MRIMS, 'mrims', $mrims, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MAUDIO, 'maudio', $maudio, 20, 40), false);
+ $sform->addElement(getEditor(_MD_XG_MFUTURE, 'mfuture', $mfuture, 20, 40), false);
if($xoopsModuleConfig['usedescript2']) $sform->addElement(getEditor(_MD_XG_DESCRIPT2, 'descript2', $descript2, 20, 40), false);
if($xoopsModuleConfig['linkgarage']){
$linkgarage_choice = new XoopsFormRadio(_MD_XG_LINKGARAGE,'linkgarage',$linkgarage);
Modified: XoopsModules/xgarage/trunk/xgarage/include/functions.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/include/functions.php 2013-09-20 23:12:04 UTC (rev 12073)
@@ -16,7 +16,7 @@
function getGarage($gid){
global $xoopsDB;
- $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = $gid";
+ $sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage FROM " . $xoopsDB->prefix("garage") . " WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getGarage()");
}
@@ -27,29 +27,29 @@
return $Garage;
}
-function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
+function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
global $xoopsDB;
- $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$year','$make','$model','$style','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkgarage')";
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkGarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$year','$make','$model','$style','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkGarage')";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
+ exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage)");
} else {
return 1;
}
}
-function updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
+function updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkgarage='$linkgarage' WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkGarage='$linkGarage' WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
+ exit("$sql > SQL Error in function :: updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage)");
} else {
return 1;
}
}
-function updateGaragePlusUpload($gid,$uid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
+function updateGaragePlusUpload($gid,$uid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkGarage){
global $xoopsDB;
- $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',uploadimage='$uploadimage',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$egine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkgarage='$linkgarage' WHERE id = $gid";
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',uploadimage='$uploadimage',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$egine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkGarage='$linkGarage' WHERE id = $gid";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: updateGaragePlusUpload($gid,$cid,$viewable,$name,$image,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list)");
Modified: XoopsModules/xgarage/trunk/xgarage/index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/index.php 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/index.php 2013-09-20 23:12:04 UTC (rev 12073)
@@ -3,8 +3,11 @@
require('header.php');
+global $xoopsModuleConfig, $xoopsUser;
// Group Permissions added by jlm69
+if($xoopsModuleConfig['usecats']){
+
$module_id = $xoopsModule->getVar('mid');
if (is_object($xoopsUser)) {
@@ -23,7 +26,9 @@
if (!$gperm_handler->checkRight("garage_view", $perm_itemid, $groups, $module_id)) {
redirect_header(XOOPS_URL."/index.php", 3, _NOPERM);
exit();
-}
+ }
+
+ }
// End Group Permissions
@@ -178,8 +183,8 @@
$xoopsTpl->assign('mrims',_MD_XG_MRIMS);
$xoopsTpl->assign('maudio',_MD_XG_MAUDIO);
$xoopsTpl->assign('mfuture',_MD_XG_MFUTURE);
+ $xoopsTpl->assign('garage_of',_MD_XG_GARAGEOF);
-
if($xoopsModuleConfig['allowcomments']) include XOOPS_ROOT_PATH.'/include/comment_view.php';
break;
Modified: XoopsModules/xgarage/trunk/xgarage/language/english/main.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/language/english/main.php 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/language/english/main.php 2013-09-20 23:12:04 UTC (rev 12073)
@@ -108,4 +108,6 @@
define("_MD_XG_USERNAME","Username ");
define("_MD_XG_STYLE","Body Style");
+define("_MD_XG_GARAGEOF","The Garage of ::");
+
?>
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/sql/garage.sql 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/sql/garage.sql 2013-09-20 23:12:04 UTC (rev 12073)
@@ -15,10 +15,9 @@
`imagechoice` tinyint(4) NOT NULL default '0',
`url` varchar(255) NOT NULL default '',
`location` varchar(75) NOT NULL default '',
+ `mark` varchar(75) NOT NULL default '',
+ `model` varchar(75) NOT NULL default '',
`year` varchar(75) NOT NULL default '',
- `make` varchar(75) NOT NULL default '',
- `model` varchar(75) NOT NULL default '',
- `style` varchar(75) NOT NULL default '',
`engine` varchar(75) NOT NULL default '',
`color` varchar(75) NOT NULL default '',
`rt` varchar(75) NOT NULL default '',
@@ -30,7 +29,7 @@
`quart` varchar(75) NOT NULL default '',
`quartm` varchar(75) NOT NULL default '',
`mengine` text NOT NULL,
- `mexterior` text NOT NULL,
+ `meterior` text NOT NULL,
`minterior` text NOT NULL,
`mrims` text NOT NULL,
`mfuture` text NOT NULL,
Modified: XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html 2013-09-20 23:12:04 UTC (rev 12073)
@@ -18,7 +18,7 @@
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" summary="" class="forumline">
<tr>
- <th height="25" nowrap colspan="2" class="thHead">The Garage of :: <{$garage.name}></th>
+ <th height="25" nowrap colspan="2" class="thHead"><{$garage_of}> <{$garage.name}></th>
</tr>
<tr>
<td width="50%" height="28" align="center" class="catLeft"><b><span class="gen">Owner Info</span></b></td>
@@ -26,41 +26,41 @@
</tr>
<tr>
<td valign="top" class="row1"><span class="gen"><{if $garage.linkgarage}><a href="../../userinfo.php?uid=<{$garage.uid}>"><{$linkgarage}></a><{/if}>
- <{$ownername}>: <b><{$garage.uname}></b><br />
- <{$location}>: <{$garage.location}><br /></span></td>
+ <b><{$ownername}>:</b> <{$garage.uname}><br />
+ <b><{$location}>:</b> <{$garage.location}><br /></span></td>
<td valign="top" rowspan="3" class="row1"><table width="100%" border="0" cellspacing="1" cellpadding="3">
- <tr>
+ <{if $rt != ''}> <tr>
<td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$rt}>:</span></td>
<td valign="top" width="100%"><b><span class="gen"><{$garage.rt}></span></b></td>
- </tr>
+ </tr><{/if}>
<tr>
- <td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$sixty}>:</span></td>
+ <{if $garage.sixty}><td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$sixty}>:</span></td>
<td valign="top" width="100%"><b><span class="gen"><{$garage.sixty}></span></b></td>
- </tr>
+ </tr><{/if}>
<tr>
- <td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$three}>:</span></td>
+ <{if $garage.three}><td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$three}>:</span></td>
<td><b><span class="gen"><{$garage.three}></span></b></td>
- </tr>
+ </tr><{/if}>
<tr>
- <td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$eigth}>:</span></td>
+ <{if $garage.eigth}><td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$eigth}>:</span></td>
<td><span class="gen"><b><{$garage.eigth}></b></span></td>
- </tr>
- <tr>
+ </tr><{/if}>
+ <{if $garage.eigthm}><tr>
<td valign="middle" align="right" nowrap="nowrap"><span class="gen"><{$eigthm}>:</span></td>
<td><b><span class="gen"><{$garage.eigthm}></span></b></td>
- </tr>
- <tr>
+ </tr><{/if}>
+ <{if $garage.thou}><tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen"><{$thou}>:</span></td>
<td> <b><span class="gen"><{$garage.thou}></span></b></td>
- </tr>
- <tr>
+ </tr><{/if}>
+ <{if $garage.quart}> <tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen"><{$quart}>:</span></td>
<td> <b><span class="gen"><{$garage.quart}></span></b></td>
- </tr>
- <tr>
+ </tr><{/if}>
+ <{if $garage.quartm}><tr>
<td valign="top" align="right" nowrap="nowrap"><span class="gen"><{$quartm}>:</span></td>
<td> <b><span class="gen"><{$garage.quartm}></span></b></td>
- </tr>
+ </tr><{/if}>
</table></td>
</tr>
@@ -100,7 +100,7 @@
<td height="28" align="left" class="catRight"><b><span class="gen"></span></b></td>
</tr>
<tr>
- <td valign="top" class="row1" align="left"><span class="gen"><{$mengine}>:<hr><center><b><{$garage.mengine}><hr></b></center><br /> <{$mexterior}>:<hr><center><b><{$garage.mexterior}></b><hr></center><br /><{$minterior}>: <hr><center><b><{$garage.minterior}></b><hr></center><br /> <{$mrims}>: <hr><center><b><{$garage.mrims}></b><hr></center><br /><{$maudio}>: <hr><center><b><{$garage.maudio}></b><hr></center><br /><{$mfuture}>: <hr><center><b><{$garage.mfuture}></b><hr></center>
+ <td valign="top" class="row1" align="left"><span class="gen"><{if $garage.mengine}><b><{$mengine}>:</b><hr><center><{$garage.mengine}><hr></center><br /><{/if}> <{if $garage.mexterior}><b><{$mexterior}>:</b><hr><center><{$garage.mexterior}><hr></center><br /><{/if}><{if $garage.minterior}><b><{$minterior}>:</b> <hr><center><{$garage.minterior}><hr></center><br /><{/if}> <{if $garage.mrims}><b><{$mrims}>:</b> <hr><center><{$garage.mrims}><hr></center><br /><{/if}><{if $garage.maudio}><b><{$maudio}>:</b> <hr><center><{$garage.maudio}><hr></center><br /><{/if}><{if $garage.mfuture}><b><{$mfuture}>:</b> <hr><center><{$garage.mfuture}><hr></center><{/if}>
</span></td>
<td valign="top" class="row1"><table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<!-- BEGIN no_pics -->
Modified: XoopsModules/xgarage/trunk/xgarage/xoops_version.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/xoops_version.php 2013-09-20 23:11:28 UTC (rev 12072)
+++ XoopsModules/xgarage/trunk/xgarage/xoops_version.php 2013-09-20 23:12:04 UTC (rev 12073)
@@ -3,10 +3,10 @@
global $xoopsModuleConfig;
$modversion['name'] = _MI_NAME;
-$modversion['version'] = .03;
+$modversion['version'] = .04;
$modversion['description'] = _MI_DESC;
-$modversion['credits'] = 'www.calibernation.com / www.xgarage.org / www.jlmzone.com';
-$modversion['author'] = 'Northern, script_fu, jlm69';
+$modversion['credits'] = 'www.calibernation.com / www.xgarage.org / www.jlmzone.com / www.arabxoops.com';
+$modversion['author'] = 'Northern, script_fu, jlm69, mowaffak';
$modversion['help'] = 'docs';
$modversion['license'] = 'GPL';
$modversion['official'] = 0;
|
|
From: <be...@us...> - 2013-09-20 23:13:08
|
Revision: 12074
http://sourceforge.net/p/xoops/svn/12074
Author: beckmi
Date: 2013-09-20 23:13:05 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
xGarage old Beta 5
Modified Paths:
--------------
XoopsModules/xgarage/trunk/xgarage/admin/functions.php
XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php
XoopsModules/xgarage/trunk/xgarage/admin/index.php
XoopsModules/xgarage/trunk/xgarage/garage.php
XoopsModules/xgarage/trunk/xgarage/image_uploader.php
XoopsModules/xgarage/trunk/xgarage/include/functions.php
XoopsModules/xgarage/trunk/xgarage/index.php
XoopsModules/xgarage/trunk/xgarage/language/english/admin.php
XoopsModules/xgarage/trunk/xgarage/language/english/main.php
XoopsModules/xgarage/trunk/xgarage/readme.txt
XoopsModules/xgarage/trunk/xgarage/sql/garage.sql
XoopsModules/xgarage/trunk/xgarage/templates/cat_index.html
XoopsModules/xgarage/trunk/xgarage/templates/view_garage.html
XoopsModules/xgarage/trunk/xgarage/xoops_version.php
Added Paths:
-----------
XoopsModules/xgarage/trunk/xgarage/admin/docs_admin.php
XoopsModules/xgarage/trunk/xgarage/admin/docs_credits.php
XoopsModules/xgarage/trunk/xgarage/admin/docs_user.php
XoopsModules/xgarage/trunk/xgarage/admin/error_log
XoopsModules/xgarage/trunk/xgarage/admin/upgrade.php
Removed Paths:
-------------
XoopsModules/xgarage/trunk/xgarage/docs/
XoopsModules/xgarage/trunk/xgarage/install.txt
Added: XoopsModules/xgarage/trunk/xgarage/admin/docs_admin.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/docs_admin.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/docs_admin.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -0,0 +1,45 @@
+<?php
+include_once '../../../include/cp_header.php';
+include_once("functions.php");
+ xoops_cp_header();
+ adminMenu(0, _AM_XG_DOCUMENTATION);
+echo "
+<h1>Garages Module for XOOPS 2.0 Administration Manual </h1>
+<hr />
+<br /><br />
+<a href=\"docs_credits.php\"><strong>Credits</strong></a> <a href=\"docs_user.php\"><strong>Users</strong></a>
+<br /><br />
+
+<p><b>Setting up the Garage Module</b>
+<ul>
+ <li>Once installed go into the module preferences and set them to your liking.</li>
+ <li>If you set it to use categories in the preferences, the next thing you need to do is add your categories.</li>
+ <li>After you create the categories you must go to the permissions section of the modules admin and set the permissions by group and category.<br /> There are 2 permissions to set for each category in each group, 'view permissions' and 'submit permissions'.</li>
+</ul>
+</p><br />
+
+<p><b>Creating Categories</b><br /><br />
+<ul>
+ <li>Right now there is only one option when creating a category, that is whether or not you want to show the race times in this category. There may be more in the future.</li>
+</ul>
+</p><br />
+
+<p><b>Setting Permissions</b><br /><br />
+<ul>
+ <li>If you are using categories you will see a tab for Permissions, click on it.
+<br />You will see a drop down box that says view permissions and all the categories you created.
+<br />Check the categories you want to have view permissions for each group.</li>
+<li>Next you need to change the drop down box so it reads 'submit permissions'.
+<br />Check the categories you want to have submit permissions for each group.
+</ul>
+</p><br />
+
+
+<p><b>Other admin functions</b><br /><br />
+<ul>
+ <li>Approving New Garages</li><br>
+ <li>Disable Garage</li><br>
+ <li>Enable Garage</li><br>
+</p>";
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/docs_admin.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/admin/docs_credits.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/docs_credits.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/docs_credits.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -0,0 +1,39 @@
+<?php
+include_once '../../../include/cp_header.php';
+include_once("functions.php");
+ xoops_cp_header();
+ adminMenu(0, _AM_XG_DOCUMENTATION);
+
+echo "<h1>Garage Module for XOOPS 2.0 Credits </h1>
+<hr />
+
+
+<br /><br /><div>
+<a href=\"docs_admin.php\"><strong>"._AM_XG_ADMIN."</strong></a> <a href=\"docs_user.php\"><strong>"._AM_XG_USERS."</strong></a></div>
+<br /><br />
+
+
+
+
+<p><strong>"._AM_XG_CODEDBY." by Northern / Script_fu / jlm69 / mowaffak</strong><br><a href=\"http://www.calibernation.com/\"><strong>http://www.calibernation.com/</strong></a><a href=\"http://www.xgarage.org/\"><br><strong>http://www.xgarage.org/</strong></a><a href=\"http://www.jlmzone.com/\"><br><strong>http://www.jlmzone.com/</strong></a><a href=\"http://www.arabxoops.com/\"><br><strong>http://www.arabxoops.com/</strong></a></p>
+<p>XOOPS - <a href=\"http://www.xoops.org/\">http://www.xoops.org/ </a></p>
+<p>Script_fu - for his encouragement to get this module done. </p>
+<p>gtop00 - thanks for the debaits, on how we should get this working. </p>
+<p>exbanious - You inspired many to make or ask for a garage module. </p>
+<p>Mudnuts4x4 - he was the original person to ask for a module like the phpBB garage,<br>
+ Sorry, its not phpbb, but its close, without a lawsuite. and its original to xoops, and no-one else.</p>
+
+<p><br>
+ <strong>"._AM_XG_TRANSLATORS."</strong></p>
+<p>English - Northern <br>
+ German - <br>
+ Japanese - <br>
+Portuguese - <br>
+Greek - <br>
+French - <br>
+Dutch -<br>
+Danish - <br>
+</p>
+<p> </p>";
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/docs_credits.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/admin/docs_user.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/docs_user.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/docs_user.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -0,0 +1,21 @@
+<?php
+include_once '../../../include/cp_header.php';
+include_once("functions.php");
+ xoops_cp_header();
+ adminMenu(0, _AM_XG_DOCUMENTATION);
+
+echo "<h1>Garages Module for XOOPS 2.0 User's Manual </h1>
+<hr>
+<br /><br />
+<a href=\"docs_credits.php\"><strong>Credits</strong></a> <a href=\"docs_admin.php\"><strong>Administration</strong></a>
+<br /><br />
+
+<p>Add new garage: </p>
+<p>Name and Description are required.<br>
+ To upload an image, edit your garage afer its adde, if site allows image uploads. </p>
+<p>Edit Garage:</p>
+<p>In some web sites, changes must be requested.</p>
+<p> </p>";
+echo("</div>");
+xoops_cp_footer();
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/docs_user.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: XoopsModules/xgarage/trunk/xgarage/admin/error_log
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/error_log (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/error_log 2013-09-20 23:13:05 UTC (rev 12074)
@@ -0,0 +1,9 @@
+[07-Oct-2007 15:21:06] PHP Warning: main(XOOPS_ROOT_PATH/include/cp_header.php) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 2
+[07-Oct-2007 15:21:06] PHP Warning: main() [<a href='function.include'>function.include</a>]: Failed opening 'XOOPS_ROOT_PATH/include/cp_header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 2
+[07-Oct-2007 15:21:06] PHP Fatal error: Call to undefined function: xoops_cp_header() in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 4
+[07-Oct-2007 15:22:30] PHP Warning: main(XOOPS_ROOT_PATH/include/cp_header.php) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 2
+[07-Oct-2007 15:22:30] PHP Warning: main() [<a href='function.include'>function.include</a>]: Failed opening 'XOOPS_ROOT_PATH/include/cp_header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 2
+[07-Oct-2007 15:22:30] PHP Fatal error: Call to undefined function: xoops_cp_header() in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 4
+[07-Oct-2007 15:23:13] PHP Warning: main(XOOPS_ROOT_PATH/include/cp_header.php) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 2
+[07-Oct-2007 15:23:13] PHP Warning: main() [<a href='function.include'>function.include</a>]: Failed opening 'XOOPS_ROOT_PATH/include/cp_header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 2
+[07-Oct-2007 15:23:13] PHP Fatal error: Call to undefined function: xoops_cp_header() in /home/searchwa/public_html/dev/modules/garage/admin/credits.php on line 4
Modified: XoopsModules/xgarage/trunk/xgarage/admin/functions.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/functions.php 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/admin/functions.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -1,7 +1,7 @@
<?php
function getCats($gid){
global $xoopsDB;
- $sql = "SELECT cid,name FROM " . $xoopsDB->prefix("garage_cats") . " WHERE gid = '$gid' ORDER BY name";
+ $sql = "SELECT cid,name,racing FROM " . $xoopsDB->prefix("garage_cats") . " WHERE gid = '$gid' ORDER BY name";
if ( !$result = $xoopsDB->query($sql) ) {
exit("$sql > SQL Error in function :: getCats($gid)");
} else {
@@ -23,11 +23,11 @@
return ($name);
}
}
-function addCat($name,$gid){
+function addCat($name,$racing,$gid){
global $xoopsDB;
- $sql = "INSERT INTO " . $xoopsDB->prefix("garage_cats") . " (name,gid) VALUES ('$name',$gid)";
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage_cats") . " (name,racing,gid) VALUES ('$name','$racing',$gid)";
if ( !$result = $xoopsDB->query($sql) ) {
- exit("$sql > SQL Error in function :: addCat($name,$gid)");
+ exit("$sql > SQL Error in function :: addCat($name,$racing,$gid)");
return 0;
} else {
return 1;
@@ -102,7 +102,7 @@
}
function getActiveGarages(){
global $xoopsDB;
- $sql = ("SELECT id,name,viewable FROM " . $xoopsDB->prefix("garage") . " WHERE disabled='0' AND approved='1' ORDER BY name");
+ $sql = ("SELECT id,viewable,name,year,make,model,style FROM " . $xoopsDB->prefix("garage") . " WHERE disabled='0' AND approved='1' ORDER BY name");
$result=$xoopsDB->query($sql);
$rows = array();
while($row = $xoopsDB->fetchArray($result)) {
@@ -135,7 +135,7 @@
function adminMenu ($currentoption = 0, $breadcrumb = '')
{
-
+
/* Nice buttons styles */
echo "
<style type='text/css'>
@@ -157,29 +157,35 @@
";
// global $xoopsDB, $xoopsModule, $xoopsConfig, $xoopsModuleConfig;
- global $xoopsModule, $xoopsConfig;
+ global $xoopsModule, $xoopsConfig, $xoopsModuleConfig;
$myts =& MyTextSanitizer::getInstance();
- $tblColors = Array();
- $tblColors[0] = $tblColors[1] = $tblColors[2] = $tblColors[3] = $tblColors[4] = $tblColors[5] = $tblColors[6] = $tblColors[7] = $tblColors[8] = '';
+ $tblColors = array();
+ $tblColors[0] = $tblColors[1] = $tblColors[2] = $tblColors[3] = $tblColors[4] = $tblColors[5] = $tblColors[6] = '';
$tblColors[$currentoption] = 'current';
echo "<div id='buttontop'>";
echo "<table style=\"width: 100%; padding: 0; \" cellspacing=\"0\"><tr>";
//echo "<td style=\"width: 45%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;\"><a class=\"nobutton\" href=\"../../system/admin.php?fct=preferences&op=showmod&mod=" . $xoopsModule->getVar('mid') . "\">" . _AM_SCLIENT_OPTS . "</a> | <a href=\"../index.php\">" . _AM_SCLIENT_GOMOD . "</a> | <a href=\"import.php\">" . _AM_SCLIENT_IMPORT . "</a> | <a href='" . smartclient_getHelpPath() ."' target=\"_blank\">" . _AM_SCLIENT_HELP . "</a> | <a href=\"about.php\">" . _AM_SCLIENT_ABOUT . "</a></td>";
- echo "<td style=\"width: 70%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;\"><a class=\"nobutton\" href=\"../../system/admin.php?fct=preferences&op=showmod&mod=" . $xoopsModule->getVar('mid') . "\">" . _AM_GARAGES_OPTS . "</a> | <a href=\"../index.php\">" . _AM_GARAGES_GOMOD . "</a> | <a href=\"index.php?op=documentation\">" . _AM_GARAGES_DOCS . "</a> | <a href=\"index.php?op=support\">" . _AM_GARAGES_SUPPORT . "</a> | <a href=\"index.php?op=donations\">" . _AM_GARAGES_DONATIONS . "</a></td>";
+ echo "<td style=\"width: 70%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;\"><a class=\"nobutton\" href=\"../../system/admin.php?fct=preferences&op=showmod&mod=" . $xoopsModule->getVar('mid') . "\">" . _AM_GARAGES_OPTS . "</a> | <a href=\"../index.php\">" . _AM_GARAGES_GOMOD . "</a> | <a href=\"index.php?op=support\">" . _AM_GARAGES_SUPPORT . "</a> | <a href=\"index.php?op=donations\">" . _AM_GARAGES_DONATIONS . "</a></td>";
echo "<td style=\"width: 30%; font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;\"><b>" . $myts->displayTarea($xoopsModule->name()) . " " . _AM_GARAGES_MODADMIN . "</b> " . $breadcrumb . "</td>";
echo "</tr></table>";
echo "</div>";
echo "<div id='buttonbar'>";
echo "<ul>";
- echo "<li id='" . $tblColors[0] . "'><a href=\"../garage.php?op=add\"><span>" . _AM_GARAGES_ADDNEWGARAGE . "</span></a></li>";
+ echo "<li id='" . $tblColors[0] . "'><a href=\"index.php?op=documentation\"><span>" . _AM_GARAGES_DOCS . "</span></a></li>";
echo "<li id='" . $tblColors[1] . "'><a href=\"index.php\"><span>" . _AM_GARAGES_INDEX . "</span></a></li>";
echo "<li id='" . $tblColors[2] . "'><a href=\"index.php?op=view_new\"><span>" . _AM_GARAGES_APPROVE . "</span></a></li>";
echo "<li id='" . $tblColors[3] . "'><a href=\"index.php?op=view_disabled\"><span>" . _AM_GARAGES_DISABLED . "</span></a></li>";
+if($xoopsModuleConfig['usecats']){
echo "<li id='" . $tblColors[4] . "'><a href=\"index.php?op=cats\"><span>" . _AM_GARAGES_CATEGORIES . "</span></a></li>";
echo "<li id='" . $tblColors[5] . "'><a href=\"garageperms.php\"><span>" . _AM_GARAGES_PERMISSIONS . "</span></a></li>";
+}
+
echo "</ul></div>";
+
}
+
+
?>
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/admin/garageperms.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -90,4 +90,4 @@
unset ($permform);
xoops_cp_footer();
-?>
+?>
\ No newline at end of file
Modified: XoopsModules/xgarage/trunk/xgarage/admin/index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/index.php 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/admin/index.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -120,11 +120,13 @@
//echo("testing123");
//adminMenu(4, _AM_GARAGES_CATEGORIES);
if($_POST['catname']){
- $success = addCat($_POST['catname'],$_POST['gid']);
+ $cid = $_POST['cid'];
+ if(!isset($_POST['racing'])) $_POST['racing'] = 0;
+ $success = addCat($_POST['catname'],$_POST['racing'],$_POST['gid']);
if($success){
- redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDED);
+ redirect_header("index.php?op=cats&cid=$cid", 5, _AM_CATEGORYADDED);
exit;
- } else redirect_header("index.php?op=cats&cid=$cid", 1, _AM_CATEGORYADDERROR);
+ } else redirect_header("index.php?op=cats&cid=$cid", 5, _AM_CATEGORYADDERROR);
}
break;
@@ -251,6 +253,7 @@
echo("<form method='post' action='index.php'>");
echo(_AM_NEWCATNAME."<input type='text' name='catname'><br/>"._AM_PARENT);
$cattree->makeMySelBox("name","",$cid,true,"gid");
+ echo("<br/>"._AM_XG_RACING."<input type='checkbox' name='racing' value='1'>");
echo("<input type='hidden' name='cid' value='$cid'>");
echo("<input type='hidden' name='op' value='add_cat'>");
echo("<br/><input type='submit' value='"._AM_ADDNEWCAT."'>");
@@ -294,11 +297,16 @@
break;
case "documentation":
xoops_cp_header();
- adminMenu(5, _AM_GARAGES_DOCUMENTATION);
+ adminMenu(0, _AM_XG_DOCUMENTATION);
- echo("<div style='text-align:center;'>"._AM_DOCS."<br/><br/><br/>");
-
- echo("<br/><br/><br/><a href='http://www.xgarage.org'>Live Docs and support at X-Garage</a>");
+ echo("<div style='text-align:center;'>"._AM_GARAGES_DOCS."<br/><br/><br/>");
+ echo "<h1>"._AM_XG_DOC_HEAD."</h1>";
+echo "<hr>
+<p><a href="."docs_credits.php".">"._AM_XG_CREDITS."</a></p>
+<p><a href="."docs_admin.php".">"._AM_XG_ADMIN_MAN."</a> </p>
+<p><a href="."docs_user.php".">"._AM_XG_USER_MAN."</a></p>
+<p> </p>";
+ echo("<br/><br/><br/><a href='http://www.xgarage.org'>"._AM_XG_DOC_SUPPORT."</a>");
echo("</div>");
@@ -311,7 +319,7 @@
echo("<div style='text-align:center;'>"._AM_SUPPORT."<br/><br/><br/>"._AM_SUPPORT_REGISTERED);
- echo("<br/><br/><br/><a href='http://www.xgarage.org/modules/newbb/'>Garages Module for XOOPS Support Forum</a>");
+ echo("<br/><br/><br/><a href='http://www.xgarage.org/modules/newbb/'>"._AM_XG_DOC_FORUM."</a>");
echo("</div>");
@@ -346,7 +354,7 @@
for($x=0;$x<count($names);$x++){
if($names[$x]['viewable']) $viewable="color:#000000;";
else $viewable="color:#cccccc;";
- echo("<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['name']."</a></div>");
+ echo("<div style=\"margin-left:100px;\"><a style='$viewable' href=\"../index.php?op=view&gid=".$names[$x]['id']."\">".$names[$x]['year']." - ".$names[$x]['make']." - ".$names[$x]['model']." - ".$names[$x]['style']."</a></div>");
}
else echo("<div>"._AM_NONEACTIVE."</div>");
break;
Added: XoopsModules/xgarage/trunk/xgarage/admin/upgrade.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/admin/upgrade.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/admin/upgrade.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -0,0 +1,27 @@
+<?php
+
+include_once '../../../include/cp_header.php';
+xoops_cp_header();
+include_once XOOPS_ROOT_PATH.'/modules/garage/include/functions.php';
+
+
+if (is_object($xoopsUser) && $xoopsUser->isAdmin($xoopsModule->mid())) {
+ $errors=0;
+
+ // 2.1) Add the new fields to the topic table
+ if (!garage_FieldExists('racing',$xoopsDB->prefix('garage_cats'))) {
+ garage_AddField("racing TINYINT( 1 ) DEFAULT '0' NOT NULL AFTER name",$xoopsDB->prefix('garage_cats'));
+ }
+
+ // At the end, if there was errors, show them or redirect user to the module's upgrade page
+ if($errors) {
+ echo '<H1>' . _AM_XG_UPGRADEFAILED . '</H1>';
+ echo '<br />' . _AM_XG_UPGRADEFAILED0;
+ } else {
+ echo _AM_XG_UPGRADECOMPLETE." - <a href='".XOOPS_URL."/modules/system/admin.php?fct=modulesadmin&op=update&module=garage'>"._AM_XG_UPDATEMODULE."</a>";
+ }
+} else {
+ printf("<h2>%s</h2>\n",_AM_NEWS_UPGR_ACCESS_ERROR);
+}
+xoops_cp_footer();
+?>
Property changes on: XoopsModules/xgarage/trunk/xgarage/admin/upgrade.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: XoopsModules/xgarage/trunk/xgarage/garage.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:12:04 UTC (rev 12073)
+++ XoopsModules/xgarage/trunk/xgarage/garage.php 2013-09-20 23:13:05 UTC (rev 12074)
@@ -1,41 +1,47 @@
<?php
-require('header.php');
-global $xoopsModuleConfig, $xoopsUser;
+include("header.php");
-//Group Perms added by jlm69
-if ($xoopsModuleConfig['usecats']) {
+$mydirname = basename( dirname( __FILE__ ) ) ;
+require_once( XOOPS_ROOT_PATH."/modules/$mydirname/include/gtickets.php" ) ;
+
+$myts =& MyTextSanitizer::getInstance();
$module_id = $xoopsModule->getVar('mid');
if (is_object($xoopsUser)) {
-$groups = $xoopsUser->getGroups();
+ $groups = $xoopsUser->getGroups();
} else {
-$groups = XOOPS_GROUP_ANONYMOUS;
+ $groups = XOOPS_GROUP_ANONYMOUS;
}
+
$gperm_handler =& xoops_gethandler('groupperm');
+
if (isset($_POST['item_id'])) {
-$perm_itemid = intval($_POST['item_id']);
+ $perm_itemid = intval($_POST['item_id']);
} else {
-$perm_itemid = 0;
+ $perm_itemid = 0;
}
//If no access
if (!$gperm_handler->checkRight("garage_submit", $perm_itemid, $groups, $module_id)) {
- redirect_header(XOOPS_URL."/index.php", 3, _NOPERM);
-exit();
- }
- }
+ redirect_header(XOOPS_URL."/index.php", 3, _NOPERM);
+ exit();
+}
+
// End Group Perms
-
require(XOOPS_ROOT_PATH.'/header.php');
include("include/functions.php");
+settype($uid, "string");
+settype($xgid, "string");
settype($cid, "integer");
+settype($cats, "array");
settype($url, "string");
settype($name, "string");
settype($image, "string");
-settype($imagechoice, "string");
+settype($imagechoice, "string");//jlm69
+settype($uploadimage, "string");//jlm69
settype($location, "string");
settype($year, "string");
settype($make, "string");
@@ -63,10 +69,9 @@
settype($notifypub, "string");
settype($nohtml, "string");
settype($nosmiley, "string");
+settype($descript2, "string");//jlm69
+settype($linkgarage, "string");//jlm69
-global $xoopsModuleConfig;
-global $xoopsUser;
-
$userIsAdmin = userIsAdmin($xoopsUser);
if(!$xoopsUser) redirect_header("/user.php",2,_MD_XG_MUSTLOGIN);
$uid = $xoopsUser->uid();
@@ -105,7 +110,7 @@
$cid = $myts->makeTboxData4Save($_POST['cid']);
$name = $myts->makeTboxData4Save($_POST['name']);
$image = $myts->makeTboxData4Save($_POST['image']);
-
+ $imagechoice = $myts->makeTboxData4Save($_POST['imagechoice']);
$url = $myts->makeTboxData4Save($_POST['url']);
$location = $myts->makeTboxData4Save($_POST['location']);
$year = $myts->makeTboxData4Save($_POST['year']);
@@ -129,16 +134,16 @@
$mrims = $myts->makeTareaData4Save($_POST['mrims']);
$maudio = $myts->makeTareaData4Save($_POST['maudio']);
$mfuture = $myts->makeTareaData4Save($_POST['mfuture']);
- $descript2 = $myts->makeTareaData4Save($_POST['descript2']);
- $linkgarage = $myts->makeTareaData4Save($_POST['linkgarage']);
+ if($xoopsModuleConfig['usedescript2']) $descript2 = $myts->makeTareaData4Save($_POST['descript2']);
+ if($xoopsModuleConfig['linkgarage']) $linkgarage = $myts->makeTareaData4Save($_POST['linkgarage']);
if($url == "http://") $url = "";
if($image) $image = "[img align=right]".$image."[/img]";
include("image_uploader.php");
- $success = addGarage($a,$uid,$cid,$name,$image,$imageupload,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
+ $success = addGarage($a,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage);
-
+//jlm69
if($success) {
$notification_handler =& xoops_gethandler('notification');
$id = $xoopsDB->getInsertId();
@@ -160,9 +165,9 @@
$notification_handler->triggerEvent ('listing', $gid, 'new_listing', $tags );
-}
+}//end jlm69
- if($success) redirect_header("index.php",8,_MD_XG_ADDSUCCESS);
+ if($success) redirect_header("index.php",2,_MD_XG_ADDSUCCESS);
else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
} else redirect_header("index.php",2,_MD_XG_ADDFAILURE);
break;
@@ -179,6 +184,12 @@
$garage = getGarage($gid);
$puid = $garage['uid'];
+ if ($xoopsModuleConfig['usecats'] != 0) {
+ $catopts = getCatOptions($cid);
+ $timetrials = $catopts['racing'];
+ } else {
+ $timetrials = '';
+ }
$ouid = $myts->makeTboxData4Save($_POST['ouid']);
$viewable = $myts->makeTboxData4Save($_POST['viewable']);
$cid = $myts->makeTboxData4Save($_POST['cid']);
@@ -194,6 +205,8 @@
$style = $myts->makeTboxData4Save($_POST['style']);
$engine = $myts->makeTboxData4Save($_POST['engine']);
$color = $myts->makeTboxData4Save($_POST['color']);
+
+ if(isset($timetrials)) {
$rt = $myts->makeTboxData4Save($_POST['rt']);
$sixty = $myts->makeTboxData4Save($_POST['sixty']);
$three = $myts->makeTboxData4Save($_POST['three']);
@@ -202,6 +215,18 @@
$thou = $myts->makeTboxData4Save($_POST['thou']);
$quart = $myts->makeTboxData4Save($_POST['quart']);
$quartm = $myts->makeTboxData4Save($_POST['quartm']);
+
+ } else {
+ $rt = '';
+ $sixty = '';
+ $three = '';
+ $eigth = '';
+ $eigthm = '';
+ $thou = '';
+ $quart = '';
+ $quartm = '';
+ }
+
$list = $myts->makeTboxData4Save($_POST['list']);
$mengine = $myts->makeTareaData4Save($_POST['mengine']);
$mexterior = $myts->makeTareaData4Save($_POST['mexterior']);
@@ -209,8 +234,8 @@
$mrims = $myts->makeTareaData4Save($_POST['mrims']);
$maudio = $myts->makeTareaData4Save($_POST['maudio']);
$mfuture = $myts->makeTareaData4Save($_POST['mfuture']);
- $descript2 = $myts->makeTareaData4Save($_POST['descript2']);
- $linkgarage = $myts->makeTareaData4Save($_POST['linkgarage']);
+ if($xoopsModuleConfig['usedescript2']) $descript2 = $myts->makeTareaData4Save($_POST['descript2']);
+ if($xoopsModuleConfig['linkgarage']) $linkgarage = $myts->makeTareaData4Save($_POST['linkgarage']);
if($url == "http://") $url = "";
if($image) $image = "[img align=right]".$image."[/img]";
@@ -242,9 +267,12 @@
redirect_header($redirect_url,2,$redirect_msg);
exit;
}
- if(!$xoopsModuleConfig['multiplegarages'] && !$userIsAdmin){
- if($xgid = doesGarageExist($uid)){
- $redirect_url = "index.php?op=view&gid=$xgid";
+
+ if($xoopsModuleConfig['multiplegarage'] = 1){
+
+
+ if($gid = doesGarageExist($uid)) {
+ $redirect_url = "index.php?op=view&gid=$uid";
$redirect_msg = _MD_XG_CANNOTADDMULTIPLE;
redirect_header($redirect_url,2,$redirect_msg);
exit;
@@ -254,12 +282,15 @@
if(!$url) $url = "http://";
include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$sform = new XoopsThemeForm(_MD_XG_ADDGARAGE, "garageform", xoops_getenv('PHP_SELF'));
+ $sform->setExtra("enctype='multipart/form-data'");
$sform->addElement(new XoopsFormHidden('aa',$xoopsModuleConfig['autoapprove']), false);
$sform->addElement(new XoopsFormHidden('op','post'), false);
- if ($xoopsModuleConfig['usecats']) {
+ if ($xoopsModuleConfig['usecats'] != 0) {
+ $catopts = getCatOptions($cid);
+ $timetrials = $catopts['racing'];
+
include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
$cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
-
//$sform->addElement(new XoopsFormSelect(_MD_XG_CATEGORY, 'cid', $cid, 3), true);
ob_start();
//$sform->addElement(new XoopsFormHidden('cid', 'gid'));
@@ -267,7 +298,7 @@
$sform->addElement(new XoopsFormLabel(_MD_XG_CATEGORY, ob_get_contents()));
ob_end_clean();
} else $sform->addElement(new XoopsFormHidden('cid',0), false);
-
+ $timetrials = '';
$sform->addElement(new XoopsFormText(_MD_XG_NAME, 'name', 50, 50, $name), true);
if($xoopsModuleConfig['addimages']){
$sform->addElement(new XoopsFormText(_MD_XG_IMAGE, 'image', 50, 255, $image), false);
@@ -288,6 +319,8 @@
$sform->addElement(new XoopsFormText(_MD_XG_STYLE, 'style', 50, 75, $style), false);
$sform->addElement(new XoopsFormText(_MD_XG_ENGINE, 'engine', 50, 75, $engine), false);
$sform->addElement(new XoopsFormText(_MD_XG_COLOR, 'color', 50, 75, $color), false);
+
+ if($timetrials) {
$sform->addElement(new XoopsFormText(_MD_XG_RT, 'rt', 50, 75, $rt), false);
$sform->addElement(new XoopsFormText(_MD_XG_SIXTY, 'sixty', 50, 75, $sixty), false);
$sform->addElement(new XoopsFormText(_MD_XG_THREE, 'three', 50, 75, $three), false);
@@ -296,6 +329,22 @@
$sform->addElement(new XoopsFormText(_MD_XG_THOU, 'thou', 50, 75, $thou), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUART, 'quart', 50, 75, $quart), false);
$sform->addElement(new XoopsFormText(_MD_XG_QUARTM, 'quartm', 50, 75, $quartm), false);
+
+ } else {
+
+ $sform->addElement(new XoopsFormHidden('rt',$rt), false);
+ $sform->addElement(new XoopsFormHidden('sixty',$sixty), false);
+ $sform->addElement(new XoopsFormHidden('three',$three), false);
+ $sform->addElement(new XoopsFormHidden('eigth',$eigth), false);
+ $sform->addElement(new XoopsFormHidden('eigthm',$eigthm), false);
+ $sform->addElement(new XoopsFormHidden('thou',$thou), false);
+ $sform->addElement(new XoopsFormHidden('quart',$quart), false);
+ $sform->addElement(new...
[truncated message content] |
|
From: <be...@us...> - 2013-09-20 23:14:10
|
Revision: 12075
http://sourceforge.net/p/xoops/svn/12075
Author: beckmi
Date: 2013-09-20 23:14:07 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
xGarage old Beta 6
Modified Paths:
--------------
XoopsModules/xgarage/trunk/xgarage/index.php
XoopsModules/xgarage/trunk/xgarage/language/english/admin.php
XoopsModules/xgarage/trunk/xgarage/xoops_version.php
Added Paths:
-----------
XoopsModules/xgarage/trunk/xgarage/class/garage.php
Added: XoopsModules/xgarage/trunk/xgarage/class/garage.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/class/garage.php (rev 0)
+++ XoopsModules/xgarage/trunk/xgarage/class/garage.php 2013-09-20 23:14:07 UTC (rev 12075)
@@ -0,0 +1,212 @@
+<?php
+/**
+ * Garage Management
+ * Doc Comments needed, once completed.
+ * @version Stage1
+ */
+include_once XOOPS_ROOT_PATH."/class/xoopsobject.php";
+
+/**
+ * Doc Comment Needed.
+ * this is the garage and everything stored in the garage.. the one car garage.
+ */
+class Garage extends XoopsObject
+{
+ var $db;
+ //not done. variable type is not set correctly
+ function Garage()
+ {
+//required and max length need to be set still
+ $this->db =& Database::getInstance();
+ $this->initVar('aa', XOBJ_DTYPE_INT, NULL); //approved
+ $this->initVar('uid', XOBJ_DTYPE_INT, NULL);//uid
+ $this->initVar('cid', XOBJ_DTYPE_INT, NULL);//cid
+ $this->initVar('name', XOBJ_DTYPE_TXTBOX);//name
+ $this->initVar('image', XOBJ_DTYPE_TXTBOX);//image
+ $this->initVar('uploadimage', XOBJ_DTYPE_TXTBOX, NULL);//uploadimage
+ $this->initVar('imagechoice', XOBJ_DTYPE_INT, NULL);//imagechoice
+ $this->initVar('url', XOBJ_DTYPE_INT, NULL);//url
+ $this->initVar('location', XOBJ_DTYPE_TXTBOX, NULL);//location
+ $this->initVar('year', XOBJ_DTYPE_TXTBOX, NULL);//year
+ $this->initVar('make', XOBJ_DTYPE_TXTBOX, NULL);//mark field?...make??? .05fixed
+ $this->initVar('model', XOBJ_DTYPE_TXTBOX, NULL);//model
+ $this->initVar('style', XOBJ_DTYPE_TXTBOX, NULL);//style??? mmissing??? .05fixed
+ $this->initVar('engine', XOBJ_DTYPE_TXTBOX, NULL);//engine
+ $this->initVar('color', XOBJ_DTYPE_TXTBOX, NULL);//color
+ $this->initVar('rt', XOBJ_DTYPE_TXTBOX, NULL);//rt
+ $this->initVar('sixty', XOBJ_DTYPE_TXTBOX, NULL);//sixty
+ $this->initVar('three', XOBJ_DTYPE_TXTBOX, NULL);//three
+ $this->initVar('eigth', XOBJ_DTYPE_TXTBOX, NULL);//eight???? misspelling?
+ $this->initVar('eigthm', XOBJ_DTYPE_TXTBOX, NULL);//misspelling again?
+ $this->initVar('thou', XOBJ_DTYPE_TXTBOX, NULL);//thou
+ $this->initVar('quart', XOBJ_DTYPE_TXTBOX, NULL);//quart
+ $this->initVar('quartm', XOBJ_DTYPE_TXTBOX, NULL);//quartm
+ $this->initVar('list', XOBJ_DTYPE_TXTBOX, NULL);//list
+ $this->initVar('mengine', XOBJ_DTYPE_TXTAREA, NULL);//mengine
+ $this->initVar('mexterior', XOBJ_DTYPE_TXTAREA, NULL);//meterier ?? mexterior .06fixed
+ $this->initVar('minterior',XOBJ_DTYPE_TXTAREA, NULL);//minterior
+ $this->initVar('mrims', XOBJ_DTYPE_TXTAREA, NULL);//mrims
+ $this->initVar('maudio', XOBJ_DTYPE_TXTAREA, NULL);//maudio
+ $this->initVar('mfuture', XOBJ_DTYPE_TXTAREA, NULL);//mfuture
+ $this->initVar('descript2', XOBJ_DTYPE_TXTAREA, NULL);//descript2
+ $this->initVar('linkgarage', XOBJ_DTYPE_INT, NULL);//linkgarage
+ }
+
+}
+
+//to be added.
+
+//xoops_getModuleHandler('garage','garage'); obj. dir
+class GarageGarageHandler extends XoopsObjectHandler
+{
+
+/**
+ * retrieves a garage
+ *
+ * @param int $gid GID of the garage
+ *
+ */
+ //done
+function &getGarage($uid)
+{
+ $garage = false;
+ if (intval($uid) > 0) {
+ //$sql = "SELECT id,approved,viewable,disabled,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage FROM " . $this->db->prefix('garage') . " WHERE id = '$gid'";
+ $sql = "SELECT * FROM " . $this->db->prefix('garage') . " WHERE id = '".$uid."'";
+ //next version . use criteria
+ if (!$result = $this->db->query($sql)) {
+ exit("$sql > SQL Error in function :: getGarage()");
+ //return $garage; //$garage which would be false
+ }
+
+ $numrows = $this->db->getRowsNum($result);
+ if ($numrows == 1) {
+ $garage = new garage();
+ $garage->assignVars($this->db->fetchArray($result));
+ }
+ }
+ return $garage;
+}
+
+//done
+function doesGarageExist($uid){
+
+ $sql = "SELECT id FROM " . $this->db->prefix("garage") . " WHERE uid = '$uid' LIMIT 1";
+ if ( !$result = $this->db->query($sql) ) {
+ exit("SQL Error in function :: doesGarageExist()");
+ }
+ $xgid = $this->db->fetchRow($result);
+ return $xgid;
+}
+
+//use criteria,
+//didnt change yet
+function &getRoster($cid){
+ $sql = "SELECT id,name FROM " . $this->db->prefix("garage") . " WHERE (approved=1 AND viewable=1 AND disabled=0) AND cid='$cid' ORDER BY name";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ return;
+ //exit("SQL Error in function :: getRoster($cid)");
+ }
+ $names = array();
+ while ( $row = $xoopsDB->fetchArray($result) ) {
+ $names[] = $row;
+ }
+ return $names;
+}
+
+//didnt change yet
+function garage_FieldExists($fieldname,$table)
+{
+ global $xoopsDB;
+ $result=$xoopsDB->queryF("SHOW COLUMNS FROM $table LIKE '$fieldname'");
+ return($xoopsDB->getRowsNum($result) > 0);
+}
+//didnt change yet
+function garage_AddField($field, $table)
+{
+ global $xoopsDB;
+ $result=$xoopsDB->queryF('ALTER TABLE ' . $table . " ADD $field;");
+ return $result;
+}
+
+//done. we use creategarage and then we do setvar. then we insertGarage
+function creategarage($isNew = true){
+ $garage = new garage();
+ if ($isNew) {
+ $garage->setNew();
+ }
+ return $garage;
+ //use setvar to set it in page that calls this.
+}
+
+//done ish
+function insertGarage(&$garage){
+ if (strtolower(get_class($garage)) != 'garage') {
+ return false;
+ }
+ if (!$garage->isDirty()) {
+ return true;
+ }
+ if (!$garage->cleanVars()) { //clean the vars
+ return false;
+ }
+ foreach ($garage->cleanVars as $k => $v) {
+ ${$k} = $v;
+ }
+
+ //use $garage->isNew() to see if the user is a new one. so we can INSERT or just UPDATE
+ //note. i left the insert and the update garages as separate methods.
+ $sql = "INSERT INTO " . $this->db->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$year','$make','$model','$style','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkgarage')";
+ if ( !$result = $$this->db->query($sql) ) {
+ exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
+ } else {
+ return 1;
+ }
+
+ if (empty($uid)) {
+ $uid = $this->db->getInsertId();
+ }
+
+ $garage->assignVar('uid', $uid);
+ return true;
+}
+
+//or?,
+//didnt change yet
+function addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
+ global $xoopsDB;
+ $sql = "INSERT INTO " . $xoopsDB->prefix("garage") . " (approved,uid,cid,name,image,uploadimage,imagechoice,url,location,year,make,model,style,engine,color,rt,sixty,three,eigth,eigthm,thou,quart,quartm,list,mengine,mexterior,minterior,mrims,maudio,mfuture,descript2,linkgarage) VALUES ($aa,$uid,$cid,'$name','$image','$uploadimage','$imagechoice','$url','$location','$year','$make','$model','$style','$engine','$color','$rt','$sixty','$three','$eigth','$eigthm','$thou','$quart','$quartm','$list','$mengine','$mexterior','$minterior','$mrims','$maudio','$mfuture','$descript2','$linkgarage')";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ exit("$sql > SQL Error in function :: addGarage($aa,$uid,$cid,$name,$image,$uploadimage,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
+ } else {
+ return 1;
+ }
+}
+//adopt the way user.php does new and old users update.,
+//didnt change yet
+function updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
+ global $xoopsDB;
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkgarage='$linkgarage' WHERE id = $gid";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ exit("$sql > SQL Error in function :: updateGarage($gid,$uid,$cid,$viewable,$name,$image,$imagechoice,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage)");
+ } else {
+ return 1;
+ }
+}
+//didnt change yet
+function updateGaragePlusUpload($gid,$uid,$cid,$viewable,$name,$image,$uploadimage,$imagechoice="0",$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list,$mengine,$mexterior,$minterior,$mrims,$maudio,$mfuture,$descript2,$linkgarage){
+ global $xoopsDB;
+ $sql = "UPDATE " . $xoopsDB->prefix("garage") . " SET uid=$uid,cid=$cid,viewable=$viewable,name='$name',image='$image',uploadimage='$uploadimage',imagechoice='$imagechoice',url='$url',location='$location',year='$year',make='$make',model='$model',style='$style',engine='$engine',color='$color',rt='$rt',sixty='$sixty',three='$three',eigth='$eigth',eigthm='$eigthm',thou='$thou',quart='$quart',quartm='$quartm',list='$list',mengine='$mengine',mexterior='$mexterior',minterior='$minterior',mrims='$mrims',maudio='$maudio',mfuture='$mfuture',descript2='$descript2',linkgarage='$linkgarage' WHERE id = $gid";
+ if ( !$result = $xoopsDB->query($sql) ) {
+ exit("$sql > SQL Error in function :: updateGaragePlusUpload($gid,$cid,$viewable,$name,$image,$url,$location,$year,$make,$model,$style,$engine,$color,$rt,$sixty,$three,$eigth,$eigthm,$thou,$quart,$quartm,$list)");
+
+ } else {
+ return 1;
+ }
+}
+
+//Delete garage?
+
+}
+
+?>
\ No newline at end of file
Property changes on: XoopsModules/xgarage/trunk/xgarage/class/garage.php
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Rev URL
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: XoopsModules/xgarage/trunk/xgarage/index.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/index.php 2013-09-20 23:13:05 UTC (rev 12074)
+++ XoopsModules/xgarage/trunk/xgarage/index.php 2013-09-20 23:14:07 UTC (rev 12075)
@@ -69,46 +69,51 @@
- if($gid){
- $garage = getGarage($gid);
- if($garage['imagechoice'] == 1) {
+ if($gid = intval($gid) > 0){
+
+ $myGarage = xoops_getModuleHandler('garage','garage');
+ $thegarage = $myGarage->getGarage($gid);
+
+ if($thegarage->getVar('imagechoice') == 1) {
$garage['image'] = "[img align=center]". XOOPS_UPLOAD_URL. "/" . "garage/".$garage['uploadimage']."[/img]";
}
- }
+ }else{
+ redirect_header("index.php",2,'Garage Doesn\'t Exist'); //need a constant for this
+ }
$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
- $garage['mengine'] = $myts->displayTarea($garage['mengine'], 1, 1, 1, 1, 1);
- $garage['mexterior'] = $myts->displayTarea($garage['mexterior'], 1, 1, 1, 1, 1);
- $garage['minterior'] = $myts->displayTarea($garage['minterior'], 1, 1, 1, 1, 1);
- $garage['mrims'] = $myts->displayTarea($garage['mrims'], 1, 1, 1, 1, 1);
- $garage['maudio'] = $myts->displayTarea($garage['maudio'], 1, 1, 1, 1, 1);
- $garage['mfuture'] = $myts->displayTarea($garage['mfuture'], 1, 1, 1, 1, 1);
- $garage['descript2'] = $myts->displayTarea($garage['descript2'], 1, 1, 1, 1, 1);
- if($garage['descript2']){
+ $garage['mengine'] = $myts->displayTarea($thegarage->getVar('mengine'), 1, 1, 1, 1, 1);
+ $garage['mexterior'] = $myts->displayTarea($thegarage->getVar('mexterior'), 1, 1, 1, 1, 1);
+ $garage['minterior'] = $myts->displayTarea($thegarage->getVar('minterior'), 1, 1, 1, 1, 1);
+ $garage['mrims'] = $myts->displayTarea($thegarage->getVar('mrims'), 1, 1, 1, 1, 1);
+ $garage['maudio'] = $myts->displayTarea($thegarage->getVar('maudio'), 1, 1, 1, 1, 1);
+ $garage['mfuture'] = $myts->displayTarea($thegarage->getVar('mfuture'), 1, 1, 1, 1, 1);
+ $garage['descript2'] = $myts->displayTarea($thegarage->getVar('descript2'), 1, 1, 1, 1, 1);
+ if($thegarage->getVar('descript2')){
if($subop == "more") $xoopsTpl->assign('showmore', true);
else $xoopsTpl->assign('more', _MD_XG_MORE);
}
- $garage['image'] = $myts->displayTarea($garage['image'], 0, 0, 1, 1, 0);
- $garage['location'] = $myts->displayTarea($garage['location'], 0, 0, 0, 0, 0);
- $garage['year'] = $myts->displayTarea($garage['year'], 0, 0, 0, 0, 0);
- $garage['make'] = $myts->displayTarea($garage['make'], 0, 0, 0, 0, 0);
- $garage['model'] = $myts->displayTarea($garage['model'], 0, 0, 0, 0, 0);
- $garage['style'] = $myts->displayTarea($garage['style'], 0, 0, 0, 0, 0);
- $garage['engine'] = $myts->displayTarea($garage['engine'], 0, 0, 0, 0, 0);
- $garage['color'] = $myts->displayTarea($garage['color'], 0, 0, 0, 0, 0);
- $garage['rt'] = $myts->displayTarea($garage['rt'], 0, 0, 0, 0, 0);
- $garage['sixty'] = $myts->displayTarea($garage['sixty'], 0, 0, 0, 0, 0);
- $garage['three'] = $myts->displayTarea($garage['three'], 0, 0, 0, 0, 0);
- $garage['eigth'] = $myts->displayTarea($garage['eigth'], 0, 0, 0, 0, 0);
- $garage['eigthm'] = $myts->displayTarea($garage['eigthm'], 0, 0, 0, 0, 0);
- $garage['thou'] = $myts->displayTarea($garage['thou'], 0, 0, 0, 0, 0);
- $garage['quart'] = $myts->displayTarea($garage['quart'], 0, 0, 0, 0, 0);
- $garage['quartm'] = $myts->displayTarea($garage['quartm'], 0, 0, 0, 0, 0);
- $garage['list'] = $myts->displayTarea($garage['list'], 0, 0, 0, 0, 0);
+ $garage['image'] = $myts->displayTarea($thegarage->getVar('image'), 0, 0, 1, 1, 0);
+ $garage['location'] = $myts->displayTarea($thegarage->getVar('location'), 0, 0, 0, 0, 0);
+ $garage['year'] = $myts->displayTarea($thegarage->getVar('year'), 0, 0, 0, 0, 0);
+ $garage['make'] = $myts->displayTarea($thegarage->getVar('make'), 0, 0, 0, 0, 0);
+ $garage['model'] = $myts->displayTarea($thegarage->getVar('model'), 0, 0, 0, 0, 0);
+ $garage['style'] = $myts->displayTarea($thegarage->getVar('style'), 0, 0, 0, 0, 0);
+ $garage['engine'] = $myts->displayTarea($thegarage->getVar('engine'), 0, 0, 0, 0, 0);
+ $garage['color'] = $myts->displayTarea($thegarage->getVar('color'), 0, 0, 0, 0, 0);
+ $garage['rt'] = $myts->displayTarea($thegarage->getVar('rt'), 0, 0, 0, 0, 0);
+ $garage['sixty'] = $myts->displayTarea($thegarage->getVar('sixty'), 0, 0, 0, 0, 0);
+ $garage['three'] = $myts->displayTarea($thegarage->getVar('three'), 0, 0, 0, 0, 0);
+ $garage['eigth'] = $myts->displayTarea($thegarage->getVar('eigth'), 0, 0, 0, 0, 0);
+ $garage['eigthm'] = $myts->displayTarea($thegarage->getVar('eigthm'), 0, 0, 0, 0, 0);
+ $garage['thou'] = $myts->displayTarea($thegarage->getVar('thou'), 0, 0, 0, 0, 0);
+ $garage['quart'] = $myts->displayTarea($thegarage->getVar('quart'), 0, 0, 0, 0, 0);
+ $garage['quartm'] = $myts->displayTarea($thegarage->getVar('quartm'), 0, 0, 0, 0, 0);
+ $garage['list'] = $myts->displayTarea($thegarage->getVar('list'), 0, 0, 0, 0, 0);
- if($garage['list']){
+ if($thegarage->getVar('list')){
if($xoopsModuleConfig['listformat']) {
- $garage['list2'] = explode(",",$garage['list']);
+ $garage['list2'] = explode(",",$thegarage->getVar('list'));
foreach($garage['list2'] as $item){
$items[] = trim($item);
}
@@ -118,37 +123,37 @@
$xoopsTpl->assign('listformat', $xoopsModuleConfig['listformat']);
if($userIsAdmin == 0){
- if($garage['approved'] == 0){
+ if($thegarage->getVar('approved') == 0){
redirect_header("index.php",2,_MD_XG_NOTAPPROVEDYET);
exit;
}
- if($garage['viewable'] == 0 && $uid != $garage['uid']){
+ if($thegarage->getVar('viewable') == 0 && $uid != $garage['uid']){
redirect_header("index.php",2,_MD_XG_NOTVIEWABLE);
exit;
}
- if($garage['disabled'] == 1){
+ if($thegarage->getVar('disabled') == 1){
redirect_header("index.php",2,_MD_XG_DISABLED);
exit;
}
}
- $garage['uname'] = xoops_getLinkedUnameFromId($garage['uid']);//added by jlm69
+ $garage['uname'] = xoops_getLinkedUnameFromId($thegarage->getVar('uid'));//added by jlm69
- if(($uid == $garage['uid'] && $xoopsModuleConfig['canuseredit']) || ($xoopsModuleConfig['canadminsedit'] && $userIsAdmin)){
+ if(($uid == $thegarage->getVar('uid') && $xoopsModuleConfig['canuseredit']) || ($xoopsModuleConfig['canadminsedit'] && $userIsAdmin)){
$xoopsTpl->assign('panel', true);
$xoopsTpl->assign('editgarage',_MD_XG_EDITGARAGE);
if($userIsAdmin) {
$xoopsTpl->assign('adminlink',_MD_XG_ADMINLINK);
- if($garage['approved'] == 0){
+ if($thegarage->getVar('approved') == 0){
$xoopsTpl->assign('approvegarage',_MD_XG_APPROVEGARAGE);
}
- if($garage['disabled'] == 0){
+ if($thegarage->getVar('disabled') == 0){
$xoopsTpl->assign('disablegarage',_MD_XG_DISABLEGARAGE);
- } elseif ($garage['disabled']) $xoopsTpl->assign('enablegarage',_MD_XG_ENABLEGARAGE);
+ } elseif ($thegarage->getVar('disabled')) $xoopsTpl->assign('enablegarage',_MD_XG_ENABLEGARAGE);
$xoopsTpl->assign('deletegarage',_MD_XG_DELETEGARAGE);
}
}
- $cid = $garage['cid'];
+ $cid = $thegarage->getVar('cid');
if($xoopsModuleConfig['usecats']){
include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
$cattree = new XoopsTree($xoopsDB->prefix("garage_cats"),"cid","gid");
@@ -156,7 +161,8 @@
$xoopsTpl->assign('path',$path);
}
-
+ //why not just use smarty constants in the template?
+ unset($myGarage); //unset .
$xoopsTpl->assign('allowcomments', $xoopsModuleConfig['allowcomments']);
$xoopsTpl->assign('gid', $gid);
$xoopsTpl->assign('gname', _MD_XG_GNAME);
Modified: XoopsModules/xgarage/trunk/xgarage/language/english/admin.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/language/english/admin.php 2013-09-20 23:13:05 UTC (rev 12074)
+++ XoopsModules/xgarage/trunk/xgarage/language/english/admin.php 2013-09-20 23:14:07 UTC (rev 12075)
@@ -1,4 +1,6 @@
<?php
+define("_AM_APPROVESUCCESS","Garage Approved.");
+define("_AM_APPROVEFAILURE","There was an error with approving this garage.");
define("_AM_GARAGES_INDEX", "Index");
define("_AM_GARAGES_OPTS", "Preferences");
define("_AM_GARAGES_GOMOD", "Go to module");
Modified: XoopsModules/xgarage/trunk/xgarage/xoops_version.php
===================================================================
--- XoopsModules/xgarage/trunk/xgarage/xoops_version.php 2013-09-20 23:13:05 UTC (rev 12074)
+++ XoopsModules/xgarage/trunk/xgarage/xoops_version.php 2013-09-20 23:14:07 UTC (rev 12075)
@@ -3,7 +3,7 @@
global $xoopsModuleConfig;
$modversion['name'] = _MI_NAME;
-$modversion['version'] = ".05beta";
+$modversion['version'] = ".06beta";
$modversion['description'] = _MI_DESC;
$modversion['credits'] = 'www.calibernation.com / www.xgarage.org / www.jlmzone.com / www.arabxoops.com';
$modversion['author'] = 'Northern, script_fu, jlm69, mowaffak';
|