View Single Post
  #129  
Old 03-14-2006, 07:27 PM
 
tntdesigns tntdesigns is offline
 

Senior Member
  
Join Date: Feb 2005
Location: Plam Beach, FL
Posts: 137
 

Default Got CMS to work in 4.0.18

Well I had some problems with cmsmanger.php
image button did not load and errors when "To create html for another part of your site" hotlink when loading?
here is my fix:


Quote:
<?
/************************************************** ***************************\
+-----------------------------------------------------------------------------+
| X-Cart CMS Manager |
| Copyright (c) 2003 Sean Donahoe, Artwrkz.net |
| All rights reserved. |
+-----------------------------------------------------------------------------+
| |
| THIS AGREEMENT EXPRESSES THE TERMS AND CONDITIONS ON WHICH YOU MAY USE |
| THIS SOFTWARE PROGRAM AND ASSOCIATED DOCUMENTATION THAT RUSLAN R. |
| FAZLIEV (hereinafter referred to as "THE AUTHOR") IS FURNISHING OR MAKING |
| AVAILABLE TO YOU WITH THIS AGREEMENT (COLLECTIVELY, THE "SOFTWARE"). |
| PLEASE REVIEW THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT |
| CAREFULLY BEFORE INSTALLING OR USING THE SOFTWARE. BY INSTALLING, |
| COPYING OR OTHERWISE USING THE SOFTWARE, YOU AND YOUR COMPANY |
| (COLLECTIVELY, "YOU") ARE ACCEPTING AND AGREEING TO THE TERMS OF THIS |
| LICENSE AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THIS |
| AGREEMENT, DO NOT INSTALL OR USE THE SOFTWARE. VARIOUS COPYRIGHTS AND |
| OTHER INTELLECTUAL PROPERTY RIGHTS PROTECT THE SOFTWARE. THIS |
| AGREEMENT IS A LICENSE AGREEMENT THAT GIVES YOU LIMITED RIGHTS TO USE |
| THE SOFTWARE AND NOT AN AGREEMENT FOR SALE OR FOR TRANSFER OF TITLE.|
| THE AUTHOR RETAINS ALL RIGHTS NOT EXPRESSLY GRANTED BY THIS AGREEMENT. |
| |
+-----------------------------------------------------------------------------+
\************************************************* ****************************/

require "./auth.php";
require $xcart_dir."/include/security.php";



$header="<center><img src=/store/admin/images/ezcontentlogo.gif></center>
";
$footer="

<center>Powered By EZ-Content Manager. &copy;2003 <a href=http://artwrkz.net> Sean Donahoe, Artwrkz.net</a>, All Rights Reserved";



if ($action==""){

$limitPerPage = 50;
$initStartLimit = 0;
if (!isset($startLimit))
{
$startLimit = $initStartLimit;
}
$querylimit = " limit $startLimit,$limitPerPage";

$nextStartLimit = $startLimit + $limitPerPage;
$previousStartLimit = $startLimit - $limitPerPage;

if ($sortby!="")
{
$sorted = " order by $sortby ";
}
$bareQuery = "select id,title,content,date,pagetype from cms ";
$queryall = $bareQuery.$sorted.$querylimit;
$resultall = MYSQL_QUERY($queryall);
$numberall = mysql_Numrows($resultall);

if ($numberall==0) {

$pagecontent="$header
<h3>There is no content at the moment</h3>

To add a new content item <a href=cmsmaker.php>Click Here</a>

";

}
else if ($numberall>0) {

$x=0;



$pagecontent="$header
<h3>List of current custom content </h3>

To add a new content item <a href=cmsmaker.php>Click Here</a>

To create html for another part of your site <a href=/store/admin/cmsmanager.php?action=html>Click Here</a>




<a href=\"$PHP_SELF?startLimit=$previousStartLimit;&l imitPerPage=$limitPerPage;&sortby=$sortby;\">Previ ous $limitPerPage Results</a>

<a href=\"$PHP_SELF?startLimit=$nextStartLimit&limitP erPage=$limitPerPage&sortby=$sortby\">Next $limitPerPage Results</a>



<table border=0 cellspacing=0 cellpadding=4>
<tr>
<td><a href=\" $PHP_SELF?sortby=title&startLimit=$startLimit&limi tPerPage=$limitPerPage\">Title</a></td>
<td><a href=\" $PHP_SELF?sortby=date&startLimit=$startLimit&limit PerPage=$limitPerPage\">Date Created</a></td>
<td><a href=\" $PHP_SELF?sortby=pagetype&startLimit=$startLimit&l imitPerPage=$limitPerPage\">Page Type</a></td>


</tr>

";
while ($x<$numberall)
{

// Changing Background color for each alternate row




// Retreiving data and putting it in local variables for each row
$id=mysql_result($resultall,$x,"id");
$title=mysql_result($resultall,$x,"title");
$date=mysql_result($resultall,$x,"date");
$pagetype=mysql_result($resultall,$x,"pagetype");


$pagecontent.="<tr height=30>
<td><a href=\"cmsmanager.php?id=$id&action=view\">$title< /a></td>
<td>$date </td>";
if ($pagetype==1){$pagecontent.="<td>Embedded Full Page</td>";}
if ($pagetype==2){$pagecontent.="<td>Rotating Side Panel -1</td>";}
if ($pagetype==3){$pagecontent.="<td>Rotating Side Panel -2</td>";}
if ($pagetype==4){$pagecontent.="<td>Rotating Side Panel -3</td>";}
if ($pagetype==5){$pagecontent.="<td>Fixed Side Panel -1</td>";}
if ($pagetype==6){$pagecontent.="<td>Fixed Side Panel -2</td>";}
if ($pagetype==7){$pagecontent.="<td>Fixed Side Panel -3</td>";}

$pagecontent.="
<td><a href=\"cmsmanager.php?id=$id&action=edit\"><img src=/store/admin/images/editthis.gif alt=\"Edit\" border=0></a></td>
<td><a href=\"cmsmanager.php?id=$id&action=delete\"><img src=/store/admin/images/trashcan.gif alt=\"Delete\" border=0></a></td>
<td><a href=\"cmsmanager.php?id=$id&action=view\"><img src=/store/admin/images/magglass.gif alt=\"View\" border=0></a></td>
</tr>";

$x++;
} // end while

$pagecontent.="</table>";

} // end if numberall > 0
$pagecontent.=$footer;
}


if ($action=="view"){
$bareQuery = "select id,title,content,date,pagetype from cms where id='$id'";
$resultall = MYSQL_QUERY($bareQuery);
$content=mysql_result($resultall,0,"content");
$pagetype=mysql_result($resultall,0,"pagetype");
$id=mysql_result($resultall,0,"id");
$title=mysql_result($resultall,0,"title");



$pagecontent.= $header.stripslashes($content);

$pagecontent.=$footer;
}

if ($action=="delete"){

$queryconfirmation = "select * from cms where id = '$id'";
$resultconfirmation = MYSQL_QUERY($queryconfirmation);
$numberconfirmation = mysql_Numrows($resultconfirmation);

if ($numberconfirmation==0) {

echo "This Record cannot be found !
";

}

else if ($numberconfirmation>0) {

$x=0;



$pagecontent="$header<h3>Is this the Record that you want to Delete?</h3><form name=formMaker method=post action=\"cmsmanager.php\">
<table border=0 cellspacing=0 cellpadding=5>
";

while ($x<$numberconfirmation)
{
$title=mysql_result($resultconfirmation,$x,"title" );
$content=mysql_result($resultconfirmation,$x,"cont ent");
$content=stripslashes($content);
$pagecontent.="
<tr height=30><td align=right>Title :</td><td>$title</td></tr>
<tr height=30><td align=right valign=top>Content :</td><td>$content</td></tr>";

$x++;
} // end while
} // end if


$pagecontent.="
</table>
<input type=hidden name=\"id\" value=$id>
<input type=hidden name=\"action\" value=delete2>
<input type=submit name=Submit value=\"Delete this Record\">
</form>";


$pagecontent.=$footer;
}

if ($action=="delete2"){
$querydelete = "delete from cms where id = '$id'";
$resultdelete = MYSQL_QUERY($querydelete);




$pagecontent.="$header<h3>Record with ID $id has been Deleted </h3>

Click <a href=\"cmsmanager.php\">here</a> to go back to Main Menu";
$pagecontent.=$footer;
}

if ($action=="edit"){



$queryupdate = "select* from cms where id = '$id'";
$resultupdate = MYSQL_QUERY($queryupdate);

$numberupdate = mysql_Numrows($resultupdate);

$id=mysql_result($resultupdate,0,"id");
$title=mysql_result($resultupdate,0,"title");
$content=mysql_result($resultupdate,0,"content");
$date=mysql_result($resultupdate,0,"date");
$pagetype=mysql_result($resultupdate,0,"pagetype") ;



$title=stripslashes($title);
$content=stripslashes($content);

$pagecontent="

<script language=\"Javascript1.2\"><!-- // load htmlarea
_editor_url = \"\"; // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split(\"MSIE\")[1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src=\"' +_editor_url+ 'editor.js\"');
document.write(' language=\"Javascript1.2\"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>
$header
<h2>Edit content item</h2>
<form name=cms method=post action=\"cmsmanager.php\"><input type=hidden name=action value=edit2>
<table>

<tr height=30 valign=top>
<td align=right>Title :</td>
<td>
<input type=\"text\" name=\"titleField\" size=50 value=\"$title\" >
</td>
</tr>


<tr height=30 valign=top>
<td align=right valign=top>Content :</td>
<td>Remember if you are creating a side panel item your final width will be around 160 pixels wide so keep content short and to the point.


<textarea name=\"contentField\" wrap=\"VIRTUAL\" cols=\"60\" rows=\"20\">$content</textarea>
<script language=\"javascript1.2\">
editor_generate('contentField');
</script>
</td>
</tr>

<tr height=30 valign=top>
<td align=right valign=middle>Content Type :</td>
<td>
<select name=\"pagetypeField\">";

if ($pagetype=="1"){$pagecontent.="<option value=\"1\" selected>Current - Embedded Full Page</option>";}
if ($pagetype=="2"){$pagecontent.="<option value=\"2\" selected>Current - Rotating Side Panel -1</option>";}
if ($pagetype=="3"){$pagecontent.="<option value=\"3\" selected>Current - Rotating Side Panel -2</option>";}
if ($pagetype=="4"){$pagecontent.="<option value=\"4\" selected>Current - Rotating Side Panel -3</option>";}
if ($pagetype=="5"){$pagecontent.="<option value=\"5\" selected>Current - Fixed Side Panel -1</option>";}
if ($pagetype=="6"){$pagecontent.="<option value=\"6\" selected>Current - Fixed Side Panel -2</option>";}
if ($pagetype=="7"){$pagecontent.="<option value=\"7\" selected>Current - Fixed Side Panel -3</option>";}

$pagecontent.="
<option value=\"1\">Embedded Full Page</option>
<option value=\"2\">Rotating Side Panel -1</option>
<option value=\"3\">Rotating Side Panel -2</option>
<option value=\"4\">Rotating Side Panel -3</option>
<option value=\"5\">Fixed Side Panel -1</option>
<option value=\"6\">Fixed Side Panel -2</option>
<option value=\"7\">Fixed Side Panel -3</option>
</select>
</td>
</tr>

</table>
<input type=hidden name=id value=\"$id\">
<input type=submit name=Submit value=\"Submit\">
<input type=reset name=Submit2 value=\"Reset\">
</form>

";




$pagecontent.=$footer;
}

if ($action=="edit2"){
$query="update cms set title='$titleField', content='$contentField', date=NOW(), pagetype='$pagetypeField' where id = '$id'";

$result = MYSQL_QUERY($query);
$pagecontent="$header
Item Updated, please go back to main menu - <a href=cmsmanager.php>Click Here</a>";
$pagecontent.=$footer;
}

if ($action=="html"){

$pagecontent="

<script language=\"Javascript1.2\"><!-- // load htmlarea
_editor_url = \"\"; // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split(\"MSIE\")[1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src=\"' +_editor_url+ 'editor.js\"');
document.write(' language=\"Javascript1.2\"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>

<div align=\"center\">$header
<h2>Quick HTML Builder.</h2>
<table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">
<tr>
<td colspan=\"2\">How to use</td>
</tr>
<tr>
<td>Step 1.</td>
<td>Build your page in the HTML editor below.</td>
</tr>
<tr>
<td>Step 2.</td>
<td>Press the <img src=\"/store/admin/images/sourcebutton.gif\" width=\"29\" height=\"23\" align=\"absmiddle\"> button to view the source.</td>
</tr>
<tr>
<td>Step 3.</td>
<td>Copy and Paste the source code into what ever form area cell you want.</td>
</tr>
</table>




<textarea name=\"contentField\" wrap=\"VIRTUAL\" cols=\"80\" rows=\"50\"></textarea>
<script language=\"javascript1.2\">
editor_generate('contentField');
</script>


";




$pagecontent.=$footer;
}


$smarty->assign("pagecontent",$pagecontent);
$smarty->assign("main","cmsmaker");
$smarty->assign("location",$location);
@include $xcart_dir."/modules/gold_display.php";
func_display("admin/home.tpl",$smarty);
?>
[/quote]
__________________
Xcart Gold 4.7.5 X-Affiliate, Add-on: X-Configurator, Add-on: X-SpecialOffers, Add-on: X-AOM, On Sale, EBay add on, Traffic Monitor, Froogle Feed, Drop Shipper, Newslist Manager, Product Options Copier 1.0, BCS Customer Reward Points, BCS Refer points, Ad Banner, PAYPAL PRO, Blue Dream, Drop Shipper bcse gallery
Reply With Quote