Hey, Would you like to work at Home ?? Just click here No need to pay, just register free and activate your account and get data Entry Work at your Home.

Thursday, August 30, 2007

content management systems

Simple Web Content Management System

Link :- http://www.allscoop.com/free-php-code.php

Simple Web Content Management System: A free open-source content management application released under the GPL. A complete content managment system, create your very own web site in just minutes. Log into the web-based cms control panel to quickly add, edit, or update your content.

A simple content management system based on PHP and the free and fast MySQL database. Simple to setup and administer. All site settings are easily customized with the administration interface. Runs on an Apache or IIS webserver with PHP and MySQL. Full web based administration. The goal of this system is to have a simple, easy to use, fast website.










Download




online web content management

online web content management is an extremely versatile and flexible content management system. completely template driven so it can be easily customized. designed to be used with small to medium personal or business website. online web content management straight forward content management administration design make this the perfect content management system for just about anyone.




Download




Free MySQL/PHP Content Management News System
web content management
one-click install
easy to customize for your site
free and open source
fast and robust
simple and straight forward design

web content management is a simple to use basic content management system for news type content. web cms code is based on php and the mysql database, so it is very fast and easy to setup. web content management allows you to login and quickly add a new news item with a news date and an expiration date. non-admin users can also be setup to add new news, but the news story has to be activated by an admin user. web content management is meant to be integrated into your existing php enabled website, or can be a simple content management system on it's own. code is released as open source under the gpl.

Download




Free Content Management
Free CMS Solution


free content management application. An easy way to get your information onto the web instantly. 100% web-based content management, features include image and file uploading, online web page editor, and more. Manage your website content with ease, keep your site updated, and cut down on your development time with free content management. Uses PHP and MySQL.

100% Free CMS Software Released Under the GPL

Download

Show users IP in a graphic - PHP Script

Show IP Display visitor's IP Address in a graphic with this simple php code.

(Please do not link to this image, it is for demonstration only.)


Your IP Address

create a new page, copy the text below and save it as image.php (or whatever you wish)




<?php

$img_number = imagecreate(275,25);
$backcolor = imagecolorallocate($img_number,102,102,153);
$textcolor = imagecolorallocate($img_number,255,255,255);

imagefill($img_number,0,0,$backcolor);
$number = " Your IP is $_SERVER[REMOTE_ADDR]";

Imagestring($img_number,10,5,5,$number,$textcolor);

header("Content-type: image/jpeg");
imagejpeg($img_number);

?>



All you'll need to display on other pages is the code below.


<img src="http://yoursite/image.php" border="1">

obviously you'll need to replace "http://yoursite", with the path to your site.


note: this code will only on systems that support GD image tools

Wednesday, August 15, 2007

Code To Generate Excel Documents - Part 2

<?php
/* Excel Query Output
Allie Micka <allie@pajunas.com> 2/13/02
Outputs an excel spreadsheet for a PEAR query contained in the
variable "$result". If the array "$summaryCols" exists, a
summary row will be printed at the end of the query containing
an excel-calculated summary for that column.

This was generated by using MS Office's "Save as HTML" feature in
Excel, which produces what they call "round trip HTML". By changing
or adding content within their markup you can create a valid Excel
document.
*/

header('Content-Type:application/vnd.ms-excel');?>
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">

<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>Amicka</o:Author>
<o:LastAuthor>Amicka</o:LastAuthor>
<o:Created><?php echo date("Y-m-d\TG:i:s\Z",time())?></o:Created>
<o:LastSaved><?php echo date("Y-m-d\TG:i:s\Z",time())?></o:LastSaved>
<o:Company>pajunas interactive,inc.</o:Company>
<o:Version>9.2720</o:Version>
</o:DocumentProperties>
<o:OfficeDocumentSettings>
<o:DownloadComponents/>
<o:LocationOfComponents HRef="file:msowc.cab"/>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<style>
<!--table
{mso-displayed-decimal-separator:"\.";
mso-displayed-thousand-separator:"\,";}
@page
{margin:1.0in .75in 1.0in .75in;
mso-header-margin:.5in;
mso-footer-margin:.5in;}
tr
{mso-height-source:auto;}
col
{mso-width-source:auto;}
br
{mso-data-placement:same-cell;}
.style0
{mso-number-format:General;
text-align:general;
vertical-align:bottom;
white-space:nowrap;
mso-rotate:0;
mso-background-source:auto;
mso-pattern:auto;
color:windowtext;
font-size:10.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset:0;
border:none;
mso-protection:locked visible;
mso-style-name:Normal;
mso-style-id:0;}
td
{mso-style-parent:style0;
padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:windowtext;
font-size:10.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset:0;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
border:none;
mso-background-source:auto;
mso-pattern:auto;
mso-protection:locked visible;
white-space:nowrap;
mso-rotate:0;}
.xl24
{mso-style-parent:style0;
font-size:8.0pt;
font-weight:700;
font-family:Verdana, sans-serif;
mso-font-charset:0;
text-align:center;
vertical-align:middle;
white-space:normal;}
.xl25
{mso-style-parent:style0;
font-size:8.0pt;
font-family:Verdana, sans-serif;
mso-font-charset:0;
white-space:normal;}
.xl26
{mso-style-parent:style0;
font-size:8.0pt;
font-family:Verdana, sans-serif;
mso-font-charset:0;
background:white;
mso-pattern:auto none;
white-space:normal;}
-->
</style>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name><?php echo $reportTitle ?></x:Name>
<x:WorksheetOptions>
<x:Print>
<x:ValidPrinterInfo/>
<x:HorizontalResolution>600</x:HorizontalResolution>
<x:VerticalResolution>600</x:VerticalResolution>
</x:Print>
<x:Selected/>
<x:Panes>
<x:Pane>
<x:Number>3</x:Number>
<x:ActiveCol>4</x:ActiveCol>
</x:Pane>
</x:Panes>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:WindowHeight>11340</x:WindowHeight>
<x:WindowWidth>17055</x:WindowWidth>
<x:WindowTopX>120</x:WindowTopX>
<x:WindowTopY>30</x:WindowTopY>
<x:ProtectStructure>False</x:ProtectStructure>
<x:ProtectWindows>False</x:ProtectWindows>
</x:ExcelWorkbook>
</xml><![endif]-->
</head>
<body link=blue vlink=purple leftmargin=0 topmargin=0>

<table x:str border=0 cellpadding=0 cellspacing=0 style='border-collapse:
collapse;table-layout:fixed;'>
<?php // <col width=64 span=4 style='width:48pt'>$summaryValues = Array();$summaryCols = isset($summaryCols) ? $summaryCols : Array();

while (
$row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
// print column labels:
if(!isset($column_labels_printed)) {
$xlCols = range(65,90);
echo
'<tr height=28 style=\'height:21.0pt\'>';
foreach(
$row as $col =>$val) {
//print label header
echo '<td height=28 class=xl24 style=\'height:21.0pt;\'>',
ucwords(str_replace('_',' ',strtolower($col))),
'</td>';

// establish information needed for column summary
$columnArray[] = $col;
$xlCol = chr(array_shift($xlCols));
if(
in_array($col,$summaryCols)) {
$summaryValues[$col] = Array(
xlCol => $xlCol,
start => 2,
end =>1,
total =>0);
}
}
echo
'</tr>';
$column_labels_printed = true;
}
//print values
echo '<tr height=29 style=\'height:21.75pt\'>';
foreach(
$row as $col => $val) {
echo
'<td height=29 class=xl25 align=right style=\'height:21.75pt;
width:48pt\''
;
if(
is_numeric($val)) { echo ' x:num'; }
echo
'>',$val,'</td>';

if(
in_array($col,$summaryCols)) {
$summaryValues[$col][total] += $val;
$summaryValues[$col][end] +=1;
}
}
echo
'</tr>';
}
//print summary columns
// print_r($summaryValues);
if(count($summaryValues)) {
foreach(
$columnArray as $col) {
echo
'<td align=right';
if(isset(
$summaryValues[$col])) {
echo
' x:num x:fmla="=SUM('.$summaryValues[$col][xlCol].$summaryValues[$col][start].':'.$summaryValues[$col][xlCol].$summaryValues[$col][end].')">'.$summaryValues[$col][total].'</td>';
} else {
echo
'>&nbsp;</td>';
}
}

if(!isset(
$column_labels_printed)) {
echo
'No Results.';
}
/*<tr height=17 style='height:12.75pt'>
<td height=17 colspan=2 style='height:12.75pt;mso-ignore:colspan'></td>
<td align=right x:num x:fmla="=SUM(C2:C7)">56308.71</td>
<td align=right x:num x:fmla="=SUM(D2:D7)">446.49</td>
</tr>
<![if supportMisalignedColumns]>
<tr height=0 style='display:none'>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
<td width=64 style='width:48pt'></td>
</tr>
<![endif]>*/
?></table>

</body>

</html>

Code To Generate Excel Documents - Part 1

<?php
header("Content-Type: application/vnd.ms-excel");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
?>

<html>
<head>
<title>Excel Spreadsheet</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="200" border="1" cellspacing="0" cellpadding="2">
<tr align="center" bgcolor="#FFFF00">
<td colspan="2">
<font face="Arial, Helvetica, sans-serif"><strong>Article
</strong> </font>
</td>
</tr>
<tr>
<td width="155" align="right">
<font size="6" face="Times New Roman, Times, serif"><em>Apples:</em></font>
</td>
<td width="31" align="left" bgcolor="#FF9900">
<strong><font color="#FFFFFF">5</font></strong>
</td>
</tr>
<tr>
<td align="right">
<font size="6" face="Times New Roman, Times, serif"><em>Oranges:</em></font>
</td>
<td align="left" bgcolor="#FF9900">
<strong><font color="#FFFFFF">5
</font> </strong>
</td>
</tr>
<tr>
<td align="right">
Total:
</td>
<td align="left" bgcolor="#FF0000">
<font color="#FFFF00" size="5" face="Arial, Helvetica, sans-serif"><strong>=SUM(B2:B3)</strong></font>
</td>
</tr>
</table>
</body>
</html>

function strip attributes

Most website owners realise that using a CMS can be beneficial to their website but very few know what these benefits actually are. Knowing the specific benefits offered by a CMS can help you to better decide which is most suitable for your website.
With the abundance of news and blog (Weblog) sites growing continuously, keeping track of what’s going on (and adding iy to your site) can be a daunting task. Fortunately, standards such as RSS (Really Simple Syndication) provide an easy way to grab content from a particular site and aggregate it into a CMS application. This means that, rather than looking for news yourself, some piece of software monitors sites that you’re interested in and downloads new content as it’s published. Although this can alleviate the problem of adding content to a website, it raises the issue of keeping the article format consistent.
PHP provides some functions to strip unwanted formatting away from a piece of text (strip_tags(), for instance). However, many sources embed formatting information in the form of tag attributes (style, font, etc.). This formatting information is usually embedded in “common” tags, such as P, SPAN,TABLE, etc. Most users will want to keep these tags because they provide the basic text structure but they want to avoid any formatting information (which is most likely provided by a CSS stylesheet). So how can attributes be stripped? The following function allows stripping all attributes from any tag (instead of the whole tag), thus leaving the content structure intact.

===========================================================================

function strip_attributes($msg, $tag, $attr, $suffix = “”)

{


$lengthfirst = 0;
while (strstr(substr($msg, $lengthfirst), “<$tag “) != “”)
{
$tag_start = $lengthfirst + strpos(substr($msg, $lengthfirst), “<$tag “);
$partafterwith = substr($msg, $tag_start);
$img = substr($partafterwith, 0, strpos($partafterwith, “>”) + 1);
$img = str_replace(” =”, “=”, $img);
$out = “<$tag”;
for($i=0; $i < count($attr); $i++)
{
if (empty($attr[$i])) {
continue;
}
$long_val =
(strpos($img, ” “, strpos($img, $attr[$i] . “=”)) === FALSE) ?
strpos($img, “>”, strpos($img, $attr[$i] . “=”)) - (strpos($img, $attr[$i] . “=”) + strlen($attr[$i]) + 1) :
strpos($img, ” “, strpos($img, $attr[$i] . “=”)) - (strpos($img, $attr[$i] . “=”) + strlen($attr[$i]) + 1);
$val = substr($img, strpos($img, $attr[$i] . “=” ) + strlen($attr[$i]) + 1, $long_val);
if (!empty($val)) {
$out .= ” ” . $attr[$i] . “=” . $val;
}
}
if (!empty($suffix)) {
$out .= ” ” . $suffix;
}
$out .= “>”;
$partafter = substr($partafterwith, strpos($partafterwith,”>”) + 1);
$msg = substr($msg, 0, $tag_start). $out. $partafter;
$lengthfirst = $tag_start + 3;
}
return $msg;

}
===========================================================================

The function takes 4 parameters.

1. $msg. The text you want to strip attributes from.
2. $tag. The tag you want to strip attributes fom (p, for instancee).
3. $attr. An array with the name of the attributes you want to strip (leaving the rest intact). If the array is empty, the function will strip all attributes.
4. $suffix. An optional text to append to the tag. It may be a new attribute, for instance.

This function can be used as an article filter, cleaning the articles before storing them into the CMS database. This can also be used to clean user-entered input to prevent the execution of Javascript events (onmouseclick, for instance) or to delete any style or font attributes from the text.
Your Ad Here