Connections/                                                                                        0000755 0023433 0004734 00000000000 11036012526 012704  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 Connections/classifieds-orig.php                                                                    0000644 0023433 0004734 00000001123 11036006767 016653  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/

$hostname_classifieds = 'localhost';   // Hostname of MySQL server
$database_classifieds = 'dbname'; // Database name
$username_classifieds = 'dbusername';    // Username for MySQL
$password_classifieds = 'dbpassword';    // Password for user

//Prefix for the tables
define("PREFIX","class_"); //table prefix

//license key
define("LICENSEKEY", "localhost");
?>                                                                                                                                                                                                                                                                                                                                                                                                                                             Connections/index.htm                                                                               0000644 0023433 0004734 00000000337 11036006770 014534  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <!doctype html public "-//W3C//DTD HTML 4.01//EN">

<html>

   <head>
      <title>Untitled</title>
   </head>

   <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">


   </body>
</html>
                                                                                                                                                                                                                                                                                                 Connections/classifieds.php                                                                         0000644 0023433 0004734 00000001137 11452370534 015720  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/

$hostname_classifieds = 'localhost';   // Hostname of MySQL server
$database_classifieds = 'xemion'; // Database name
$username_classifieds = 'xemion';    // Username for MySQL
$password_classifieds = 'crete9Ta';    // Password for user

//Prefix for the tables
define("PREFIX","dir"); //table prefix

//license key
define("LICENSEKEY", "83-159-65-1126374381-c4ca4238");
?>
                                                                                                                                                                                                                                                                                                                                                                                                                                 add-company.php                                                                                     0000644 0023433 0004734 00000000752 11430262461 013336  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
	require_once('includes/init.php');


$class_tpl->assign("title", "Advertise Your Design Company - More Clients & Leads");
$class_tpl->assign("category", $category);
	$class_tpl->assign('body','add-company.tpl');
	$class_tpl->display('layout.tpl',$page);
?>
                      administration/                                                                                     0000755 0023433 0004734 00000000000 11173341362 013454  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/ajax.php                                                                             0000644 0023433 0004734 00000021744 11051631424 015114  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/cpaint/cpaint2.inc.php');

$cp = new cpaint();
$cp->register('deleteUpload');
$cp->register('subtract');
$cp->register('extra_listing_fields');
$cp->register('extra_search_fields2');
$cp->start();
$cp->return_data();

function deleteUpload($id, $fid)
{
	global $db, $cp;
	$id=(int)$id;
	$fid=(int)$fid;
	$sSQL="SELECT sValue FROM ".PREFIX."products_fields WHERE pID=".$id." AND fID=".$fid;
	$result=$db->query($sSQL);
	$rs=$result->fetch();
	@unlink('../uploads/'.$rs['sValue']);
	$sSQL="DELETE FROM ".PREFIX."products_fields WHERE pID=".$id." AND fID=".$fid;
	$db->query($sSQL);
	$cp->set_id("deleteResponse");
	$cp->set_data();
	return;
}
	/**
	 * Subtract two values
	 */
function subtract($num1, $num2) 
{
	global $cp;
	$cp->set_id("response");
	$total=$num1-$num2;
	if($total<0)
	{
		$total=0;	
	}
	$cp->set_data(FormatCurrency($total));
	return;
}

   /**
    * Gets extra searchable fields
    * @return output or all the extra fields.
    * @access public
    */
function extra_listing_fields($type)
{
	global $db, $cp;
	$optdata="";
	$selected="";
	$defaultValue="";
	$type=(int)$type;
	if($type!="")
	{
		$optdata='<table width="100%" cellpadding="2" cellspacing="2">';
		$sSQL = "SELECT f.fID, f.fOrder FROM `".PREFIX."fields` AS f INNER JOIN ".PREFIX."fields_bindings AS fb ON fb.fieldID = f.fID AND fb.catID = ".$type." ORDER BY fOrder ASC";
		$result2 = $db->query($sSQL);
		$rows=$result2->size();
			if($rows>0)
			{
				while($rs2=$result2->fetch())
				{
					$sql="SELECT fID,fName,fDefault,fType,fRequired,fRange,fRangeValue FROM `".PREFIX."fields` WHERE fID='".$rs2['fID']."' ORDER BY fOrder ASC";
					$result3 = $db->query($sql);
					$row = $result3->fetch();
					#get the user values
					$sql4="SELECT pID,fID,sValue FROM ".PREFIX."products_fields WHERE pID='".$lid."' AND fID='".$rs2['fID']."'";
					$result4 = $db->query($sql4);
					$arow=$result4->fetch();
					if($arow['sValue']<>"")
					{
						$defaultValue=$arow['sValue'];
					}
					else
					{
						$defaultValue=$row['fDefault'];
					}
						if($row['fRequired']=="Y") 
						{
							$star=LANG_STAR;
						}
						else 
						{
							$star="";
						}
							if($row['fType']=="D")
							{
								//it is a select list//
								if($row['fRange']=='Y')
								{
								if($row['fRangeValue']!="0|0|0")
								{
									$fRangeValue=explode("|", $row['fRangeValue']);
									$optdata.="<tr><td align='left' width=\"15%\" nowrap>".$star ." ". $row['fName'].":</td><td align='left' class=\"formright\" width=\"50%\"><select name=\"opt".$row['fID']."\">";
									for ( $counter = $fRangeValue[0]; $counter <= $fRangeValue[1]; $counter += $fRangeValue[2]) 
									{
										if($fRangeValue[0]==$counter)
										{
											$selected=" SELECTED";
										}
										else
										{
											$selected='';
										}
										$optdata.='<option value="'.$counter.'"'.$selected.'>'.$counter.'</option>';
									}
									$optdata.="</select>";
									$optdata.="</td></tr>\n";
								}
								}
								else
								{
								
								$optdata.="<tr><td align='left' width=\"15%\" nowrap>".$star ." ". $row['fName'].":</td><td align='left' class=\"formright\" width=\"50%\"><select name=\"opt".$row['fID']."\">";
								$ssql="SELECT optID,fieldID,optValue,optOrder FROM ".PREFIX."fields_options WHERE fieldID='".$row['fID']."'";
								$resultsets=$db->query($ssql);
								while($opt=$resultsets->fetch())
								{
									if($arow['sValue']==$opt['optValue']) $selected=" SELECTED";
									$optdata.="<option value=\"".$opt['optValue']."\"".$selected.">".$opt['optValue']."</option>\n";
									$selected="";
								}
								$optdata.="</select></td></tr>";
								
								}
							}
							elseif($row['fType']=="P")
							{
								//it is a parent select list//
								$optdata.="<tr><td align='left' width=\"15%\" nowrap>".$row['fName'].":</td><td align='left' class=\"formright\"  width=\"50%\"><select name=\"opt".$row['fID']."\" onChange=\"displayNewSec(this);\">";
								$optdata.="<option value=\"\">". LANG_PLEASE_SELECT ."</option>";
								$ssql="SELECT optID,fieldID,optValue,optOrder FROM ".PREFIX."fields_options WHERE fieldID='".$row['fID']."' ORDER BY optValue";
								$resultsets=$db->query($ssql);
								while($opt=$resultsets->fetch())
								{
									$optdata.="<option value=\"".$opt['optValue']."\">".$opt['optValue']."</option>\n";
								}
								$optdata.="</select></td></tr>";
							}
							elseif($row['fType']=="C")
							{
								//checkbox
								$optdata.="<tr><td align='left' width=\"15%\" nowrap>".$star ." ". $row['fName'].":</td><td align='left' class='formright' width=\"50%\">";
								$ssql="SELECT optID,fieldID,optValue,optOrder FROM ".PREFIX."fields_options WHERE fieldID='".$row['fID']."'";
								$resultsets=$db->query($ssql);
								$selectedOpt=explode(",", $arow['sValue']);
								while($opt=$resultsets->fetch())
								{
									if (in_array($opt['optValue'], $selectedOpt)) 
									{
										$checked=" CHECKED";
									}
									$optdata.="<input type=\"checkbox\" name=\"opt".$row['fID']."[]\" value=\"".$opt['optValue']."\"".$checked." />".$opt['optValue']."<br />\n";
									$checked="";
								}
											$optdata.="</td></tr>\n";
							}
							elseif($row['fType']=="S")
							{
								//single text field
								$optdata.="<tr><td align='left' width=\"15%\" nowrap>".$star ." ". $row['fName'].":</td><td align='left' class='formright' width=\"50%\"><input type=\"text\" name=\"opt".$row['fID']."\" value=\"".$defaultValue."\" /></td></tr>\n";
							}
							elseif($row['fType']=="M")
							{
								//multi text field
								$optdata.="<tr><td align='left' width=\"15%\" nowrap>".$star ." ". $row['fName'].":</td><td align='left' class='formright' width=\"50%\"><textarea name=\"opt".$row['fID']."\" cols=\"35\" rows=\"5\">".$defaultValue."</textarea></td></tr>\n";
							}
							elseif($row['fType']=="F")
							{
								//file upload
								if($arow['sValue']<>"") 
								{
									$rowspan=" rowspan='2'";
								}
								$optdata.="<tr><td align='left'".$rowspan.">".$star ." ". $row['fName'].":</td>";
								if($arow['sValue']<>"") 
								{
									$ext = substr(strrchr($arow['sValue'], "."), 1);
									if($ext=="pdf")
									{
										$icon='<img src="../images/icon_pdf.png" />';	
									}
									elseif($ext=="zip")
									{
										$icon='<img src="../images/icon_zip.png" />';	
									}
									else
									{
										$icon='<img src="../images/icon_page.png" />';
									}
									$optdata.="<td align='left' class='formright'>".$icon ." ".$arow['sValue']."</td>\n";
									$optdata.="<tr><td align='left' class='formright'><input type=\"file\" name=\"opt".$row['fID']."\" onChange=\"checkOneFileUpload(this,'".$row['fExtensions']."',true,'','','','','','','')\"></td></tr>\n";
								}
								else
								{
									$optdata.="<td align='left' class='formright'><input type=\"file\" name=\"opt".$row['fID']."\" onChange=\"checkOneFileUpload(this,'".$row['fExtensions']."',true,'','','','','','','')\"></td></tr>\n";
								}
							}
				}
			}
		$optdata.="</table>";
		$cp->set_id("response");
		$cp->set_data($optdata);
	}
	return;
}
function extra_search_fields2($type)
{
	global $db, $cp;
	$sSQL = "SELECT optSub FROM `".PREFIX."fields_options`WHERE optValue='".mysql_real_escape_string($type)."'";
	$test=$sSQL;
	$result2 = $db->query($sSQL);
	$rows=$result2->size();
		if($rows>0)
		{
			$optdata2='<table width="100%" cellpadding="2" cellspacing="2">';
			while($rs2=$result2->fetch())
			{
				$sql="SELECT fID,fName,fDefault,fType,fRequired FROM `".PREFIX."fields` WHERE fID='".$rs2['optSub']."' ORDER BY fOrder ASC";
				$test.="<br>".$sql;
				$result3 = $db->query($sql);
				$row = $result3->fetch();
						if($row['fType']=="Y")
						{
							//it is a child select list//
							$optdata2.="<tr><td align='left' width=\"25%\">".$row['fName'].":</td><td align='left' class=\"formright\"><select name=\"opt".$row['fID']."\">";
							$optdata2.="<option value=\"\">". LANG_PLEASE_SELECT ."</option>";
							$ssql="SELECT optID,fieldID,optValue,optOrder FROM ".PREFIX."fields_options WHERE fieldID='".$row['fID']."' ORDER BY optValue";
							$resultsets=$db->query($ssql);
							while($opt=$resultsets->fetch())
							{
								$optdata2.="<option value=\"".$opt['optValue']."\">".$opt['optValue']."</option>\n";
							}
							$optdata2.="</select></td></tr>";
						}
						elseif($row['fType']=="S")
						{
							//single text field
							$optdata2.="<tr><td align='left' width=\"15%\" nowrap>".$row['fName'].":</td><td align='left' class='formright' width=\"50%\"><input type=\"text\" name=\"opt".$row['fID']."\" /></td></tr>\n";
						}
			}
				$optdata2.="</table>";
		}
	$cp->set_id("optResponse");
	$cp->set_data($optdata2);
	return;
}
?>                            administration/annual.png                                                                           0000644 0023433 0004734 00000025053 11051631425 015442  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR  X      OG    IDATx{\Te?a*J8Y-/*y+onH%h%XoKj\3l%_*"0%~9<~=9g`0      6! ! ! ߭׷uWתwE͏`8/kJl[Z"  ,jDiᠡZΛމS7D  aWEח-Z&?}g<]/ohl:񫵰2eʃV\ooTn   dJܦ7֕Q"?رӋfT~quuE@" aeɘl<:v_7?JXhL2eʔLBRtVJNN...~<xs|g_~ɓf\zY+˖-?~|jj*!DR744L>  >pӷ
c6{V)2o㌐2hР-[|gǎ3/B^^op?xӧOϟ>}i.\xa++?~~~jڴkll<yիVVV3g,..޾}Unno6  (c9oG?^^0;]bqss`2dNoݺu#G֭/KKKry[[ExxikKK`2Mzmś7o$   }[-]LmnY$ߴ-dn\ܸzu7_~7n!dڴi)))>>>Frtt1H$	YoݺeV͛7

]]]+** ORu8Q۷/w<+?ݽB{oQvzW!;w$B
!$++믿꫄?VVV,X0uT7mtʕDǩS655  0 iivw/iTpw[kqRiyPׯYfSLa/  >!n|FC


|}}  0OPTk[?͑ǩ$_R]gnvٻwoΝ{
 `S"lzTYڶsx).ZꜞVؗZ|yU  LaĿ93:̴̴eV>dj駟NKK#^zĉ1116<SӦM%&ٳV   S}}g4'47NPzΏc90D5{Զٛ)))&Mڸq~x5\>zz  k}Q#fϘLԼ&vlз>O_$B7---b1u #wڕ1z{R'R{	!<6^Oojkk.\hZaƌNQ:UQQL&3= ЭV}9ȃُs󵒮?LCmB_~ڵc^vѣG֭3LmX[[iZ㉝Vj}С[BZQ==GcbqppԖE}^!FtsW FGe3'~;00XiӦp_|qƌs?}p3gnٲeܸqǏ75iҤ˗;yZ[KJJ<x`QS;w<z*xbFFq1L3;[WWtEv޽{n_NIIÇMKa4 >Ov3.^6ُ.:Uܸ7mzXD
`?~;mF[&BD"т:t!999˖-3
ĉVmf+777'''VkٳgSz*4v8***?T~ Fg<O|>sq3'u6NQ~9vOu ltRrrrAA%Kuuu'NXlѣGoN744ݻzY$:t(..cL={C!T5=`̙26"""󃃃?ò2ӳz}xxH$tRlllRRɓ'KJJN8]XXxqWW~ۙ+aVV}||Μ9CQՅ>ٳH$jjj"`XlcLn111"HպuҒlmmMYv-U~ȑ`///BM'T*BHTTTCCRW
O DMMMn:tРAT1K,ikk{w;nݺgRɘ}ΝŋթꐐBH[['xظ[C9ez קo VX1tŋ_t*7nL&;sW_}EM:Ʀuǎ
g&Lkk배0J'77Fikksrrrssxxxd{nĈkfffDDDKKKPP5 ̍=oM9bcc3={EEEuu+-ROR9rH]Ǐ߽{wDD֭[=<<	!'NTTN
		VejjX,

VbN4:::10Ms}mtG?CPPСC^|Ŏ{u:Vcƌ1-/))qtt4~aJJJD"wijj	 dH ,[frssj @$B }  @  !  !  !  !  !  ?ܻwfw޽qFo{w566^~;)o f͚:y{Q˗/W*-rssˣ
zK/8w6_GEETRtuuuuuuppDP!  OSL!DFF:::{AB>?slj[ә}޳>?ɓIII}5k֌?~ݺuv:tnݺ  PYU__OmSYbmmmooOm9rdʕgϞuVOfPz'̾ZhΚ5Z$i4QFBVZuB=J}UMYYJdZV8;;1  illKII:u*U>}!33ʔQFyxxx{{;w.&&f5ܸq#,,յD9>#Tׯ_v횿RR|޽eeeeee/lo  ,Y$<<ܘ$\{nmɒ%ɧN3a׮]~~~~#G,Z!pswQ\\BVZP(
Űaè\\\.^(J+**nܸa<_e  ~{%''wܕtOرߟ2|D8;;_~Ʀ',))[ZZ<==gRv=7766ٳ'%%YYYӓRYY)J	!RB}?8(ԬY*  }?#G=zd,>%ϟwppv^paĉ999...kϟ0a¨Qlmm\s;;;cm׿|}}Lg3/A-[<x2hРf|ذa=2Mc  jaaammM3gNbb"!$88B:tۛr/vvv;v&̚5kӦMKKK{7Ǐ_XXG͞=?""_;DoTUU~X~O^ҡ 6LfV^ZZH=h\&QiLuC'|siBt>--ˋ*T*鑑iiiJҬN 8Ύt!G뻊GtWm,>\$QsNBSO=%mllө[*##5#  F"0
k,SRR"^ZV&YZZDt U#dю\\\:ZZZvZNG   D%=B  dվJ h]_5>,4ns6"C  wIG @X$B Kp: g,a;_ ,o # ˛Dٙ;  q6bi^'  lE"lGK  xM"6  }`y9;s ;X, wH|	 >I_ ,o!gg  | v8{  /a GDx޽cǚtR\nee}!EK  x=Κ5Z$i4QFBT*L&jٹB# Q@k?Ӕ)S!!dҥ
"222999;;;99BBȥK!r~ E!v}aq;>FD@+,H*..5Z&nݺB#/a GeٓBXYY)J	!RBj.Gc  B{LXdIxxԩS{]g v>oX[[oذX"H***RiEESW
x
g  q6D'>}ڴPTGFF)n
 @Xڟ>|H$&ܹD"0}}¬v (ӒћXMD">#|A1cjZLfiiMgg  | ;@Fbii8^'  l @X$B @X$B Kp: g,a;_ ,o # ˛Dٙ;  q6bi^'  lE"lGK  xM"6  }`y9;s ;X, wH|	 >I_ ,o!gg  | v8{  /a G7PK  xM" 8`Ҩ^4+6Lu:]ii\.2	 8`H"ܷo͛


<==UV?~Z>z3<C)++ST2Lj4gggz @Xa@@@ffܹs;gӒ䄄dӽ_ ,p	*aÆQ%FVBBCCnjv<gg  | ;@F;eoo嬬lFC-VVVJRBT*-//'\tGt `C"d|@mlٲEV<xwO6  }`Y~}"  ԶD"JNNNBa<RK  xe'޿ȑ4///PTGFF)JS8;s ;4z/T*bq}}Mzz:ud||JJMM0	 8`If:*))f/zV+L߲`  ;+e]_CbBv}&=B/a G5
  tau ;X$v  }`y @X$B Kp: g,a;_ ,o # ˛Dٙ;  q6bi^'  lE"lGK  xM"6  }`y9;s ;X, wH|	 >I_ ,o!gg  | v8{  /a GD---MKt:]ii\.꾐"%l  <Ҟ۷y梢OOOLRd2Vh*4 8`Y06/:tܹDtRBU!!ҥK\Nk? "`^;>VиUxkD"ag&LXhj5!$44t֭	|	 ><,SYY)J	!RBj.Gc  g v >!H***RiEESW
x
g  q6DT*###ҔJe7F_ ,O<x066>((/$)!H222L_0+$)=B  }j慨>FH@+'®zV+L_ﴐJ>}
  @U7^Xh2F	!...SH6  q6DS_ ,o_s ,o!gg  | v8{  /a G7PK  xM" 8`4g  q6"#%l  <&
|	 >I g,Fu ;X$v @X$B/a G73w  lh;N  | D؎ # ˛D(%l  <&rv w|iTSBNWZZ*˭̎u ;؁WZuqjUѣ<!LRd2VhMO6  }`YݻwΜ9%ё			ɦ{ @XaAAB6lUhj5!$44t֭fsv wyiYYYӓRYY)J	!Rr%BH^^!D.U |eZ}=EK  xeӧOSB*VTT899B
H/a GDx#GBҼBRT*N 8`ҨR666Ta||JJMM0;	 8`r"KJJb˂cƌj2-{ # =B/a G5
  tyi8{  /a G7PK  xM" 8`4g  q6"#%l  <&
|	 >I ]lkkkYY٘1cNICCݻwǎ]h;}Nwqvv:1`>/Hlyy:vD"1ݛ[oUWW;vl]vDha0h/Źwܙ7oSyyɓ'/e1|@wVބDS_GuM2%"""%%%''g:~ꄄ
aooߋo_/]lBXbŞ={w߽t0|wԿ慨^zEDRYYTX
BZrիW;-	Hԋo	zqٳgG}?O999;Nw 19ɪ}d,E#G>Mt~;vؔ7tU#lwKw޵y葍MEEOܰ9uLO4$&&f޼yNDN_s1=we bw gu.t{G~!5H$f,_\R<866i!x{D"ihhW`>/T7cƌgϮXȑ#*DL4ѱuĉ'Nx饗7w3Ȑ:  	IDATcǎ-Y/f~u`>/T;gΜÇWWW<y$>>~ÆjoyԩS_yjoE=,#{q.cuu_|a crRa{WI[[[yySwVVVZYY9w̅M"{6VfZ0|x{`=Bn-tR\neee/K*9Y b\cȽ:p(T*Lj5^ g^LNNNHHHNN6 wKFVBBCCn8~Ǹ`u;:{:9+++ϥJdCiiY	O>Jw gu;zH:tӁ#ո꾴m:nꫯġD}oR|w gu;t}D"ɉP({MMao]z0|[g>suưzMJezz:!$--MT  PO>!H222^   fcƌMIIzj?fk׮WU=uݏ?璓<xbصo߾vt˗8|yև#JKKKKKÇcdCCCyy۷o\SSP(nݺJصiӦę3g2?쳅keeeNfe:www<y7nrڵ'N<?~v#`}=fn޼iccVvV!!!7ҒVU*UPPP}}=		ihhؾ}mm-cMyyyEDDdff&%%0ֺo08h"dF.SϜ9p(Gv;{[3~WRRR̙V\]]Z-^pBX'O|JeZZ/!D.3:R]]][[k\޽RSScmmnݺe˖egg3Ӻ^ooo_PP駟2bEEŖ-[Ν;H/,,.cT*O&[y 131|---UUUpuu=tcMR2lڵ^^^u 88866`0.^%m۶_fѹs.Zĉ
֍ZZZz%fqqq{HLLT*+V`u3gn߾yև0fee544r1jkk
̙3W^}9&Dm'&&^zS|lmmUT---ԏΝguPZZe3ijjJJJaaa999L6m۶e˖Qۻv튎>uؽ{7%`1<Nݴ^YYm6<jupp0[[S7MYr%zQPSSckk\0**jʕJrL^PPDm'%%//^p!55x;|ڵ{a111+VhiiYzouu5cwyW^-n޼|Cmmܹs[MEEE111EEE4G0xoooe^^^&M={6󩨵544tѢEUUUҲdD2bĈ+V0?ϟ?ݽCee%͞=;,,ۻ[ZZ֮]+H\]]ׯ_'??L]]ݙ3gJ%0b/vc`&Bm6[?r[\ut	R*++FgΜ9~8JOO?p`oye2Yjj*V4i0bl{oU<>} @2}5kP?ZiÆw$$$d|)NW[[[UUV_|E88  F^^^mm1~'/^b?OUUYÇ555C1bĈ#RRR}Y#H  =9d:;2?;Sr X1uTiӦ?͛YYY3w:thx8qƠٳg7662zO!  ]_nkkp
4i&[[_=<<^xVZ|H   hX  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  AC"  Aϯ%PG    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     administration/benchmark.php                                                                        0000644 0023433 0004734 00000002745 11051631425 016124  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
error_reporting(E_ALL);
@define("APP_JPGRAPH_PATH", FILESYSTEM_PATH . "includes/classes/jpgraph/");
include_once(APP_JPGRAPH_PATH . "jpgraph.php");
include_once(APP_JPGRAPH_PATH . "jpgraph_pie.php");

$font = FF_FONT1;

$stats = unserialize(base64_decode($HTTP_POST_VARS["encoded_stats"]));
$labels = array();
$data = array();
foreach ($stats as $point) {
    if ($point["name"] != "Start") {
        $labels[] = $point["name"] . " (" . $point["diff"] . ")";
        $data[] = (float) $point["diff"];
    }
}

// A new graph
$graph = new PieGraph(750, 500, "auto");

// Setup title
$graph->title->Set("Benchmark Results");
$graph->title->SetFont($font, FS_BOLD, 12);

// The pie plot
$p1 = new PiePlot($data);
$p1->SetTheme('pastel');

// Move center of pie to the left to make better room
// for the legend
$p1->SetCenter(0.26,0.55);

// Label font and color setup
$p1->SetFont($font, FS_BOLD);
$p1->SetFontColor("black");

// Use absolute values (type==1)
$p1->SetLabelType(1);

// Label format
$p1->SetLabelFormat("%.5f");

// Size of pie in fraction of the width of the graph
$p1->SetSize(0.3);

// Legends
$p1->SetLegends($labels);
$graph->legend->SetFont($font);
$graph->legend->Pos(0.06,0.10);

$graph->Add($p1);
$graph->Stroke();
?>
                           administration/cache/                                                                               0000755 0023433 0004734 00000000000 11036006023 014505  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/cache/c82285bdb00383c7d56baa6b30fe882c                                               0000644 0023433 0004734 00000015704 11051631427 021101  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 O:9:"MagpieRSS":23:{s:6:"parser";i:0;s:12:"current_item";a:0:{}s:5:"items";a:3:{i:0;a:11:{s:5:"title";s:31:"68 Classifieds Holiday Schedule";s:4:"link";s:70:"http://www.68classifieds.com/forums/showthread.php?t=2117&goto=newpost";s:7:"pubdate";s:29:"Mon, 18 Dec 2006 13:33:48 GMT";s:11:"description";s:149:"First off I want to wish every one a Merry Christmas and happy holidays.

Our offices will be closed December 22nd through January 2nd. 

Although...";s:7:"content";a:1:{s:7:"encoded";s:331:"<!-- BEGIN TEMPLATE: postbit_external -->
<div>First off I want to wish every one a Merry Christmas and happy holidays.<br />
<br />
Our offices will be closed December 22nd through January 2nd. <br />
<br />
Although the offices will be closed we will be checking in occasionally.</div>


<!-- END TEMPLATE: postbit_external -->";}s:8:"category";s:20:"News & Announcements";s:2:"dc";a:1:{s:7:"creator";s:6:"suzkaw";}s:4:"guid";s:57:"http://www.68classifieds.com/forums/showthread.php?t=2117";s:7:"summary";s:149:"First off I want to wish every one a Merry Christmas and happy holidays.

Our offices will be closed December 22nd through January 2nd. 

Although...";s:12:"atom_content";s:331:"<!-- BEGIN TEMPLATE: postbit_external -->
<div>First off I want to wish every one a Merry Christmas and happy holidays.<br />
<br />
Our offices will be closed December 22nd through January 2nd. <br />
<br />
Although the offices will be closed we will be checking in occasionally.</div>


<!-- END TEMPLATE: postbit_external -->";s:14:"date_timestamp";i:1166448828;}i:1;a:11:{s:5:"title";s:23:"v3.1.5b is now released";s:4:"link";s:70:"http://www.68classifieds.com/forums/showthread.php?t=2029&goto=newpost";s:7:"pubdate";s:29:"Thu, 30 Nov 2006 16:19:45 GMT";s:11:"description";s:149:"Version 3.1.5b is now released and available from the members section: 
https://www.68classifieds.com/members/index.php

This is a bug fix release...";s:7:"content";a:1:{s:7:"encoded";s:528:"<!-- BEGIN TEMPLATE: postbit_external -->
<div>Version 3.1.5b is now released and available from the members section: <br />
<a href="https://www.68classifieds.com/members/index.php" target="_blank">https://www.68classifieds.com/members/index.php</a><br />
<br />
This is a bug fix release and the only changed files are:<br />
contact.php<br />
contactus.php<br />
friendmail.php<br />
<br />
It is recommended that everyone upgrade and at the very minimum replace those files.</div>


<!-- END TEMPLATE: postbit_external -->";}s:8:"category";s:20:"News & Announcements";s:2:"dc";a:1:{s:7:"creator";s:6:"suzkaw";}s:4:"guid";s:57:"http://www.68classifieds.com/forums/showthread.php?t=2029";s:7:"summary";s:149:"Version 3.1.5b is now released and available from the members section: 
https://www.68classifieds.com/members/index.php

This is a bug fix release...";s:12:"atom_content";s:528:"<!-- BEGIN TEMPLATE: postbit_external -->
<div>Version 3.1.5b is now released and available from the members section: <br />
<a href="https://www.68classifieds.com/members/index.php" target="_blank">https://www.68classifieds.com/members/index.php</a><br />
<br />
This is a bug fix release and the only changed files are:<br />
contact.php<br />
contactus.php<br />
friendmail.php<br />
<br />
It is recommended that everyone upgrade and at the very minimum replace those files.</div>


<!-- END TEMPLATE: postbit_external -->";s:14:"date_timestamp";i:1164903585;}i:2;a:11:{s:5:"title";s:18:"Google Code Search";s:4:"link";s:70:"http://www.68classifieds.com/forums/showthread.php?t=1971&goto=newpost";s:7:"pubdate";s:29:"Mon, 20 Nov 2006 13:54:13 GMT";s:11:"description";s:148:"With Google's new code search it is possible for them to index all the files that are in zip format and stored on your server.  This means if you...";s:7:"content";a:1:{s:7:"encoded";s:773:"<!-- BEGIN TEMPLATE: postbit_external -->
<div>With Google's new code search it is possible for them to index all the files that are in zip format and stored on your server.  This means if you have a compressed site backup stored on your server that includes the connections file then someone could search and possible find this file with your database connection. <br />
<br />
To avoid this please remove any compressed files.  Also it will not be possible for them to read the contents of the connections/classifieds.php used in our system because it is processed by php before it is shown to the browser.<br />
<br />
Also please note that is not explicitly for 68 Classifieds but any type of script you may be running.</div>


<!-- END TEMPLATE: postbit_external -->";}s:8:"category";s:20:"News & Announcements";s:2:"dc";a:1:{s:7:"creator";s:6:"suzkaw";}s:4:"guid";s:57:"http://www.68classifieds.com/forums/showthread.php?t=1971";s:7:"summary";s:148:"With Google's new code search it is possible for them to index all the files that are in zip format and stored on your server.  This means if you...";s:12:"atom_content";s:773:"<!-- BEGIN TEMPLATE: postbit_external -->
<div>With Google's new code search it is possible for them to index all the files that are in zip format and stored on your server.  This means if you have a compressed site backup stored on your server that includes the connections file then someone could search and possible find this file with your database connection. <br />
<br />
To avoid this please remove any compressed files.  Also it will not be possible for them to read the contents of the connections/classifieds.php used in our system because it is processed by php before it is shown to the browser.<br />
<br />
Also please note that is not explicitly for 68 Classifieds but any type of script you may be running.</div>


<!-- END TEMPLATE: postbit_external -->";s:14:"date_timestamp";i:1164030853;}}s:7:"channel";a:8:{s:5:"title";s:44:"68 Classifieds Forums - News & Announcements";s:4:"link";s:35:"http://www.68classifieds.com/forums";s:11:"description";s:32:"Important news and announcements";s:8:"language";s:2:"en";s:13:"lastbuilddate";s:29:"Wed, 20 Dec 2006 21:14:26 GMT";s:9:"generator";s:9:"vBulletin";s:3:"ttl";s:2:"60";s:7:"tagline";s:32:"Important news and announcements";}s:9:"textinput";a:0:{}s:5:"image";a:3:{s:3:"url";s:65:"http://www.68classifieds.com/forums/images/bluesaint/misc/rss.jpg";s:5:"title";s:44:"68 Classifieds Forums - News & Announcements";s:4:"link";s:35:"http://www.68classifieds.com/forums";}s:9:"feed_type";s:3:"RSS";s:12:"feed_version";s:3:"2.0";s:8:"encoding";s:10:"ISO-8859-1";s:16:"_source_encoding";s:0:"";s:5:"ERROR";s:0:"";s:7:"WARNING";s:0:"";s:19:"_CONTENT_CONSTRUCTS";a:6:{i:0;s:7:"content";i:1;s:7:"summary";i:2;s:4:"info";i:3;s:5:"title";i:4;s:7:"tagline";i:5;s:9:"copyright";}s:16:"_KNOWN_ENCODINGS";a:3:{i:0;s:5:"UTF-8";i:1;s:8:"US-ASCII";i:2;s:10:"ISO-8859-1";}s:5:"stack";a:0:{}s:9:"inchannel";b:0;s:6:"initem";b:0;s:9:"incontent";b:0;s:11:"intextinput";b:0;s:7:"inimage";b:0;s:17:"current_namespace";b:0;s:13:"last_modified";s:31:"Wed, 20 Dec 2006 21:14:26 GMT
";s:4:"etag";s:36:""bfe70a0666788ceb49c3e76e52f4bd58"
";}                                                            administration/cache/index.htm                                                                      0000644 0023433 0004734 00000000337 11051631427 016342  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <!doctype html public "-//W3C//DTD HTML 4.01//EN">

<html>

   <head>
      <title>Untitled</title>
   </head>

   <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">


   </body>
</html>
                                                                                                                                                                                                                                                                                                 administration/category.php                                                                         0000644 0023433 0004734 00000016604 11051631431 016003  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
	require_once('includes/init.php');
	require_once(FILESYSTEM_PATH .'includes/classes/kernel/Categories.php');
	require_once(FILESYSTEM_PATH .'includes/classes/images/class_upload.php');
	require_once(FILESYSTEM_PATH .'includes/classes/images/class_resize.php');

	$Categories = new Categories;
	if($_SESSION['admin_category']!="Y")
	{
		$class_tpl->assign('body','notallowed.tpl');
		$class_tpl->displayTemplate();
		die;
	}
	//they have selected to delete the image
	if ((isset($_GET['catimage'])) && ($_GET['catimage'] != "")) 
	{
		$listingid=(int)$_GET['catimage'];
		if($Categories->removeCatImage($listingid))
		{
			//sucessfull
			$class_tpl->assign('success',TRUE);
		}
		else
		{
			//not successfull
			$class_tpl->assign('success',FALSE);
		}
	}
	// they have selected delete
	if(isset($_POST["action"]) && $_POST["action"] == "delete" && isset($_POST["id"])) 
	{
		$id=(int)trim(@$_POST['id']);
		$newid=(int)trim(@$_POST['parent_id']);
		$sSQL = "UPDATE ".PREFIX."listings SET section=".$newid." WHERE section=".$id;
		$db->query($sSQL);
		$sSQL = "DELETE FROM ".PREFIX."categories WHERE id=".$id." LIMIT 1";
		$db->query($sSQL);
		if(!$db->isError()) 
		{
			//sucessfull
			$Categories->removeCatImage($id);
			$location="category.php";
			$class_tpl->assign('title',LANG_FORWARD_SUCESS);
			$class_tpl->assign('forward',TRUE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
		else
		{
			//not successfull
			$location="category.php";
			$class_tpl->assign('title',LANG_FORWARD_ERROR);
			$class_tpl->assign('forward',FALSE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
	}
	// they have selected delete
	elseif(isset($_REQUEST["action"]) && $_REQUEST["action"] == "deletecat" && isset($_REQUEST["id"])) 
	{
		$id=(int)trim(@$_REQUEST['id']);
		$tree=$Categories->getAdminCatTree("", 0);
		$class_tpl->assign("getcats", $tree);
		$class_tpl->assign('action','delete');
		$class_tpl->assign('id', $id);
		$class_tpl->assign('body','category/category_delete.tpl');
	}
	// they have selected modify
	elseif(isset($_POST["action"]) && $_POST["action"] == "modifycat" && isset($_POST["id"])) 
	{
		$id=(int)trim(@$_POST['id']);
		if(isset($_GET['upload']) && @$_FILES['image']['name']<>"")
		{
		     //first remove the original
			$Categories->removeCatImage($id);
			//now upload the new
			#$DMX_debug = true; //uncomment for debugging
			$ppu = new pureFileUpload();
			$ppu->path = "../catimages";
			$ppu->extensions = "GIF,JPG,JPEG,BMP,PNG";
			$ppu->formName = "mainform";
			$ppu->storeType = "file";
			$ppu->sizeLimit = "";
			$ppu->nameConflict = "uniq";
			$ppu->requireUpload = "false";
			$ppu->minWidth = "";
			$ppu->minHeight = "";
			$ppu->maxWidth = "400";
			$ppu->maxHeight = "";
			$ppu->saveWidth = "";
			$ppu->saveHeight = "";
			$ppu->timeout = "600";
			$ppu->progressBar = "";
			$ppu->progressWidth = "300";
			$ppu->progressHeight = "100";
			$ppu->checkVersion("2.1.2");
			$ppu->doUpload();
		}
		if(@$_POST['image']=="")
		{
			$sSQL="SELECT image FROM ".PREFIX."categories WHERE id=".$id;
			$result=$db->query($sSQL);
			$rs=$result->fetch();
			$image=$rs['image'];
		}
		else
		{
		     $image=$_POST['image'];
		}
		$data['id']=$_POST['id'];
		$data['parent_id']=$_POST['parent_id'];
		$data['name']=$_POST['name'];
		$data['slug']=$_POST['slug'];
		$data['description']=$_POST['description'];
		$data['image']=$_POST['image'];
		$data['allowads']=$_POST['allowads'];
		$data['display']=$_POST['display'];
		$data['cKeywords']=$_POST['cKeywords'];
		$data['cLink']=$_POST['cLink'];
		$data['cOrder']=$_POST['cOrder'];
		$data['cPromo']=$_POST['cPromo'];
		$data['image']=$image;
			if($Categories->editCategory($data)) 
			{
				//sucessfull
				$location="category.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//not successfull
				$location="category.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	// they have selected add page
	elseif(isset($_POST["action"]) && $_POST["action"] == "addcat") 
	{
		if(isset($_GET['upload']) && @$_FILES['image']['name']<>"")
		{
			//now upload the new
			#$DMX_debug = true; //uncomment for debugging
			$ppu = new pureFileUpload();
			$ppu->path = "../catimages";
			$ppu->extensions = "GIF,JPG,JPEG,BMP,PNG";
			$ppu->formName = "mainform";
			$ppu->storeType = "file";
			$ppu->sizeLimit = "";
			$ppu->nameConflict = "uniq";
			$ppu->requireUpload = "false";
			$ppu->minWidth = "";
			$ppu->minHeight = "";
			$ppu->maxWidth = "400";
			$ppu->maxHeight = "";
			$ppu->saveWidth = "";
			$ppu->saveHeight = "";
			$ppu->timeout = "600";
			$ppu->progressBar = "";
			$ppu->progressWidth = "300";
			$ppu->progressHeight = "100";
			$ppu->checkVersion("2.1.2");
			$ppu->doUpload();
		}
		$data['parent_id']=$_POST['parent_id'];
		$data['name']=$_POST['name'];
		$data['slug']=$_POST['slug'];
		$data['description']=$_POST['description'];
		$data['image']=$_POST['image'];
		$data['allowads']=$_POST['allowads'];
		$data['display']=$_POST['display'];
		$data['cKeywords']=$_POST['cKeywords'];
		$data['cLink']=$_POST['cLink'];
		$data['cOrder']=$_POST['cOrder'];
		$data['cPromo']=$_POST['cPromo'];
			if($Categories->addCategory($data)) 
			{
				//sucessfull
				$location="category.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//not successfull
				$location="category.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	// they have selected to add new page
	elseif(isset($_REQUEST["action"]) && $_REQUEST["action"] == "addnew") 
	{
		$tree=$Categories->getAdminCatTree("", 0);
		$class_tpl->assign("getcats", $tree);
		$class_tpl->assign('action','addcat');
		$class_tpl->assign('body','category/category_form.tpl');
	}
	// they have selected to modify a category
	elseif(isset($_REQUEST["action"]) && $_REQUEST["action"] == "modify" && isset($_REQUEST["id"])) 
	{
		$Categories->getCategoryById(@$_REQUEST['id']);
		$class_tpl->assign('action','modifycat');
		$tree=$Categories->getAdminCatTree("", 0);
		$class_tpl->assign("getcats", $tree);
		$class_tpl->assign('body','category/category_form.tpl');
	}
	// they have selected to duplicate a category
	elseif(isset($_REQUEST["action"]) && $_REQUEST["action"] == "duplicate" && isset($_REQUEST["id"])) 
	{
		$Categories->getCategoryById(@$_REQUEST['id']);
		$class_tpl->assign('action','addcat');
		$tree=$Categories->getAdminCatTree("", 0);
		$class_tpl->assign("getcats", $tree);
		$class_tpl->assign('body','category/category_form.tpl');
	}
	else
	{
		$tree=$Categories->getAdminCatTree("", 0, TRUE);
		$class_tpl->assign("results", $tree);
		$class_tpl->assign('body', 'category/category_browse.tpl');
	}
$class_tpl->displayTemplate();
?>                                                                                                                            administration/coupons.php                                                                          0000644 0023433 0004734 00000015175 11051631432 015657  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Users.php');
$Users= new Users;
if($_SESSION['admin_payment']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}

	if(isset($_POST["act"]) && $_POST["act"] == "delete" && isset($_POST["id"]) && $_POST['id']<>"") 
	{
		//delete the coupon
		$id=(int)trim(@$_POST['id']);
		$sSQL = sprintf("DELETE FROM ".PREFIX."coupon WHERE cID=%s LIMIT 1",$id);
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$location="coupons.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//not successfull
				$location="coupons.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	elseif(isset($_POST["act"]) && $_POST["act"] == "modifycoupon" && isset($_POST["id"])) 
	{
		// they have selected modify
		$group='';
		$id=(int)trim(@$_POST['id']);
		$groups=@$_POST['groups'];
		$total = count($groups);
		$i=1;
		if(is_array($groups))
		{
			foreach($groups as $groubObj)
			{
			     if($i==$total)
				{
					$group .= $groubObj;
				}
				else
				{
					$group .= $groubObj.",";
				}
				$i++;
			}
		}
		$sSQL = sprintf("UPDATE ".PREFIX."coupon SET cCoupon=%s, cName=%s, cNumber=%s, cEndDate=%s, cDiscount=%s, cType=%s, cNumAvailable=%s, cGroup=%s, cUserID=%s WHERE cID=%s",
					GetSQLValueString($_POST['cCoupon'], "text"),
					GetSQLValueString($_POST['cName'], "text"),
					GetSQLValueString($_POST['cNumber'], "text"),
					GetSQLValueString($_POST['cEndDate'], "text"),
					GetSQLValueString($_POST['cDiscount'], "text"),
					GetSQLValueString($_POST['cType'], "text"),
					GetSQLValueString($_POST['cNumAvailable'], "text"),
					GetSQLValueString($group, "text"),
					GetSQLValueString($_POST['cUserID'], "int"),
					GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$location="coupons.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//not successfull
				$location="coupons.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	elseif(isset($_POST["act"]) && $_POST["act"] == "insertnew") 
	{
		//insert a new coupon
		$group='';
		$groups=@$_POST['groups'];
		$total = count($groups);
		$i=1;
		if(is_array($groups))
		{
			foreach($groups as $groubObj)
			{
			     if($i==$total)
				{
					$group .= $groubObj;
				}else
				{
					$group .= $groubObj.",";
				}
				$i++;
			}
		}
		$sSQL = sprintf("INSERT INTO ".PREFIX."coupon (cName,cCoupon,cNumber,cEndDate,cDiscount,cType,cNumAvailable,cGroup,cUserID) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s)",
					GetSQLValueString($_POST['cName'], "text"),
					GetSQLValueString($_POST['cCoupon'], "text"),
					GetSQLValueString($_POST['cNumber'], "text"),
					GetSQLValueString($_POST['cEndDate'], "text"),
					GetSQLValueString($_POST['cDiscount'], "text"),
					GetSQLValueString($_POST['cType'], "text"),
					GetSQLValueString($_POST['cNumAvailable'], "text"),
					GetSQLValueString($group, "text"),
					GetSQLValueString($_POST['cUserID'], "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$location="coupons.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				 $class_tpl->assign('forward',TRUE);
				 $class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//not successfull
				$location="coupons.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	elseif(isset($_REQUEST["act"]) && $_REQUEST["act"] == "modify" && isset($_REQUEST["id"])) 
	{
		//show the modify page
		$id=(int)trim(@$_REQUEST['id']);
		$sSQL=sprintf("SELECT cID,cCoupon,cName,cNumber,cEndDate,cDiscount,cType,cNumAvailable,cGroup,cUserID FROM ".PREFIX."coupon WHERE cID=%s", $id);
		$result=$db->query($sSQL);
		$rs=$result->fetch();
		$cGroup=explode(",", $rs['cGroup']);
		$class_tpl->assign('act', 'modifycoupon');
		$class_tpl->assign('cID', $rs['cID']);
		$class_tpl->assign('cCoupon', $rs['cCoupon']);
		$class_tpl->assign('cName', $rs['cName']);
		$class_tpl->assign('cNumber', $rs['cNumber']);
		$class_tpl->assign('cEndDate', $rs['cEndDate']);
		$class_tpl->assign('cDiscount', $rs['cDiscount']);
		$class_tpl->assign('cType', $rs['cType']);
		$class_tpl->assign('cNumAvailable', $rs['cNumAvailable']);
		$class_tpl->assign('cUserID', $rs['cUserID']);
          
		//now the user groups
		$sSQL="SELECT uGroupID, uTitle FROM ".PREFIX."user_groups ORDER BY uGroupID";
		$result=$db->query($sSQL);
		$getgroups=array();
		while($rs=$result->fetch())
		{
			if(in_array($rs['uGroupID'], $cGroup))
			{
				$rs['selected']="Y";
			}
			$rs['uTitle']=safeStripSlashes($rs['uTitle']);
			$getgroups[]=$rs;
		}
		$class_tpl->assign('getgroups', $getgroups);
		$Users->getAllUsersForSelect();
		$class_tpl->assign('body','coupons/couponsform.tpl');
	}
	elseif(isset($_REQUEST["act"]) && $_REQUEST["act"] == "addnew") 
	{
		//show the coupon form so they can add a new one
		$class_tpl->assign('act','insertnew');
		//now the user groups
		$sSQL="SELECT uGroupID, uTitle FROM ".PREFIX."user_groups ORDER BY uGroupID DESC";
		$result=$db->query($sSQL);
		$getgroups=array();
		while($rs=$result->fetch())
		{
			$rs['uTitle']=safeStripSlashes($rs['uTitle']);
			$getgroups[]=$rs;
		}
		$class_tpl->assign('getgroups', $getgroups);
		$Users->getAllUsersForSelect();
		$class_tpl->assign('body','coupons/couponsform.tpl');
	}
	else
	{
		// final else show all the coupons
		$sSQL="SELECT cID,cCoupon,cName,cNumber,cEndDate,cDiscount,cType,cNumAvailable FROM ".PREFIX."coupon ORDER BY cEndDate DESC";
		$result=$db->query($sSQL);
		$results = array();
		$i=0;
		while($rs=$result->fetch())
		{
			$results[] = $rs;
		}
		$class_tpl->assign('results', $results);
		$class_tpl->assign('body','coupons/coupons.tpl');
     }
$class_tpl->displayTemplate();
?>                                                                                                                                                                                                                                                                                                                                                                                                   administration/csv.php                                                                              0000644 0023433 0004734 00000002540 11051631433 014755  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Pagination.php');
require_once('../includes/classes/kernel/Users.php');
$Users= new Users;
require_once 'Spreadsheet/Excel/Writer.php';

// Creating a workbook
$workbook = new Spreadsheet_Excel_Writer();

	// sending HTTP headers
	$format_title =& $workbook->addFormat();
	$format_title->setBold();
	$format_title->setColor('black');
	$format_title->setPattern(2);
	$format_title->setFgColor('silver');
	// let's merge
	$format_title->setAlign('merge');

	// Creating a worksheet
	$worksheet =& $workbook->addWorksheet('Classified Users');
	
	//now the headings
	$list=$Users->getAllUsers($options, $current_row, TRUE);
	$i=0;
	foreach ($list['list'][0] as $key => $value) {
		//echo $key."<BR>";
		$worksheet->write(0, $i, ucwords($key), $format_title);
		$i++;
	}
	//now the users
	$i=1;
	$next=0;
	foreach ($list['list'] as $v1) {
		foreach ($v1 as $key => $value) {
			//echo "$key $value\n";
			$worksheet->write($i, $next, $value);
			$next++;
		}
		$next=0;
		$i++;
	}	
	$workbook->send('users.xls');

// Let's send the file
$workbook->close();
?>                                                                                                                                                                administration/documentation/                                                                       0000755 0023433 0004734 00000000000 11036006043 016315  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/documentation/english.php                                                            0000644 0023433 0004734 00000011546 11051631434 020473  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/

// Main Settings //
define("DOC_TITLE", "The title of your site. This will appear in the browser's title bar.");
define("DOC_KEYWORDS", "The keywords for your site.");
define("DOC_SMTP", "Would you like to use a smtp server to send email? If not then php's mail() function will be used.");
define("DOC_SMTP_SERVER", "If you selected yes above then please enter the SMTP server.");
define("DOC_SMTP_USERNAME", "The username to login to the smtp server.");
define("DOC_SMTP_PASSWORD", "The password to login to the smtp server. This can be blank depending on your setup.");
define("DOC_SMTP_PORT", "The port number of the smtp server.  If blank the default will be used.");
define("DOC_HTML_EDITOR", "Would you like to enable the TinyMCE text editor for the page templates?");
define("DOC_SITE_TEMPLATE", "Please select the site template.");
define("DOC_EMAIL_VALIDATION", "Do you want to require users to validate their emails before they become registered? If not, then they are automatically registered.");
define("DOC_CAT_TOTAL", 'Do you want to enable the category listing total?  This is used when viewing the categories. For example it would display My Category (4) where 4 is the total listings in that category and its child categories.');

// User View Settings //
define("DOC_USER_VIEW", "Please Note: These settings define what is available to be seen by people browsing your site.  Some of these settings can be overridden through the usergroups. So please check in both places.");
define("DOC_USER_CAPABILITIES", "Please Note: By unchecking these checkboxes it will make the individual tabs unavailable.");

// Category //
define("DOC_CATEGORY_SLUG", "The category slug is a unique name given to this category.  When entered, it is used as the query string in the address in place of the category ID.");
define("DOC_CATEGORY_KEYWORDS", "These are category specific keywords. If none are entered the default site keywords will be used.");
define("DOC_CATEGORY_WEIGHT", "All categories are sorted alphabetically but you can override this by using a weight.  The higher the weight the sooner the category will appear.");
define("DOC_CATEGORY_PROMO", "Any text entered here will be displayed on that category's page. You can enter text or html.");
define("DOC_CATEGORY_LINK", "Entering a URL here will cause anyone clicking the category link to be redirected to that URL. Please note: this prevents the placing of ads within this category.");

// Extra Fields //
define("DOC_MIN_MAX_STEP", "These range values are used to create two select boxes.<br><br>The min is the minimum number to start with. <br> The max is the maximum number. <br> The step is how much the numbers increment by.<br><br> So for example min 100 max 5000 step 1000 would cause the boxes to start at 100 and increment by 1000 until it reached 5000.");
define("DOC_SUB_ID", "The sub id field is used to enter the field id of the child option.");
define("DOC_VALID_EXTENSIONS", "Please enter the valid file extensions seperated by a comma. For example doc,pdf,txt.");

//Bad Words //
define("DOC_BAD_WORDS", "Whatever term you enter will be replaced by the replacement entered.  The case does not matter but if you enter cat with the replacement of dog, then catalyst will become dogalyst.");

//Listing Packages //
define("DOC_LIST_PRICE", "This only appears so you can say the package is normally priced higher than it currently is.");
define("DOC_EXTERNAL_URL", "This allows the user to enter a url to their website.");
define("DOC_INTERNAL_NAME", "This is a title that is only displayed through the administration. This is helpful in distinguishing between two packages that are similar.");

//Memberships //
define("DOC_MEMBERSHIP_GROUP", "Once someone purchases a membership they will become a member of this usergroup while their membership is active.");
define("DOC_MEMBERSHIP_NUMBER", "Please enter the number of ads included with this membership.");
define("DOC_MEMBERSHIP_FEATURED", "Please enter the number of featured ads that are included with this membership.");
define("DOC_MEMBERSHIP_BOLD", "Please enter the number of bold ads that are included with this membership.");
define("DOC_MEMBERSHIP_HIGHLIGHTED", "Please enter the number of highlighted ads that are included with this membership.");

//Modules //
define("DOC_MODULES_GETMORE", "Get More Modules");
define("DOC_MODULES_GETMORE_TXT", "You can find additional modules for your site in the 68 Classifieds <a href='http://www.68classifieds.com/extensions/' target='_blank'>Extensions Pages</a>. To install a plugin, you generally just need to upload the module files into your modules/ directory. Once a module is uploaded, you would click regenerate at the top of this page.");
?>
                                                                                                                                                          administration/documentation/french.php                                                             0000644 0023433 0004734 00000011100 11051631435 020272  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/

// Main Settings //
define("DOC_TITLE", "Le titre de votre site");
define("DOC_KEYWORDS", "Les mots-cls de votre site.");
define("DOC_SMTP", "Souhaitez-vous utiliser votre serveur SMTP pour l\'envoi des emails ? Si non, la fonction php mail()sera utilise.");
define("DOC_SMTP_SERVER", "Si vous avez choisi \'oui\' ci-dessus, alors veuillez entrer les caractristiques de votre serveur SMTP.");
define("DOC_SMTP_USERNAME", "Le nom d\'utilisateur pour accder au serveur SMTP.");
define("DOC_SMTP_PASSWORD", "Le mot de passe pour accder au serveur SMTP. Cela peut-tre un espace vide, cela dpend de votre configuration.");
define("DOC_SMTP_PORT", "Le numro de port de votre serveur SMTP.  Laissez vide si vous souhaitez utiliser le port par dfaut.");
define("DOC_HTML_EDITOR", "Souhaitez-vous activer l\'diteur de texte TinyMCE pour concevoir et modifier les pages prformates ?");
define("DOC_SITE_TEMPLATE", "Veuillez choisir le type de modle.");
define("DOC_EMAIL_VALIDATION", "Souhaitez-vous tester la validit de l\'adresse email avant qu\'un membre soit enregistr ? Si non, il n\'y aura aucune vrification.");

// User View Settings //
define("DOC_USER_VIEW", "Important : Ces paramtres permettent de dterminer ce qui est accessible aux visiteurs.  Certains de ces paramtres peuvent tre dtermins galement dans la partie \"groupes d'utilisateurs\". Veuillez vrifier dans les deux parties.");

// Category //
define("DOC_CATEGORY_KEYWORDS", "Ce sont les mots-cls spcifiques  la rubrique. Si rien n\'est saisi, les mots-cls par dfaut seront utiliss lorsque cette rubrique sera affiche.");
define("DOC_CATEGORY_WEIGHT", "Toutes les rubriques sont classes par ordre alphabtique. Il est possible de modifier cet ordre en choisissant une \'force\'.  La rubrique ayant la \'force\' la plus leve sera affiche avant les autres.");
define("DOC_CATEGORY_PROMO", "Le texte saisi apparatra lorsque la rubrique sera affiche. Vous pouvez saisir du texte ou du code HTML.");
define("DOC_CATEGORY_LINK", "URL de redirection. Si le champ est rempli, toute personne qui cliquera sur cette rubrique sera redirig vers cette URL.");

// Extra Fields //
define("DOC_MIN_MAX_STEP", "These range values are used to create two select boxes.<br><br>The min is the minimum number to start width. <br> The max is the maximum number. <br> The step is how much the numbers increment by.<br><br> So for example min 100 max 5000 step 1000 would cause the boxes to start at 100 and increment by 1000 until it reached 5000.");
define("DOC_SUB_ID", "The sub id field is used to enter the field id of the child option.");
define("DOC_VALID_EXTENSIONS", "Veuillez saisir les types de fichiers autoriss, spars par une virgule. Par exemple doc,pdf,txt.");

//Bad Words //
define("DOC_BAD_WORDS", "Remplacez un terme par un autre.  Attention, si vous demandez que 'cat' soit remplac par 'dog', alors le mot 'catgorie' sera affich 'doggorie'.");

//Listing Packages //
define("DOC_LIST_PRICE", "Ce prix barr permet de montrer que la formule cote gnralement plus cher que son prix actuel.");
define("DOC_EXTERNAL_URL", "Cela autorise l\'utilisateur  entrer l\'URL de leur site web.");

//Memberships //
define("DOC_MEMBERSHIP_GROUP", "Une fois qu\'une personne achte une offre prpaye, elle devient un membre de ce groupe d\'utilisateurs tant que leur abonnement est actif.");
define("DOC_MEMBERSHIP_NUMBER", "Veuillez dfinir le nombre d\'annonces incluses avec  cette offre prpaye.");
define("DOC_MEMBERSHIP_FEATURED", "Veuillez dfinir combien d\'annonces pouvant paratre dans la rubrique \'les meilleures annonces\' sont incluses dans cette offre.");
define("DOC_MEMBERSHIP_BOLD", "Veuillez dfinir combien d\'annonces pouvant paratre en caractre gras sont incluses dans cette offre.");
define("DOC_MEMBERSHIP_HIGHLIGHTED", "Veuillez dfinir combien d\'annonces pouvant tre mises en valeur sont incluses dans cette offre..");

//Modules //
define("DOC_MODULES_GETMORE", "Obtenir d'autres modules");
define("DOC_MODULES_GETMORE_TXT", "Vous pouvez trouver des modules supplmentaires pour votre site sur le portail de 68 Classifieds <a href='http://www.68classifieds.com/modifications/' target='_blank'> rubrique modifications</a>. Pour installer un plugin, il vous suffit de tlcharger les fichiers du module dans votre rpertoire modules/ . Une fois charg, vous cliquerez sur 'rgnrer' au sommet de cette page.");
?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                 administration/editor.php                                                                           0000644 0023433 0004734 00000007266 11051631437 015466  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
 require_once('includes/init.php');
 
 if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}

 	if(isset($_POST['action']) && $_POST['action']=="modify")
 	{
 		$page=@$_POST['page'];
 		$dir=@$_POST['dir'];
 		$content=safeStripSlashes(@$_REQUEST['pPageContent']);
 		$file=FILESYSTEM_PATH . 'templates/'. $dir .'/'. $page;
 		$fp=fopen($file, 'w+');
 		fputs($fp, $content);
 		fclose($fp);
 		$location="editor.php?dir=$dir&file=$page";
		$class_tpl->assign('title',LANG_FORWARD_SUCESS);
		$class_tpl->assign('forward',TRUE);
		$class_tpl->assign('location',$location);
		$class_tpl->assign('body','forward.tpl');
		$class_tpl->display('layout.tpl');
		exit;
 	}
	elseif(isset($_GET['file']))
	{
		$file=str_replace('./','',$_GET['file']);
		$dir=str_replace('.','',$_GET['dir']);
		$dir=FILESYSTEM_PATH . 'templates/'. $dir;
		$file=$dir.'/'.$file;
		$pPageContent='';
		if(is_file($file))
		{
			$fp=fopen($file, 'r');
			while(!feof($fp))
			{
				$pPageContent.=fgets($fp);	
			}
			if (!is_writable($file)) 
			{
				$class_tpl->assign('error', LANG_ADMIN_CHMOD_ERROR);	
			}
			$class_tpl->assign('dir', @$_GET['dir']);
			$class_tpl->assign('page', $_GET['file']);
			$class_tpl->assign('edit',TRUE);
			$class_tpl->assign('pPageContent',htmlspecialchars ($pPageContent));
		}
		$class_tpl->assign('body','editor/editor.tpl');
	}
    // Define the full path to your folder from root
    $path = FILESYSTEM_PATH . 'templates/';
    
    //are they changing directories?
    if(isset($_GET['dir']))
    {
    	$dir=str_replace('.','',$_GET['dir']);
    	if(is_dir($path .'/'. $dir))
    	{
    		$path=$path.'/'.$dir;	
    	}
    }

    // Open the folder
    $dir_handle = @opendir($path) or die("Unable to open $path");

    // Loop through the files
    $data=array();
    
    //add a back link first
    if(!empty($_GET['dir']))
    {
    	$directory=explode('/', $_GET['dir']);
    	$pop=array_pop($directory);
    	$back = implode("/", $directory);    	
    }
    $data[]['name']='<img src="images/folder.png" alt="back" width="16" height="16" style="padding-right: 2px;" /><a href="editor.php?dir='.$back.'">../'.$back.'</a>';
    
    //first the folders
    while ($file = readdir($dir_handle)) 
    {
    	if($file == "." || $file == ".." || $file == "images" || $file == '.svn' )
    	{
        	continue;
    	}
			if(is_dir($path.'/'.$file.'/'))
        	{
        		if(!empty($_GET['dir']))
        		{
        			$dirf = str_replace('.','',$_GET['dir']);
        			$dirf=$dirf.'/'.$file;	
        		}
        		else
        		{
        			$dirf=$file;	
        		}
        		$data[]['name']='<img src="images/folder.png" alt="'.$file.'" width="16" height="16" style="padding-right: 2px;" /><a href="editor.php?dir='.$dirf.'">'.$file.'/</a>';
        	}
    }
    //now the files
    rewinddir($dir_handle);
    while ($file = readdir($dir_handle)) 
    {
    	if($file == "." || $file == ".." || $file == "index.htm")
    	{
        	continue;
    	}
    	if(is_file($path.'/'.$file))
    	{
    		$data[]['name']='<img src="images/page_edit.png" alt="'.$file.'" width="16" height="16" style="padding-right: 2px;" /><a href="editor.php?dir='.$dir.'&amp;file='.$file.'">'.$file.'</a>';
    	}
	}
	closedir($dir_handle);
	
    $total=count($data);
    $num=$total / 2;
    $class_tpl->assign('split', round($num));
    $class_tpl->assign('data',$data);
    $class_tpl->assign('body','editor/editor.tpl');

$class_tpl->displayTemplate();
?>
                                                                                                                                                                                                                                                                                                                                          administration/fields.php                                                                           0000644 0023433 0004734 00000043155 11051631440 015435  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Categories.php');
$Categories = new Categories;
if($_SESSION['admin_category']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	if(isset($_POST['act']) && $_POST['act']=="changeorder")
	{
		$currentorder = (int)@$_POST["selectedq"];
		$neworder = (int)@$_POST["newval"];
		$sSQL = "SELECT fID FROM ".PREFIX."fields ORDER BY fOrder";
		$result=$db->query($sSQL);
		$rowcounter=1;
		while($rs=$result->fetch())
		{
			$theorder = $rowcounter;
			if($currentorder == $theorder)
				$theorder = $neworder;
			elseif(($currentorder > $theorder) && ($neworder <= $theorder))
				$theorder++;
			elseif(($currentorder < $theorder) && ($neworder >= $theorder))
				$theorder--;
			$sSQL="UPDATE ".PREFIX."fields SET fOrder=" . $theorder . " WHERE fID=" . $rs["fID"];
			mysql_query($sSQL) or print(mysql_error());
			$rowcounter++;
		}
		$class_tpl->assign('success',TRUE);
	}
	if(isset($_POST['act']) && $_POST['act']=="delete" && isset($_POST['id']) && $_POST['id']<>"")
		{ //delete a record//
			$fid=(int)$_POST['id'];
				if($fid<>"")
				{
					$sSQL="SELECT fOrder FROM `".PREFIX."fields`WHERE fID=".$fid;
					$result=$db->query($sSQL);
					$rs=$result->fetch();
					$order=$rs['fOrder'];
					$sSQL="DELETE FROM `".PREFIX."fields` WHERE fID=$fid LIMIT 1";
					$db->query($sSQL);
						if($db->isError()) 
						{
							//not successfull
							$location="fields.php";
							$class_tpl->assign('title',LANG_FORWARD_ERROR);
							$class_tpl->assign('forward',FALSE);
							$class_tpl->assign('location',$location);
							$class_tpl->assign('body','forward.tpl');
						}
						else
						{
							$sSQL="DELETE FROM `".PREFIX."fields_options` WHERE fieldID=$fid";
							$db->query($sSQL);
								if($db->isError()) 
								{
									//not successfull
									$location="fields.php";
									$class_tpl->assign('title',LANG_FORWARD_ERROR);
									$class_tpl->assign('forward',FALSE);
									$class_tpl->assign('location',$location);
									$class_tpl->assign('body','forward.tpl');
								}
								else
								{
									//sucessfull
									$sSQL="DELETE FROM ".PREFIX."fields_bindings WHERE fieldID=".$fid;
									$db->query($sSQL);
									$sSQL="UPDATE ".PREFIX."fields SET fOrder=fOrder-1 WHERE fOrder > ".$order;
									$db->query($sSQL);
									$location="fields.php";
									$class_tpl->assign('title',LANG_FORWARD_SUCESS);
									$class_tpl->assign('forward',TRUE);
									$class_tpl->assign('location',$location);
									$class_tpl->assign('body','forward.tpl');
								}
						}
				}
	}
	elseif(isset($_POST['mode']) && $_POST['mode']=="doadd")
	{
		//add new text field
		$go=FALSE;
		$fName = ( empty($_POST['fName']) ) ? '': $_POST['fName'];
		$fInternal = ( empty($_POST['fInternal']) ) ? '': $_POST['fInternal'];
		$fType = ( empty($_POST['fType']) ) ? '': $_POST['fType'];
		$fRequired = ( empty($_POST['fRequired']) ) ? '': $_POST['fRequired'];
		$fSeen = ( empty($_POST['fSeen']) ) ? 'N': $_POST['fSeen'];
		$fSearch = ( empty($_POST['fSearch']) ) ? 'N': $_POST['fSearch'];
		$fGlobal = ( empty($_POST['fGlobal']) ) ? 'N': $_POST['fGlobal'];
		$fDefault = ( empty($_POST['fDefault']) ) ? '': $_POST['fDefault'];
		$fRange = ( empty($_POST['fRange']) ) ? 'N': $_POST['fRange'];
		$fRangeMin = ( empty($_POST['fRangeMin']) ) ? '0': floatval($_POST['fRangeMin']);
		$fRangeMax = ( empty($_POST['fRangeMax']) ) ? '0': floatval($_POST['fRangeMax']);
		$fRangeStep = ( empty($_POST['fRangeStep']) ) ? '0': floatval($_POST['fRangeStep']);
		$fExtensions = ( empty($_POST['fExtensions']) ) ? '': $_POST['fExtensions'];
		
		$fRangeValue=$fRangeMin.'|'.$fRangeMax.'|'.$fRangeStep;
		//get the max order//
		$sql="SELECT MAX(fOrder) AS max FROM `".PREFIX."fields`";
		$result=$db->query($sql);
		$rs=$result->fetch();
		$max=($rs['max']+1);
		$sSQL = "INSERT INTO `".PREFIX."fields` SET ";
				//$sSQL.="fname='".trim($fName)."', ";
				$sSQL.="fname=".GetSQLValueString($fName,"text").", ";
				$sSQL.="fInternal=".GetSQLValueString($fInternal,"text").", ";
				$sSQL.="fType='".trim($fType)."', ";
				$sSQL.="fDefault='".trim($fDefault)."', ";
				$sSQL.="fRequired='$fRequired', ";
				$sSQL.="fSeen='$fSeen', ";
				$sSQL.="fOrder='$max', ";
				$sSQL.="fSearch='$fSearch', ";
				$sSQL.="fGlobal='$fGlobal', ";
				$sSQL.="fRange='$fRange',";
				$sSQL.="fExtensions='$fExtensions',";
				$sSQL.="fRangeValue='$fRangeValue' ";
				$db->query($sSQL);
				if (!$db->isError()) 
				{
					//sucessfull
					//now insert the cats submitted//
					$cat="";
					$uid=$result->insertID();
					if(is_array(@$_POST["cat"]))
					{
						foreach(@$_POST["cat"] as $catObj)
						{
							//$cat += $catObj;
							$sSQL= sprintf("INSERT INTO ".PREFIX."fields_bindings (fieldID,catID ) VALUES (%s,%s)",
							  						GetSQLValueString($uid, "int"),
													GetSQLValueString($catObj, "int"));
						 	$db->query($sSQL);
						}
					}
					if( ($fType=="D" || $fType=="C" || $fType=="P" || $fType=="Y") && $fRange=="N")
					{
						//now insert the options//
						$options=$_POST['optName'];
						$sub=@$_POST['optSub'];
						$counter=0;
						while($counter <= count($options)) {
							if($options[$counter]<>"")
							{
								$sSQL = "INSERT INTO `".PREFIX."fields_options` SET ";
								$sSQL.="fieldID=".$uid.", ";
								$sSQL.="optValue='".trim(mysql_real_escape_string($options[$counter]))."'";
								if($sub[$counter]<>"") {
									$sSQL.=", optSub=".(int)$sub[$counter];
								}
								$db->query($sSQL);
								if ($db->isError()) {
									die(mysql_error());
								} else {
									$go=TRUE;
								}	
							}
							$counter++;
						}
					}
					else
					{
						//now forward
						$location="fields.php";
						$class_tpl->assign('title',LANG_FORWARD_SUCESS);
						$class_tpl->assign('forward',TRUE);
						$class_tpl->assign('location',$location);
						$class_tpl->assign('body','forward.tpl');
					}
				} 
				else 
				{
					//not successfull
					$location="fields.php";
					$class_tpl->assign('title',LANG_FORWARD_ERROR);
					$class_tpl->assign('forward',FALSE);
					$class_tpl->assign('location',$location);
					$class_tpl->assign('body','forward.tpl');
				}
				if($go==TRUE)
				{
					//sucessfull
					$location="fields.php";
					$class_tpl->assign('title',LANG_FORWARD_SUCESS);
					$class_tpl->assign('forward',TRUE);
					$class_tpl->assign('location',$location);
					$class_tpl->assign('body','forward.tpl');
				}
	}
	elseif(isset($_POST['mode']) && $_POST['mode']=="domodify" && isset($_POST['fid']) && $_POST['fid']<>"")
	{
		//modify the database
		$fid = ( empty($_POST['fid']) ) ? '0': (int)$_POST['fid'];
		$fName = ( empty($_POST['fName']) ) ? '': $_POST['fName'];
		$fInternal = ( empty($_POST['fInternal']) ) ? '': $_POST['fInternal'];
		$fType = ( empty($_POST['fType']) ) ? '': $_POST['fType'];
		$fRequired = ( empty($_POST['fRequired']) ) ? '': $_POST['fRequired'];
		$fSeen = ( empty($_POST['fSeen']) ) ? 'N': $_POST['fSeen'];
		$fSearch = ( empty($_POST['fSearch']) ) ? 'N': $_POST['fSearch'];
		$fGlobal = ( empty($_POST['fGlobal']) ) ? 'N': $_POST['fGlobal'];
		$fDefault = ( empty($_POST['fDefault']) ) ? '': $_POST['fDefault'];
		$fRange = ( empty($_POST['fRange']) ) ? 'N': $_POST['fRange'];
		$fRangeMin = ( empty($_POST['fRangeMin']) ) ? '0': floatval($_POST['fRangeMin']);
		$fRangeMax = ( empty($_POST['fRangeMax']) ) ? '0': floatval($_POST['fRangeMax']);
		$fRangeStep = ( empty($_POST['fRangeStep']) ) ? '0': floatval($_POST['fRangeStep']);
		$fExtensions = ( empty($_POST['fExtensions']) ) ? '': $_POST['fExtensions'];
		$fRangeValue=$fRangeMin.'|'.$fRangeMax.'|'.$fRangeStep;
		$fExtensions=@$_POST['fExtensions'];
		//handle the new categories//
		$sSQL="DELETE FROM ".PREFIX."fields_bindings WHERE fieldID=".$fid;
		$db->query($sSQL);
		$cat="";
		if(is_array(@$_POST["cat"]))
		{
			foreach(@$_POST["cat"] as $catObj)
			{
				$cat += $catObj;
				$sSQL= sprintf("INSERT INTO ".PREFIX."fields_bindings (fieldID,catID ) VALUES (%s,%s)",
									GetSQLValueString($fid, "int"),
									GetSQLValueString($catObj, "int"));
				
				$db->query($sSQL);
			}
		}
		$sSQL = "UPDATE `".PREFIX."fields` SET ";
		$sSQL.="fname=".GetSQLValueString($fName,"text").", ";
		$sSQL.="fInternal=".GetSQLValueString($fInternal,"text").", ";
		$sSQL.="fType='".trim($fType)."', ";
		$sSQL.="fDefault='".trim(mysql_real_escape_string($fDefault))."', ";
		$sSQL.="fRequired='$fRequired', ";
		$sSQL.="fSeen='$fSeen', ";
		$sSQL.="fSearch='$fSearch', ";
		$sSQL.="fGlobal='$fGlobal', ";
		$sSQL.="fRange='$fRange',";
		$sSQL.="fRangeValue='$fRangeValue',";
		$sSQL.="fExtensions='$fExtensions' ";
		$sSQL.="WHERE fID=".$fid;
		$db->query($sSQL);
		if (!$db->isError()) 
		{
			$forward=TRUE;
			$go=TRUE;
		} 
		else 
		{
			//not successfull
			$location="fields.php";
			$class_tpl->assign('title',LANG_FORWARD_ERROR);
			$class_tpl->assign('forward',FALSE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
		if($fType=="D" || $fType=="C" || $fType=="P" || $fType=="Y")
		{
			//DELETE all options //
			$sSQL="DELETE FROM `".PREFIX."fields_options` WHERE fieldID=".$fid;
			$db->query($sSQL);
			if ($db->isError()) 
			{
				//not successfull
				$location="fields.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//now insert the options//
				$i=0;
				$options=$_POST['optName'];
				$sub=@$_POST['optSub'];
				$counter=0;
				while($counter <= count($options)) {
					if($options[$counter]<>"")
					{
						$sSQL = "INSERT INTO `".PREFIX."fields_options` SET ";
						$sSQL.="fieldID=".$fid.", ";
						$sSQL.="optValue='".trim(mysql_real_escape_string($options[$counter]))."'";
						if($sub[$counter]<>"") {
							$sSQL.=", optSub=".(int)$sub[$counter];
						}
						$db->query($sSQL);
						if ($db->isError()) {
							die(mysql_error());
						} else {
							$go=TRUE;
						}	
					}
					$counter++;
				}
				//extra fields
				$extra=array();
				$sSQL = "SELECT f.fID,sValue FROM ".PREFIX."products_fields AS p, `".PREFIX."fields` AS f WHERE p.pID='".mysql_escape_string($view)."' AND f.fSeen='Y' AND p.fID=f.fID ORDER BY f.fOrder ASC";
				$result=$db->query($sSQL);
				$i=0;
				while ($rs=$result->fetch()) 
				{
					$sql="SELECT fID,fName FROM `".PREFIX."fields` WHERE fID='".$rs['fID']."' AND fSeen='Y' ORDER BY fOrder ASC";
					$result2=$db->query($sql);
					$rs2=$result2->fetch();
					if(strpos($rs['sValue'], "|"))
					{
						$rs['sValue'] = explode("|", $rs['sValue']);
					}
					$tmp = array(
						'fID' => $rs['fID'],
		                'title' => $rs2['fName'],
		                'value'=> $rs['sValue'],
		            );
					$extra[$i++] = $tmp;
					$i++;
				}
				$class_tpl->assign('extra', $extra);				
			}
		}
		if($go==TRUE)
		{
			//sucessfull
			$location="fields.php";
			$class_tpl->assign('title',LANG_FORWARD_SUCESS);
			$class_tpl->assign('forward',TRUE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
	}
	elseif(isset($_POST['act']) && $_POST['act']=="newparentopt")
	{
		//add a record//
		for($index=0; $index<=21; $index++)
		{
			$data[$index]['id']=$index;
			$data[$index]['optnum']=$index;
			$data[$index]['optValue']="";
			$data[$index]['optSub']="";
		}
		$class_tpl->assign('data', $data);
		$tree = $Categories->getCatTree("", 0);
		$class_tpl->assign('getcats', $tree);
		$class_tpl->assign('action', 'doadd');
		$class_tpl->assign('body','fields/fieldsformparent.tpl');

	}
	elseif(isset($_POST['act']) && $_POST['act']=="newchildopt")
	{
		//add a record//
		for($index=0; $index<=21; $index++)
		{
			$data[$index]['id']=$index;
			$data[$index]['optnum']=$index;
			$data[$index]['optValue']="";
			$data[$index]['optSub']="";
		}
		$class_tpl->assign('data', $data);
		$tree = $Categories->getCatTree("", 0);
		$class_tpl->assign('getcats', $tree);
		$class_tpl->assign('action', 'doadd');
		$class_tpl->assign('body','fields/fieldsformchild.tpl');

	}
	elseif(isset($_POST['act']) && $_POST['act']=="addnew")
	{
		//add a record//
		for($index=0; $index<=21; $index++)
		{
			$data[$index]['id']=$index;
			$data[$index]['optnum']=$index;
			$data[$index]['optValue']="";
			$data[$index]['optSub']="";
		}
		$class_tpl->assign('data', $data);
		$tree = $Categories->getCatTree("", 0);
		$class_tpl->assign('getcats', $tree);
		$class_tpl->assign('action', 'doadd');
		$class_tpl->assign('body','fields/fieldsform.tpl');

	}
	elseif(isset($_POST['act']) && $_POST['act']=="addnewtext")
	{
		//add a record//
		$tree = $Categories->getCatTree("", 0);
		$class_tpl->assign('getcats', $tree);
		$class_tpl->assign('action', 'doadd');
		$class_tpl->assign('fRange', 'N');
		$class_tpl->assign('body','fields/fieldsformtext.tpl');
		
	}
	elseif(isset($_POST['act']) && $_POST['act']=="modify" && isset($_POST['id']) && $_POST['id']<>"")
	{
		//modify a record//
		$modify=(int)@$_POST['id'];
		$sSQL = "SELECT fID,fName,fInternal,fType,fDefault,fRequired,fSeen,fOrder,fSearch,fRange,fRangeValue,fExtensions FROM `".PREFIX."fields` WHERE fID=".$modify;
		$result=$db->query($sSQL);
		$rs=$result->fetch();

		$tree = $Categories->selected_cat_tree("", 0, $modify);
		$class_tpl->assign('fid', $rs['fID']);
		$class_tpl->assign('fName', safeStripSlashes($rs['fName']));
		$class_tpl->assign('fInternal', safeStripSlashes($rs['fInternal']));
		$class_tpl->assign('fType', $rs['fType']);
		$class_tpl->assign('fDefault', safeStripSlashes($rs['fDefault']));
		$class_tpl->assign('fRequired', $rs['fRequired']);
		$class_tpl->assign('fSeen', $rs['fSeen']);
		$class_tpl->assign('fOrder', $rs['fOrder']);
		$class_tpl->assign('fSearch', $rs['fSearch']);
		$class_tpl->assign('fRange', $rs['fRange']);
		$fRangeValue=explode("|", $rs['fRangeValue']);
		$class_tpl->assign('fRangeMin', $fRangeValue[0]);
		$class_tpl->assign('fRangeMax', $fRangeValue[1]);
		$class_tpl->assign('fRangeStep', $fRangeValue[2]);
		$class_tpl->assign('fExtensions', $rs['fExtensions']);
		$class_tpl->assign('getcats', $tree);
		$class_tpl->assign('action', 'domodify');
			if($rs['fType']=="P")
			{
				//parent
				$sSQL="SELECT optID AS id,fieldID,optValue,optOrder,optSub FROM `".PREFIX."fields_options` WHERE fieldID=".$modify." ORDER BY optValue";
				$result=$db->query($sSQL);
				$size=$result->size();
				$noptions=0;
				$data=array();
					while($rows = $result->fetch())
					{
						$rows['optnum']=$i;
						$data[] = $rows;
						$i++;
					}
				for($index=1; $index<=$size+21; $index++)
				{
					$data[$index]['optnum']=$index;
					$data[$index]['optValue']=$data[$index]['optValue'];
					$data[$index]['optValue']=$data[$index]['optValue'];
				}
				$class_tpl->assign('data', $data);
				$class_tpl->assign('body','fields/fieldsformparent.tpl');
			}
			elseif($rs['fType']=="Y")
			{
				//child or youth
				$sSQL="SELECT optID AS id,fieldID,optValue,optOrder,optSub FROM `".PREFIX."fields_options` WHERE fieldID=".$modify." ORDER BY optValue";
				$result=$db->query($sSQL);
				$size=$result->size();
				$noptions=0;
				$i=0;
				$data=array();
					while($rows = $result->fetch())
					{
						$rows['optnum']=$i;
						$data[] = $rows;
						$i++;
					}
				for($index=1; $index<=$size+21; $index++)
				{
					$data[$index]['optnum']=$index;
					$data[$index]['optValue']=$data[$index]['optValue'];
					$data[$index]['optSub']="";
				}
				$class_tpl->assign('data', $data);
				$class_tpl->assign('body','fields/fieldsformchild.tpl');
			}
			elseif($rs['fType']=="D" || $rs['fType']=="C")
			{
				$sSQL="SELECT fieldID,optValue,optOrder,optSub FROM `".PREFIX."fields_options` WHERE fieldID=".$modify." ORDER BY optValue";
				$result=$db->query($sSQL);
				$size=$result->size();
				$noptions=0;
				$i=0;
				$data=array();
					while($rows = $result->fetch())
					{
						$rows['optnum']=$i;
						$data[] = $rows;
						$i++;
					}
				for($index=1; $index<=$size+21; $index++)
				{
					$data[$index]['optnum']=$index;
					$data[$index]['optValue']=$data[$index]['optValue'];
					$data[$index]['optSub']="";
				}
				$class_tpl->assign('data', $data);
				$class_tpl->assign('body','fields/fieldsform.tpl');
			}
			elseif($rs['fType']=="C")
			{
				$class_tpl->assign('body','fields/fieldsform.tpl');
			}
			else
			{
				$class_tpl->assign('body','fields/fieldsformtext.tpl');
			}
	}
	else
	{ //show all fields
		$sSQL = "SELECT fID,fName,fInternal,fType,fRequired,fOrder,fSearch FROM `".PREFIX."fields` ORDER BY fOrder ASC";
		$result=$db->query($sSQL);
		$max=$result->size();
		$i=0;
		$data=array();
		while($rs=$result->fetch())
		{
			switch ($rs['fType'])
			{
				case "D":
				$type=LANG_DPLIST;
				break;
				case "P":
				$type=LANG_PARENT_FIELD;
				break;
				case "Y":
				$type=LANG_CHILD_FIELD;
				break;
				case "S":
				$type=LANG_TXTSINGLE;
				break;
				case "M":
				$type=LANG_TXTMULTI;
				break;
				case "C":
				$type=LANG_CHECKBOX;
				break;
				case "F":
				$type=LANG_FILE_UPLOAD;
				break;
				case "B":
				$type=LANG_DATE_FIELD;
				break;
			}
			$tmp = array(
				'fID' => $rs['fID'],
				'fName'=> $rs['fName'],
				'fInternal'=>$rs['fInternal'],
				'fType' => $type,
				'fRequired' => $rs['fRequired'],
				'fOrder' => $rs['fOrder'],
				'fSearch'=> $rs['fSearch'],
            );
            $data[$i++] = $tmp;
		}
		$class_tpl->assign('max', $max);
		$class_tpl->assign('title',$title);
		$class_tpl->assign('results', $data);
		$class_tpl->assign('body','fields/fields.tpl');
	}
$class_tpl->displayTemplate();
?>                                                                                                                                                                                                                                                                                                                                                                                                                   administration/gateways.php                                                                         0000644 0023433 0004734 00000006451 11051631440 016011  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Gateways.php');
$Gateway=new Gateways($db);
if(isset($_GET['action']))
{
	if($_GET['action']=="regenerate")
	{
		if($Gateway->regenerate())
		{
			$class_tpl->assign('msg',LANG_GATEWAY_REGENERATE_SUCCESS);	
		}
	}
}
if(isset($_GET['do']) && isset($_GET['action']) && isset($_GET['id']))
{
	if($_GET['do']=="changestate")
	{
		$Gateway->changeStatus($_GET['id'], $_GET['action']);
	}
}
if(isset($_POST['act']) && $_POST['act']=="changeorder")
	{
		$currentorder = (int)@$_POST["selectedq"];
		$neworder = (int)@$_POST["newval"];
		$sSQL = "SELECT id FROM ".PREFIX."gateways ORDER BY gOrder";
		$result=$db->query($sSQL);
		$rowcounter=1;
		while($rs=$result->fetch())
		{
			$theorder = $rowcounter;
			if($currentorder == $theorder)
				$theorder = $neworder;
			elseif(($currentorder > $theorder) && ($neworder <= $theorder))
				$theorder++;
			elseif(($currentorder < $theorder) && ($neworder >= $theorder))
				$theorder--;
			$sSQL="UPDATE ".PREFIX."gateways SET gOrder=" . $theorder . " WHERE id=" . $rs["id"];
			mysql_query($sSQL) or print(mysql_error());
			$rowcounter++;
		}
		$class_tpl->assign('success',TRUE);
	}

	if(isset($_POST["action"]) && $_POST["action"] == "modifypage" && isset($_POST["id"])) 
	{
		// they have selected modify
		$id=(int)trim(@$_POST['id']);
		$sSQL = sprintf("UPDATE ".PREFIX."gateways SET displayname=%s, showas=%s, active=%s, demo=%s, extra=%s, extra2=%s WHERE id=%s",
					GetSQLValueString(@$_POST['displayname'], "text"),
					GetSQLValueString(@$_POST['showas'], "text"),
					GetSQLValueString(@$_POST['active'], "text"),
					GetSQLValueString(@$_POST['demo'], "text"),
					GetSQLValueString(@$_POST['extra'], "text"),
					GetSQLValueString(@$_POST['extra2'], "text"),
					GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$location="gateways.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//not successfull
				$location="gateways.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	elseif(isset($_POST["action"]) && $_POST["action"] == "modify" && isset($_POST["id"])) 
	{
		//show the modify page
		$id=(int)trim(@$_POST['id']);
		$sSQL=sprintf("SELECT * FROM ".PREFIX."gateways WHERE id=%s", $id);
		$result=$db->query($sSQL);
		$rs=$result->fetch();
	    foreach($rs as $key => $value)
        {
        	//loop through the results and assign to the template
        	$class_tpl->assign($key, safeStripSlashes($value));
        }
		$class_tpl->assign('body','gateways/gatewaysform.tpl');
	}
	else
	{
		$results = $Gateway->getAllGateways();
		$class_tpl->assign('results', $results);
		$class_tpl->assign('max', count($results));
		$class_tpl->assign('body', 'gateways/gateways.tpl');
	}
$class_tpl->displayTemplate();
?>
                                                                                                                                                                                                                       administration/images/                                                                              0000755 0023433 0004734 00000000000 11036006206 014712  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/images/add.png                                                                       0000644 0023433 0004734 00000001335 11051631442 016155  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  oIDAT8˥Ka[/Y()%X(olNۖskn.-h;8fEP"jïMGˈ}yພ羹$ I.tulu	AX:𼂒ZHh1DnZJOJB{Z?`2`S=N$ő=;a&jwqJG#<"N2h8޵`6xցn_+~Zto}`x%XЛ͈	hXѿƻ/}BJ_G&|Qr-6AރEL⬡\U3:WUh[C6+	6.f *K͸ܝFqou4܄?d|XҥMvD`*_[#A20liR|xq`4w=\uQ	m+G|%$5Թ5RO*YGMUOGqj4ְ(X&
s1c˭(LVfRdjQ	'-1ATA>U	j4,pV"4L$e@.ArBY a~my Y])Q8tNLܞt2"I	o=CSd)__AF (    IENDB`                                                                                                                                                                                                                                                                                                   administration/images/ajax-loader.gif                                                               0000644 0023433 0004734 00000003464 11051631442 017602  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a       FFFzzz   XXX$$$666hhh                                             !Made by AjaxLoad.info ! 
   !NETSCAPE2.0   ,       w  	!DBAH¬aD@ ^AXP@"UQ#	B\;1o:2$v@
$|,3
_# d53"s5e! ! 
  ,       v  i@e9DAA/`ph$Ca%@ pHxFuSx#.݄YfL_"
p
3BW]|L\6{|z87[7! ! 
  ,       x  e9DE"2r,qP j`8@8bH, *0-mFW9LPE3+
(B"f{*BW_/@_$~Kr7Ar7! ! 
  ,       v  4e9!H"*Q/@-4ép4R+-pȧ`P(6᠝U/ 	*,)(+/]"lO/*AkK]A~666! ! 
  ,       l  ie9"* -80H=N;TEqeUoK2_WZ݌V1jgWe@tuH//w`?f~#6#! ! 
  ,       ~  ,e9"*
;pR%#0` 'c(J@@/1i4`VBVu}"caNi/]))- Lel	mi} me[+! ! 
  ,       y  Ie9"M6*¨"7E͖@G((L&pqj@Z %@wZ) pl(
ԭqu*R&c	`))(s_J>_\'Gm7$+! ! 
  ,       w  Ie9*, (*(B5[1 ZIah!GexzJ0e6@V|U4Dm%$͛p
	\G x		} @+|=+
1-	Ea5l)+! ! 
  ,       y  )䨞'AKڍ,E\(l&;5 5D03a0--ÃpH4V	%i
p[R"|	#
	6iZwcw*! ! 
 	 ,       y  )䨞,K*0a;׋аY8b`4n¨Bb bx,(	Ƚ %
>
2*i*	/:+$v*! ! 
 
 ,       u  )䨞l[$
Jq[q3`Q[5:IX!0rAD8CvHPfii QAP@pC%D PQ46iciNj0w)#! ! 
  ,       y  ).q
,GJ r(J8C*B,&<
hW~-`,	,>;
8RN<,<1T]
c'qk$
@)#! ;                                                                                                                                                                                                                     administration/images/attach.png                                                                    0000644 0023433 0004734 00000001513 11051631443 016670  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR        h   	pHYs        gAMA  o3    cHRM  l  ro      n  A  1t  l-  IDATxb`@    b````hhhn0   &%%30000hkk7    b(//gbbbc````HOOI0yzz<xேv0s    @PsmX`?~ѣ~w/tȑ#VVVgsqv{EE3جGX988X8pdyyU$.Ɍ{H8&((hߙ<<<N~sÆBBB߿go0ZZZc``?~u߿9|5_VV.]gTRR۷oS?^zCKBQ7pFԦ!HD)ڬũ)h/h'aK@+߳{[LDs~j6+qh/1D"[U^;BkjgݙITq08;l~3S՜(_J-s	T< ŶeY(y	P(v֍^w`YR~
緁~<J)]m
!6֩  r\8Ό1RR~o&yu]wB)UfRJ'TjhXdcp8 | !0I rG"    IENDB`                                                                                                                                                                                     administration/images/calendar.png                                                                  0000644 0023433 0004734 00000001742 11051631444 017202  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR        h   	pHYs        gAMA  o3    cHRM  l  ro      n  A  1t  l-  XIDATxb`Fuu&&&    bXlQ?    btwCc8qСC:::    ,̡0 /QKġ"gdTu׈I|d0 hkDD1JU+3k33D9'  -0ᷰ6T'7q v4r#ܠfKI'5|<:wrzX=q`ȳUE6M*hE֊^q% mJJIbuʲd(
sc(0m,.`lLLL\Vtl-XZ$>yt?5q70 D/gּ/(;^mGx2܌|ĨO7
J|ubyi`6rl+s}offYYc]WBU$aYDPDq{OYxiU%4%=MP5a2Mߜ1kAGwfݻڃTV+1EvvbH)XZ~;rx)T8X)G@ufnL`?=ui|pZ~\e<GtHtB!*^
Oޝ}:]^=@;!gYs||:ڀs7'[3sǏƷ/BU"4R@"
1$ZwRH}^,/<R/=͆pαZx3uMm1bE[kinΣ5ʲ9b`<3LPꦟmik-*˲8ZFDHӔ^G%s1k)!`\2P"c =b    IENDB`                              administration/images/check.png                                                                     0000644 0023433 0004734 00000001031 11051631444 016475  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDAT8˽.Ca{8bnSBT')E)VCJǥj ZՆg/hݿk n^k[ꝿ2P6c=XH*G`?xԅ{77VԨپ%VHyqNtn[J2^53X,S-OƜoDXx2Oܵ	r]L`}Z࿳TU(SiP/a:6͖,A`%S=[
b[a='LaW{xD[u9JBGqzfGN0os6"ffhZR".2H-[{(7h@`%E[IWu3e+ lGQ&' k|<R
H    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       administration/images/cross.png                                                                     0000644 0023433 0004734 00000001544 11051631445 016563  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR        h   	pHYs        gAMA  o3    cHRM  l  ro      n  A  1t  l-  IDATxb?p   b    bd```jbJ\vhs   bD1nuviEO1<?yj:Xs?q    D1
@ WV%)D9I. .z,TQ1{nw]iF	,y" 6=!!`b{%6 .F  s d
(D%j'/CqWum֯ SM17?5Ge?jP"p{"AO%VGAVnHR P ]MN́hlՋFm9<vAizJlLWãHBO /:%8VP`jfD:ItA+޺I[SEԥP@]w:hi03tRN
mr\+8xsXLDW7oN&)0u`6ㅈ"|͑P@>k TEA4^m^Y:- 2<D{ǭ(W7:JjJOipl.<UViiϗXhgK	;΄KցVR.`PiP 
dS    IENDB`                                                                                                                                                            administration/images/dberror.png                                                                   0000644 0023433 0004734 00000005066 11051631445 017074  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR          }Jb   	pHYs        gAMA  o3    cHRM  l  ro      n  A  1t  l-  	IDATxb?2`a```ߖ P-4n]?R   bD7!99]e+322^d~wcBKqe   <!
A oV Eb0LsL20`y9`$#<x#vݛxIn^^Z MsHqY	8T7Eo1F9BPX6@  dϱJ`@skKqI[
39B\,
[TE4՘r2Os6kmTa m5)lQ4< Icxw1(IZZ4~f|wyrjިLVZ~O2|Yqۘ,NEU]k-p۹ѯ,Qէ'8߻g,\Ɓ;(98.k'(R8RNVGeZFIKk2f~<|muR~<{8Y˥dؓDw9FC*&B$zmnq4`n7aa~e2¨suHejUeaJ)0`P)vK4KևJ߆7S|O4?fad%<b7{%"v9ffl( w>!l|܅"koAl#r-tu3.B_j ׏&v0|ۜsl9"/vDW.+C!̂2dMP؅DPtBu8\	UtfXs͑Z;s?z<۾;|]LO?xo^ޗyMٳO4K"7	ejDJBhh="k&$I0v٦fZEځ3=BmB>Otvv"1*ܕO&WoӅs!ksݞ@$ct^0
08xf	XU.~:B=x(c`a,Ɲ4tUŝЂ1UU
::p8D"J_d=_rJ3aR
Yz @l6[[DCƑEK9p ۻeo<}SQssS%,J-xzg<JAjftF"Л,rq6(kpAuR%&~LEf!(7#*`7shMpoaYSmPRɃd<צ (biI]d`dK=?cJ
Jnv=}pT|+r{|R?Ul0UB+R&d2dYn"]J|!b!DPfv`$ W `N!?J.42n"
AI`4/V`DRB<	$bA`>ĀImQ*ҟ@lvfv3;ׇnӍM2q{3{9PGMx	?Yi2 	{Y chSއnY5@p	\R\
࢜]Y/r]y1lnn~mddxҋg.pEGnE`t$e333i50z#1-!Gz|P*TqY-=+"077)0TGcHRǔ=\qHUQTjS^.gQ*|>Ǒ sS|,NBӴ]RssO
H ƕ[믕',B2aO"#"pίvvvvowP(CQȲE/o߁4Mض]a&LDPyպMӐN"A $Ir%I9yPp~A u"HDְ'8%%ͦ@SY?}
jL1í5gJC<@v")[G	=;Q.&A^SBXX&0:S?|֎ɖ!.)MoP, 3Gj.}gvsnyPLrmV]|w>1"5DljU%XE"Zohݑ	gDC]]</XsNp/3r@ŃJX	 6\055dn@@J<ׁͿUdmkU(x<Qo@%d㭣7Ƙ
Wu  *IRk"@,C0$7bi"`mmDt4  JUQ'nb*>\ IT@r  @e ";u X"n1    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                                          administration/images/error.png                                                                     0000644 0023433 0004734 00000001232 11051631446 016556  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  ,IDAT8˥SKHkTC[RL5o=ck)c.$BDP,,NY(FFfkaf>o1Hb=fU~Ϣ=USl.ZkP(9X(>H3kR x_Oqg覆8t]tiXas_j'{Љ_袺I~}^OTj5՟羇}vM悥]b7(Vl9o XoCn%M+ciѐ+Ci@IzW^5
@Ee6dVK>@dW2U/zWѳ'BOlYxoT3#Yd(,aPG+_Rr\:m;gS o * 0>N  @aΣ5;5 0?kkz65ß}	/qoI0- R`ZUކ1̌U rj1BCeqƊ@޳H\):xu4E3'ǃxǃ8>!@}X;Lc٧S/    IENDB`                                                                                                                                                                                                                                                                                                                                                                      administration/images/flag_blue.png                                                                 0000644 0023433 0004734 00000001237 11051631446 017352  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  1IDAT8˥]HSap)#rO,UDuQTJR^DEIԤL:1Hkᚉ6-LZJneb88 /ÁsxNDᘭoY.:{$/Tw6
{2FqOTFd`øpk^I$_*= i੫Bр3KUH\~@{1@w|><0¸c:d`A,I`@] ꤗBoC*<CH|g8VE%"[j} pS75<ӊC}lf{	X{~EנzέgOԺ'coh t4FWgn,qdv
@u&'J7PMs;$h"gҦ/WѼS܌X slTmbK)i. )>	
t`A.?@ʄSSVBn)+<&~l9/dg Kp5]-    IENDB`                                                                                                                                                                                                                                                                                                                                                                 administration/images/flag_green.png                                                                0000644 0023433 0004734 00000001240 11051631447 017516  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  2IDAT8˥]LRapmuE71KOb]Y*rK3G\@IǊ$!A*Ԍ\NmP8Z[[YyΨ-/}ߞs 2/
oSO>TֹU|&8cP罈`r'L_Ck_Lz 8T!x$m-`ruCI	/n>e躾. r	e@r.zJ
G|ec~GWVh),t' ު]h߻cF$mR#xt`j7^GaiO*j.7>\[JX:'<d
c>L(6pĆݯ- UP#2
ߒLjk¬a,#2NyV޸7F+Qp4f;,pD%dC3qmO	sQ(
ִs<3"tv3QȻ[./\'K.Rwn82AoH NZ@
o
s@@2Ի/BR*    IENDB`                                                                                                                                                                                                                                                                                                                                                                administration/images/flag_orange.png                                                               0000644 0023433 0004734 00000001235 11051631447 017675  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  /IDAT8˥]HSaqHW,UDuQTJR^TVҊJkK YFmi-\jlHdR&,[9䅻ao-9N.?r4:j}Nrb1!9#B3%" t+O.[;ś?7o7w^t0	#FU7<Pv"N@Aʪќ!xt"Z)$ ZG-eF@Y"&@m&E=Ⳟaq5]{JGWТ$U9wՈ]YlF7̘<Vy/X355nXjZ+36	p/Jܺa;<:w@1].K@v͏x)4B[BG%BCHN^aeL..Sc%`S(tCY`f>=gN]0~&Ă-Ӗ	 vqCH(>$@.+Iֳ$dkBi5`8s-m    IENDB`                                                                                                                                                                                                                                                                                                                                                                   administration/images/flag_pink.png                                                                 0000644 0023433 0004734 00000001213 11051631450 017351  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDAT8˥_HSq_HhC=FH&(EFPRCOj"3h"Q=t̹M]{(e?3rvX3pq>{e X2ߋӲ,cZN{uy,MU90P	MD7@g360,G8 ϕq3E6YaV+  0KT֑~L)	屆TB:P U6~?.D:n,hۏ#G\Dm[	Pݭd_t2ҝ>?PV F:<MΠ{3m#}GUAM	pG@p΁똖Jb1=U᭗[%%6e'Jxb3/{p6 O31I}	͟tyjw&'}WwBRMfC$0ƞP;HEh=>iNQͭ+/`9	/Cw 1ع.1    IENDB`                                                                                                                                                                                                                                                                                                                                                                                     administration/images/flag_purple.png                                                               0000644 0023433 0004734 00000001220 11051631450 017715  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  "IDAT8˥]HSap鶋.*#,:aU,J
!!q!mr6/j<3jmv,s~sY4wS嬥5y|^Uی5@$)_2ҀV{	S:QUYˈ:eY+tyL-]B:	dS@@	暭8.-'k]rc.`|"  /Ia }u)ƹVVn@ܩlrA1a`db<3kKsTb(Ѡ	bn2g=} fa_Z<<k0?j$M̷xM"l(0 ݪ	'ru zCpK"jsx։';)pM<Ln8)iw aSe$||$j5\c^kqe
q]`2R,
.t'Hc8Ϳ"d/*ԫ

vPn5@߿L?    IENDB`                                                                                                                                                                                                                                                                                                                                                                                administration/images/flag_red.png                                                                  0000644 0023433 0004734 00000001231 11051631451 017163  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  +IDAT8˥_HSaqQ.,-a[
jaHAQFe[ATaj)2-3cԅ&E,XcnobXz|<o6wèKl&׾ըگM]G!掘ݳÅCOZ61'J-2"ԭK^"1baW[FNK0$TK{[jĵ.<}]e1Hi7/d@lP|Ģ>7?ZSNg4] 2#^99Y{ ]G=<[`deXg`*`1Pyp,Lhv܇{ʾ;%Wʭgst.7~?ïOrd| _lx`-Z1vV:k³}{}~n<UTI@ZhL^g}T.>U;b͜	@Wy|:H -(K ?0 d	8=J{ B%˄    IENDB`                                                                                                                                                                                                                                                                                                                                                                       administration/images/flag_yellow.png                                                               0000644 0023433 0004734 00000001237 11051631452 017733  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  1IDAT8˥]HSa@2(0.(/n*H
RfHr>F3Ӝ]hnlX6L6%cM*=wd;`cy./Ϗyy^ M{E-ֽ92mKT.kvh_?.O0b"uD hZ˃rrI'"wٰȺеbw@`s_Ǳ=\G;dQ#7*c#/&3~X $<zY$p@BLtWH?"M#ش>{9
0E+rJtQלqRQ CUU EO!kcme0GyTYxar;.
Z|*m#_	[IHӀN܏Sa:"XuXCTO{js|uʫ;x${MzX0$BŻDNp/+w
dο"zjZ'b}Ñ

}W<_!79>Ja    IENDB`                                                                                                                                                                                                                                                                                                                                                                 administration/images/folder.gif                                                                    0000644 0023433 0004734 00000001031 11051631452 016653  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDAT8œA[EtQg7wALCWA0P017p2=:A3cb2'pܪ$Vme@
ݬ2OTO1W/`z8%;O;9P#9B}^nO;Ǫo~d~Edpɳ__ j<w	;L==`rNvTy .Y8@~J=olS
uI 	3oޞ
B
!
CF(N߃J,$k(!TAF*$X(}fR/xQ
Eqx!i3,mf?OԓnAQ tI$Z ޓۈ8]YۚN    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       administration/images/folder.png                                                                    0000644 0023433 0004734 00000001613 11051631453 016701  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR        h   	pHYs        gAMA  o3    cHRM  l  ro      n  A  1t  l-  IDATxb?d.   bx֓O    bd```xn.-<O    bD1û| .&r-%~|{L(䩳?r0|_N    Lλ`K1Ć\Z+p忼4.pr $b.<gN8X#	p^{i;nvyBb=ɓI`n6% aag!*_>g
FBf&dccM;]/m۾Ҙ>?sJ{YWTuMX
95?R!~s+4=/1fRCF15+R̄iF2KYU4_{XL2V+:<7P_{A /䲒PE\$0p5pC8^h$>O@EAԨ&aZ~kmlXf=z^/Jכ򤔝Zvnh4QR!46l6VqA@PX,jz1c>Ixz<(윗/6N7%H8q8={N&Wj[k-9npqxӔnGeI{i1ZXO-BHCȎ;N#:]x,ڢA*T-Xqh@2@I5~$e/Pdsh4wXa~@~w ?+ZZ    IENDB`                                                                                                                     administration/images/help.png                                                                      0000644 0023433 0004734 00000002143 11051631453 016355  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR        h   	pHYs        gAMA  o3    cHRM  l  ro      n  A  1t  l-  IDATxb````tA-`   bqjf````4   bi˞wϟgϻ	_ɓ'U    D      6h-Yx    |      	  y     {    /]oIW  &&  m5-X%0.2  ~: `      2     .            
-s*   ѭw氎$;KBQ Q:XHX"A\h=hAP-57szͿ ,f9tVq;`[t[Ql'xv(Wy%Lf=?vPláO%6=gԹlxXB`FG e`(1Ѳ
K Wr_O~Fw%ZkJ:nM(zD<zqN⽗{ $& kEH1 BMpTqR:A\;tqE,JMb].w>ҷ?`Nx6衹gJcd>%_7=^[^T{4Wܿ4{z|xf$`8fFPޟcum˫wjZy3OV5|Jmf4'q&4vaʛڅJGnхFQJ-] eDLI
9`OTEnW:zRE ޶HowCֿ]Sb1bP*? I bߧo;fNڭu8}l)_h)G}d?@! "k[6 ;[?w?=p33}+͈lhO5>2 \@ Ӆ܊    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                             administration/images/modulehelp.png                                                                0000644 0023433 0004734 00000002201 11051631454 017557  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR        h   	pHYs        gAMA  o3    cHRM  l  ro      n  A  1t  l-  IDATxb````tA-`   bqjf````4   biL|hGNeO_5h     D      6h-Yx     |>m     
 y     {    /]nHW  )%  m5-X%0.2   5(   2                 
-s*   ѭw氎$+q ~ڳy%2;KnKqPrqaJZ)\?4j'\8QpV^ga6ycs`06[VבֿPɔx7MXmv0R'aFnlOjTju m?~!)c-b#0S8~[	iӮ *Pw pEERMϣb_gX	ŭ5W3_t`?\bDM~#]b5Ii@Q,.":( TPPA\\:UcR'Ǣ"
B`$h1iK.w# SW>wI@f`X.Z7p{fgnvLnÑq &O^`(lo>+.㧎Z zBR3ĢaLrNn,_ʫXbT"+=dU" A a⃓T[Ed@ۑW-UUxRx!c,ܚeZ\h"h#_nߡٮ_%Ҋ2doIEPq$I "cou.+ܡwl`Q	Z/3X_ϛ] @Ȅbi-61F/zSj7+@h޿ \8~}    IENDB`                                                                                                                                                                                                                                                                                                                                                                                               administration/images/nophoto.gif                                                                   0000644 0023433 0004734 00000001761 11051631455 017103  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89ad 2   ߥ̲٬            !  ,    d 2  0I8ͻ`(dihlءLWJ~{yOw3Q) gar )Gh .zq
m;\q eVO	X X	vPzvZCVtzq_WuXxR\ \eN	VzaqQ O VaΘeWWRWRN46+0`pA@i ?r9	0þ\`SO۟mx&%E(qAW`tT
]_@ONG	%md"5ߴC>V5CG4VY`RBj/+ӭi{fוNjoZeRgL:25,Ƕ	C!'N0] W"cZ " ˖1 +ѝN gT/yD@m<m	˟OD" 1   h-dF:`QVC>NHvUME]1fxIqG5XMʍ#=NP=Uc&H=H
rS|'0JAٖaY!zxbNTIFԉ0E	d$~hiNNxS9^ݙ">PI$ݕ|pU8@_MҚ@()ϫEjwjWdԐ8PlPR-9XAPBڃ\%hl4ʭR @͌1Sʬ;Y+axnb2
%~
:oJ]:u D\ϝ	JÞum0a|r t98RU!I'1;'NƇ-DmH'  ;               administration/images/notread.png                                                                   0000644 0023433 0004734 00000001127 11051631455 017064  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDAT8˅[oaOVÿ ˼6MmkFp$ Np門V9pbnwfgfFZjJrRbx@:R^r܊~/ \ D$z&r^DQP()0"HHu]a2xvHR[:-/U+H!D"&(f._:iM	3>#WEJAt=ǫ-^W@%|F6DQc.Al>WV\v$IȆMO?.BNӍX,	|UmsFp8y)v8s#~%?1y~C@|ӌLQ 
cu\vݲV.~//b    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                         administration/images/page_add.png                                                                  0000644 0023433 0004734 00000001777 11051631456 017170  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR        h   	pHYs        gAMA  o3    cHRM  l  ro      n  A  1t  l-  uIDATxb````:udN܊    bXz]{N:   bd```h__5}@$>۷    bXvUVe&L+YM#Okk|&jݛv2(++3ppp   41
0 @џIZ8f)	+x'C6,pڭ"!"B5	 M1FKGYc@ uϟi1'xj۵0ooǋbU {R
eU*(n)H.KKkSkC/P[@KP/p3H0h	Aoq#85MsNJEQ,I0aΔRuyRj" dܽ]uE/Va*vh4My2$Q g&`GaB4㆗gdjM~p]m6N!G7\eh8#իʲ$l_$c(?>bؐ"(Q`?h	(©%B¡=h)H
qD	yQny{P,m eYXE0D"L& pCihߏceue-Jb&;o.VndT%lu\.}Eo@r_lZGH1+J'dx~c?x	0z t!/lpEhje=s#4躎TL],3S6@:&
<R #jhLOq'K))
H)O C_ 0;q    IENDB` administration/images/page_copy.png                                                                 0000644 0023433 0004734 00000001605 11051631456 017400  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR        h   	pHYs        gAMA  o3    cHRM  l  ro      n  A  1t  l-  IDATxbd```Xv[M6egg   bغu[Gg```    bܴi[!fffQQQ11   10@OQH@fZe!S\ eι#⬵>fvzw   \!HJ VRL@WGj{G-8Hj9GZgJuB{jh}b?{o9a{(/ rAǨBQ EDH#hi][=*+/lJ9W ڶ}O$?kv{8x>r^y<EUUWUe)iEIPe0mqXkyqaa]׻xGeLӄ1}iy/"!<GUU/e!c|GsUaq(@r4!DqH@8),rbmPD묢4_Ӱ:F~YR$IBr0<M&giؐEp8 I4e6px Bk]6M m}8&b R/c<?[B@)ELSNYq\vݛ pv9Ea -ł^֚(*|߯yu U #gC/{ۻ w7O"hpW    IENDB`                                                                                                                           administration/images/page_delete.png                                                               0000644 0023433 0004734 00000001723 11051631457 017672  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR        h   	pHYs        gAMA  o3    cHRM  l  ro      n  A  1t  l-  IIDATxb````:udSN   bXz][O:     \ڵ|֠}~Up2Ӓ<3   $˱0E'Dae/YJe<MH˧cqe foI `/*">>   bd```}߿3\\kB7+pWdbʠ.𸲄᭹VHHHrALwc_1|a߾}x>a4lܸ+	2iDʦmBjh A~ fa߀pE3˖}891F)uն=f(UU]:Ǒ<ύsB4MBJ	(@|o&50]	>g _wknW+h 7?H)4Mz6Ma>I*ʲ> 8.)%4(?@PBQ2d"
qemW&P.
YEp` Y1P"jV]&dw8	Z[A !>8yP8)xLJ!aFRrz;o_/nZvl~g,^|vXk<֯>NWW[WTL8L3&ܔb&RD"e:"q9}_\c-jzmL&ba(X
w>vrֲ,RϷwcv76d2/Zz!6FwX,@ va##    IENDB`                                             administration/images/page_edit.gif                                                                 0000644 0023433 0004734 00000001447 11051631457 017341  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDATOhu yw9ge&"2&A:uVt.AA]<L::dE<ĚjH3ܜMIa_^"مH !U9O.֍W pg>9롢H낆  Ҋ?/}_'֏jC	E#m*Ưi)LYUھ}ظxq`u#RkRJj4$!dD!iOn9C/im&N{ A	DJD)u\~'ו:nһaK	A I"%wyĖU־zRWO؄wRD(SHIF^<mK|Z}(5oh^?g
dD"%+_Z՚V4Wtnoy{2Ud( WD}k=?3:4B}fFF6lWgCDLԽ𓕼ՋGd-6snޣRͤPg 2?𞗭gĥ/fwc{GճY(T
#KWw<ɱI?+*pbSJ;Vm?{;,=yܣ} *J%T휫SK^&%HKD9)˔:WPJYո뵡Κ(]IJr*OA	){Or= @ @+<ZNXWy    IENDB`                                                                                                                                                                                                                         administration/images/page_edit.png                                                                 0000644 0023433 0004734 00000002061 11051631460 017343  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR        h   	pHYs        gAMA  o3    cHRM  l  ro      n  A  1t  l-  IDATxb````:ud[]   bXz]O   bleԾa;F?~9Å+    bXvUVe/))?Ǐߟc/^pvE+sw    $ͱ	@8yhN0d
@Dq[p1r{#Bl= ~|0i\vcy6dޯvyCF\dIgὮ@U;U%}?+Y""<9<.C ǿ|mp,"&0xVWEeiiqȡph=8/|DǏXkZk)e'"3unj*N vFQ[;=FWB0$˲Ckqugag>i:$UU>}f6ÇK{ʲlu]bl8}bÔv1a2.y^:J) `{t 1ha羜QCKiRCh5\D&"(rn&%CD-D( ZL]sJqxkVשw4NNO!J)R8O˲ZEx{6F&aunH$B4E1vul<JT*%j[{]>k.?-_;;lj}k JϹ\NFz>;zGM Rb=d˛Q}\r6OܫB @b1H)9|lݗˬ?{M2t.Mq'd4!:<xN|lpw!x0#m%aC? =ku    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                                               administration/images/page_excel.gif                                                                0000644 0023433 0004734 00000001461 11051631460 017502  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDATMUU  {S#
r -MRTڄK
EaBD!ѢH!jM dI ecｙw9}_9[,G?ȁ)v|8\|؞ !w&}%1YB g.^w⊿Mw{OA	b19䤮NVQ:.xWv!9碯H("E dp36(>ԎgS5Be㏻|o~+UФںeKZUݝ齓WU%N[;?~S'S۲njvG2j|ӎ4mm-5DlyаEwSA^nw\[ּoxhD_EBM'{_Ld`ݢkwZ2+
2Jn.]Mq璻M&㐲*2e5&7nzZjrG<k%nՉ<kLA"UDl#8}/gЙn|r#O=gdl7/֕2R&*zw͉ξ/^/rbI!D#7"U 7@	uh Fڲv7  ^꩔2    @YT7zP_1G圣L g(*MC	!kBXA ,tSJhY+X    IENDB`                                                                                                                                                                                                               administration/images/page_white_go.png                                                             0000644 0023433 0004734 00000001144 11051631461 020225  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDAT8˕KQ(RJ}B.FSkJ7-"RQUPFQHP4UĂTJqBJB^s֯h1so0 |ܠTXPD"o<?J$(9z,T!I|><vl6S-!#WJ P(zhs B ~8s-%8@w%jFI{Hj-8Pb\kD="#XrѿK:-?JǗs+zڍ>viQ|,;-=|z;֚1s[x
w߱DZeoqoq5fnC}RX
<-A.ӷQ5W@Y2dU,OiI1vM(5y@(
lYPR49T}vs    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                            administration/images/polls/                                                                        0000755 0023433 0004734 00000000000 11036006164 016046  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/images/polls/blue-left.gif                                                           0000644 0023433 0004734 00000000070 11051631462 020413  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a 
      So   !  ,     
  	2 ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                        administration/images/polls/blue-right.gif                                                          0000644 0023433 0004734 00000000071 11051631463 020600  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a 
      So   !  ,     
  
2  ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                       administration/images/polls/blue.gif                                                                0000644 0023433 0004734 00000000063 11051631463 017466  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a 
      So   !  ,     
  	R ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                             administration/images/polls/green-left.gif                                                          0000644 0023433 0004734 00000000070 11051631464 020566  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a 
         !  ,     
  	2 ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                        administration/images/polls/green-right.gif                                                         0000644 0023433 0004734 00000000071 11051631465 020753  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a 
         !  ,     
  
2  ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                       administration/images/polls/green.gif                                                               0000644 0023433 0004734 00000000063 11051631465 017641  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a 
         !  ,     
  	R ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                             administration/images/polls/orange-left.gif                                                         0000644 0023433 0004734 00000000070 11051631466 020743  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a 
         !  ,     
  	2 ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                        administration/images/polls/orange-right.gif                                                        0000644 0023433 0004734 00000000071 11051631466 021127  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a 
         !  ,     
  
2  ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                       administration/images/polls/orange.gif                                                              0000644 0023433 0004734 00000000063 11051631467 020016  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a 
         !  ,     
  	R ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                             administration/images/polls/orig.png                                                                0000644 0023433 0004734 00000070365 11051631470 017530  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR   d   
   B~   sBIT|d   	pHYs    ~   tEXtCreation Time 07/27/05LF   %tEXtSoftware Macromedia Fireworks MX 2004v  prVWx{PTߕA !)M;U2l5&fjјQA
iיfi'PlbMc#ԈhTL4ew@RPBhEw};gjM#qf=<s;gw̞"*i%
W)p~8?7*2zpԀNdvۀmQ?? TypM\, Ȁ|Cf oU`O7Om]L̋unn,J~pyf&;S_uȞ}<8|w+ϛ{+U~4w/ǍRjeIt?!ev).lS_uI#$r^7(k:9ZUT36ʎN	ik]dseffݩ<nN"MHIx51tid5FShR핲l\Q~m]yElW$sed:/IU]^Х<?v'r.R{]igh'_^6t>q O)"Ȥ:_68p@FυQ6S˽Gucƨ.qn?AKF|J(䛾v .e B5_զe^#P]FzEOҽ){o"V~dЪR|C%THFzERwտE)zX}٧76{nIDr{<Omitaxz3q%ұD4Vylk2nI/$d)`|
mH}Y):,ZdftK-33s[y~/}Oy~ǩ^bl+WyydV+7S\lNyjs+wvy,]&Ѯ<?+%b]>딆Z)N<)H4:R^5rȔNtH!Vm[Ze(UN*|v.Ӫd}]r<-a9"Z$j>"D*M"^<ꓴCr2rH|2mW#'PG*TtKӁk]}M]5_rUiuU<euP,JّiwL:/Y\B|F\['c_ɳ뾒O?9C뱘)
	*žb-ػk6Hpb?l֭gL/v|Ϥ<_G؀ZZ{X=b;WΌ<5\}EzK-
Tƾ)Viߺ_J,(3i5iC`5}#я(F?% W?gFkf<3Gq,4H6R=A&JfPoc>R=Twx)hgWUvr{~8?z 9|)M{{r=y^?֠ScW?)hgڌXnӟfcג?O9uPkVc2PiFۦ/mWzp9\	g'l?~G.0?_2x
\x/>px?Up-  u!ap=(0c0`oÀ߁~|>p>>	>>>+C`?7À[`vp+v]0O`ga`m0vpSg0À;a]000n0?`_//{aaW+Ol   HmkBF                                                                   )3  mkTSx][sFf&H'[ڪ82o(JSl*67d%^.KMJMקsnyzLdjyXmo0~u'o-<uVvSe[8ʥ2Q\?p~_(#eKB2!tmOƸ'1$p[.]dwZ><dH`C]iQO{p9l6[c>6c!910`8M_|s#env
\<&ңyʏQ	Z3FFۀ тπ{y`#LƇ0c1|=cLgtFdLFkUۆNc1(} wϐ?O=MԚJ}薀m0t7HwrO{ t#"Gc.Q5LjΰTF #Woh茥Jc?#2r%j$b-
?`N@ iCI<ybl!FpB6EHPI
Cb5+gU_G"0z	*$bёga>{-f !^ɦwAb 9IvHo")D/MwS)Ɛ93cd֝JPUMy${DWY)$=͉DA Cn@M|>;F,	~ l?!w.K:c;A\߱L0ܬ->એǌ41[@N'E5]cKgbi
ŠCt"Y5#aG7BNIA=Ucj< Г2~	֊:'F`"h՛h2,b0Zh"q@R^MH^DP`H*Ņ.4QQ`h@u|l`~OWEr
(-WiQzR{C0mI_NpO*Nqq
y<t4TFehTFehԂ<J!1S^|\~%,FbQ>ys: PM0Y0909Mn פ_[ʡ5V.beLlPSC.pljsف|)^[űCQo1C!:IFĝ]q!49榍HZgG_ ,j"IhR$1.罘9Yj\0B`EuS=G
m+g	̃ɐ\
Bm$	R+da	>lFWcbJĹ>`#\a,_G8b$+gjuT]R|m$bDx kC``
`݆~#69+z}ANҺ"ҭ~cT~)D;+1g2` Ҍb*Ҥ`>~Qx7Cx(Q.?vBs-bXcęrӼ0FB XQo!5%B{#pi)%8K8r]pπ}AּTJ<@y)?C ;'_8X4pDҐ1܆Wp3BC=ùlv1(3i-&S>P,b
E/[bz/\x0AuR$SП@:d#a3,hdь$ɠ4Q,z#bb,)C&Ӎ%Sgm~#j[em"	iqM49 挌`*pOi`,{z֣ y PiW6yd}aaT>H|*\pQ45dkqR0ըE@
ㄩ1ԠGoMǓ$6heE-n]&'C_E4G%?ؾn}?zvG1Luta1:2u&#S#S4Et)u4k)"$#oܔ`\g8	0:dP拧SBXax8!BYYBHI@5,7_%,cK
NJtv
LdHs^g2{XV/KcM8 *)ba3g]N[>b
֣ 2m̹
FR{Z$aqb[m9,`Cp׷IytOC{F>N3\h=ydI+5qM?,H0E1׼V asJo 6B¯.F6./UkJ|t
L0lKX186+<`b\+'C#2xE"_f .OO7Ra$^f&KjپN<E8[(!Klvq4\@	Q­,HE>t"L1R9f\ZzI#ޚLy:TE;M-YSjKrI)1"C!%.o=9`&Vd)C{tNMuMIdGqDsN2sDwtsCqwm}NN1;Q/$^ԤhIfbMҹI-z
qƫȔeŮXU~	f/:{/ +X:#YZ%޿y0O}od+O쩘Pl3=o}^R9fTV~2.<-MI(죴kN
\X:ܣNգezt38Lԯ"AINb=grϙU-2b5'jZեetf[9~f!IźZzdDHy"?8XoչUo-[BdIzըzLo=+)-j<v+&e2}yOe&S/)V/|E8䳋VT6B
oYr٨EKZ9Nh֘{k\"vo6u;[<9/ְҦxOp|{ 6rɜH/m-hǎؑ;]}ؕB = i-=k[ 
2n@e3k64V%wCk9i< i4զz#5us54Z<dxf=,:'dgݽKbIBL뎜Y3G8)
E}Tiەr,vϾX͌is@ajzhӼV}ГE
Z(W~QP`Qc%UȾV%pyVѳY#@bN<Ȏg6咹0/uAH@9C2$ȩ
FU&f(S24@8k9*&YST[TH?\ƜOd+Ee35ͺYӤ``8jd-5Wk{;Jvzn]Ki-6ycTW7aBum%L+CkU,!OX[ThK(6PDys=6C;QXI,X䊳l]3snA`43QgNzۉk	ZԌ؂kzL0/68ʕ۳]zt+<

۹1<S(j?RG\]ţ?8xyA1Y"m#5? //,X-2U[S4]8܈2ӀsuQcѕu X'DM jE]%튺RދkŮ~:X6u+Tf
:6BJk2ޣz9mT2,aJ<<^|d]/0{Gd[8ʡ)Nސ
[ސ|ZsF6xN/<\yHAī'd4oR =!9zѮD(Q~ʫx4
E>XNkTҦ#z'4Y1ܼgOJMPZ4.Т^c]eJ`_"SbaIy\ӕH%yCkwCW3Q1tw7GWsYqtwGvBTt2;[;W|9q(CW2tb芡C(ԂxH\?Xqv.ggW}8;#]1t0C\[1tgyZʻYU|عZyW]bubj]C1zWU]qt芣8Vb犝w;W\$ƱwCW]b<]+*ή8ZyWqvEubj]C;_FP_n=CocWnj_[;oMńX
[K,dmJ[g_8cSY2Wy$GUZ핬LjRgy(-kh7GBڢ/[?yØ$FHakԐd&ڻkϱn[Zg|mQMߊ-ZPj5pV2ploV]qtx[tg!gm39[S׽:5k	F>ᣆD1G2_Mkg:y}lQȒ#B &We׿:IG_\Fp3+_ݦ1\Y*rRnBGvFRA[̈́ V^FB?MIj^Hwc-SN{aQK	j7"*Xkـ|D|
>8Ӳ{YO]S"?}Oe3Y%(y5>NEHmch$둭tD
8Z/־)h(5mƐ?-#d-q3Ϋ#Q/ox$Kj3a)Ȗ?+rm*p3r;k&0}L$v}HDgB)=-(sg*Rj]h[Vɤս:qD}oP$)ُ(KN,D;]%>kO(zF,D\6"QQJA&^%|>Ǻqʄ@ziw+N9ݲ,H#˼烙]}zlw]=UY~II6dUJ{DG7k)YORjצ]놺".'uI_W$g:@t&gZ7<y~#X^K|F%**QE%DQ?qG8'»vm6ƦWQQSC\Bj:(W[4Plze=<x=ª"uCߣ*GH{ۊ>E5Bc?;^޳bAGgs$5*7cZo~pAk>g7ɭUq\-s}򯤯mu`hǏpgyٟZzaDm(VtY#	ؤQW7)R#˳AW8^b_,ʏ#/Hڡ GruIB^ʎ{bI0tI.Y$	8=$&1G#]$2>u\w¸,Y:Yln;9@y^kI@SO_#:icܻ4$.@,Ґxy%bhB5e{ijɢ=O1᮶\kvIw٫UIf++~/6OH7iVc@sVRu,87Ls%^ew4Ƶ$kN}!R\fjq+ۤyf9+ֺY5CWzSj"gCs0O$*RT%i6HovQ׏b@{p5#Ѿ@_)NvWGt=Ecׂy<1ںA[T[(kW|i<Gi3ɚW'#:w]Xjy~+VWf`5}LMiw:43f
+d_GuG).5R,Ve>MgG4ZG5[N~L]Wd&W#%ߌRWV
T{\Wjcw2fQp7
0ma=v#>[7(VQO㮟?9V=8lKL,{AŻFo췏S{hB=jL:<BeEv}JZ]:zNΑnO'ݛL55h}`s%|?NP[cm2m@m%8Csb`wf@Qi~""4~9s8#p;TlG~.9oSLizT'sӗ="د~ 	h=ֽQLwpY΍s8tѽ.=Io.契[kL`=O,v9$}78[u1wĦd{6%6T:+؄.5L6sC:kHwwEG(G%N 
j]k`kSWڰ?8dpsLojQcc7+S~ώM|#C7N_H!պް!`9Gw9C Lbэ8@7!~!)0s؏mb)VAIδlyJ?:45|J<N4NT);X>% bmbA%]rx!`Gv_|v_Jx<<
EᷦhA0pFSexܶyٻ]`*]S۠kZix#Co8l?8>͢W^A{6|rvG>jAKRvo*`P5di5ܣz$e5k~`)ԹdтͰVJM.%w?=I{}3M		$s9śk)ŵ¥ҥ Ѳx88WUjsh*'i|R:uL4߶1qu<@Y 7d-$иI(M(pRPn+\{taH.+NYh*~DۆmlU#P]+bKd ɶ<D71#<Xor-71Mrꐓ%Bk&^?]yo   mkBSx]0{5|Q_V؄&MfЃ{&;;ujh>u5z/LcFT	яjVc{AZڔ^pu9ZҀن؛=ؓmOM6s[ 
YN\f_sgzUNwRm#%+%	cVC~:LBL:\:m  
mkBT W                                                                    x흍8FSHI!)$FRHnwHYx3ꇤ saaaaxIǏ'U{o_ھgW9o'GW{>~Jlo߾)*/N\ϱov[iZ_ձaJΝ/:6O-92b?Tlk%?_21BsY5>:> c=1Owy^- ڶ,Xz usM#גU]>H_yYv!ۉ_miRus]Xm_g)YY)m]y,m z1aaaxEߓGקo/Y\k6xjgH|yu.\aæM&wk#ϐ$?]Mo\Ⱦ,/ڥQ@~6s?)}, lgX #vQgBٙ^uのuhm?}{].~}v_J;xogJY]޳@.)oqC?}>@Xߘ'- (W?	źvƔOʙRv[K?[A}?-wmՑ}<GcK1}uxLzަU00Pc[<>g\=c}Mggg	Ǆ-B^k_g?F? v0||؎=ǧHPgs/hؑIt~{n^}ZyD5XWvO)"c0vYZ|~_%/,p\ɹyΰZ/;/xs_9?Pܯ5ݻ\[y|č8g ʱL{?00_k3>z_\S|<)b|7aaaxn.ta?l^Cvkؽ#~e)3<3^kdlc&jK+o"e<.ʞ`^(3zu
l+6v<ïk7]/lc[`On}򚄫G뎱zt^v2)?;Wmr5ocIz?Ozx{&!ez."ѯ1Gg{+ҏlw<=}GݽFƨ^)zIpGK ֜{{eG12ۭqiumf>.}~a?00[u+7Svq֭y΅
?ނ}XwŶv?ߩDZۓ-q/?߳=<~#>Fk"qzrQo	9r,nY[;o:)@-`ק-7({߯S@µK9֠ɸ>:n3
_[_*mtcmC>qSL<?<nѯn!>=<6;ǫsaaa{xˌ\ފpx?0׋#5zяc]x^l򼠕(f:~٣^lin59W~\;?vn6erUbS~v^UO7O(|;+SG4|?f*?rW~2oNٟS9~daևmH6mX[J~s.ym4ٶO|Bd/b5ɿyU?0000000.P~*1@G\⟿KrKXs2(ߥ纎J8'>X@▼QQbqwxb)_K|v 1M6kee-2Ǜ59?K^E~9ϱQﱮYF8N?~;:=J<-t ĒyNAgC	\NXKs)'^Kg\~2}6}Գ)n]Or^j~"{p29w6/.z-v:+M{WJYZ굢`%Ҥl9ힶկ#OUz+U?;sd~vND7*.Y+v:ye;8}~|+ÑޅN9}{Bƞ#txխsXɿkSV/uJ=oG<ջL'L:D]6jfgLz/+ؽ[{rCMYq~[{yy	czA;w9zszWHVax3  %  mkBT                                                                     x흍)q ĉ8D^>׻gI@XjjgiЃ`0`0?ϟ|:s eQ3|ӧO|:2|.};7eGFO6_Qv]T]^ˮg{>pjzkuo{yye?{-x/D:3D&򈼹e^Hyi#/OGzϪ߯_~
:sMe#M3Y#=2QЙ[\s=E8}E>GȩTڲTg-}VfoSVwzV}./>~<Vrv@>!?U1<#}=F[ ~QڋBN..+푹^edLo+[\-kdW(}6q$#?z6Bөi?L7!3O_Q}Пuo[=tkȋM!'}/Ƈdr2_Cﲨ:`0:8o=+8-4}۞cĥXdq{bUq©ήm!ƶg*ΪU\z[GA=^+ru{LV	U?)V>ғ)x|Yҁgi\yi^cUo*=!TY?rfgWsʽVn*VX#=Fϫ+[F~yH\L~[O҇h5ݵTow|Sfӟ+);F;:x)/OSyUo2e)Ve3'wgGg=J^`0
ľu kU,Ksؑ5nY,bXw{w&3QהNQev	]ƷgcH˞i{A3I8hwduwUIWq8I>+@pQşGcZ\ƪUߝ]/:3d;ɫ:gB9R|GW~w2;fz<AǏߊg_ly=Uy3= [6_3]U_k]]ײ2;j->t|+i5nΟgZY|<1NyŬ|E7k?z/k><=Α}N΅>uWydʬdz`0*\?W8GY:Dgcg<2+'W6qn؟{ru"w<Tk.\rnO>U쏘~c#T?+y{Q,,^qF/Xv8.֩g3}ȸOP~n%hUG4(_sn|W}Tg&x^c,Fѭ+<#+}/Uw8BRh_|33!mr\7U9m({ѝpvew[xG]߱?g;,nҽow8]וb?OV=Z_#ve?vN_WrYLo;1g9pV^G~>[_vNOS3`0Q[	veO\k^8 ֔v<Zbz\Opbn$~}oz3јmKvU]^iNWA#x딫jtq:E=z%օq)CcYEqyRG-+u(K\hP'*^ء^q=m=y|Kvūe\rȊ4={W1;=ݷxp;o@>ȘT\Ԏ+C=*ɫ|GJOCW]x1.ﵠ9_EбVq)v(ʑ}[GwǺ{-oSdו_˞׃2;iT&w*w:g׭SOsj%Z[~_˯d֮+w]7`0]kIu+eL]ւoA^;=GR? v쯱;<y o$N1紈=:ߥPVu< <&3KyC/4r)i=*/|Ύ^]QNН1qGw>ù{<FVr2nlo؍ا|mo'qbӋr`eef6
0lzsA_x7췣*U}R%+C_	ڟ~I\Q~ky#_jo~DyU^`5pko?:ˮCw>?Kv:A}E:_n+{u=rq͓̳]>>d}+|L01`0leg:׺񶊝`W,3O?]\9P~[kOWiGc~)-<w.3q}'vuw$Vnv(r52S;Wk_Kϔ8B/hEՠ'9w?K;x:x<|@cϽVyc@ۖSw8Bq]=2lBe6V}eR(	VeZT4ade2ޒ+nYBTqSߔ<[&=f[|szP)G}{Zׅ3n7jpWwftEw[ǽ;`l?`0`0`{~i`oLy>uoi\qK|} 7Svu9G쯿c¾#>,jow{ՆݲL=mW2u_8دjo?kD߱mw>#}E:OۡO;<sy}ڛk}~|M'8CTo+[WUQr'\'tTYwz.D=W|~q=_ yMǏktbS=2|ұyN_}Oe摽ۏtLS6q`Cjf3#ܰ?z1H]\"W]O;2'@@~tG:{u7m1Q]PWV2Sz]ϥzs3]vxwҞ:ڗ>y`$jw  ymkBT 6                                                                    x횉m0]HI!)$FR?6c<lHٱdtC"+RJ)RJkJ߃L_SUn7ss~uU-Uyy9c/Juz?i>>>~ sm+vuՑνYu8uN?WP>1JsWiV_uKEϸ/r_gKW]ױEYcl,[TYHT}xL#}A GV7^}>iҞ-i;}LJX&TP3T#ߨgJl e'=?͘ona|7>?ǐU%;/mN/IfQփz{<d6dn;Qm{{5$iѦxg<$"^%=RJ)Ste/֔ a};k_y?9Ԛlz}m#GKk!k(9G1z,Q&liV濊#_<3Ξm$^9g{9&w&:˙uf֚R:ֽL+mWW^z%I2loZf?k4W-#	?V/c^!!{u̵ʴUٷAGe>G}?v✽3X~j{zTAO^ʰ>?sy|G)P</11~2ў׆R/7 Ӿsmsr"(2cϹ;~u-)}<U1g:apb5{3(k!m'mʞ2.~[)}GκbXELpaԃ77Fy0@ߋL?󞕹Khi@=RJ)RJ)RJ]M;;j;  SmkBT                                                                     xi`Qqqqq!	COMlS$I$I$I$I$I$IqO9˵wOo]ss,Խu˲<^0tc}av=7_{V9z}ٿ^s_y~?}ez۶@wE՟k$I$I$I                                         @?
R*f  *mkBT                                                                    x}+(H,"H$"#X$,QԈZs>U{	..T}6 ڳ-F`p]k ߅~b

О$wݓٱ|sCo A+q3lOx@(0a+?	T,_7s\Ϙ^Bl1)C+k(FyN"8dPC_9>O0&l4Im+nwGrŰ<Qq		+H}eq~~[).5c6,muO9p\<//?N:Mp) Ĝ-2p'uKq`_/64<~ 77SNBQ맨uM{5%.BNɊk:	kNm9*uU|2%;]Faג)RE%HWc0Mg>)/tihf	ѸX>E)<,6s45zb?J\<OM%O#(76:=	ӋYAHLs6MXBcX&ǘJte.	3.je(?<?-1$pO= x	]<Jt¡Vg`|I,<丕}FQj]o%[Pa6XY<?Yoh F067ၭ6JFG[wv)7?,@w
nMǦmk>?Lj=%wZizFTx$kP8Em	jAOހ>~؆B9	֤8UKCvjbLCy;mjP. DkwUE3ܨ8xUJs\ɟ+;}sFQ(KIXݛƨ
1+KdX];Jģcx$D׷X`i @l̏rnm$^9΄zBGϞQ=nfkDe;
<a>,⢞jk0B[p($ Ǡp4nq`XƓ	vϵ.xHnorJ5Hu뇗fa[Z:><M@J9$q] }=Hk3鲺tQ=,	7߻s>36[gRL؍?(&w.7C#~B{]
UW71jk~ecGrD.=K@WǱM0倐0\xvqNZ>#BE	)&yA}t?BYm(WIpɱ|2+\2 )l8tl@Z.Be񅋍RSƃm>dIl'NadĢG3%#)?$s	_5=YBR#-k"qGP-e"f%֩-ϓ378M9ϊ,_*n;HEBƱcl~˝[/sagIE2,z1t:kLș壋G){7ond{@rP>kwk׽#kXfyEAB9uM4P=_lgW؇N#_nGpp,ZUu6ȓVӰ0EK7*|]{75F\ԶzQz!	uH>upT٣o3P)[^6` -d&*=%fY<^ط`_6|h3ء>2 Pq7ώ,NsjF=B`큳CiU)R鐏@LҮǧmb<2FHRqùFXi䎲OmGA}:*uf:@ʫRH.66jcGOpO-6HKJU:Jǃv<gz 1F*qm-;I 7?O(Yrde
F	ѥrHaۡ> ,3DZEƮqq7p?ȌK%ȧ$;?Qr6pP7`a^=R_)m>D3#£_'Iɭu͋C-Rne㯄ssL<ȭ/R)|Lt_1<u}E
Dzl$H+N_2scۯ-rHV.֏'(}o	:]謧6Fhlw@z{6P_?Eh߹vK/B"Mh;бo)gRm $5, Ex(?:gU뵅F4 	߹E4!q?lAYvs:mR(GZyGq+w0)NzuY-&"Y	='I8{mL/~!.BA=缱Y|z:f#¬oh2XjǼI|1i3A(|vf1NKLͫ.?r]qBS^#o.l%z⁋Y~i䔃P qu&7(U;Bl zFx׎M,|PfV֠k'Nb̔/$EN
HAiQ=u-/TQAD9gW%YZ\aԥ5Ojru"9Bzp̬vll=ɸYyܾ5tmEz+M>Lk=rr4/gEr~PnB[\g[{gYvRW'
{Fem1{wL;7&$xc0n&u@5sCCձm8Heft<PJZ@4K|#`}akRN'~IU!kWLZDNK̡U;gL~a(]!Bjv(f\B}AuHR gM<7O:[m6uv;3=wwn3pKM{. t"nt?dibC6=E	,ѮO
0hvG;=MV%ʪr 4H8rK썀xA:2e.ݟ0N<g'6%G1ַm}^jnҽS0CzLX3UM;^^~XcavGHu"1kNKT?,r=܎X}6CBW6ۻ F\3m{4!]9ửJ4n5Jsw^Dhz8P]z1x~ J8#c%ϾcF{do@w0QsP_́ ?3yB2Đ{|5}>x{q(aтa?Q%l4ςxmWI׆GC1kQ3iJh,KRO`ʲ<![NwaZx\Rtv^ZJa\(ZPE 1ޣhy0S L!yQP̞#R@ӱ&4a9'2ċIE8XIr
4*yb˼/#x;2R~ O7h՘U^k(侠,2)C:(ِ;Q3>4)%b6B8\ pe<S+jsp%<&t{3?|N)p7b?aiDWlXZ>;u)ko)#WSncRx{[sXv195_0Kՙ7> Tp5ٴl3S"؝LX睫[5mQ ="u}pϘ*xbՉ#iM+@Z!	Ϯ~jYݬ$?5mtu] %@݅:4h8ۃtu3;
ΑO1A/r
R*5i&j#Y2:$Z(ad@>'z
L뇶6Z8|`6"X1_z'F-я?X^A:?1;h/KVB'vOnFSƤQ{=kh7MwXQp\v͓O/.
N3HKRlK"q^Wh1wth@3e6N|I;y?8t[[!$,ήLe"z%IކAkRl!3u8ځy?_W)AbCO!rza5Sn֗#<43y6"R߃CQ&>[#
B Hǽ{vekOTlq(UH͵hݔ8,@tՂL{p/*L"d_yk,4G̖bD>,.ok"D;|7[.DCA#ilϟI֬Dq]+eE	_--ڰc^Lq1~CCC9gNH8BkhJ#Z-`VoMa 9r$ պZ-hkh
?C$	^tď9d(8P݅]ڶw[wl;dn׆oKdHބ(DInI M_( 5)6H/Y1 QRk,nXHʉ?>df&6^EJmt{CCc`0ʅv5x<\9Yc}106"״!֏9dl:'1H"<HN&]569!I1;"YxAK-ym|hd"]U.akgbbw24j- Q Od-:N	dG˥MI	VG=W!r6wH3p"ۋ#g6*x9k{H<WBQߍOMV{Kh^<FW<L:w$|oY-Q]<ʫ!!垹Fq@}3fR%oĿMrD+N|YY6jr11k4i'Xf\:e޼ ~P91ߍ
&78Qape5 9osMy	K-uu9Bdx7HV&_!ClgL 04yS}|qٳkbs:f'/㼳@!]%z#=Js`3W ez<PIGC0@455gxcTGU#RCC?tdxL`Ɓ8dgsT?M6},_ \k٬lt΄ls:m"25be\]\˛{xaLoQlPwK7?M ^a,_lb(1?3݌^7:ރ^usϚqB8*hGxYCm5M~{Sg9nRXC}[hOtC1#W3*:;&_Gۂ&H|5L<4Ƀ\bD?]fM{V6*S<e0,!AؾKmmߍrOoC2
#p'$F˿@!{0VYWoe,'H'`r1#ͿMRSYZBh|xH@6YziWlwQ}yqs!`~y#-OՑIXmy|*0o@]ۓ^(`Pqvefv'OA=B݂pCJ#
֞q5RwV&)ԩn@po]{3v:Yf*aW_&'
Jk0nDx\/HDuqZ\ڌG+啵XZT>z'7QqɌ#KR./CVgQȬ\`?d1yuM6Ƶ8ZX]8^pwQE&1frRKi$GݜЕh3'{;;~FK37ku<pdʎ+CRMzƏ7)n Ҁ lEGyl:̑IoB<A\\6dFqϡɅQ[1<kN>S%|ЕsTulebA}Aʹ10A{KʘӺtjdLI=r	PRg_LbRŞl?␔)![Fowi&k^CV(t@pW2{hxHGRn͉eCbxԉ6GQd27\ثdS=\Ff*0ۣ OP5(rZߙxQZ>~GAeN-jY7Ҿn;n?ӹ"Px}/N W:݊&׾:x"ꭥу;R펔c䛅љElmG§a=h¨BG_uYnZ쫭FYs U"zM&:Gnu.DX5Xn;}ԫ%XO?~2&Frjj8yA*W	I9/ub)Zl:s 85J>~iI<k¶٤^Sx[sGD( +"EHnֆA_\FZ%?4`w_{7"0Y@f}PEjmv:QrN[wz*5c?jf7?K_P', sZ(oT|Ó\-%蔒hy\	cK/	˧YGԻڐz&c"*(,yEq(y[q`a7Xļ~R/{hh"g=wݠ՗?̶uNh{g?tqm,u[Yot+!hf.2]ݹ?&wARFľ붾Ue%dliqMs&6Xw-&Y3(G9{cׁ֬ǿM;vn"b)<׾e_1p}11F#YXpq]s,[%*&@DfҹAٙfs,>3Yԕ;:#hELם[ROd^GA˩f~Y!En0~/A
Km>^WYq"<цF*c:xw|͞w%ehRgd9̕v3vDgh>>?3hYDkgC(ʹԕSԜ|2Q94(?OGQ34fccPopTYaW(>@tX4`LGٞpɄaŰl\[9c26UM6f, 'C4i<Dn#xгHz5[
_QtmvNC_`x~Mbs PEx؇;cW*n\?׿v:O3@fR&em[mٜC5f(MNiYXxШ=4
yHO<0|3[B	:d1"ZO$+Kxi̒=sJg~i[Rz'G#v}>?W~psϠ?kAKrŵk@I|>^xs?\`,D̒5W^wDMXf_8<%| 8_왉pP1Wlm߃f?4:́_Ԕv M;k:p_sj؎qw]$F}y,b'N=o0,
~M
YR46+!}@~ujctCP.Y(x׎z?70WXFܣo3z0c8RGg0TU򄽻w"/4֏CQ`[{Ocn]+{{N!3<Vyx,!C
b.lf'\ ןgu,μw-/3ۥNX(coMDsa##0{c%uDWCBZAZ6,؏x(Z%wHbhTb2<$*cnk_א#{D+B<!S/gÏ`9.^]ßC+>3+5]qpj'
r9FDȬ)~:9Gmx2-?sraG"yvUpa;Ră A\&
?#n	0eed~oq嶭! !ǲP^H)>oȑ.ļԶ=Hy7S-M
?8ycߧq|#5"2Бlm#UeΤVbM͘jAc7Z
]>4gb
s	2WRsKg6's8qzTT[R[w )I95xWj#!nN+zPڔ	KgTE,?{^RDݥ=Ru^zîc&D'i74SJߔ&HUG[crͦ<׿~4}څh;lpAZ%XZ;tQ?yk1+Ƴu6[Dc4Ɯ*dB#!}e>samhG3c^8u9󼵕⸈߂UyB;f"Yi=D=4&|C3g]~WgjhSIXU"1A5Fr4{AljwTt6</N \Rta|i>T.Wo>>xϯY{緷 m,J{gg}v~)]s!?wXGFl!7U|Cnfﳅ:.@mq%臔Ru?.:aBֺE#Gg'yXDuSWǊD)21ѵVagWPqȒs?¶@g")s\T{f3go^w:^" {d#!φt},nyWFKvX4|<B+8i=-;X	5l=/xlwn] 
+SӼ,{՞ /ДV +<<o ԇeNp^OOvqR wHF3݁=o;`~kRwCu¦kjE|qϩKV,*?xk}QxU/M=հp=犐^xBˏKx@[IYB]T➐Kq.ὀPwAG\Wϋ92SA\Y\y=ǨGjբM@tԂvDz+Bĺ\լ6k6LʦR_rnl|UAϯ<
|!;8_1gsލC >VB~,˘_&fjp/Wԍwa O H3I`u1ͤ+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_W|+_Wݚw)   PIDATxױ0gGSnר$T ɚrlk}fh0A4HjYT,p    IENDB`                                                                                                                                                                                                                                                                           administration/images/polls/red-left.gif                                                            0000644 0023433 0004734 00000000070 11051631470 020235  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a 
           !  ,     
  	2 ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                        administration/images/polls/red-right.gif                                                           0000644 0023433 0004734 00000000071 11051631471 020422  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a 
           !  ,     
  
2  ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                       administration/images/polls/red.gif                                                                 0000644 0023433 0004734 00000000063 11051631471 017310  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a 
           !  ,     
  	R ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                             administration/images/print.gif                                                                     0000644 0023433 0004734 00000001327 11051631473 016547  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a    {}{ｾRUR祦ޜ޽{y{ý焪ƾ֌ތތRQRZYZsusB!ƵRYRcecZcac{ƾ{{Bss                                                                                                                           !     ,       VPE
&U&$ULU$%%,BU,ASIO60KT  .F:RC+(VJ		=3G9#Ä:(<p(/GG{;0DE(һ ?&
9G={Ln HQϟ@Ob	
0@D`bQ$Nn@+Wdp"X˶- 48!xQ߿P1B"B<xcǌ<AAD˘3kP  ;                                                                                                                                                                                                                                                                                                         administration/images/read.png                                                                      0000644 0023433 0004734 00000001145 11051631474 016344  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDAT8˅IaOUÿ {bFcN4FMtn-=6c li4BH!(dX՗.U>BZERA\FTBXDP }!r^C2^@I`&tl$ɝ,S3MD.'	90NCӴY6)F?2m$	b@WH<Nt͐xjD"5v1of^gVfI.lfhě9<VOC|8i4>C8%JlGk8z#SmȉrXZ\@{x<.`^orŌBx<^'j}U1}QWhT]"kL|snێ#~ߢK\}bx'BQ'{i^oPȲz].c)weSL|iW(S    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                           administration/images/sortasc.gif                                                                   0000644 0023433 0004734 00000000065 11051631475 017071  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a    !  ,       }i-S  ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                           administration/images/sortdesc.gif                                                                  0000644 0023433 0004734 00000000065 11051631475 017241  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a    !  ,       	jȭS  ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                           administration/images/spam.png                                                                      0000644 0023433 0004734 00000001275 11051631476 016377  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  OIDAT8˅͋RQo-E{AiٴYDDL	e(*z_WQGSǨ͵9WIy缇ELT
dDx  `-&NOj@TCiARQBcZTѨn8B!xC!UO$JA3tR*eY-cck'2+<!=JVKIv <:
Nsa"<Qj6JRS>ɎC<uͦ@J0ԒF$eTC/@ =r9evԋӒz>yK /^ naSp?tvDIZZ6ëM$Σ|A֍OwuQfԷ'eY$RH sH1^,kZ๢*:].Kp8$:Bm~>:zpv9iw$~	 k{UϢ:YVlx*"+oks}0/+/e!j45L`}&ZLy~=    IENDB`                                                                                                                                                                                                                                                                                                                                   administration/images/user_go.png                                                                   0000644 0023433 0004734 00000001431 11051631476 017074  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDAT8˥kH?0[.ˉ1a834btyϜĭ4mms
i:_B L'{܏(JpC  ?{ 3en54SmHFPBE~u
42p͟7ⶂ}`Kt\c #)A,hkMYa-̯+aqHbzl);>0Z^HzAx-W*w;x'7R}+fJ<t+*`(֜Ü>L_&;03o$F.县I`[̜-s@4Aj'O_9:VLYU}hfsd}Dy	#O&MHi>'5x6cRH28,PɆG	RhaAL8P]C\	🚐@ICiw
;QБ@!bKSb'BO
.DM:A3*r/%MJ!(@Ɂx{HD%4"#3I\u6*!Vቚyof5򳭈¬:"c:9ӯ+un[cjUb9rrc X9;&Mq3ȑ	kmЮ    IENDB`                                                                                                                                                                                                                                       administration/images/vcard.png                                                                     0000644 0023433 0004734 00000001025 11051631477 016530  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDAT8S=OP=#0]0HE'dH''6G$1`~%B	Z(m}0xnywhQ̂md RIܢhuEQbr|,퇱uPP8VW
Z'>N_̄1 |H!J-%G<erF._TBM{e{ㄾݔED/[ڒ6g7(YfL&; Vq^] }r᪵ZMD"ancP/=b&c.Kc^|>7DSP=SAjHTθ^+׸v`gsEfLvnw|ZE0:AP,Dt @@(3\N6}R)&h]9w̿?6\0Z    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           administration/includes/                                                                            0000755 0023433 0004734 00000000000 11036006221 015250  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/includes/init.php                                                                    0000644 0023433 0004734 00000046407 11051631501 016741  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php //0037f
// Copyright 2008 68 Classifieds
if(!extension_loaded('ionCube Loader')){$__oc=strtolower(substr(php_uname(),0,3));$__ln='/ioncube/ioncube_loader_'.$__oc.'_'.substr(phpversion(),0,3).(($__oc=='win')?'.dll':'.so');$__oid=$__id=realpath(ini_get('extension_dir'));$__here=dirname(__FILE__);if(strlen($__id)>1&&$__id[1]==':'){$__id=str_replace('\\','/',substr($__id,2));$__here=str_replace('\\','/',substr($__here,2));}$__rd=str_repeat('/..',substr_count($__id,'/')).$__here.'/';$__i=strlen($__rd);while($__i--){if($__rd[$__i]=='/'){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}@dl($__ln);}else{die('The file '.__FILE__." is corrupted.\n");}if(function_exists('_il_exec')){return _il_exec();}echo('Site error: the file <b>'.__FILE__.'</b> requires the ionCube PHP Loader '.basename($__ln).' to be installed by the site administrator.');exit(199);
?>
4+oV56jtd77M3ML6kv49Kj+GRoZx5peY6q6kFjWOeIGZZPtSZaPIpzq9l8IyIWXjaaSoELdClvFg
Hv4OoVQYl2Zs8hzly7kaM/KlB09bn5A5tleka8rG0cUikQsgoPpdmEgXeGbY6ahietDfzgV7Zb4k
ncSDSm4pPytnOG0SCpF9J+KXmMBrf23gNo9QjPEd8alqJcOIiGIyjr5+CiG1hWUMB6Y0QsfSoGVG
qH4YPUMr30SsasJhe4LMuR/lizgrHwFNK6HlyNSQVuN/cs29Exsx9q8ICsuJSIQTP1Q/1Sx5Wkk0
eQGSAJD8A5Ck3W3kPGYuX8Wjh1m68lUC9U5BnidIIO+kHNEdTSAh361GD7YWaEKBkL+vAhZiCLpx
sFAR482C07R948vCtYCnX672LrH2MtuMLKBFGTH+Rx2q5qRbSFZAkqLVrZi/fQ1mAR6K0hlg2Jb2
Ql/IcWaPbB7ztMPy4oplEsknwb9LDNV++FXsHmE7GH0rYrmCWwi9/Xav1fyOe43sbNn/Mnex3Xg0
tmLBiuxbDZ97E67nP1YOxdQnQ5oDdsSxPDDuE+krbKg0/AhygpQ2/iQAX9baLnED+dsfHqT180TJ
3KL3zABZq7TguCz2fHSrwjOf92acaB3VqCaU/qnpyrB40o3PUtSGaA2TlUJ8TUrIV1PJUfiBNTAC
mtjpcNSPwVlEaXGYDO7v7v5aTnTH3qEZduCbQzWZ0zIaPMu3/8CKJU3goMHfU107freSarSfzQtV
h9dgFa3yfMGPu4Vyun0+bi0XlCLHt2M3cA/WdxXdvZV1MpA8ZKVUPO77igdU+Baf2uImQ4vRFQzT
OYX1KTPU150Nxwf9H+DqzaapHNx3IKXf5yT6NvfkFMg3NpkcRUj5RHLEtsZxl7csX/xvCq0HnNHi
Ko5iCsjg8/ob7wprnKLKw0k2uNnrLrrQnb/XyBTFmXs4h1niUm+yKdllah14C5fNa9H/SrQ7R2rJ
qSVa1iOkzfWwb3JYv6ZVGCdL+CKnSIvwH1VghIrZw76qEAwcClHWA8TstCc2so5uW95PxRPPiM7G
QnkSQnjxgR+B+YGF2UW5P1fbxnIEGerO8WsD/28vMH76O/EhxKf7VEFwRDnE5j3R32xB5dnHi8yA
5CJA6o5U2YlIn65RbuUt6s7D+Wlxb5PYfuTxt70LWi0bSR73KWvXb6mEBrxiIPw/5PlI7fSJIlQQ
WN6/UtkvRnK+MqVW7lrguyZ1Z3kFi+5K3c+jLh7T63KW+Zl+/4jtqfoApAv9n6By1ssjDRoa+fDK
hSEamxdQXG4awrtMC02rkgicVRFT46lNPKKSLeHEy0jVKwB0yrPTZoZBY4c97zKkGdgslfA7lyW9
Nlea6xEA97wRpXspW+xo/OCzqsCadeY3tbNdYQebqjOzc2zaiWkXOdROPjWXhPIe9qke7CXTPu5X
sjy1BgssoQST+XelWq8Jjev8UKomJJ19qrwej2Z3ImmdUd8PQSj6kIcRQ322GeFZEIyKFXopHnSq
9WSJWZ7RPv6p9NWcSpFQBOUQ264bNRExUKsJUo0x2BweXA+IX740GQ9RxgmIyEokw5QA1Do2Pgx2
yNWEi/xl0JZR9kTe8qwvR8nGQarw7lRoCvXn2AbrcKuA0GcAgMqVUM2awdjYd2IcnUwAweSiZoK/
Z3WToYnlLQnbp2fjVtp/1BKWcW0Mm3Ls19iP/isEmgmRG2ETDWS0QRw78kJVmwpQEsj4i2unYOvE
mubAngLh+qQb8tk6e6auTl4UMsMojmgBH/6qIvfcv2+J5h3DowOgO48eeKWppfyWuk9009cO0i/6
v+X05Q3Td/QTs76kLNIy1IwLPGjMZiW4EL9JI7uw68/LI8e8Fg+KRzRGEt1pSbr6SPyhbki00qfE
Fqa4fzBkgDb5kMfDWqQonzGGzD1clWTnqfOMTSsrtt3CR/tUCWaifBSUY76UbQzQ6vc++tKsfx1m
65ltf3UJNILrS9IlGt4SypMXTQTtQI3hnekW1hBJvkmMiSGuZvg9KVSN8BCubCKaSnsmOzyphfUA
5ONBc65IHjrCCCifk/96qz0F2vRhUFNCxbXzf3JMcIKj2zYzVtLIrFjEcAiShToMVfqoDNMbg6ku
8wePaKfv31cjmmg13cR4USgH3CTZ8j4c6gnNYJ4LVY+PYi3evUHvctwUu2YtxpVJuhQ01qvL0ERh
TuES/0GH3vBwxBF6/hQJPH3uOq7s5xgL4t8wmqtUqHCkFpYq3X5k9vPgA/nxG14nYcwQFO0J94l3
sIa0zV/3CZWGboc2/HFnFTL61Tb4xF4TBwc4J3B+PgkUZaCfYaxS4vvkVhyZ7hH2K9yZU1pVN9zh
mEPgvxtSCR1H+PyJ6kv/NoOg3Qb0m92BQgpqnMTW7msAQatn89roJ0MD6AxGAiBTiEB0RBMeXdOB
G07DQ46Kc7z35FL0i8D6JVMAhguoM3F3QA/q77ckjhIeqQKKxM+2AgImilKIwxcPFkU5lWPUraVt
SSHeyGiRIBUAG11auMP5fH/20TCxLjUdv0gn7Gpa9gwJST1FGCF50SAb/X3wpwhmE8SJAZUZKcMj
2naatrQ12dIddHJUrkJr+1LgczIEW2ntKQFmurb0ebY3p8sCLTZhr/wL+cwbDMBWqvc9IWrojyOQ
Uzrt5MhIDpPNAs8hdQkNo/GVR5SpRfw+XeUXJF6ets6tmVY8SlgXgemEBfqLtpIikWC43VQJWeD/
NlhhI30SwAnVnhD8YuKxjKHynHkZnA3Hp19drcMXEBWgAz6imlIHtzavoW/gh4hDvYH4BIjobWqJ
98omMjzXooifokHcehvc+TN5Ne3rJMIQN6LE1UxqistJsm/5qT2FyErMGAlh2oTYOJTmD02Nk1+D
HKhvCsf0ErhZVCK+Kw8Xc21ih0ItRP+vFuWFoiltajSQVcARkyOIpgmMzWKu4uHtYE/nZansfSMH
kgjxD2uZUUMVLnDdqWpVYq0mn/orlbxcbNyI73EeuFpPYovaAJPCyRGFipubmbfDxRxih7dij3/u
VmGFMDUH3DUe3CpXleh22OMQ3s1VppN/7/zYAA9QlgvfszaoIMlbEmOuBG1v9B7PU50qoWlxdPk7
FIgda7mqbfe4DZyAXfxgexWHwYL3d/Ks0H9YsQEC7/nqfAr/vDz/l0H0sLoniO0UXCgiC3JcwwBL
PvWcV1FbrdM7eI1kOv7y88sX5i7DPEzpPC3R0cKHxN+otpQgl8X8FZvgTNorP7DJrxn+TnnbZkKS
0FH+7UppPTHO0zihf3u1Heid6PVOnXhFbob7r9R91ng6JBfEATCZL/oS14XNNgZr2NFgqXCGX2Fm
09YaLVdeq+/7l400aOQEmgM9kzxAe+UtZ5EpAc5Njdkn60nOb/ugvB0Ai9jzA8ji7d8UaTLZRQaM
zKM1zeWehGri6yDYuaSNRQlwgEmXOSZaE9IbKzWYuv1B5Dem+e4MvzQFwuAFYQHAHxCB9mxvrKSW
WIyOlgnyRsOkjkoPTRJ9JgUcruxDpG7PG8Y/PHImBC3OFdZpXIK1BrTVkW6gkQ4vU8+3zGsH1ekI
rRB09hik8+DS9eigRYPJXJv84tFZjukAcs+PDdyLLVkInEofpHcXO6RdV8uUsXWuKBWCtBI8r8gb
XDGoxxid/oxvG9prXAeQyGfyQMNDPWwAJCnSxRW3Dz5YAlFN97nNhZ65aYonYpuCm+ywxM45RS3I
+3ha+/RXV2IrMyW80oZKyr63O9C0KGXrDnwdCrN/O+UHuQCA+OGdjHbEuYeRjxH0LdnOMSJfXdMn
SoTLbfJuJwnoE1VyGw09l3reO40M7aF1QqmgK3H9ZNUPvXFWYUhpog3Xn/JK9oADhQSe/oFVmlpC
XcZWn3CmOnSSQwJTRwWtqe3HmGXr/6/8pfNg93ylunNIar+QE5cO1Y0prv/LWBCljaSpPX5gWUGI
o5hNWjbWeYickntKC4E/atuTYFRz1h2LwZttoorQtuM7Qn2KPyiEZx+ZsOFzmiQXky33lU+vTkat
MjE6z5fDdrfoj9LIyj/eKC90P1NuaFt3Or+olcbjInnN73q5D9iM/fNHx+t9R4KthVADiBJJwgYB
KV/ZA8uqQjdELsUbrTl4BNl3HX0mc0BH8D7yMglGyOS5oCVIc7dYbYo8JMETBtkqIrljZ/D4WgNL
k1PwnqBd46WeB05NYuvzM35rVaBhL+Fv+ueLSA4wZiamNcuO9v+uEd4YjVfya/rFqtGXt6vQoIIx
MM6yk3jK0wfdj7PdECSquYQNXux7RMAyGJK/Lfeln0KJojZFkHXfsf9f7T3MbAOvjtxxc8AB6fbb
LZ1YIr5K+sVaCJYGhaEKfsOpyttMtxGvtBBzCDNyIVI1X7+tKlxuXrsSqerpBJw+VzfHWGhFrXLo
ezZ3JVUrxeleLkhtUd5M+tx0kbJfpHP2Kb7X9lTc0hUoXd1D/9k9YLW+RzL8ffNCGtHREh4Sgo/W
W3Z59lqqX7MdW41tsQJbxlY8Brd6NFFLFj2AvLwqeiQmR9VMEtXuNA7ZMAnQTKIxyD07FgUYiqUH
Qw/Pu3P/Z3WPGGfEPBcrGTDNBEXivnPgg5cckU6WpX1Df3eQCwIl9V3LaXStnqp9CzBOqBH7IVrC
qfhcLp+nGelJ2TTgrkAKApIe2weDum6APkuQ6Oz+I9jv2YUDKuLqWgdbZThoA6fvS6wky4nxdknc
3jKEuGwlEOK/kZc7u5DcT2Yzseq9rtLttaT/MwWI4aFVLNuCbKfdJfevGXlhYKWEay2YwGAYRVo7
Tm8JkJDAr2vIREAgE3kXJML07G74deq9RVIplProE18BR+RunNa3hWom5gughTVj29/zxfkRWA09
QxSkRrRypX8TYn+BvGgJ7XGxaRjrOuUJVIkqNnhEMbOMxcbdI8WTMhHAzs70xFCoH2U1UjAwh9mg
8Dn25o/2d7AC89RrL9swM5q5jtsfKygkgfNSLvn2+EqBaDhEthO4bCUK5HMJtyxvYNP7aeBY5umP
BY9cJEfzGnjDDcsVyTipdYMoXNnLzHZOJcbKH5KKqEvndiX2gCNEDFAHRGzMAPbshLAR/Bs5Uo7y
pUeNhGHiM3XwoxpP10D9BbyEXQs2CH4z5YfgGNXimcDpg3hr7VykrZbUsTh/Qc80vrFCkx1Ys+pN
ndyRadmIfszaRbbeFm4p4RE7OSc4Zwe/KDUNQPujiYa1lc3rARDtdkEhC8tdPEjlnF2TGCTCERSm
rg7ItA0LP8WNJESdRMt7/raTWcMwcQBySrv4yBcz4y9XO6WQKtvrnwrw9thQDYs8Uxtju+mOeSTP
o1ZdJjO1W7tieym3v/D4VfjErChv/1QRTcIU5InntD0wO+jo6Gf8LA4+gl/oGs54G682/+OEBWHr
UqlK2BzGE2JAoo3tgfs4i8kJLc/07kp5xrRqxNeUIih3Jx60pDSU+W6mZ1VM2cZXt1TbYQB/8SJN
bXZUabJF6s5Os04Ryqtbu3anKhT/g7TwegK1a800oNgMMPb2641jA2/6rzQ0JhXDMCGWrZk3RkkV
LRkZYSyAgk+WeLQnKKsPo0BCHYJl/YbQ2f1zTg00t+icaz4dRL9fsIrFvqOGTg+3k6c9oJasKqzQ
qIKoLfXX4cyf1pW28LLALWmQjk6AyvMFf2Zv7vr1iTdvy5nybp7+WK55CVjtv3BFYtivuz4jQ3SU
SD4wHDWz8VC7e1Mg3EAauJ/ZpVfjegZ/DXqEpRWRh49NLBQ2+a65MYAi7Bqt9WZ+5ATlECd78fW4
R2RAlQOwLNakNS28/ownoxu3Uz11Papxb1FyvXc4wiif/IjJusPS1N3/aAp8f4W/yjQV5Wp+4JTi
7eV3fJCGqOhkHTif+Ewz6M27oXGuGTKNSHGrwbzs+IMKPrPyaFDorb9arlKrtX4aAyvcXY9R3keh
28trdc1ltC5ZCF/G+2oNMAaQlrFuo7RCGZALOGPseG+OfC4rmJeS7q2akOAmk5xdAXMkAuVralRI
orzyinpx/xCp2c77YOwaYZ2hTjvOpyAlCIGzY6AvL/vLvvHf3AhAF+vLw+RV6Il6jxfRNxdubueG
bDSX8qxUpiaMfIcx6l7Dx6UtITFi1PyzvKo0aqMOPtZSwWUnq+41Pd26DU8Bvfcezp2O/anIftzy
6byxxYqQJRR955V09F+JaAFA2AbPkH6mFU7Qbx0zFnRUCwakXwEoKdCCxobAxHbfKEnT1UfBMzWI
Q1FlwYkMW0d0ziCPofNTP2XyTx8kHk2HZgxzZHwT+0x1BGanGWhjk859Y6SwMGRn9rMUgSBNjxu4
niv8V0YETQe3MNmGdX2WSJ6/kd0gxoHocJ0Oq+gAVKOroZLqhdS14QxjvJ4jxKqFX4ehOzUGSwg7
9EIjOjWVZRfRkkmIXXVH5Tj4YHUGJY8JkBUZ2jLCtksOcznezG7JOtxHGCVeKAzmXQmdR6Z1uTL1
7GDcg3LJMCPWmEjyxStUNT8dPhRgor9xwsyaI6t7OMYAX5pWbxrYMVvCzeTjKlvhlu9jDFn9Hkge
pJItPU9tWTIghJ+X8b08OTD96ARIEIboeSwyFdCGgrbqIOlJiIz8VYjn2qh7eDW5tH2gkNVSM1Up
AYXmMq26xHJYZAH8+OMhccTSkJvUQe2eTOVBEI12RipV69P6KcRluEtab7tbPpur0aZ6SEemNzt6
wY+PBFmZHGgWMoiHECFoEcn0docKu3JWleDYoGHVxVggOaPTo2oxsU6IqnjifJ0vlPqhoB+Myh6C
XsdiOT0DQRDxJDxQEBwhUEbPZ0sDzyt0iaeQQdQGKqzVDW2Yhfk5VQmItyZkZnPRNDeFkRdAIGfQ
V+ipFOpv90Z5YEzc/tGvOIJ/UtJeZ2nKtpPb1MHwamq3Ljo1QZ3nlyW42NN8jqd6n91k36+UWM1Y
kbkeJOmvEgbUTkBEBLvVpTTnqC1l53bHI8puVaZWNC/1a1GofbHxEqoTqdp9Q86pbEhsQijjd6Qp
ytmn4gw0vKGv0A6KsVNAcSvsIbFSanHOv23FhSnDa9qpn+oUzyETSn+0yEMb3GWNs9eiHvgROYBQ
Ot3JvbsPh+vaZiyT9Ys5MEs8Vd+yLnmIGl4vsTKmk1JtD1vFs6B7vaBXSgYZyiozjCAP5y4XLgiE
G5ZseTNDmZywpVwe/xPBu44CYi7dESl6O+iCuufbHJZdrzUlBHE8rp55GvqAN/+te6ihY3j10ebr
3NYpcOxYtqfoxlorQ6BMdwpJTbpOpWzj/vskpngiqcBS/S86/59eiY05B6yUr1uRdkKd1ld4OJBT
V190UKH9nbyNBv2jWeI8fG7OlTrZBak4i9rnnrhw8WY14DQeAazi/pPsOM+Znph5yqmWXGY/GYgA
5wVIznyaHqHmur+jZgwTAJEJYSsCgKy42aWBBGBKmeZMrmPx7pe1puijMzD6N+9VX+V7vjPfAeZJ
WJV4O+lcURcHcuOK14hnFpUtTSYsCgDLrvt/RR/qAlc3V2XDdWWRH8FkqZ8cmk7lv03bk8z2avbC
cpafzNYado6OwU+Un+dhZ15tjKV47FRNcuKE0wuppzDyTrDPwL5Z+UqEEJrUh9oQwRjJ1RcXyzTX
+KFQL65v74h3XYm6SUpiBb+C1KYyKW/0jekllTZM1G/c1go2pl75P2adXL6PlueuVhT2l+DDHT13
sA5m240oC30rZR0sfto2YN/xLMbGeRlcMv2H/4S37qGs/9WgtGgUHvsDbR063pAyJJa8MpI48ygn
cnv70fjMne+1A3By0RmXt3x7IY/D3kIK3z4/WP6NnMGX8ddhqgaFxts35LgziFAdTz1scYEWuRne
ZabiyqnnbfUoX4iP9xVmUEt42B4G/MfpD5p7TbkXXL06MCIl6qI86c/a+x4X7UPZ3r+QSKHxPaHc
5EFh0qqNzXSs6osvLQvbxmvmVzaSjT88w8yE/B5MsuhNkC4CSlBWq9oMwuR8n97eBMa42mq0HHTJ
TuhYe94s0G/Ewrqsu8V4Jc9RnucAy/uMk8lPxh374veAxkHeeEOCOPqr+rln/XIUHrrzI0vsasCu
T+8EAYByXDGIWon8HO1/pAcyY1k8telMve/+GNxZ7Nc4VBVFXfMWn7+nnRxf7CmfCF40fjOzZSJI
b/QBevo2oWxSoisW2FI7AXXzzDmzvvpCl2l9gmWcBkR/d+ZKf1/xvfmJDkJaasM4pIFo/cJAtJqQ
c14YtjWns5nSrpAjwqzTRplXymC6cSoweApp5sgKs9hz89MtbveDt2x1IS1SqnXmCFbwb9yjL1l4
EWUvkAvAumxanpveTybcVQGsGypjUz9hJdyZ9T5ObGIleQ1CxiR2/WvbI8LH+s7UHbKubO4oDlPy
wyYAVwrP+G3aB69hadT5Uz7FlIWUbzCUQywcu+/h2xe3BeXTNRBZYUch/zttRNtKuxvOrl0ueOA3
elIGKylsMJzxccu62PMdX4Ao85TZzEhljZ1z92ToLPKPU/G9JjopMr9yFxM5s8IwYtMEl8BVuRw0
Ko69fsFKeWGzemiPir+tki6wdanIACJrE+KV5mxZz6gbzAOtBhwKI+9JkrTmtyKmLve48r+BhNJv
IcOmX7OlqRQpAqhDDE6e+quFeP0v9cu2McYNgm/GTiWOvM36Yp6jDaKeTeyh5vrBGlZsny2eYmFA
UUaZ9DSX5B5LbyZy2Gb8GULDiP9TTf2IkvtFdnrHCi1aDlYSDQcfjdlK/gE7CytWkpLpR5GIWDK+
xcVBErdl/aC+X5zCQy5uUH74b6q9HtjKEdpaVt8c+7fkp9zwlJse3ZsO3V3pPlIOc4CtFP7CWFLV
fHWqkJJkfQUWgx1+y17Cwz6CH5xN48TJOhN32GUlRCZ8lXs6NnxSLm7Dgck/Zp1VBRpwjo9tVpbR
+NYBCxr38b5xRApK0Nu5Q2YNjVzLv9dE5ILrg5WkrrkhivopZmB/tamjAn/2ponzNk7l5y00u2UQ
jf6a29pZeOwrxCBfRiPy1/0NPjCVY3hemYBxUN0pS9xjy49Ca7jvJW8KtdfTr9TMZzzjAgMX642C
GrHEuKIa9NIuJ/hnzOW2qRDQlukQcxBWv9IPl0l3oQV0Eq+ChzhhKfybUfHP7x6+fS6f12eClSIz
AKDVTiF+GG8T8vaGke9jjY5a52iA8SvnskSC3/Uxs4r93NLev5Hal6a55ryYgbnjioOZNvkHirFj
8VwGggSjh5q/MmY44LMX19PBX6PnIK7pcGPT1V9/uiVi4zUQIfsMBjNl150enpeUWeO4CeLgc4T3
iRltb/LKdgbgOfwNqFE7ZpLb6MVP9LzAToWlioXc22xWTF9i25zNBKJKxK6wONfpWsJp/KuUzqzd
s4SekFykIOZJNPPZrNCtOVF2J25s3xCri0pfMsLYs5gxw2na0TLYvGYHV2JDSqTjpXf31lJF/xCk
hoH+n7XwvSjEM6KCRfYTrH172y1kVrtITJha84jdBZFBqpdb3WsRYsHtA9Tz3awu97pwXH5u1e8K
463UNCEQJXZoplvc44hhzekOI7YcrrrYArw8XZeU1gYQmc4Q6NwnOLrR0bYyfPwpt9V1ayf/w4eK
OjWEgwo/QSdSNYPxBS1DVNSx9YShLDrMEaFVLdgk/h7szzX68tcXHDGD/pV5Z0XL1dd7wUD2oybA
CyWXvok/Is16s41HXxwoUC8mvb945K1hNdfAvNE8V7CPI+3Ce9oVnkjKdKYBKxS5j7RYSufBQVBk
lwARjgHJ6EQRMNgOiLfKPGmIRD9PlGPqw/cRHoM6WkZsYiM4k3uBu0ceE43OfG16sAbCyhsE13g8
tKGRday5oY/kMRnmB13dbt6E+BTmMW7YvYwsBEV8MKiWWz3Fb3j30bJNU9fL6sFwdXMLdDjJ0Kh7
9djpohuue06zrY5CNFwf2ebiL9EjLU0UeFXTciLf/dm3krYNvvfi1w25CTE98KRq/0+K7LigVGdH
r0K9wXHfn+wnRL+jucCHWidww4CpwF5LKV7U7aUnEnI3GY4+KNXdpFreOgzhabL9zA/D5ug7VfT6
IsHlOsGBKTQFJJM/5Fvnx1/CIkWgMmMF/W2twPbPiNOsz02laBVTeAM11Yycrl86PGr5jNtrV/Mx
bAd8IkuaXBm1OeWEa7Hxq57eSx+Pcy2zJDwFy5OxynpsAK+0vPcHjfLz13cRifZeL/AnsI1YJHzC
ZVnOwKzMl5bzc3JHzyw364P5i+Y6K4ecb1/8pFV/AWoMecOJeGkpGFye8ySwMvXcWxb5iuSCiOPO
S3Th1d+12MvTOTHVejApG6qBVBArgzkCy2g01xDR1mGiLkTmO8NyNOANzPLC5+MMfV6mcXGMVvsg
TZ3gHXjwL0zAmqYD5EmPlhqOQ8+Z/oPpfWRdaiGG7hUlvJluJCahPHVhkMA/EfwkHfUMZMlERHF3
Rk1LwTwem3FOWIXz3QDIMIkLRiCGg5Z50nX6hM03RESaTsKT6YRAOxoXw86PvTS01ujS9+Rc4rOk
+EArR2WvMxjrFgGTd1Xxm8NrstnVilnVi0biknQm+0Z8ICJigUrM53F4VLlOnjoJnEcbDlcyuDeV
bqPchQHzA9VkLq//CiDX5O4nVUjmeR3/MqbTEG15EvqnsKFp7dVSB4yg0bbhUKrnFlhMLmEc52Ql
7MTiKo53V6P4849VrTPB/QGpjkkHbBIwR0sPChYuLVSvMuFnGhPRMb2N1murWZMUtcdeM7uvDwD2
e4cR7hYn1h5FabluP+B0Hiq170tyvtQiUseNgVZfZMTpIXE8MmdxSnjOoqdndd8gy1Y//37gNSkF
5FO/FQa1d5FxMwMPZXTynK9RjHLDqYm5ckLTlPxSoqg2U/VB4OcoZM8OdcYqzRKObpB9yXw3+YpE
BrltNdSlxirmwZMFOqnHIe2msrgPb/PmRyaJAM3+kz5yabYsqDAoHwx03jY99KYiZ2wVpstDsxeX
9y8d/9uvQ58YBkRNHvTxQ7wwLWBfiH8vpvUu408PI90zUoDpPiEQT6SnPiuZwUaxCiAO8MHz6Z20
8CCXuDIUrv5tDxHVyg1EjYHw5F/EqH/r8rSzcK/aeT+ysH9KjWw3hkdJpLPrh7CHpnqDMzSv4Hs+
7YWibsxdwnmrW2WFHfr7AylXMAz4fVBfPonp3biZg3UK27q5/uyQDpNMN6DhvIk2l7LDZ5m/MTI1
D/6szHENdezx/ZWsQaleSzZxUzVCu/UODfB4fXbz1Yn0h6Gf4LK9+KfwFrAvDmK1yQ2BfGwKa3fe
Sp4KnkYDv0r33zQlS7WtiDuxFk/zToD2feqq/hQuFP8jZF8KXa0o8jpxlTdZ9Ee/JoEX+RL0ebkV
0M8rQgZQ3YFards+0tJIW4oTeJCaUjvIjwRZhys45yxouC6515MKI/S2YhG4uarUU/QZPjSQebYW
37WOn2OB16+JnHSox+kedS+M8Qu0N3CBC6J3jcmgxc6fUgZPGW9931tKuoyPqbD3+XGMz6rR/rCW
DznaShfwni8a52HQ0AMD1+ZjcY9gx/Z3EwkgW8pWNGWZZlsXXRZjSoO0gUYJXhUMZlQeuYnjIVY9
M9u/TGhD0zXisihaSBwpbOTCU4gXRnY/n5LZgcatNMeYECdhCwlRU/LqQrtXdRjRMZbQlGVc+oga
cHiTnLzm8na0zDGqdmvXAafT5goUtHXTtKF1ZxrkMiQ2UAvdd6iKRFpPHT4sCQYUt6+Ps1Jgz3vC
R21lPVs2SyPv481QmZ4jySyD8OwnGpjTRo7/BAOHhJ07UPmxClpD4WC9r05vuqBGey1P6TlN92t3
aIDBBPUuR58IROXVs4ShwISbplbmj+lIvc47wM/HKtcW5L5pB+0zMgrCD42LWd6u+DJbMFMTuzto
cp7GcY7g3m4Usj3tHaKbRPy9ZbzjGqm3vAEWZda+/xdAjKesd5jbiTcwg7zbSdOvMNRIt7oxyV2i
5T75oI9NM22gujLle2kQ5RTiLU2JCVWYCNIKzUHB5pDbqjsV+5YRL1RQeUUpx6p/7XxhhQNBN0We
SDtJ5Hp6+tlF5RuHfIH0oFpMZrKhtVnuwn23rq0HPnVgtWFO9sswMjUEZxSXGsNaGDV1H1kxTPbr
ubKw2pr3EOSdo/NcrwFl0NT5/QqJYPi+cHFXFIvf+lRNVnE7+PUe2nB0ornzwc/IOwgi6jGpYzFg
u7CB/s19YBsKE5a7AX5qGQzPZJ57Czy5aL53XJYrMRRs0dIjevhC0AbYkqjfVwqsq7tI92NxWCUp
/6+t4/bUEaLfFiEz8dedaOZS+uKL68L6h4B6//eokJ7Y3FLSf0ILdK5bReJwHULwrSHT56THaeqf
RVuOZDUTvYwJy7KHye8XO0k7bGvsgUqtna0GH043b/r+L5uoItZdeoR8Q2CFciTKdSPpweHKUtFf
xHTuh4MzO0CSFtm1nZD9euax637hJHP2IBFaS2mG/wiejMOxgF5W7VuOsSsM2hZsFdxsUmJGWkv1
0mETyGv84FLgq/Bi6vTAS2KJ2Uuhp93jZ0wS5TwSyD+cnRDQ/HJ9cXQI4ketr+4QAoMYICGhSpxh
MPLJ/FxJZMn+wF3E/DFzDzzjuKuHfttC0rFaplFxcXLsMH+/uHVPwBtQiGDx1Pi6t5f44nxlmbxy
C32DHGbaIe5BSNRF9dwUyQRw99m4ENFN4++6UZuEcZ/pt8bcqeQBijABvSpNpzqHW+CPJJN3pfIy
koIsQfe9KPzrdoMATcP+G6p7zgweAPEJNFk0mo0pdyYL+otD3MbBdaHOaga7iJjd/BmEajwBOz6b
btZ/79ZjEgEi24xG6kufAox4rjPb27jZ132QVSetqzP2CEMrYkdj4u2RMlxXYiIvG7LHUmMHkB/k
9qVns6COUyF++51QQ0Edf2Qb/mWmbdnFv6DVx59Oh7WfxIM/sTCHryx/U5io864Gu1C79MSCrsR0
R52OX7xjeOmMiD8xutMJuuouSA7WvgGW84aKqaqOKSO+XDA4ge0CeE1c8NUDgUtCSAlm/gRH+ojI
zSmiC8OwmGYiXvjt7XMnQSRdEzNcpqL6nHxnC9bf5rhoy3Mw3s3MSxYkp0s1SETDCogpNp0wWGu4
maO1Sy+fA8/WpNZ9c7g+tyjRK5CmX4bI8MomcUZV7FyS23NbFwj6VFzepL/k74hY8k0EVRrd8kL9
i6X2XWgr6OblMIZydeULcUUETLTy3vCVGHuNROwPKOE60N9/PzUCy4h42pfh5kkZsLrvbH9+IhQ2
I/r+ZF2lUWGgUD+sPTa2nqBiCMOBa4c/VZwdRE9C8VsbxUqYZNFNpdrcxs+oY4IOaUjMhJEy1I/t
pi1409nXTszcocPkfIl9DHKso5aCocL8A605R9jNJS532iAgcOByZpipPmM9TKa+MMu5DJdW/oW3
Bwicm3fgaZKjNYSomv1FTtuWBxtFz+9/bkEEViNvv4Q0D9Fa+2k7dOVsJdbeYhpbbuS5yx1xndXU
N7i5/oAxJjVf9i/Bsq2c3rbxza0oageFsJ3v+Me32dXlJON6owEFidzHhvUZHlyb71d0T1gDsdg3
9wwqy0EEsQrT+OFeFtfXteSZv3fpSCBGM17xM/8phO1J5SLtW+LNcSRj9hGnV33YbPE2QQMA4uPx
yrFDkEfid5FbaFotd3agtfwjT0bHwL9HRVteXrpVBHsWBnFf1IY/G7FCMIaU/okj+HW46lels973
sQBtp6lljNC0WcuWHlnGnpakZWlssYrM643O4q5FoFDj6col27i3MDloAdxRaz8l+dXAaJRaHvcU
O72SXkzEHrkeqeBCn9aZpZrJ0Aqdez/FoSIYiYzKvsCL1eUsXt8nM1ij/fDImly9Vaw3jpQqWtit
wQ9gOKV/xZkmOXgVVzMz8o3e5lrEKJYhV2ewkxp7vjo9WITnanfqb7WhrRYiSPtRwxKpJ75Y/B6S
QdQv1u+Vp0eP/xn5dqlQcnGRy1sv6rO2PBVbixdZbOLPiSyFKP8si9vBYBdi3NHskPH2eMadMUG6
DF89kMDTxFiC0FDKftTh13HwVw7fKkKnn3dK7ejNnvF2EP24lUxBqNSK34WV+s/bIsUj3B/zkcpk
ZnePERnOq0kmgF+fufmFqjBdRJYvZjb6Lif1cD0YP0TfGXo7gqcNdqdTCkoBZLR4bod2T0xpFiSi
j8DXVMEI2PYVXc57xRkS4Salgg+LYoxy9xY9iPXCpmPmCuzBmpiDP9Bj/9tyAFvO85wI+XK7CDiI
2c9OkRhi5nac1UOGc3cTtzlxRTfQBhgU01VPHKz9e9zKIIVnNnSQRgN/8knT7c9IpqXRvcZnKwgb
rsx7WTcXEIZe+grj7bZwncQNBqiZz38SVgXBOx8iw5wvDOjuJP97SFo+lwvos8avVpSTHBpvdbh3
zRMcwEDf2OZ5AyuFXZJG08zH41P0JtEZ8z7oXeNL+i6ZTdVYqcLSvN96ASrzxiy9dseHBaIMqk20
S4FO5UKxTmPfwIlw92fn4b1HPRQvcRn5wBdWA8tM5dpe97XgBPV7N4CVmF2eBUU1V4DSSISlGrf3
P72s+wIedNn86JthMfg9tIDCB4vDfeFdfHfVvwyLUkRHPvB4BeZ4e5kc14dQdKbF2AyfnCSVz2gJ
BQG2CdimOP4v9++uQUCrVUJOI4pt6A++d3SCfqQZ1FF0uAohIDfTgwX0LqypyMGMY9KOk1vb2GiL
czGsPPNQ3Nt8hfXTciH2tY3WfDio6IJYsaFxeSonKlJvXSwznjrONSQW4NDI/Ds3SNHra8CQAuBS
DV9ig34pYP+QMZuaFfZCJtCuudmsni2IzxsnX09mSVy7ipT1uXY+ZPTunHi4H5+WbKqnPjW16oVz
9lz0vntsWUbCREo8A46VpbNfnYAjYrRr6yAcnnV8Mqvft/qEFPd1BLPOerPbLa4PgsNrP/GiPqBs
MjDI+MOWTeZnZWk6MWEQaDceThIlpx+eRH9tCRU4thJxlUwXuH4OmU+SmgCADqvk4gKH//8H+fDy
sdUXmhMP+axGDUmCK+oWKWC0CbTHuQmq3Ip35Gl+ZwAK9kbj5J6uz0GhAcuSS7DxbvEejaICK8gM
x/QHJMIvTGBupC0pnih4YICQ9z6IM++OztPsbBZvpYh2QN4LednEqCplbOOZnjYA8Se/vnzpCulM
zWStA55t+ttYqoZ6jk6WCa5Xl2FcaPgLkYG1G8J6MnCAJjzn1Kvwf+7TRrkgHy8IjntwHl/8xsLQ
k8BPjHTp08/vzaIpHn5K9rV8o/RADZQKPcs8JWNzgBB9kCr5WjncIGj/jeg1CqPfpQpZaoKmDUrN
JNww+EI6ax4vVXCDGv40lCqx/sk2XGaOOiQtJojFKlmOUw5ItjafSHU478WR387iWHa4fTMgofwN
4z0WV3DqK/O4cNHKM/6eKE8C4m38DsM8OUwkgbP+uAIvDtQp45JDIfJAoD18T1Y2zOxL3wzZ6RnO
AKKs7RX2VEzD1Ai0qSh81h6jmA0XPld/lNaIfODwjVgbg8GFKk7IUMuhQt4bQAhk1b2q7ikTGKcJ
i7xzzhKoFY0Hs4MXRSFDaFx8uj0EBP5r/oxJGJINPKDo6EPvVm4hAV9kaRhL9ZXZ8sWofKXdU5x7
hfsM6l8UIcdzaswWGCZwY7ygYu0YFQeUnds0+0wiwfQ7Y8JY4kqxsfyrPjo5kX4Yjtr/3dL++ap9
EMlezbcorcVOn59DijXI0wGG0Gn1b+O95FhC4IzyApX2h+AORjZ1tZY/7Tv5tX+3keZe5KZtUIHK
cio7TfcqJx7/xLRMgeUxLWv6cJdDJw3PkV8wnnA11LsLTyPUrLIG20Sau2712nRB8MpGHwwYVY3F
fdxF849LlhxWQhpLrg7GMa//KxNRPJCEt+2qRW7RC5SYImMw3p+sIeXNtjeqlC8jGnn0d20xtQmn
e6GXP9NE/gXlf5+VDjnW3cz20aU7dwsj1cgqlHjqFqODk2f/HvaGtmOZGbTZSXXoQk2Nxm5b/4e6
0Gc6Ncp2M+XCNNfIdPdZKKHxOC8m+NfN5lMNE5NEaBuEax11jNP+t/nqvzjywzoy141r7Ig9HsDo
SxUsSsztB102kKW8sLY8EdXm8uzhtVkAql03tS+GLCiUKmY9D/bCMgMdeNypSlAd8ZWRWj/5CTZ4
1gizwTPKdUxR573DaVvTGXskfIgVOYRgOGaCANueFUjPJgyv7sDH8GYs+xVVyzCTrQPDdajU/sxk
lt5BalwTZFuJVgN4dsrBXDu1gI0Vj1WnxGB8k/5A/zySPYuwo7hkto+HaLRvPmrvUDvViQytkjXp
z0a2TlGtRUBUyj3hDNK6XScDY34lrA2I8TrUDOkDMKHbIXB8qBfNM2oS7QX0mSIIVvD+Cs2i27CL
BV81Is6pejO7FfLl1RjbnH8PGrD4rffKbThkweRTJ8DGL84r3raMEubVJLfi5JLSXqJIvfFLcTnj
1i/+ZfBCEByU9SvjRfRYqaCTn0l+kcBnVwN+bLm3SUcG4ekmkQzRQldU7Cs1wZdMzI93b5ahSWUy
v08DcUZrSrMs0A4YI9mLb8XqwzOSAa8rQh+VCy/yjHrB/Z0zXWXwM3jdwvmt+F7I/EwUFgyaU9B4
IMl/efkuo9QYyU+T6kJjn24NCXG4fHutDxIcOg8fi5KGtl2gVULvqtgAO4F+W5tnYXWLM+XgL+gW
W/XYE0yB124A+H5TVe3am5NAfi6Pz0lku9xC1xsRM7NTQ2YW1G1bfJe/xWk8VR6+Lv2YJQkTtfRb
oGlTOWGHorsqS0wzR1SYxSFuhpYh5IHm9E4joCL61Dcqnb3ovMUZLszgff0T6Yiw7K309Vkkob6M
wKNn/Ga/xGQU5qw/IfQ+oCeceLZ+YEz25GBmc3Yl26gSGAr4b3rb+iV8R6BfkaZmaNY8pmrl2MvX
9A5sPg20pPbliZ+Pv55hoaiaCj9FjsVq0bl2pEjp1g7HMsA8067OGOND3nWodvDehAVChlD6NQxf
yfOk5al+2TB07nY3mm9yS+FNmEkCApadFja0vnkohkX78BS8bJlSpGF5PoTwuMt8ltLUVOmkhw9d
ut2D1DabRguMHAa51IvREXnGAc6JJxvLcb/0v88zpNtNmjvLuqLoVWOEBgFDT82+RjuPAkbE63Cg
DsLrZib7ItYM4dVsrzCibLM9jOYWNuPAQ1+3QxONMvbJ2L4CRR1GhlfnK4LDS4LMxqteh7Bc7if3
YBTDFRJqwfJoPnQ4DHyTdur1tSGpZ7b14hvJI4sVxhFJ1nHi+zNWJR+T5KtSs5GvoiMHtEWm3X18
ZU593Iqu5FmuKyjGANkgMbn5H+EudSFeaW//Men78GJnIWW0z1iXwHdoPMrzLSVS5Nluj+CACu+T
gKqZBuws4Y2RC2r3YAJHuOefDom5yGDgiI69EyG2JURCdq75c0LCgqG/U6EvvCd5y4XmSl0R7ZEG
nWYiL9maWDYS2030ee/RaLhi831u5+BYJofAesWoLehK+NUzw/oVPS3RrrXl/1AWhgqK9s6y4e5Y
iC3CXbGcOoDpm6ZbjkXTItdW121a+rBVa3xpx/URT2mu1RWHRxMULK0xgG2H5iDNbRJA5ciBgH7P
dX2l8rfjtG5cojjejFWialhTK+lHS511qCQVsBTbmDl1dogDfjzU713/on0Cg3YKuO2/H09/6dTQ
3dWb8oiJfTTLK+4+BmXKSOICaJuoCIHNPQNuNfW4ihnc0PD4Gj3XiHmcQAbPNKwKrsnN6QO8UF4m
sBua6Ho8wvz3LbmqWlBT6MLQluaARzuGhbbLWcPCpfB22osoHxVQLQlRXvjZS8BlcJYtLlednbRL
bycRYQppYxcrbvhH6PPSgm+Mnp8lOE8kc35mUk/GnX7Jur1GIa4QrfoAXvJux6Asdrz8sGu59ElF
Fme9iZrlWoRK3zRqpGgxj9ExiZEaRPUwpaRi2cv5iakSzaytFN8mpWFd7GAMBF/k9BFdNzuunSEk
611ozIhNrbl4G2FvUVA4xLJK3QSAuLMfWf7QN8ivNIV3FlSNdMdgm3+ho1ZOMUnW3pc8Udj1ydr6
VzAq10q7nrQ3X0ebKnqPpin4L2LqDDISr3Bbe+sHMmtXJUgzr42LzbqBn3FwHmZskP4ShfIN6gfl
sAMFTM4dbiBErR6UEBn7tlti48juJmQDUFRznHg7CI6n39n+rfABALG03fW5TLd9rWIxejf0wseh
xixHpmgUuq5+n0FVnng4Z+pIR7uR/todlSTl8hgVhfcCAjGhKqprC8s9XoDWk2Mrc9Hv1EpqeBto
itFGfRWdS6MV/U4aq7nZpFpetESlFJtGMH+Ezvct6mp/sbkABczA6Zs0uCGjntRnQ/nnJY/x199l
ptaTlfSFKojr8m1RwymXRzZYSA59EJirltXIhQpjUibticMqns7XKvAr6EXdOovbZpcG3an8017p
Y5oeME6KcPbpjcKogtgBwL9ptS0e1y8DVQTg+EAsQll2CZej+10I2XdhHjonioOWYSn42+43/jYA
Ht2z/W+IP3kz6Jar+WZuVIKAoO+lWW5xAexGWDuXlATe+wpa83DwEmRaVEi54iKJBO83wsn/lDbK
iJjOWB1sN+Vmrd0kR9woRS2fCwml8m==                                                                                                                                                                                                                                                         administration/includes/params.php                                                                  0000644 0023433 0004734 00000000356 11051631502 017253  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

/**
 * This file is included in the init file before any 
 * other php coding has started.  This is usefull if your
 * host requires a custom setting that you can not change.
 */

error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
?>                                                                                                                                                                                                                                                                                  administration/index.php                                                                            0000644 0023433 0004734 00000010376 11051631504 015276  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Users.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Orders.php');
require_once(FILESYSTEM_PATH .'includes/classes/magpierss/rss_fetch.inc');
$Users= new Users;
$Orders= new Orders;
	$error='';
	if (file_exists('../setup/index.php'))
	{
		$error="Warning: Please remove the setup directory.<br />";
	}
	if($Core->settings['mainTakeOffline']=="Y")
	{
		$error.="Warning: Your site is currently set to offline.";
	}
	$class_tpl->assign('error', $error);

	//new orders
	$sSQL="SELECT oID, oOwnerID, oProduct, oDate FROM ".PREFIX."orders ORDER BY oDate DESC LIMIT 10";
	$result=$db->query($sSQL);
	$neworders="<ul>";
		while($row=$result->fetch())
		{
			$user=$Users->getUserNameById($row['oOwnerID']);
			$neworders.='<li>'.$user['username'] .' - <a href="orders.php?action=modify&amp;id='.$row['oID'].'">'.$row['oProduct'].'</a> - '.$row['oDate'].'</li>';
		}
	$neworders.='</ul>';
	$class_tpl->assign('neworders', $neworders);
	
	//new listings
	$sSQL="SELECT id, title, dateadded FROM ".PREFIX."listings ORDER BY dateadded DESC LIMIT 10";
	$result=$db->query($sSQL);
	$newlistings="<ul>";
		while($row=$result->fetch())
		{
			$newlistings.='<li><a href="listings.php?view='.$row['id'].'">'.$row['title'].'</a> - '.$row['dateadded'].'</li>';
		}
	$newlistings.='</ul>';
	$class_tpl->assign('newlistings', $newlistings);
	
	//new users
	$sSQL="SELECT id, username, joindate FROM ".PREFIX."users ORDER BY joindate DESC LIMIT 10";
	$result=$db->query($sSQL);
	$newusers="<ul>";
		while($row=$result->fetch())
		{
			$newusers.='<li><a href="users.php?view='.$row['id'].'">'.$row['username'].'</a> - '. $row['joindate'].'</li>';
		}
	$newusers.='</ul>';
	$class_tpl->assign('newusers', $newusers);
	
	// get total//
		$sSQL = "SELECT id FROM ".PREFIX."listings";
		$result=$db->query($sSQL);
		$rs=$result->fetch();
		$total_listings=$result->size();
	
		// get users//
		$sSQL = "SELECT id FROM ".PREFIX."users";
		$result=$db->query($sSQL);
		$total_members=$result->size();
	
		// get subscribers//
	     $sSQL="SELECT firstname, lastname, email FROM ".PREFIX."users WHERE newsletter='Y'";
		$result=$db->query($sSQL);
		$subscribers=$result->size();
		
		if($total_members<>"")
		{
			$percentage=number_format(($subscribers/$total_members)*100);
		}
		else
		{
			$percentage=0;
		}
		$class_tpl->assign('total_listings', $total_listings);
		$class_tpl->assign('total_members', $total_members);
		$class_tpl->assign('percentage', $percentage);
		$class_tpl->assign('subscribers', $subscribers);
	
	//monthly sales
	$dateMinusOneMonth = mktime(0, 0, 0, date("m")-1, date("d"),  date("Y"));
	$date = date("Y-m", $dateMinusOneMonth);
	$class_tpl->assign('lastmonth', $Orders->getMonthlyTotal($date));
	
	$date=date("Y-m");
	$class_tpl->assign('thismonth', $Orders->getMonthlyTotal($date));
	
	//pending orders
	$class_tpl->assign('results', $Orders->getPendingOrders());
	
	//private messages
	$sSQL='SELECT turnedon FROM '.PREFIX.'settings_pm WHERE id=1';
	$result=$db->query($sSQL);
	$row=$result->fetch();
	if($row['turnedon']=='Y')
	{
		$sSQL='SELECT COUNT(*) AS total FROM '.PREFIX.'pm WHERE isspam = "Y"';
		$result=$db->query($sSQL);
		$rs=$result->fetch();
		$result->freeResult();
		$totalspam=$rs['total'];
		$class_tpl->assign('totalspam', $totalspam);
		$class_tpl->assign('pmon', "Y");
	}
				
	//rss
	$url = 'http://www.68classifieds.com/forums/external.php?type=rss&forumids=2&count=2';
	$url = 'http://www.68classifieds.com/forums/external.php?forumids=2&fulldesc&count=3';
	$rss = fetch_rss($url);
	$output='';
	$i='';
		foreach ($rss->items as $item) 
		{
			$href = $item['link'];
			$href = str_replace('&', '&amp;', $href);
			$data =  $item['pubdate'];
			$btitle = $item['title'];
			$blog[$i]['link']= $href;
			$blog[$i]['title'] = $btitle;
			$output.="<strong><a href='".$href."' target='_blank'>".$btitle."</a></strong>";
			$output.="<p>".$item['description']."</p>";
		}
		$class_tpl->assign('news', $output);
$class_tpl->assign('body', 'home.tpl');
$class_tpl->displayTemplate();
?>                                                                                                                                                                                                                                                                  administration/javascript/                                                                          0000755 0023433 0004734 00000000000 11036006246 015617  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/javascript/fat.js                                                                    0000644 0023433 0004734 00000005020 11051631505 016723  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 // @name      The Fade Anything Technique
// @namespace http://www.axentric.com/aside/fat/
// @version   1.0-RC1
// @author    Adam Michela

var Fat = {
	make_hex : function (r,g,b) 
	{
		r = r.toString(16); if (r.length == 1) r = '0' + r;
		g = g.toString(16); if (g.length == 1) g = '0' + g;
		b = b.toString(16); if (b.length == 1) b = '0' + b;
		return "#" + r + g + b;
	},
	fade_all : function ()
	{
		var a = document.getElementsByTagName("*");
		for (var i = 0; i < a.length; i++) 
		{
			var o = a[i];
			var r = /fade-?(\w{3,6})?/.exec(o.className);
			if (r)
			{
				if (!r[1]) r[1] = "";
				if (o.id) Fat.fade_element(o.id,null,null,"#"+r[1]);
			}
		}
	},
	fade_element : function (id, fps, duration, from, to) 
	{
		if (!fps) fps = 30;
		if (!duration) duration = 3000;
		if (!from || from=="#") from = "#FFFF33";
		if (!to) to = this.get_bgcolor(id);
		
		var frames = Math.round(fps * (duration / 1000));
		var interval = duration / frames;
		var delay = interval;
		var frame = 0;
		
		if (from.length < 7) from += from.substr(1,3);
		if (to.length < 7) to += to.substr(1,3);
		
		var rf = parseInt(from.substr(1,2),16);
		var gf = parseInt(from.substr(3,2),16);
		var bf = parseInt(from.substr(5,2),16);
		var rt = parseInt(to.substr(1,2),16);
		var gt = parseInt(to.substr(3,2),16);
		var bt = parseInt(to.substr(5,2),16);
		
		var r,g,b,h;
		while (frame < frames)
		{
			r = Math.floor(rf * ((frames-frame)/frames) + rt * (frame/frames));
			g = Math.floor(gf * ((frames-frame)/frames) + gt * (frame/frames));
			b = Math.floor(bf * ((frames-frame)/frames) + bt * (frame/frames));
			h = this.make_hex(r,g,b);
		
			setTimeout("Fat.set_bgcolor('"+id+"','"+h+"')", delay);

			frame++;
			delay = interval * frame; 
		}
		setTimeout("Fat.set_bgcolor('"+id+"','"+to+"')", delay);
	},
	set_bgcolor : function (id, c)
	{
		var o = document.getElementById(id);
		o.style.backgroundColor = c;
	},
	get_bgcolor : function (id)
	{
		var o = document.getElementById(id);
		while(o)
		{
			var c;
			if (window.getComputedStyle) c = window.getComputedStyle(o,null).getPropertyValue("background-color");
			if (o.currentStyle) c = o.currentStyle.backgroundColor;
			if ((c != "" && c != "transparent") || o.tagName == "BODY") { break; }
			o = o.parentNode;
		}
		if (c == undefined || c == "" || c == "transparent") c = "#FFFFFF";
		var rgb = c.match(/rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/);
		if (rgb) c = this.make_hex(parseInt(rgb[1]),parseInt(rgb[2]),parseInt(rgb[3]));
		return c;
	}
}

window.onload = function () 
	{
	Fat.fade_all();
	}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                administration/javascript/menu.js                                                                   0000644 0023433 0004734 00000027107 11051631506 017130  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 /***********************************************************************************************
	
	Copyright (c) 2005 - Alf Magne Kalleland post@dhtmlgoodies.com
	
	Get this and other scripts at www.dhtmlgoodies.com
	
	You can use this script freely as long as this copyright message is kept intact.
	
	***********************************************************************************************/
		
	var topMenuSpacer = 0; // Horizontal space(pixels) between the main menu items	
	var activateSubOnClick = true; // if true-> Show sub menu items on click, if false, show submenu items onmouseover
	var leftAlignSubItems = true; 	// left align sub items t
	
	var activeMenuItem = false;	// Don't change this option. It should initially be false
	var activeTabIndex = 0;	// Index of initial active tab	(0 = first tab) - If the value below is set to true, it will override this one.
	var rememberActiveTabByCookie = true;	// Set it to true if you want to be able to save active tab as cookie
	
	var MSIE = navigator.userAgent.indexOf('MSIE')>=0?true:false;
	var Opera = navigator.userAgent.indexOf('Opera')>=0?true:false;
	var navigatorVersion = navigator.appVersion.replace(/.*?MSIE ([0-9]\.[0-9]).*/g,'$1')/1;
		
	/*
	These cookie functions are downloaded from 
	http://www.mach5.com/support/analyzer/manual/html/General/CookiesJavaScript.htm
	*/	
	function Get_Cookie(name) { 
	   var start = document.cookie.indexOf(name+"="); 
	   var len = start+name.length+1; 
	   if ((!start) && (name != document.cookie.substring(0,name.length))) return null; 
	   if (start == -1) return null; 
	   var end = document.cookie.indexOf(";",len); 
	   if (end == -1) end = document.cookie.length; 
	   return unescape(document.cookie.substring(len,end)); 
	} 
	// This function has been slightly modified
	function Set_Cookie(name,value,expires,path,domain,secure) { 
		expires = expires * 60*60*24*1000;
		var today = new Date();
		var expires_date = new Date( today.getTime() + (expires) );
	    var cookieString = name + "=" +escape(value) + 
	       ( (expires) ? ";expires=" + expires_date.toGMTString() : "") + 
	       ( (path) ? ";path=" + path : "") + 
	       ( (domain) ? ";domain=" + domain : "") + 
	       ( (secure) ? ";secure" : ""); 
	    document.cookie = cookieString; 
	}	
	
	function showHide()
	{
		if(activeMenuItem){
			activeMenuItem.className = 'inactiveMenuItem'; 	
			var theId = activeMenuItem.id.replace(/[^0-9]/g,'');
			document.getElementById('submenu_'+theId).style.display='none';
			var img = activeMenuItem.getElementsByTagName('IMG');
			if(img.length>0)img[0].style.display='none';			
		}

		var img = this.getElementsByTagName('IMG');
		if(img.length>0)img[0].style.display='inline';
				
		activeMenuItem = this;		
		this.className = 'activeMenuItem';
		var theId = this.id.replace(/[^0-9]/g,'');
		document.getElementById('submenu_'+theId).style.display='block';
		

				
		if(rememberActiveTabByCookie){
			Set_Cookie('dhtmlgoodies_tab_menu_tabIndex','index: ' + (theId-1),100);
		}
	}
	
	function initMenu()
	{
		var mainMenuObj = document.getElementById('menu');
		var menuItems = mainMenuObj.getElementsByTagName('A');
		if(document.all){
			mainMenuObj.style.visibility = 'hidden';
			document.getElementById('submenu').style.visibility='hidden';
		}		
		if(rememberActiveTabByCookie){
			var cookieValue = Get_Cookie('dhtmlgoodies_tab_menu_tabIndex') + '';
			cookieValue = cookieValue.replace(/[^0-9]/g,'');
			if(cookieValue.length>0 && cookieValue<menuItems.length){
				activeTabIndex = cookieValue/1;
			}			
		}
		
		var currentLeftPos = 0;
		for(var no=0;no<menuItems.length;no++){			
			if(activateSubOnClick)menuItems[no].onclick = showHide; else menuItems[no].onmouseover = showHide;
			menuItems[no].id = 'mainMenuItem' + (no+1);
			menuItems[no].style.left = currentLeftPos + 'px';
			currentLeftPos = currentLeftPos + menuItems[no].offsetWidth + topMenuSpacer; 
			
			var img = menuItems[no].getElementsByTagName('IMG');
			if(img.length>0){
				img[0].style.display='none';
				if(MSIE && !Opera){
					img[0].style.bottom = '-1px';
					img[0].style.right = '-1px';
				}
			}
						
			if(no==activeTabIndex){
				menuItems[no].className='activeMenuItem';
				activeMenuItem = menuItems[no];
				var img = activeMenuItem.getElementsByTagName('IMG');
				if(img.length>0)img[0].style.display='inline';	
							
			}else menuItems[no].className='inactiveMenuItem';
			if(!document.all)menuItems[no].style.bottom = '-1px';
			if(MSIE && navigatorVersion < 6)menuItems[no].style.bottom = '-2px';
			

		}		
		
		var mainMenuLinks = mainMenuObj.getElementsByTagName('A');
		
		var subCounter = 1;
		var parentWidth = mainMenuObj.offsetWidth;
		while(document.getElementById('submenu_' + subCounter)){
			var subItem = document.getElementById('submenu_' + subCounter);
			
			if(leftAlignSubItems){
				// No action
			}else{							
				var leftPos = mainMenuLinks[subCounter-1].offsetLeft;
				document.getElementById('submenu_'+subCounter).style.paddingLeft =  leftPos + 'px';
				subItem.style.position ='absolute';
				if(subItem.offsetWidth > parentWidth){
					leftPos = leftPos - Math.max(0,subItem.offsetWidth-parentWidth); 	
				}
				subItem.style.paddingLeft =  leftPos + 'px';
				subItem.style.position ='static';
					
				
			}
			if(subCounter==(activeTabIndex+1)){
				subItem.style.display='block';
			}else{
				subItem.style.display='none';
			}
			
			subCounter++;
		}
		if(document.all){
			mainMenuObj.style.visibility = 'visible';
			document.getElementById('submenu').style.visibility='visible';
		}		
		document.getElementById('submenu').style.display='block';
	}
	
var checktoggle = 1;
function toggleAll(formname) {
	var currForm = formname;
	var isChecked = checktoggle;
	var itercount = 1;
	var trassignid;

	if (checktoggle == 1) {
		checktoggle = 0;
	} else {
		checktoggle = 1;
	}

	for (var elementIdx=0; elementIdx<currForm.elements.length; elementIdx++) {
		if (!currForm.elements)
		{
			break;
		}

		if (currForm.elements[elementIdx].type == 'checkbox') {
			currForm.elements[elementIdx].checked = isChecked;
		} else if (currForm.elements[elementIdx].type == 'hidden') {
			hidval = currForm.elements[elementIdx].name;

			if (hidval.substr(0, 13) == 'itemhighlight')
			{
				trassignid = hidval.substr(13, hidval.length);
				currForm.elements[elementIdx].value = isChecked;
				highlightTR("trid"+trassignid, isChecked, itercount);
				itercount++;
			}
		}
	}
}

// Calendar //
var popupCalendar = null;

function showCalendar(id, format, showsTime, showsOtherMonths) {
	var el = document.getElementById(id);
	if (popupCalendar != null) {
		popupCalendar.hide();
	} else {
		var cal = new Calendar(1, null, calSelected, calCloseHandler);
		if (typeof showsTime == "string") {
			cal.showsTime = true;
			cal.time24 = (showsTime == "24");
		}
		if (showsOtherMonths) {
			cal.showsOtherMonths = true;
		}
		popupCalendar = cal;
		cal.setRange(1900, 2070);
		cal.create();
	}
	popupCalendar.setDateFormat(format);
	popupCalendar.parseDate(el.value);
	popupCalendar.sel = el;

	popupCalendar.showAtElement(el, "Br");

	return false;
}

function calSelected(cal, date) {
	cal.sel.value = date;
	if (cal.dateClicked && (cal.sel.id == "opt_due"))
	cal.callCloseHandler();
}
function calCloseHandler(cal) {
	cal.hide();
	popupCalendar = null;
}

		/** ------------------------------------
        /**  Live URL Title Function
        /** -------------------------------------*/
        
        function catSlug()
        {
        	var defaultTitle = '';
			var NewText = document.getElementById("name").value;
			
			if (defaultTitle != '')
			{
				if (NewText.substr(0, defaultTitle.length) == defaultTitle)
				{
					NewText = NewText.substr(defaultTitle.length)
				}	
			}
			
			NewText = NewText.toLowerCase();
			var separator = "-";
			
			if (separator != "_")
			{
				NewText = NewText.replace(/\_/g, separator);
			}
			else
			{
				NewText = NewText.replace(/\-/g, separator);
			}
	
			// Foreign Character Attempt
			
			var NewTextTemp = '';
			for(var pos=0; pos<NewText.length; pos++)
			{
				var c = NewText.charCodeAt(pos);
				
				if (c >= 32 && c < 128)
				{
					NewTextTemp += NewText.charAt(pos);
				}
				else
				{
					if (c == '223') {NewTextTemp += 'ss'; continue;}
				if (c == '224') {NewTextTemp += 'a'; continue;}
				if (c == '225') {NewTextTemp += 'a'; continue;}
				if (c == '226') {NewTextTemp += 'a'; continue;}
				if (c == '229') {NewTextTemp += 'a'; continue;}
				if (c == '227') {NewTextTemp += 'ae'; continue;}
				if (c == '230') {NewTextTemp += 'ae'; continue;}
				if (c == '228') {NewTextTemp += 'ae'; continue;}
				if (c == '231') {NewTextTemp += 'c'; continue;}
				if (c == '232') {NewTextTemp += 'e'; continue;}
				if (c == '233') {NewTextTemp += 'e'; continue;}
				if (c == '234') {NewTextTemp += 'e'; continue;}
				if (c == '235') {NewTextTemp += 'e'; continue;}
				if (c == '236') {NewTextTemp += 'i'; continue;}
				if (c == '237') {NewTextTemp += 'i'; continue;}
				if (c == '238') {NewTextTemp += 'i'; continue;}
				if (c == '239') {NewTextTemp += 'i'; continue;}
				if (c == '241') {NewTextTemp += 'n'; continue;}
				if (c == '242') {NewTextTemp += 'o'; continue;}
				if (c == '243') {NewTextTemp += 'o'; continue;}
				if (c == '244') {NewTextTemp += 'o'; continue;}
				if (c == '245') {NewTextTemp += 'o'; continue;}
				if (c == '246') {NewTextTemp += 'oe'; continue;}
				if (c == '249') {NewTextTemp += 'u'; continue;}
				if (c == '250') {NewTextTemp += 'u'; continue;}
				if (c == '251') {NewTextTemp += 'u'; continue;}
				if (c == '252') {NewTextTemp += 'ue'; continue;}
				if (c == '255') {NewTextTemp += 'y'; continue;}
				if (c == '257') {NewTextTemp += 'aa'; continue;}
				if (c == '269') {NewTextTemp += 'ch'; continue;}
				if (c == '275') {NewTextTemp += 'ee'; continue;}
				if (c == '291') {NewTextTemp += 'gj'; continue;}
				if (c == '299') {NewTextTemp += 'ii'; continue;}
				if (c == '311') {NewTextTemp += 'kj'; continue;}
				if (c == '316') {NewTextTemp += 'lj'; continue;}
				if (c == '326') {NewTextTemp += 'nj'; continue;}
				if (c == '353') {NewTextTemp += 'sh'; continue;}
				if (c == '363') {NewTextTemp += 'uu'; continue;}
				if (c == '382') {NewTextTemp += 'zh'; continue;}
				if (c == '256') {NewTextTemp += 'aa'; continue;}
				if (c == '268') {NewTextTemp += 'ch'; continue;}
				if (c == '274') {NewTextTemp += 'ee'; continue;}
				if (c == '290') {NewTextTemp += 'gj'; continue;}
				if (c == '298') {NewTextTemp += 'ii'; continue;}
				if (c == '310') {NewTextTemp += 'kj'; continue;}
				if (c == '315') {NewTextTemp += 'lj'; continue;}
				if (c == '325') {NewTextTemp += 'nj'; continue;}
				if (c == '352') {NewTextTemp += 'sh'; continue;}
				if (c == '362') {NewTextTemp += 'uu'; continue;}
				if (c == '381') {NewTextTemp += 'zh'; continue;}
				
				}
			}
    
			NewText = NewTextTemp;
			
			NewText = NewText.replace('/<(.*?)>/g', '');
			NewText = NewText.replace('/\&#\d+\;/g', '');
			NewText = NewText.replace('/\&\#\d+?\;/g', '');
			NewText = NewText.replace('/\&\S+?\;/g','');
			NewText = NewText.replace(/['\"\?\.\!*$\#@%;:,=\(\)\[\]]/g,'');
			NewText = NewText.replace(/\s+/g, separator);
			NewText = NewText.replace(/\//g, separator);
			NewText = NewText.replace(/[^a-z0-9-_]/g,'');
			NewText = NewText.replace(/\+/g, separator);
			NewText = NewText.replace(/[-_]+/g, separator);
			NewText = NewText.replace(/\&/g,'');
			NewText = NewText.replace(/-$/g,'');
			NewText = NewText.replace(/_$/g,'');
			NewText = NewText.replace(/^_/g,'');
			NewText = NewText.replace(/^-/g,'');
			
			if (document.getElementById("url_title"))
			{
				document.getElementById("url_title").value = "" + NewText;			
			}
			else
			{
				document.forms['mainform'].elements['slug'].value = "" + NewText; 
			}		
		}                                                                                                                                                                                                                                                                                                                                                                                                                                                         administration/javascript/toggle.js                                                                 0000644 0023433 0004734 00000002665 11051631507 017450  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 if (document.getElementById && document.getElementsByTagName && document.createElement) {
	document.write('<style type="text/css">#toggleable div {display: none;}</style>');
	window.onload = initShowHide;
}


function initShowHide() {
	// Hide all toggleable sections with JavaScript for the highly improbable case that CSS is disabled
	// Note that in this case the 'flash of visible content' still will occur
	// For testing purposes you can add the following code to disable CSS: document.getElementsByTagName('link')[0].disabled = true;			
	hide();
	var toggle = document.getElementById('toggle');
	var as = toggle.getElementsByTagName('a');
	for (var i = 0; i < as.length; i++) {
		as[i].onclick = function() {
			show(this);
			return false;
		}
	}
	document.getElementById('info').style.display = 'block';
}

function show(s) {
	hide();
	var id = s.href.match(/#(\w.+)/)[1];
	document.getElementById(id).style.display = 'block';
	var oldCurrent = document.getElementById('current');
	// If this element exists, remove its ID attribute
	if (oldCurrent) oldCurrent.removeAttribute('id');
	// Add the ID attribute with value 'current' to the newly active tab header (LI element)
	s.parentNode.setAttribute('id', 'current');
	//call cpaint
	//displaySec(id);
}

function hide() {
	var toggleable = document.getElementById('toggleable').getElementsByTagName('div');
	for (var i = 0; i < toggleable.length; i++) {
		toggleable[i].style.display = 'none';
	}
}

                                                                           administration/language/                                                                            0000755 0023433 0004734 00000000000 11036006261 015231  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/language/english.php                                                                 0000644 0023433 0004734 00000066266 11051631512 017413  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/

// Set the PHP locale to English
setlocale(LC_ALL, 'english');

// general //
define("ADMIN_FIELD_SIZE", "30");
define("LANG_SUBMIT", "Submit");
define("LANG_SAVE", "Save");
define("LANG_UPDATE", "Update");
define("LANG_RESET", "Reset");
define("LANG_SETTINGS_SAVED", "Your settings have been saved.");
define("LANG_YES", "Yes");
define("LANG_NO", "No");
define("LANG_DELETE", "Delete");
define("LANG_CLOSE", "Close");
define("LANG_PLEASE_SELECT", "Please Select");
define("LANG_STAR", "*");
define("LANG_TO", "To");
define("LANG_LOGGED_IN", "Logged In:");
define("LANG_ANY", "Any");

///////////////////////////////////////////////////////////////////////////////
//added v4.0.4
///////////////////////////////////////////////////////////////////////////////
define("LANG_RENEWAL", "Renewal");
define("LANG_ORIGINAL_ORDER", "View Original Order");
define("LANG_ORD_HISTORY", "Order History");
define("LANG_CUSTOMER_INFO", "Customer Information");
define("LANG_ADDITIONAL_INFO", "Additional Info");

// User Notes //
define("LANG_NOTES", "Notes");
define("LANG_WROTE", "wrote on");
define("LANG_NOTES_TXT", "Any notes entered here will be only accessable from the administration and the user will not see them.");
define("LANG_ADD_NOTE_SUCCESS", "Your note has been added! <br />Before it will show you will need to refresh the page.");


// user groups //
define("LANG_DELETE_USER_GROUP", "Warning: All users that belong to this group will be placed in the registered users group.");
define("LANG_ADMIN_USER_GROUPS", "User Groups");
define("LANG_BANNED_GROUP", "This Usergroup is a 'Banned' Group");
define("LANG_USERGROUP_CONTACT_OWNER", "This Usergroup can contact the owner");
define("LANG_USERGROUP_FRIEND_MAIL", "This Usergroup can email a friend");
define("LANG_USERGROUP_VIEW_SITE", "This Usergroup can view your site");
define("LANG_USERGROUP_VIEW_PHOTOS", "This Usergroup can view photos");
define("LANG_USERGROUP_VIEW_PRICE", "This Usergroup can view price");
define("LANG_THIS_USERGROUP", "This Usergroup can view");
define("LANG_PHOTO", "Photo");
define("LANG_DISPLAY_SELLER", "Seller's Name");
define("LANG_DISPLAY_COUNTRY", "Seller's Country");
define("LANG_DISPLAY_PRICE", "Seller's Price");
define("LANG_DISPLAY_DATE", "Date Added");
define("LANG_DISPLAY_EXPIRATION", "Expiration");
define("LANG_DISPLAY_HITS", "Hit Count");
define("LANG_USER_FAVORITES", "This Usergroup can save favorites");
define("LANG_USER_ALLOW_CONTACT", "Contact the owner");
define("LANG_DISPLAY_CONTACT_REGISTERED", "Only registered users");
define("LANG_DISPLAY_CONTACT_ALL", "All users");
define("LANG_DISPLAY_CONTACT_NONE", "Do not use");
define("LANG_DISPLAY_FRIENDMAIL", "Friendmail");
define("LANG_DATEADDED", "Date Added");

// user //
define("LANG_FULLNAME", "Name");
define("LANG_USER_NOTES", "User Notes");
define("LANG_NEWSLETTER", "Newsletter");
define("LANG_TERMS", "Terms &amp; Conditions");
define("LANG_CAPTCHA", "Security Image");
define("LANG_DISPLAY", "Display");
define("LANG_MEMBER_ADMINISTRATOR", "Are you sure wish to assign this member to the administrators user group?");
define("LANG_ACCOUNT_INFO", "Account Information");
define("LANG_USER_GROUP", "User Group");
define("LANG_PLEASE_CONFIRM", "Please confirm your");
define("LANG_PERSONAL_INFO", "Personal Information");
define("LANG_FIRST_NAME", "First Name");
define("LANG_LAST_NAME", "Last Name");
define("LANG_ADDRESS", "Address");
define("LANG_CITY", "City");
define("LANG_STATE", "State");
define("LANG_STATE_NONE", "State (Non US)");
define("LANG_COUNTRY", "Country");
define("LANG_ZIP", "Postal Code");
define("LANG_PHONE", "Phone");
define("LANG_IP", "IP");
define("LANG_EMAIL", "Email");
define("LANG_BILLING_INFO", "Billing Information");
define("LANG_BILLING_SAME", "Billing address the same as customer information");
define("LANG_BLACKLIST", "Blacklist");
define("LANG_ADMIN_CAPABILITIES", "Administration Capabilities");
define("LANG_JOIN_DATE", "Join Date");
define("LANG_LAST_LOGIN", "Last Login");
define("LANG_EXPORT_TO_EXCEL", "Export the users shown to Excel");

// view user settings //
define("LANG_DISPLAY_USER", "User View Settings");
define("LANG_DISPLAY_USER_DESC", "These settings define which fields are displayed on the view member page");
define("LANG_DISPLAY_NAME", "Display users name");
define("LANG_DISPLAY_ZIP", "Display Postal Code");
define("LANG_DISPLAY_PHONE", "Display Telephone Number");
define("LANG_DISPLAY_EMAIL", "Display Email");
define("LANG_DISPLAY_ADDRESS", "Seller's Address");
define("LANG_DISPLAY_CITY", "Seller's City");
define("LANG_DISPLAY_STATE", "Seller's State");

// Transactions //
define("LANG_TRANSACTIONS", "Transactions");
define("LANG_TRANSACTION_ID", "Transaction ID");
define("LANG_DATE", "Date");

// Settings Checkout //
define("LANG_CHECKOUT_SETTINGS", "Checkout Settings");
define("LANG_CHECKOUT_SETTINGS_TXT", "These settings control what is displayed or what actions is taken when a member is placing an ad.");
define("LANG_CHECKOUT_NOTIFICATION", "Notification when ads are placed or edited");
define("LANG_CHECKOUT_EXTERNAL_URL", "Allow External URL");
define("LANG_CHECKOUT_MANUALLY_APPROVE", "Manually Approve Ads");
define("LANG_CHECKOUT_DISPLAY_PRICE", "Allow Price Field");
define("LANG_CHECKOUT_DISPLAY_SHORT_DESC", "Display Short Description Field");
define("LANG_CHECKOUT_DISPLAY_DESC", "Display Description Field");
define("LANG_CHECKOUT_REQUIRE_PRICE", "Require Price");
define("LANG_CHECKOUT_REQUIRE_SDESC", "Require Short Description");
define("LANG_CHECKOUT_REQUIRE_DESC", "Require Description");
define("LANG_MODIFY_AD_STATUS", "When a user modifies their ad should the status change?");
define("LANG_RENEWAL_ALLOW", "Allow Renewal");
define("LANG_RENEWAL_DAYS", "Renewal Days");
define("LANG_RENEWAL_DAYS_TXT", "How many days before the ad expires would you like the user to be notified?");

// Settings Users Admin //
define("LANG_USER_SETTINGS_TXT", "These settings control what is displayed in the user administration area.");
define("LANG_USER_SHOW_HITS", "Display the number of listing views");
define("LANG_USER_SHOW_SEARCH_HITS", "Display the number of views through search");

// Settings Search //
define("LANG_SEARCH_SETTINGS_DESC", "These settings define which fields are displayed on the search page.");
define("LANG_SEARCH_STATE", "Search State");
define("LANG_SEARCH_CITY", "Search City");
define("LANG_SEARCH_PRICE", "Search Price");
define("LANG_SEARCH_COUNTRY", "Search Country");
define("LANG_SEARCH_PAGINATION", "Page Number Location");
define("LANG_TOP", "Top");
define("LANG_BOTTOM", "Bottom");
define("LANG_BOTH", "Both Top &amp; Bottom");
define("LANG_SITE_MAX_SEARCH", "Max number of search results per page");
define("LANG_SITE_SORT", "Initial Listings Sort");
define("LANG_SITE_SORT_ASC", "Ascending");
define("LANG_SITE_SORT_DESC", "Descending");
define("LANG_SHOW_LISTING_TEMPLATE", "Search Results Template");
define("LANG_SHOW_LISTING_TEMPLATE_1", "Default");
define("LANG_SHOW_LISTING_TEMPLATE_2", "Short description display");
define("LANG_LISTINGS_DISPLAY_TXT", "These settings define which fields are displayed on the search results and category listings page.");

define("LANG_ADMIN_LISTINGS_DISPLAY_PHOTO", "Display Photo");
define("LANG_ADMIN_LISTINGS_DISPLAY_TITLE", "Display Title");
define("LANG_ADMIN_LISTINGS_DISPLAY_PRICE", "Display Price");
define("LANG_ADMIN_LISTINGS_DISPLAY_DATEADDED", "Date Added");
define("LANG_ADMIN_LISTINGS_DISPLAY_EXPIRATION", "Expiration Date");
define("LANG_ADMIN_LISTINGS_DISPLAY_CITY", "Sellers City");
define("LANG_ADMIN_LISTINGS_DISPLAY_STATE", "Sellers State");
define("LANG_ADMIN_LISTINGS_DISPLAY_COUNTRY", "Sellers Country");

// Settings Regional //
define("LANG_SITE_LANGUAGE", "Site Language");
define("LANG_ADMINSITE_LANGUAGE", "Administration Site Language");
define("LANG_DATE_FORMAT", "Date Format");
define("LANG_ADMINDATE_FORMAT", "Administration Date Format");
define("LANG_DATE_FORMAT_TXT", "Format for the date that the users will see");
define("LANG_ADMINDATE_FORMAT_TXT", "Format for the date in the administration");
define("LANG_ADMIN_CURRENCY", "Currency");
define("LANG_ADMIN_CURRENCY_SYMBOL", "Currency Symbol");
define("LANG_ADMIN_CURRENCY_DECIMAL", "Currency Decimal");
define("LANG_ADMIN_CURRENCY_DECIMAL_PLACES", "Currency Places");
define("LANG_ADMIN_THOUSANDS", "Thousands Seperator");
define("LANG_CURRENCY_BEFORE", "Currency Symbol comes before the numbers");

// Settings //
define("LANG_FRONTEND_SETTINGS", "Front End Settings");
define("LANG_MAIN_SETTINGS", "Main Settings");
define("LANG_SEARCH_SETTINGS", "Search Settings");
define("LANG_LISTING_VIEW_SETTINGS", "Listing View Settings");
define("LANG_USER_VIEW_SETTINGS", "User View Settings");
define("LANG_IMAGE_SETTINGS", "Image Settings");
define("LANG_REGIONAL_SETTINGS", "Regional Settings");
define("LANG_BAD_WORD_SETTINGS", "Bad Word Settings");
define("LANG_PM_SETTINGS", "Private Message Settings");
define("LANG_USER_SETTINGS", "User Settings");
define("LANG_REGISTRATION_FIELDS", "User Registration Fields");
define("LANG_EDIT_STATES", "Edit States");
define("LANG_EDIT_COUNTRIES", "Edit Countries");
define("LANG_EDIT", "Edit");
define("LANG_USER_ADMIN_SETTINGS", "User Admin Settings");
define("LANG_STATES_COUNTRIES", "States &amp; Countries");
define("LANG_COUNTRY_CODE", "Country Code");
define("LANG_STATE_ABBR", "State Abbreviation");

// Products //
define("LANG_PRODUCT", "Product");
define("LANG_LISTING_PACKAGE", "Listing Package");
define("LANG_LISTING_PACKAGES", "Listing Packages");
define("LANG_NEW_LISTING_PACKAGE", "New Listing Package");
define("LANG_LIST_PRICE", "List Price");
define("LANG_MEMBERSHIP", "Membership");
define("LANG_MEMBERSHIPS", "Memberships");
define("LANG_NEW_MEMBERSHIP_PACKAGE", "New Membership Package");
define("LANG_RENEWAL_PRICE", "Renewal Price");
define("LANG_NUMBER_ADS", "Number of Ads");
define("LANG_DAYS", "Days");
define("LANG_TYPE", "Type");
define("LANG_TITLE_CHARACTERS", "Maximum number of title characters");
define("LANG_SDESC_CHARACTERS", "Maximum number of short description characters");
define("LANG_DESC_CHARACTERS", "Maximum number of description characters");
define("LANG_ALLOW_FEATURED", "Allow Featured");
define("LANG_ALLOW_PHOTOS", "Allow Photos");
define("LANG_ALLOW_PHOTOS_IF", "If checked how many");
define("LANG_ALLOW_BOLD", "Allow the user to bold the ad");
define("LANG_ALLOW_EXTRA_IF", "If checked how much extra is it");
define("LANG_ALLOW_HIGHLIGHTED", "Allow the user to highlight the ad");

// Private Messages //
define("LANG_SHOW_MESSAGES_FROM", "Show Messages From");
define("LANG_SHOW_MESSAGES_TO", "Show Messages To");
define("LANG_FROM", "From");
define("LANG_FLAGS", "Flags");
define("LANG_READ", "Read");
define("LANG_NOT_READ", "Not Read");
define("LANG_SPAM", "Spam");
define("LANG_MARK_SPAM", "Mark as Spam");
define("LANG_MARK_NOT_SPAM", "Mark as Not Spam");
define("LANG_MARKED_SPAM", "This message is marked as spam.");
define("LANG_MESSAGE", "Message");
define("LANG_MESSAGE_INFO", "Message Info");
define("LANG_DATE_SENT", "Date Sent");
define("LANG_FOLDER", "Folder");
define("LANG_INBOX", "Inbox");
define("LANG_OUTBOX", "Outbox");
define("LANG_TURNED_ON", "Turned On");
define("LANG_MAX_STORED", "Max Stored Messages");
define("LANG_ALLOWED_HTML", "Allowed HTML Tags");
define("LANG_PM_SEND_NOTIFICATION", "Send email notification");

// pagination //
define("LANG_SHOWING_PAGE", "Showing page");
define("LANG_PREVIOUS", "&lt;");
define("LANG_NEXT", "&gt;");
define("LANG_FIRST", "<strong>&laquo;</strong> First");
define("LANG_LAST", "Last <strong>&raquo;</strong>");

// Pages //
define("LANG_MODIFY_PAGES", "Modify Content Pages");
define("LANG_PAGE_LI", "You can view these pages by visiting yoursite.com/pages.php?page=X - Where X is the id number above.");
define("LANG_PAGE_LI2", "The contact us is a page named contactus.php and you can just link to it from your templates layout.tpl file. <br />It will send the submitted form to the email address you setup in the site settings.");
define("LANG_PAGE_NAME", "Page Name");
define("LANG_PAGES_HTML", "The form above will accept any html that you type into it.");
define("LANG_PAGES_NAV", "Should this page be visible in the navigation?");
define("LANG_PAGES_NAV_TXT", "If no you can access through the instructions at the bottom of this page.");
define("LANG_PAGES_PUBLISH", "Do you want to publish this page?");
define("LANG_PAGES_PUBLISH_TXT", "If no it will not be seen.");
define("LANG_PAGE_PREVIEW", "Preview (updated when page is saved)");
define("LANG_SAVE_AND_CONTINUE", "Save and Continue Editing");
define("LANG_HTML_CONTENT", "HTML Content");
define("LANG_CODE_EDITOR", "Code Editor");
define("LANG_SHOW_EDITOR", "Show Editor");
define("LANG_HIDE_EDITOR", "Hide Editor");

// Orders //
define("LANG_SHOW_ORDERS_FROM", "Show Orders From");
define("LANG_SHOW_ORDERS_TO", "Show Orders To");
define("LANG_TOTAL", "Total");
define("LANG_ORDER_STATUS_COMPLETED", "Completed");
define("LANG_ORDER_STATUS_PENDING_APPROVAL", "Completed Pending Approval");
define("LANG_ORDER_STATUS_PENDING_PAYMENT", "Pending Payment");
define("LANG_ORDER_STATUS_CANCELLED", "Cancelled");
define("LANG_ORDER_STATUS_NOT_COMPLETED", "Not Completed");
define("LANG_ORDER_DETAILS", "Order Details");
define("LANG_LISTINGS_PLACED", "Listings Placed");

// Modules //
define("LANG_MODULE_NAME", "Module Name");
define("LANG_VERSION", "Version");
define("LANG_HELP", "Help");
define("LANG_UPGRADE", "Upgrade");
define("LANG_ADMIN", "Admin");
define("LANG_MODULE_REGENERATE_SUCCESS", "Gateway list regenerated from file system");
define("LANG_MODULE_ACTIVE", "Active");
define("LANG_MODULE_INACTIVE", "Inactive");
define("LANG_MODULE_UNINITIALIZED", "Uninitialized");
define("LANG_MODULE_INITIALIZE", "Initialize");
define("LANG_MODULE_ACTIVATE", "Activate");
define("LANG_MODULE_DEACTIVATE", "Deactivate");
define("LANG_MODULE_DEACTIVATECONFIRM", "Are you sure you wish to deactivate this module?");
define("LANG_MODULE_DELETECONFIRM", "Remove module and drop related database fields and tables?");
define("LANG_ADMIN_NO_MODULE", "This module does not have an administration section.");

// Main Settings //
define("LANG_SITE_TITLE", "Site Title");
define("LANG_SITE_KEYWORDS", "Site Keywords");
define("LANG_SITE_URL", "Classifieds Site url");
define("LANG_SITE_SECURE_URL", "Secure url or https");
define("LANG_SITE_EMAIL", "Site Email");
define("LANG_SMTP", "Use SMTP Server for email");
define("LANG_SMTPHOST", "SMTP Server Address");
define("LANG_SMTPUSERNAME", "SMTP Username");
define("LANG_SMTPPASSWORD", "SMTP Password");
define("LANG_SMTPPORT", "SMTP Port");
define("LANG_HTML_EMAILS", "HTML Emails");
define("LANG_HTML_EDITOR", "Enable HTML Editor");
define("LANG_SITE_TEMPLATE", "Site Template");
define("LANG_ADMINISTRATION_TEMPLATE", "Administration Template");
define("LANG_EMAIL_VALIDATION", "Require Email Validation");
define("LANG_SITE_CAT_COLUMNS", "Number of columns for categories on home page");
define("LANG_SITE_CAT_COLUMNS_CAT", "Number of columns for categories on category page");
define("LANG_SITE_SUBCAT_COLUMNS", "Number of columns for subcategories on category page");
define("LANG_REMOVE_TIME", "Number of days you would like expired listings to be deleted");
define("LANG_SITE_TAKE_OFFLINE", "Take Site Offline");
define("LANG_SITE_OFFLINE_REASON", "Offline Reason");
define("LANG_ENABLE_CAT_TOTAL", "Enable category listing total");

// Newsletter //
define("LANG_EMAIL_MEMBERS", "Email Members");
define("LANG_SUBJECT", "Subject");
define("LANG_SUBJECT_TXT", "The subject of your email");
define("LANG_HTML_MESSAGE", "HTML Message");
define("LANG_AVAILABLE_VARS", "Some available variables are:");
define("LANG_EMAIL_ERROR", "There has been a mail error sending to");
define("LANG_EMAIL_SUCCESS", "Mail sent to");
define("LANG_EMAIL_UNSUBSCRIBE", "Unsubscribe");
define("LANG_EMAIL_UNSUBSCRIBE_TXT", "You can unsubscribe by modifying your profile at this link:");


// Listing settings //
define("LANG_DISPLAY_LISTINGS", "Listing View Settings");
define("LANG_DISPLAY_LISTINGS_DESC", "These settings defines the way you want your sites viewlisting page to appear");
define("LANG_DISPLAY_IMAGE", "Image Display");
define("LANG_DISPLAY_IMAGE_ONE", "View Listing Format 1 (Images on right)");
define("LANG_DISPLAY_IMAGE_TWO", "View Listing Format 2 (Images on top)");
define("LANG_DISPLAY_IMAGE_COLS", "Number of image columns");
define("LANG_DISPLAY_IMAGE_COLS_TEXT", "This is only used if you selected format 2.");

// listings //
define("LANG_TITLE", "Title");
define("LANG_SEARCH", "Search");
define("LANG_PRICE", "Price");
define("LANG_URL", "URL");
define("LANG_SHORT_DESCRIPTION", "Short Description");
define("LANG_GENERAL_DETAILS", "General Details");
define("LANG_LISTING_DETAILS", "Listing Details");
define("LANG_SELLER", "Seller");
define("LANG_STATUS", "Status");
define("LANG_STATUS_ACTIVE", "Active");
define("LANG_STATUS_NOT_ACTIVE", "Not Active");
define("LANG_STATUS_EXPIRED", "Expired");
define("LANG_LOADING", "Loading...");
define("LANG_BAN_DELETE", "Fraud (Ban &amp; Delete)");
define("LANG_BAN_DELETE_JS", "This will delete all the users listings and place them in the banned user group.");
define("LANG_RANK", "Rank");
define("LANG_DATE_ADDED", "Date Added");
define("LANG_VIEWS", "Views");
define("LANG_SEARCH_VIEWS", "Search Views");
define("LANG_CONTACTED", "Contacted");
define("LANG_EXTRA_OPTIONS", "Extra Options");
define("LANG_BOLD", "Bold");
define("LANG_HIGHLIGHTED", "Highlighted");
define("LANG_FEATURED", "Featured");
define("LANG_NO_THANKS", "No Thanks");
define("LANG_SHOW_LISTINGS_FROM", "Show Listings From");
define("LANG_SHOW_LISTINGS_TO", "Show Listings To");
define("LANG_CHANGE_STATUS", "-- Change Status --");

// image settings //
define("LANG_IMAGE", "Image");
define("LANG_IMAGES", "Images");
define("LANG_IMAGE_COMPONENT", "Image Upload Component");
define("LANG_IMAGE_COMPONENT_TXT", "The image upload component your server supports");
define("LANG_IMAGE_ALLOWED_EXT", "Allowed Extensions");
define("LANG_IMAGE_ALLOWED_EXT_TXT", "Valid file extensions users can upload");
define("LANG_IMAGE_LARGE_WIDTH", "Large Image Width");
define("LANG_IMAGE_LARGE_WIDTH_TXT", "The maximum width of uploaded image. If it is larger it will get resized to this.");
define("LANG_IMAGE_LARGE_HEIGTH", "Large Image Height");
define("LANG_IMAGE_LARGE_HEIGHT_TXT", "The maximum height of uploaded image. If it is larger it will get resized to this.");
define("LANG_IMAGE_LARGE_QUALITY", "Large Image Quality");
define("LANG_IMAGE_LARGE_QUALITY_TXT", "The quality of the  resized image. 80 is the recommended value.");
define("LANG_IMAGE_THUMB_WIDTH", "Thumbnail Width");
define("LANG_IMAGE_THUMB_WIDTH_TXT", "The maximum width of the thumbnail image. The thumbnail will be resized to this.");
define("LANG_IMAGE_THUMB_HEIGHT", "Thumbnail Height");
define("LANG_IMAGE_THUMB_HEIGHT_TXT", "The maximum height of the thumbnail image.");
define("LANG_IMAGE_THUMB_QUALITY", "Thumbnail Quality");
define("LANG_IMAGE_THUMB_QUALITY_TXT", "The quality of the thumbnail image.");
define("LANG_IMAGE_MAX_SIZE", "The maximum kbytes the uploaded can be.");
define("LANG_IMAGE_UPLOAD_WIDTH", "The Max Image Width for uploaded image");
define("LANG_IMAGE_UPLOAD_HEIGHT", "The Max Image Height for uploaded image");

// gateways //
define("LANG_GATEWAY", "Gateway");
define("LANG_REGENERATE", "Regenerate");
define("LANG_GATEWAY_REGENERATE_SUCCESS", "Gateway list regenerated from file system");
define("LANG_NEED_HELP", "Need Help with these settings?");
define("LANG_CLICK_HERE", "Click Here");
define("LANG_SHOW_AS", "Show As");
define("LANG_ACTIVE", "Active");
define("LANG_DEMO", "Demo");
define("LANG_GATEWAY_DELETECONFIRM", "Remove gateway and drop related database fields and tables?");

// fields //
define("LANG_ORDER", "Order");
define("LANG_FIELD_NAME", "Field Name");
define("LANG_INTERNAL_NAME", "Internal Name");
define("LANG_FIELD_TYPE", "Field Type");
define("LANG_EXTRA_FIELDS_CH", "Click here to add a new field");
define("LANG_REQUIRED", "Required");
define("LANG_NEW_OPTION", "New Option");
define("LANG_NEW_TEXT_OPTION", "New Text Option");
define("LANG_NEW_CHECKBOX_OPTION", "New Checkbox Option");
define("LANG_DPLIST", "Drop down list");
define("LANG_TXTSINGLE", "Text Single Line");
define("LANG_TXTMULTI", "Text Multi Line");
define("LANG_CHECKBOX", "Check Boxes");
define("LANG_FIELD_SEEN", "Field Seen In Listing");
define("LANG_FIELD_DEFAULT", "Field Default Value if any");
define("LANG_FIELD_SEARCHABLE", "Field Searchable");
define("LANG_FIELD_OPTIONS", "Options");
define("LANG_FIELD_CAT", "Please select which categories use this field. <br />Ctrl click for multiple selections.");
define("LANG_FIELD_CHECKBOX", "Enter the options that the user can choose from. <br />Separate each option with a comma.");
define("LANG_PARENT_FIELD", "Parent drop down list");
define("LANG_CHILD_FIELD", "Child drop down list");
define("LANG_DATE_FIELD", "Date Field");
define("LANG_RANGE", "Range");
define("LANG_EXTRA_FIELDS_ADV", "Or add an advanced parent child field.");
define("LANG_FILE_UPLOAD", "File Upload");
define("LANG_RANGE_MIN", "Min");
define("LANG_RANGE_MAX", "Max");
define("LANG_RANGE_STEP", "Step");
define("LANG_SUB_ID", "Sub ID:");
define("LANG_MORE_FIELDS", "Click for more fields");

// editor //
define("LANG_YOU_ARE_COMPARING", "You are comparing the file:");
define("LANG_ADMIN_NOT_READABLE", "The file was not found or not readable.");
define("LANG_IDENTICAL", "The two files are identical.");
define("LANG_COMPARE", "Compare");
define("LANG_ADMIN_CHMOD_ERROR", "This file is not writable. Please CHMOD it to 777 if you wish to use this editor.");

// coupons //
define("LANG_COUPON_OR_DISCOUNT", "Coupon or Discount");
define("LANG_EXPIRATION", "Expiration");
define("LANG_COUPONS_TXT", "Please enter your coupon or discount settings.");
define("LANG_COUPON", "Coupon");
define("LANG_DISCOUNT", "Discount");
define("LANG_COUPON_NAME", "Coupon or Discount Name");
define("LANG_COUPON_CODE", "Coupon Code");
define("LANG_COUPON_CODE_TXT", "This is only used if you have selected coupon");
define("LANG_COUPON_DISCOUNT", "Discount Type");
define("LANG_COUPON_PERCENTAGE", "Percentage");
define("LANG_COUPON_FLAT_RATE", "Flat Rate");
define("LANG_DISCOUNT_AMOUNT", "Discount Amount");
define("LANG_NUMBER_AVAILABLE", "Number Available");
define("LANG_COUPON_ENDING_DATE", "Ending Date");
define("LANG_CALANDER", "Calendar");
define("LANG_COUPON_GROUPS", "Please select which user groups can use this coupon or discount.<br />Ctrl click for multiple selections.");
define("LANG_COUPON_USER", "Username");
define("LANG_COUPON_USER_ANY", "-- Any User --");

// categories //
define("LANG_CATEGORY", "Category");
define("LANG_CATEGORY_SETUP", "Category Setup");
define("LANG_ADD_NEW", "Add New");
define("LANG_MODIFY", "Modify");
define("LANG_DUPLICATE", "Duplicate");
define("LANG_ID", "ID");
define("LANG_NAME", "Name");
define("LANG_WEIGHT", "Weight");
define("LANG_ACTIONS", "Actions");
define("LANG_NO_RESULTS", "No results");
define("LANG_DELETE_CAT", "Delete Category");
define("LANG_SELECT_LISTING_CAT", "Please select which category you want the listings moved to");
define("LANG_CATEGORY_SLUG", "Category slug");
define("LANG_DESCRIPTION", "Description");
define("LANG_KEYWORDS", "Keywords");
define("LANG_CATEGORY_LINK", "Category Link");
define("LANG_ALLOW_ADS", "Allow Ads");
define("LANG_PARENT_CATEGORY", "Parent Category");
define("LANG_TOP_CATEGORY", "Top Category");
define("LANG_DISPLAY_CATEGORY", "Display Category");
define("LANG_CURRENT_CAT_IMAGE", "Current Category Image");
define("LANG_PROMO", "Promotional Category Text");

// bad words //
define("LANG_CENSOR", "Word Censor");
define("LANG_WORD", "Word");
define("LANG_REPLACEMENT", "Replacement");

// layout //
define("LANG_DASHBOARD", "Dashboard");
define("LANG_LISTINGS", "Listings");
define("LANG_ORDERS", "Orders");
define("LANG_USERS", "Users");
define("LANG_CATEGORIES", "Categories");
define("LANG_PAYMENT", "Payment");
define("LANG_SETTINGS", "Settings");
define("LANG_SUPPORT_FORUMS", "Support Forums");
define("LANG_LOGOUT", "Logout");
define("LANG_MANAGE_LISTINGS", "Manage Listings");
define("LANG_ADD_LISTING", "Add Listing");
define("LANG_MANAGE_ORDERS", "Manage Orders");
define("LANG_ADD_ORDER", "Add Order");
define("LANG_MANAGE_USERS", "Manage Users");
define("LANG_ADD_USER", "Add Users");
define("LANG_USER_GROUPS", "User Groups");
define("LANG_PRIVATE_MESSAGES", "Private Messages");
define("LANG_MANAGE_CATEGORIES", "Manage Categories");
define("LANG_EXTRA_FIELDS", "Extra Fields");
define("LANG_MANAGE_PRODUCTS", "Manage Products");
define("LANG_COUPONS_DISCOUNTS", "Coupons &amp; Discounts");
define("LANG_PAYMENT_PROVIDERS", "Payment Providers");
define("LANG_TEMPLATE_EDITOR", "Template Editor");
define("LANG_PAGE_EDITOR", "Page Editor");
define("LANG_MODULES", "Modules");
define("LANG_VIEW_SITE", "View Site");

// dashboard //
define("LANG_RUNNING", "You are running");
define("LANG_CURRENT_VERSION", "Current Version");
define("LANG_LICENSE_KEY", "License Key");
define("LANG_TOTAL_LISTINGS", "Total Listings");
define("LANG_TOTAL_MEMBERS", "Total Members");
define("LANG_NEWSLETTER_SUBSCRIBERS", "Newsletter Subscribers");
define("LANG_INCOME_STATS", "Income Stats");
define("LANG_THIS_MONTH", "This Month:");
define("LANG_LAST_MONTH", "Last Month:");
define("LANG_NEW_ORDERS", "New Orders");
define("LANG_NEW_LISTINGS", "New Listings");
define("LANG_NEW_USERS", "New Users");
define("LANG_ACCESS_KEYS", "Access Keys");
define("LANG_QUICK_LISTING_SEARCH", "Quick Listings Search");
define("LANG_LISTING_ID", "Listing ID:");
define("LANG_USER_ID", "User ID:");
define("LANG_SEARCH_TEXT", "Search Text:");
define("LANG_LATEST_NEWS", "Latest News");
define("LANG_CLICK_HERE_UPGRADE", "Click here to upgrade");

// login //
define("LANG_ERROR", "Error");
define("LANG_SUPPORT_JAVASCRIPT", "Your browser must support javascript. Please enable it and refresh this page.");
define("LANG_PLEASE_LOGIN", "Please Log In");
define("LANG_PLEASE_ENTER_DETAILS", "Please enter your details below");
define("LANG_USERNAME", "Username");
define("LANG_PASSWORD", "Password");
define("LANG_COLON", ":");
define("LANG_REMEMBER_ME", "Remember My ID");
define("LANG_LOGIN_SUCCESS", "Login Successful");
define("LANG_USER_LOGIN_ERROR", "I am sorry your username or password is incorrect. If you forgot your password please <a href='../userforgot.php'>click here</a> to generate a new one.");
define("LANG_NOT_ALLOWED", "I am sorry but you are not allowed to view this page.");

// forward //
define("LANG_FORWARD_SUCESS", "Settings saved!");
define("LANG_FORWARD_ERROR", "Sorry there was an error");
define("LANG_FORWARD_ERROR_MSG", "The site administration has been notified.");
define("LANG_FORWARD", "You will be forwarded.");
define("LANG_FORWARD_IF_NOT", "If this does not happen automatically then");
define("LANG_FORWARD_CLICK_HERE", "click here");

// javascript //
define("LANG_JS_STAR", "*");
define("LANG_JS_DELETE_CONFIRM", "Are you sure you want to delete this record?");
define("LANG_JS_NOT_UNDONE", "It can not be undone!");
define("LANG_JS_PLEASE_ENTER", "Please enter a value in the field");
define("LANG_JAVASCRIPT_PLEASE_ENTER", "Please enter a value in the field");
define("LANG_JS_GREATER_ZERO", "must be greater than 0.");
define("LANG_JS_SELECT_DIF_CAT", "Please select another category. This category can not have ads placed in it.");
define("LANG_JS_PASSWORD_ERROR", "You must type your password twice and it must match.");
?>                                                                                                                                                                                                                                                                                                                                          administration/language/french.php                                                                  0000644 0023433 0004734 00000100564 11051631513 017216  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/

// Set the PHP locale to French
setlocale(LC_ALL, 'french');

define("ADMIN_FIELD_SIZE", "30");
define("LANG_SUBMIT", "valider");
define("LANG_SAVE", "Save");
define("LANG_UPDATE", "Update");
define("LANG_RESET", "Reset");
define("LANG_SETTINGS_SAVED", "Your settings have been saved.");
define("LANG_YES", "Yes");
define("LANG_NO", "No");
define("LANG_DELETE", "Delete");
define("LANG_CLOSE", "Close");
define("LANG_PLEASE_SELECT", "Please Select");
define("LANG_STAR", "*");
define("LANG_TO", "To");

// User Notes //
define("LANG_NOTES", "Notes");
define("LANG_WROTE", "wrote on");
define("LANG_NOTES_TXT", "Any notes entered here will be only accessable from the administration and the user will not see them.");
define("LANG_ADD_NOTE_SUCCESS", "Your note has been added! <br />Before it will show you will need to refresh the page.");

// user groups //
define("LANG_DELETE_USER_GROUP", "Warning: All users that belong to this group will be placed in the registered users group.");
define("LANG_DATEADDED", "Date Added");

define("LANG_ADMIN_USER_GROUPS", "groupes d'utilisateurs");
define("LANG_ADMIN_BANNED", "Ce type d'utilisateurs est le groupe des utilisateurs \"bannis\"");
define("LANG_USERGROUP_CONTACT_OWNER", "Ce type d'utilisateurs peut contacter un vendeur");
define("LANG_USERGROUP_FRIEND_MAIL", "Ce type d'utilisateurs a accs au formulaire \"avertir un ami\"");
define("LANG_USERGROUP_VIEW_SITE", "Ce type d'utilisateurs a accs  la partie aperu du site");
define("LANG_USERGROUP_VIEW_PHOTOS", "Ce type d'utilisateurs a accs aux photos");
define("LANG_USERGROUP_VIEW_PRICE", "Ce type d'utilisateurs a accs aux prix");

define("LANG_THIS_USERGROUP", "ce groupe d'utilisateur peut avoir accs");
define("LANG_PHOTO", " la photo");
define("LANG_DISPLAY_SELLER", "au nom du vendeur");
define("LANG_ADMIN_DISPLAY_ADDRESS", " l'adresse du vendeur");
define("LANG_ADMIN_DISPLAY_CITY", " la ville du vendeur");
define("LANG_ADMIN_DISPLAY_STATE", " la rgion du vendeur");
define("LANG_DISPLAY_COUNTRY", "au pays du vendeur");
define("LANG_DISPLAY_PRICE", "aux prix affichs");
define("LANG_DISPLAY_DATE", " la date d'ajout");
define("LANG_DISPLAY_EXPIRATION", " la date d'expiration");
define("LANG_DISPLAY_HITS", "au compteur de hits");
define("LANG_USER_FAVORITES", " la fonction \"annonces prfres\"");
define("LANG_USER_ALLOW_CONTACT", "contacter le vendeur");
define("LANG_DISPLAY_CONTACT_REGISTERED", "seuls les utilisateurs enregistrs");
define("LANG_DISPLAY_CONTACT_ALL", "tous les utilisateurs");
define("LANG_DISPLAY_CONTACT_NONE", "ne pas utiliser");
define("LANG_DISPLAY_FRIENDMAIL", "envoyer un courriel  un ami");

/////////////////////////////////
//v3.0.5
/////////////////////////////////
define("LANG_ADMIN_SHOW_LISTING_TEMPLATE", "Modles de rsultats de recherche");
define("LANG_ADMIN_SHOW_LISTING_TEMPLATE_1", "par dfault");
define("LANG_ADMIN_SHOW_LISTING_TEMPLATE_2", "afficher le rsum");

/////////////////////////////////
//v3.0.4
/////////////////////////////////
define("LANG_ADMIN_LOGIN_SUCCESS", "connexion russie !");
define("LANG_ADMIN_EMAIL_ISHTML","Est-ce du HTML ?");

/////////////////////////////////
//v3.0.3
/////////////////////////////////
define("LANG_ADMIN_EMAIL_VALIDATION", "Ncessite une validation par courriel");

/////////////////////////////////
//v3.0.2
/////////////////////////////////
define("LANG_ADMIN_BACKUP", "sauvegarde");
define("LANG_ADMIN_BACKUP_TXT", "Cela gnrera une sauvegarde de votre base de donnes. Veuillez vous assurer au pralable que le rpertoire 'backup' dans le fichier 'administration' a bien t cr et qu'il a bien un CHMOD  777.");
define("LANG_ADMIN_DISPLAY_PHONE", "tlphone du membre");
define("LANG_MODIFY_AD_STATUS", "Quand les membres modifient leur annonce, est-ce que le statut des annonces change ?");
define("LANG_SHOWING_PAGE", "Montrer la page");
define("LANG_MAINTENANCE", "maintenance");
define("LANG_CLEAR_COMPILED", "nettoyer les modles en cache");
define("LANG_CLEAR_COMPILED_TXT", "Ceci vous permettra de nettoyer tous vos caches de modles, utile si vous effectuez un changement dans un modle (template) et que la modification n'apparat pas.");
//previous and next
define("LANG_PREVIOUS", "&lt;");
define("LANG_NEXT", "&gt;");
define("LANG_FIRST", "<strong>&laquo;</strong> dbut");
define("LANG_LAST", "fin <strong>&raquo;</strong>");


//index
define("LANG_ADMIN_SYSTEM_OVERVIEW", "tat du systme");
define("LANG_ADMIN_DEFINE", "lments");
define("LANG_ADMIN_VALUE", "valeur");
define("LANG_ADMIN_RUNNING", "vous utilisez la version");
define("LANG_ADMIN_CURRENT_VERSION", "version conseille");
define("LANG_ADMIN_TOTAL_LISTINGS", "nombre total d'annonces");
define("LANG_ADMIN_TOTAL_MEMBERS", "nombre total de vendeurs");
define("LANG_ADMIN_NEWSLETTER_SUBSCRIBERS", "total d'adhrents  la newsletter (- en %)");
define("LANG_ADMIN_UNAPPROVED", "nombre d'annonces refuses ou en attente de validation");

//user login //
define("LANG_COLON", " :");
define("LANG_USER_LOGIN_TITLE", "veuillez vous connecter");
define("LANG_USER_LOGIN_TEXT", "veuillez saisir les lments ci-dessous");
define("LANG_PLEASE_ENTER", "veuillez entrer votre");
define("LANG_USER_USERNAME", "nom d'utilisateur");
define("LANG_USER_PASSWORD", "mot de passe");
define("LANG_USER_NEED_TO_REGISTER", "pas encore inscrit(e) ?");
define("LANG_USER_FORGOT_PASS", "mot de passe oubli ?");
define("LANG_USER_REMEMBER_ME", "enregistrer mes paramtres sur cet ordinateur");
define("LANG_USER_LOGIN_ERROR", "Votre nom d'utilisateur et/ou votre mot de passe est incorrect.");

//change pass //
define("LANG_JAVASCRIPT_PLEASE_ENTER", "veuillez saisir le champ");
define("LANG_ADMIN_NEW_USER", "nouvel utilisateur");
define("LANG_ADMIN_NEW_PASSWORD", "nouveau mot de passe");
define("LANG_PLEASE_CONFIRM", "veuillez confirmer votre");

// bad words //
define("LANG_ADMIN_CENSOR", "Gestion des mots interdits");
define("LANG_ADMIN_WORD", "mot");
define("LANG_ADMIN_REPLACEMENT", "remplac par");
define("LANG_ADMIN_MODIFY", "modifier");
define("LANG_ADMIN_DELETE", "supprimer");

// main settings //
define("LANG_ADMIN_MAIN_SETTINGS", "paramtres principaux");
define("LANG_ADMIN_MAIN_SETTINGS_TITLE", "Veuillez saisir les lments ci-dessous");
define("LANG_ADMIN_SITE_TITLE", "nom du site");
define("LANG_ADMIN_SITE_KEYWORDS", "mot-cls");
define("LANG_ADMIN_SITE_DESCRIPTION", "description du site");
define("LANG_ADMIN_SITE_URL", "adresse Internet du site");
define("LANG_ADMIN_SITE_SECURE_URL", "adresse Internet scurise du site (HTTPS)");
define("LANG_ADMIN_SITE_EMAIL", "adresse courriel du site");
define("LANG_ADMIN_SITE_LANGUAGE", "langue du site");
define("LANG_ADMIN_SITE_TEMPLATE", "modle utilis pour le site");
define("LANG_ADMIN_SITE_MAX_SEARCH", "nombre maximum de rsultats de recherche par page");
define("LANG_ADMIN_SITE_CAT_COLUMNS", "Nombre de catgories par ligne sur la page principale");
define("LANG_ADMIN_SITE_CAT_COLUMNS_CAT", "Nombre de catgories par ligne sur la page des rubriques");
define("LANG_ADMIN_SITE_SUBCAT_COLUMNS", "Nombre de catgories par ligne sur la page des sous-catgories");
define("LANG_ADMIN_SITE_SORT", "trier les annonces par");
define("LANG_ADMIN_SITE_SORT_ID", "N");
define("LANG_ADMIN_SITE_SORT_TITLE", "titre");
define("LANG_ADMIN_SITE_SORT_DESCRIPTION", "description");
define("LANG_ADMIN_SITE_SORT_FEATURED", "rubrique coup de coeur");
define("LANG_ADMIN_SITE_SORT_PRICE", "prix");
define("LANG_ADMIN_SITE_SORT_HITCOUNT", "nombre de clics");
define("LANG_ADMIN_SITE_SORT_DATEADDED", "date d'ajout");
define("LANG_ADMIN_SITE_SORT_EXPIRATION", "date d'expiration");
define("LANG_ADMIN_SITE_SORT_ASC", "croissant");
define("LANG_ADMIN_SITE_SORT_DESC", "descendant");
define("LANG_ADMIN_SITE_TAKE_OFFLINE", "dsactiver le site");
define("LANG_ADMIN_SITE_OFFLINE_REASON", "raison de la dsactivation");

// search settings //
define("LANG_ADMIN_SEARCH_SETTINGS", "paramtres de recherche");
define("LANG_ADMIN_SEARCH_SETTINGS_DESC", "Ces paramtres dfinissent quels champs seront utiliss sur la page de recherche.");
define("LANG_ADMIN_SEARCH_STATE", "recherche par rgion");
define("LANG_ADMIN_SEARCH_CITY", "recherche par ville");
define("LANG_ADMIN_SEARCH_PRICE", "recherche par prix");
define("LANG_ADMIN_SEARCH_COUNTRY", "recherche par pays");
define("LANG_ADMIN_SEARCH_PAGINATION", "emplacement du numro de la page");
define("LANG_ADMIN_TOP", "au sommet");
define("LANG_ADMIN_BOTTOM", "en bas de page");
define("LANG_ADMIN_BOTH", "au sommet & en bas");
define("LANG_ADMIN_YES", "oui");
define("LANG_ADMIN_NO", "non");
define("LANG_ADMIN_LISTINGS_DISPLAY_TXT", "Ces paramtres dfinissent quels champs seront utiliss sur les pages de rsultats de recherche et sur les pages des rubriques.");
define("LANG_ADMIN_LISTINGS_DISPLAY_PHOTO", "afficher la photo");
define("LANG_ADMIN_LISTINGS_DISPLAY_TITLE", "afficher le titre");
define("LANG_ADMIN_LISTINGS_DISPLAY_PRICE", "afficher le prix");
define("LANG_ADMIN_LISTINGS_DISPLAY_DATEADDED", "date d'ajout");
define("LANG_ADMIN_LISTINGS_DISPLAY_EXPIRATION", "date d'expiration");
define("LANG_ADMIN_LISTINGS_DISPLAY_CITY", "ville des vendeurs");
define("LANG_ADMIN_LISTINGS_DISPLAY_STATE", "rgion des vendeurs");
define("LANG_ADMIN_LISTINGS_DISPLAY_COUNTRY", "pays des vendeurs");

// view listing settings //
define("LANG_ADMIN_DISPLAY_LISTINGS", "Paramtres des annonces");
define("LANG_ADMIN_DISPLAY_LISTINGS_DESC", "Ces paramtres dfinissent la faon dont vous voulez voir apparatre les annonces");
define("LANG_ADMIN_DISPLAY_IMAGE", "affichage des images");
define("LANG_ADMIN_DISPLAY_IMAGE_ONE", "format d'affichage des images #1 (images  droite)");
define("LANG_ADMIN_DISPLAY_IMAGE_TWO", "format d'affichage des images #2 (images au sommet)");
define("LANG_ADMIN_DISPLAY_IMAGE_COLS", "nombre de colonnes utilises par l'image");
define("LANG_ADMIN_DISPLAY_IMAGE_COLS_TEXT", "uniquement utilise pour le format 2.");

// view user settings //
define("LANG_ADMIN_DISPLAY_USER", "Paramtres de la fiche de l'utilisateur");
define("LANG_ADMIN_DISPLAY_USER_DESC", "Ces paramtres dterminent quels champs seront affichs sur la page des vendeurs");
define("LANG_ADMIN_DISPLAY_NAME", "montrer le nom complet du vendeur");
define("LANG_ADMIN_DISPLAY_ZIP", "montrer le code postal");
define("LANG_ADMIN_DISPLAY_PHONE", "montrer le numro de tlphone");
define("LANG_ADMIN_DISPLAY_EMAIL", "montrer l'adresse courriel");
define("LANG_ADMIN_SITE_RATE_MEMBERS", "autoriser les membres  noter les vendeurs");

// image settings //
define("LANG_ADMIN_IMAGE_SETTINGS", "Paramtres de chargement des images");
define("LANG_ADMIN_IMAGE_SETTINGS_DESC", "Veuillez entrer les dtails des paramtres de chargement d'images ci-dessous");
define("LANG_ADMIN_IMAGE_COMPONENT", "Composant de tlchargement d'images");
define("LANG_ADMIN_IMAGE_COMPONENT_TXT", "le composant de tlchargement d'images que votre serveur utilise");
define("LANG_ADMIN_IMAGE_ALLOWED_EXT", "extensions autorises");
define("LANG_ADMIN_IMAGE_ALLOWED_EXT_TXT", "extensions de fichier que les utilisateurs peuvent employer");
define("LANG_ADMIN_IMAGE_LARGE_WIDTH", "Largeur maximale d'image");
define("LANG_ADMIN_IMAGE_LARGE_WIDTH_TXT", "La largeur maximale d'une image charge. Si la largeur est suprieure, elle sera redimensionne  cette largeur.");
define("LANG_ADMIN_IMAGE_LARGE_HEIGTH", "Hauteur maximale d'image");
define("LANG_ADMIN_IMAGE_LARGE_HEIGHT_TXT", "La hauteur maximale d'une image charge. Si la hauteur est suprieure, elle sera redimensionne  cette hauteur.");
define("LANG_ADMIN_IMAGE_LARGE_QUALITY", "Qualit maximale de l'image");
define("LANG_ADMIN_IMAGE_LARGE_QUALITY_TXT", "Il s'agit de la qualit optimale de l'image. 80 est la valeur conseille.");
define("LANG_ADMIN_IMAGE_THUMB_WIDTH", "Largeur des miniatures");
define("LANG_ADMIN_IMAGE_THUMB_WIDTH_TXT", "La largeur maximale d'une miniature. Si la largeur est suprieure, elle sera redimensionne  cette largeur.");
define("LANG_ADMIN_IMAGE_THUMB_HEIGHT", "Hauteur des miniatures");
define("LANG_ADMIN_IMAGE_THUMB_HEIGHT_TXT", "la hauteur maximale des miniatures.");
define("LANG_ADMIN_IMAGE_THUMB_QUALITY", "Qualit des miniatures");
define("LANG_ADMIN_IMAGE_THUMB_QUALITY_TXT", "Il s'agit de la qualit des images miniaturises.");
define("LANG_ADMIN_IMAGE_MAX_SIZE", "Il s'agit de la taille maximale d'un fichier charge (en kb).");

// renewal settings //
define("LANG_ADMIN_RENEWAL_SETTINGS", "Paramtres de renouvellement d'annonces");
define("LANG_ADMIN_RENEWAL_SETTINGS_DESC", "Veuillez modifier ci-dessous les paramtres de renouvellement des annonces.");
define("LANG_ADMIN_RENEWAL_ALLOW", "autoriser le renouvellement");
define("LANG_ADMIN_RENEWAL_ALLOW_TXT", "Souhaitez-vous que les vendeurs puissent renouveler leurs annonces");
define("LANG_ADMIN_RENEWAL_DAYS", "Jour de renouvellement");
define("LANG_ADMIN_RENEWAL_DAYS_TXT", "Combien de jours avant l'expiration de l'annonce souhaitez-vous que son auteur en soit inform ?");
define("LANG_ADMIN_RENEWAL_EMAIL_SUBJECT", "Sujet du courriel de renouvellement");
define("LANG_ADMIN_RENEWAL_EMAIL_SUBJECT_TXT", "Le sujet du message courriel qui sera envoy pour informer de l'expiration prochaine de son annonce.");
define("LANG_ADMIN_RENEWAL_EMAIL", "corps du message courriel");
define("LANG_ADMIN_RENEWAL_EMAIL_TXT", "Le contenu du message courriel qui sera envoy pour informer de l'expiration prochaine de son annonce.");

// browse users //
define("LANG_ADMIN_BROWSE_USERS", "Liste des utilisateurs");
define("LANG_ADMIN_NAME", "nom");
define("LANG_ADMIN_EMAIL", "adresse courriel");
define("LANG_ADMIN_INFO", "infos");

// user admin settings //
define("LANG_ADMIN_USER_SETTINGS_TXT", "Ces paramtres vous permettent de dterminer ce qui apparatra  la connexion du vendeur.");
define("LANG_ADMIN_USER_SHOW_HITS", "montre le nombre d'annonces visites");
define("LANG_ADMIN_USER_SHOW_SEARCH_HITS", "montre le nombre d'annonces issues d'une recherche");

// user registration //
define("LANG_ADMIN_USER_REGISTRATION", "Champs d'enregistrement lors de l'inscription de l'utilisateur");
define("LANG_ADMIN_FIELD_NAME", "nom du champ");
define("LANG_ADMIN_DISPLAY", "activer");
define("LANG_ADMIN_REQUIRED", "obligatoire");
define("LANG_ADMIN_FIRST_NAME", "prnom");
define("LANG_ADMIN_LAST_NAME", "nom");
define("LANG_ADMIN_ADDRESS", "adresse complte");
define("LANG_ADMIN_CITY", "ville");
define("LANG_ADMIN_STATE", "rgion");
define("LANG_ADMIN_STATE_ABBR", "abrviation de la rgion");
define("LANG_ADMIN_COUNTRY", "pays");
define("LANG_ADMIN_COUNTRY_CODE", "code du pays");
define("LANG_ADMIN_ZIP", "code postal");
define("LANG_ADMIN_PHONE", "tlphone");
define("LANG_ADMIN_NEWSLETTER", "lettre d'informations");
define("LANG_ADMIN_TERMS", "Conditions Gnrales");
define("LANG_ADMIN_CAPTCHA", "Image de scurit");

// user checkout settings //
define("LANG_CHECKOUT_SETTINGS", "Paramtres de dpt d'annonces");
define("LANG_CHECKOUT_SETTINGS_TXT", "Ces paramtres permettent de contrler ce qui est actif, et quelles actions suivent le dpt d'une annonce.");
define("LANG_CHECKOUT_NOTIFICATION", "envoi d'un courriel lorsqu'une nouvelle annonce est dpose");
define("LANG_CHECKOUT_EXTERNAL_URL", "autoriser les URL externes au site");
define("LANG_CHECKOUT_MANUALLY_APPROVE", "validation manuelle des annonces");
define("LANG_CHECKOUT_DISPLAY_PRICE", "autoriser le champ \"prix\"");
define("LANG_CHECKOUT_DISPLAY_SHORT_DESC", "autoriser la courte description");
define("LANG_CHECKOUT_DISPLAY_DESC", "autoriser la description plus longue");
define("LANG_CHECKOUT_REQUIRE_PRICE", "ncessite un prix");
define("LANG_CHECKOUT_REQUIRE_SDESC", "ncessite une courte description");
define("LANG_CHECKOUT_REQUIRE_DESC", "ncessite une description");

// browse listings //
define("LANG_ADMIN_BROWSE_LISTINGS", "Liste des annonces");
define("LANG_ADMIN_TITLE", "titre");
define("LANG_ADMIN_ACTIVE", "active");
define("LANG_ADMIN_NOT_ACTIVE", "inactive");
define("LANG_ADMIN_NOT_COMPLETED", "incomplte");
define("LANG_ADMIN_DATE_ADDED", "date d'ajout");
define("LANG_ADMIN_AUTHORIZATION", "autorisation N");
define("LANG_ADMIN_STATUS", "statut");
define("LANG_ADMIN_SHOW_LISTINGS_FROM", "voir les annonces depuis le :");
define("LANG_ADMIN_SHOW_LISTINGS_TO", "voir les annonces jusqu'au :");
define("LANG_ADMIN_NO_RESULTS", "pas de rsultat.");
define("LANG_ADMIN_TOTAL", "total :");
define("LANG_ADMIN_UPDATE", "mettre  jour");
define("LANG_ADMIN_RESET", "remise  zro");
define("LANG_ADMIN_LAST_MONTH", "durant les 30 derniers jours");
define("LANG_ADMIN_LAST_WEEK", "durant les 7 derniers jours");
define("LANG_ADMIN_LAST_24", "durant les dernires 24 heures");
define("LANG_ADMIN_TODAY", "aujourd'hui");

// search listings //
define("LANG_SEARCH", "recherche");
define("LANG_SEARCH_TEXT_HEAD", "veuillez saisir vos critres de recherche ci-dessous");
define("LANG_SEARCH_TEXT", "recherche par mot");
define("LANG_SEARCH_INCAT", "dans la rubrique");
define("LANG_SEARCH_ALLCAT", "tout slectionner");
define("LANG_SEARCH_PRICE_RANGE", "par ordre de prix");
define("LANG_TO", "");
define("LANG_SEARCH_BUTTON", "rechercher");
define("LANG_SEARCH_LISTING_ID", "numro d'annonce");
define("LANG_SEARCH_ACTIVE", "active");

// search users //
define("LANG_ADMIN_SHOW_USERS_TO", "voir les utilisateurs inscrits jusqu'au :");
define("LANG_ADMIN_SHOW_USERS_FROM", "voir les utilisateurs inscrits depuis le :");

// view listing //
define("LANG_ADMIN_SELLER", "vendeur");
define("LANG_ADMIN_PRICE", "prix");
define("LANG_ADMIN_EXPIRATION", "expiration");
define("LANG_ADMIN_URL", "URL");
define("LANG_ADMIN_VIEWS", "visiteurs");
define("LANG_ADMIN_SEARCH_VIEWS", "recherches");
define("LANG_ADMIN_SHORT_DESCRIPTION", "rsum");
define("LANG_ADMIN_DESCRIPTION", "description complte");
define("LANG_ADMIN_IP", "adresse IP");
define("LANG_ADMIN_RENEWAL_INVOICE", "facture de renouvellement");

// modify listing //
define("LANG_ADMIN_MODIFY_LISTING", "modifier une annonce");
define("LANG_ADMIN_STEP1", "tape 1. entrez les dtails de l'annonce :");
define("LANG_ADMIN_ORDER_DETAILS", "dtails de facturation :");
define("LANG_ADMIN_CATEGORY", "catgorie");
define("LANG_ADMIN_EXTRA", "options de l'annonce");
define("LANG_ADMIN_BOLD", "en gras");
define("LANG_ADMIN_HIGHLIGHT", "en surbrillance");
define("LANG_ADMIN_FEATURED", "apparatra dans les coups de coeur");
define("LANG_ADMIN_AMOUNT", "montant");
define("LANG_ADMIN_PAID", "pay");
define("LANG_ADMIN_OWNER", "vendeur");
define("LANG_ADMIN_PACKAGE", "formule");
define("LANG_ADMIN_MANUAL_APPROVAL", "validation manuelle");

// listing images //
define("LANG_ADMIN_MODIFY_IMAGES", "modifier les images");
define("LANG_ADMIN_MODIFY_IMAGE_RANK", "modifier l'ordre des images");
define("LANG_ADD_IMAGES", "ajout d'images");
define("LANG_ADD_IMAGES_TXT", "veuillez saisir les dtails de l'image ci-dessous");
define("LANG_ADD_IMAGES_TITLE", "nom de l'image");
define("LANG_YOU_HAVE_PLACED", "vous avez charg %s image(s) sur la(les) %s image(s) possible(s)");

// view member //
define("LANG_ADMIN_JOIN_DATE", "date d'inscription");
define("LANG_ADMIN_LAST_LOGIN", "dernire connexion ");
define("LANG_VIEW_MEMBER", "voir la fiche de ce vendeur");
define("LANG_TOTAL_REVIEW", "nombre total de visites");
define("LANG_AVG_RATING", "note moyenne");
define("LANG_RATING", "notation");
define("LANG_OUT_OF_STARS", "sur 10 toiles");
define("LANG_MEMBER_RATING", "notation du membre");
define("LANG_MEMBER_ERROR", "Le vendeur que vous recherchez ne peut tre trouv");
define("LANG_ADMIN_VIEW_ALL_LISTINGS", "voir toutes les annonces");
define("LANG_ADMIN_INVOICE", "facture");
define("LANG_ADMIN_ID", "N");

// modify member //
define("LANG_USER_MODIFY_REGISTRATION", "modifier l'enregistrement");
define("LANG_STAR", "*");
define("LANG_ADMIN_CHANGE_PASSWORD", "veuillez saisir votre mot de passe ci-dessous si vous souhaitez en changer");
define("LANG_ADMIN_USER_GROUP", "type d'utilisateur");

// add member //
define("LANG_USER_REGISTRATION", "Ajout manuel d'un utilisateur");
define("LANG_ALREADY_REGISTERED", "<strong>ATTENTION !</strong> Ce nom d'utilisateur ou l'adresse courriel est dj enregistre chez nous !");
define("LANG_USER_BLACKLISTED", "Ce nom d'utilisateur ou l'adresse courriel a t banni(e).");

// email members //
define("LANG_EMAIL_MEMBERS", "lettre d'informations (newsletter)");
define("LANG_SUBJECT", "sujet");
define("LANG_SUBJECT_TXT", "sujet du message courriel");
define("LANG_HTML_MESSAGE", "version HTML");
define("LANG_AVAILABLE_VARS", "les variables disponibles sont :");
define("LANG_EMAIL_ERROR", "Une erreur a t rencontre lors de l'envoi du message courriel ");
define("LANG_EMAIL_SUCCESS", "message courriel envoy ");
define("LANG_EMAIL_UNSUBSCRIBE", "se dsinscrire");
define("LANG_EMAIL_UNSUBSCRIBE_TXT", "Vous pouvez vous dsinscrire en modifiant votre profil en cliquant sur ce lien :");

// extra fields //
define("LANG_ADMIN_EXTRA_FIELDS", "champs supplmentaires");
define("LANG_ADMIN_EXTRA_FIELDS_NAME", "nom du chanp");
define("LANG_ADMIN_EXTRA_FIELDS_TYPE", "type de champ");
define("LANG_ADMIN_ORDER", "ordre");
define("LANG_ADMIN_EXTRA_FIELDS_CH", "cliquez ici pour ajouter un nouveau champ");
define("LANG_ADMIN_NEW_OPTION", "liste de choix");
define("LANG_ADMIN_NEW_TEXT_OPTION", "champ texte");
define("LANG_ADMIN_NEW_CHECKBOX_OPTION", "option de la nouvelle case  cocher");
define("LANG_ADMIN_DPLIST", "liste droulante");
define("LANG_ADMIN_TXTSINGLE", "champ sur une ligne");
define("LANG_ADMIN_TXTMULTI", "champ sur plusieurs lignes");
define("LANG_ADMIN_CHECKBOX", "cases  cocher");
define("LANG_ADMIN_FIELD_SEEN", "champ visible dans l'annonce");
define("LANG_ADMIN_FIELD_DEFAULT", "valeur par dfaut");
define("LANG_ADMIN_FIELD_SEARCHABLE", "champ  intgrer dans la partie \"recherche\"");
define("LANG_ADMIN_FIELD_OPTIONS", "Options");
define("LANG_ADMIN_FIELD_CAT", "Veuillez slectionner quelle(s) rubrique(s) utilisera(ont) ce champ. <br />Maintenez la touche \"Ctrl\" et cliquez sur les rubriques pour en slectionner plusieurs.");
define("LANG_ADMIN_FIELD_CHECKBOX", "Veuillez saisir les options que le vendeur pourra choisir. <br />Sparez chaque option par une virgule.");
// payment //
define("LANG_ADMIN_PAYMENT", "modifier les services de paiement");
define("LANG_ADMIN_PAYMENT_NAME", "nom du service de rglement");
define("LANG_ADMIN_PAYMENT_SHOW", "sera visible sous ce nom");
define("LANG_ADMIN_PAYMENT_ACTIVE", "actif");
define("LANG_ADMIN_PAYMENT_DEMO", "dmo");
define("LANG_ADMIN_NEED_HELP", "Besoin d'aide pour ces paramtres (en anglais uniquement) ?");
define("LANG_ADMIN_CLICK_HERE", "cliquez ici");

// coupons //
define("LANG_ADMIN_COUPONS", "paramtres du bon de rduction");
define("LANG_ADMIN_COUPONS_TXT", "Veuillez entrer les paramtres du bon de rduction ou de la remise.");
define("LANG_ADMIN_NEW_COUPON", "bon de rduction ou remise");
define("LANG_ADMIN_COUPON_OR_DISCOUNT", "bon de rduction ou remise");
define("LANG_ADMIN_COUPON_NAME", "nom du bon de rduction");
define("LANG_ADMIN_COUPON", "bon de rduction");
define("LANG_ADMIN_DISCOUNT", "remise");
define("LANG_ADMIN_COUPON_CODE", "code du bon de rduction");
define("LANG_ADMIN_COUPON_CODE_TXT", "Ne peut tre utilis que si vous avez opt pour un bon de rduction");
define("LANG_ADMIN_COUPON_DISCOUNT", "type de remise");
define("LANG_ADMIN_COUPON_PERCENTAGE", "pourcentage");
define("LANG_ADMIN_COUPON_FLAT_RATE", "montant de remise");
define("LANG_ADMIN_DISCOUNT_AMOUNT", "montant de la remise ou pourcentage de remise");
define("LANG_ADMIN_NUMBER_AVAILABLE", "nombre disponible");
define("LANG_ADMIN_COUPON_ENDING_DATE", "date de validit");
define("LANG_ADMIN_CALANDER", "calendrier");
define("LANG_ADMIN_COUPON_GROUPS", "Veuillez choisir quel type d'utilisateurs peut utiliser ce bon de rduction ou cette remise.<br />Maintenez la touche \"Ctrl\" pour effectuer plusieurs slections.");

// category //
define("LANG_ADMIN_CATEGORY_SETUP", "Gestion des rubriques");
define("LANG_ADMIN_ALLOW_ADS", "autorise le dpt d'annonces");
define("LANG_ADMIN_PARENT_CATEGORY", "rubrique lie ");
define("LANG_ADMIN_DISPLAY_CATEGORY", "rendre visible la rubrique");
define("LANG_ADMIN_TOP_CATEGORY", "rubrique principale");
define("LANG_ADMIN_IMAGE", "image");
define("LANG_ADMIN_CURRENT_CAT_IMAGE", "image illustrant actuellement la rubrique");

// packages //
define("LANG_ADMIN_LIST_PRICE", "prix hors promotion");
define("LANG_ADMIN_TITLE_CHARACTERS", "nombre maximum de caractres dans le titre");
define("LANG_ADMIN_SDESC_CHARACTERS", "nombre maximum de caractres dans le rsum");
define("LANG_ADMIN_DESC_CHARACTERS", "nombre maximum de caractres dans la description");
define("LANG_ADMIN_ALLOW_FEATURED", "autoriser la slection \"coup de coeur\"");
define("LANG_ADMIN_ALLOW_PHOTOS", "autoriser les photos");
define("LANG_ADMIN_ALLOW_PHOTOS_IF", "si autorises, combien ?");
define("LANG_ADMIN_ALLOW_BOLD", "autoriser la diffusion en caractres gras ");
define("LANG_ADMIN_ALLOW_EXTRA_IF", "si autorise, cot de l'option");
define("LANG_ADMIN_ALLOW_HIGHLIGHTED", "autoriser la diffusion en surbrillance");
define("LANG_ADMIN_RENEWAL_PRICE", "prix du renouvellement");

// local //
define("LANG_ADMIN_ADMINSITE_LANGUAGE", "langue de la partie gestion du site");
define("LANG_ADMIN_DATE_FORMAT", "format de la date");
define("LANG_ADMIN_ADMINDATE_FORMAT", "format de la date admin");
define("LANG_ADMIN_DATE_FORMAT_TXT", "format de la date");
define("LANG_ADMIN_ADMINDATE_FORMAT_TXT", "format de la date (partie gestion du site)");
define("LANG_ADMIN_CURRENCY", "montaire :");
define("LANG_ADMIN_SYMBOL", "symbole");
define("LANG_ADMIN_DECIMAL", "sparateur entre nombre entier et dcimales");
define("LANG_ADMIN_PLACES", "(nombre de caractres aprs le sparateur)");
define("LANG_ADMIN_THOUSANDS", "sparateur de milliers");
define("LANG_ADMIN_CURRENCY_BEFORE", "le symbole montaire est plac AVANT le chiffre");

// add pages //
define("LANG_ADMIN_MODIFY_PAGES", "modifier les pages prformates");
define("LANG_ADMIN_ADD_NEW", "ajouter");
define("LANG_ADMIN_PAGE_LI", "Vous pouvez voir ces pages en allant sur votresite.com/pages.php?page=X - o X est le numro de page ci-dessous.");
define("LANG_ADMIN_PAGE_LI2", "La page de contact est une page nomme contactus.php ; il vous suffit de cliquer dessus depuis votre fichier de modles layout.tpl. <br />Cela permettra l'envoi du formulaire  l'adresse courrier que vous avez indique dans le logiciel.");
define("LANG_ADMIN_PAGE_NAME", "nom de la page");
define("LANG_ADMIN_PAGES_HTML", "le formulaire ci-contre acceptera les balises html que vous saisirez.");

// email templates //
define("LANG_ADMIN_MODIFY_EMAIL", "modifier les courriels prformates");
define("LANG_ADMIN_HTML_CONTENT", "contenu au format HTML");
define("LANG_ADMIN_TEXT_CONTENT", "contenu au format TEXTE");
define("LANG_ADMIN_EMAIL_LI", "Les modles de courriel vous autorisent  changer les messages envoys depuis votre site.");
define("LANG_ADMIN_EMAIL_LI2", "Vous pouvez utiliser plusieurs variables dans les messages.");
define("LANG_ADMIN_EMAIL_LI3", "Insrez les variables suivantes  l'endroit que vous souhaitez dans le courriel : ");

// statistics //
define("LANG_ADMIN_STATS", "statistiques du site");
define("LANG_ADMIN_REGISTRATION_STATS", "statistiques d'enregistrement");
define("LANG_ADMIN_NEW_LISTING_STATS", "statistiques de dpt d'annonces");
define("LANG_ADMIN_NEWEST_MEMBER", "utilisateur le plus rcemment inscrit");
define("LANG_ADMIN_TOP_PURCHASER", "le meilleur vendeur");
define("LANG_ADMIN_MOST_REPLIED", "annonce ayant gnr le + de contacts");
define("LANG_ADMIN_MOST_VIEWED", "annonce la + vue");

// print invoice //
define("LANG_ADMIN_CLIENT_ADDRESS", "vos coordonnes :");
define("LANG_ADMIN_ORDER_ID", "votre numro de commande");
define("LANG_ADMIN_CREATED", "cre le");
define("LANG_ADMIN_DETAILS", "dtails");
define("LANG_ADMIN_PRODUCT", "annonce");
define("LANG_ADMIM_GRAND", "total");
define("LANG_ADMIN_PRINT", "imprimer");

// javascript //
define("LANG_JS_STAR", "*");
define("LANG_JS_DELETE_CONFIRM", "tes vous sr(e) de vouloir supprimer cet enregistrement ?");
define("LANG_JS_NOT_UNDONE", "Cette action est irrversible!");
define("LANG_JS_PLEASE_ENTER", "Veuillez remplir le champ");
define("LANG_JS_GREATER_ZERO", "doit tre suprieur  0.");
define("LANG_JS_SELECT_DIF_CAT", "Veuillez choisir une autre rubrique. Cette rubrqiue n'accepte pas le dpt d'annonces.");




// forward //
define("LANG_FORWARD_SUCESS", "Les paramtres ont t enregistrs !");
define("LANG_FORWARD_ERROR", "Une erreur est survenue");
define("LANG_FORWARD_ERROR_MSG", "Le gestionnaire du site en a t inform.");
define("LANG_FORWARD", "Vous allez tre redirig(e).");
define("LANG_FORWARD_IF_NOT", "Si cela ne se fait pas automatiquement, alors");
define("LANG_FORWARD_CLICK_HERE", "cliquez ici");

//template
define("LANG_TPL_ADMIN_NAVIGATION", "Navigation");
define("LANG_TPL_ADMIN_HOME", "accueil");
define("LANG_TPL_ADMIN_CHANGE_PASS", "changer le mot de passe du gestionnaire");
define("LANG_TPL_ADMIN_MAIN_SETTINGS", "gestion des paramtres");
define("LANG_TPL_ADMIN_SETTINGS", "");
define("LANG_TPL_ADMIN_MAIN", "principaux paramtres");
define("LANG_TPL_ADMIN_SEARCH", "param. de la page 'recherche'");
define("LANG_TPL_ADMIN_LISTING", "param. de l'annonce");
define("LANG_TPL_ADMIN_USER_VIEW", "param. de la fiche 'membre'");
define("LANG_TPL_ADMIN_IMAGE", "paramtres des images");
define("LANG_TPL_ADMIN_RENEWAL", "param. renouvellement");
define("LANG_TPL_ADMIN_REGIONAL", "paramtres rgionaux");
define("LANG_TPL_ADMIN_BAD_WORD", "mots interdits");

define("LANG_TPL_ADMIN_USER_ADMIN_SETTINGS", "paramtres divers");
define("LANG_TPL_ADMIN_USER_ADMIN_MANAGE", "statistiques vendeur");
define("LANG_TPL_ADMIN_USER_REGISTRATION", "champs d'inscription");
define("LANG_TPL_ADMIN_USER_CHECKOUT", "param. dpt d'annonce");

define("LANG_TPL_ADMIN_MANAGE_LISTINGS", "gestion des annonces");
define("LANG_TPL_ADMIN_BROWSE_LISTINGS", "liste des annonces");
define("LANG_TPL_ADMIN_SEARCH_LISTINGS", "recherche d'une annonce");
define("LANG_TPL_ADMIN_ADD_LISTING", "ajout d'une annonce");

define("LANG_TPL_ADMIN_MANAGE_MEMBERS", "gestion des utilisateurs");
define("LANG_TPL_ADMIN_BROWSE_MEMBERS", "liste des utilisateurs");
define("LANG_TPL_ADMIN_SEARCH_MEMBERS", "rechercher un utilisateur");
define("LANG_TPL_ADMIN_ADD_MEMBERS", "ajout d'un utilisateur");
define("LANG_TPL_ADMIN_EMAIL_MEMBERS", "envoi de la newsletter");
define("LANG_TPL_ADMIN_USERGROUPS", "groupes d'utilisateurs");

define("LANG_TPL_ADMIN_STATS", "statistiques");
define("LANG_TPL_ADMIN_SITE_STATS", "statistiques");

define("LANG_TPL_ADMIN_CATEGORY", "gestion des rubriques");
define("LANG_TPL_ADMIN_EDIT_CATEGORY", "modifier une rubrique");
define("LANG_TPL_ADMIN_EXTRA_FIELDS", "champs supplmentaires");

define("LANG_TPL_ADMIN_PAYMENT_SETUP", "paramtres de facturation");
define("LANG_TPL_ADMIN_COUPON", "bons de rduction");
define("LANG_TPL_ADMIN_PAYMENT_PROVIDER", "modes de paiement");
define("LANG_TPL_ADMIN_PACKAGES", "tarifs de diffusion");

define("LANG_TPL_ADMIN_MAINTENANCE", "maintenance");

define("LANG_TPL_ADMIN_TEMPLATE", "modles");
define("LANG_TPL_ADMIN_PAGES", "pages web");
define("LANG_TPL_ADMIN_EMAIL_TEMPLATES", "modles de courriels");

define("LANG_TPL_ADMIN_STATES_COUNTRIES", "rgions & pays");
define("LANG_TPL_ADMIN_EDIT_STATES", "diter les rgions");
define("LANG_TPL_ADMIN_EDIT_COUNTRIES", "diter les pays");

define("LANG_TPL_ADMIN_LINK", "liens utiles");
define("LANG_TPL_ADMIN_MANUAL", "manuel d'utilisation (en anglais)");
define("LANG_TPL_ADMIN_FORUM", "forums d'aides (en anglais)");
define("LANG_TPL_ADMIN_UPGRADE", "mettre  jour le site");



// layout //
define("LANG_DASHBOARD", "Dashboard");
define("LANG_LISTINGS", "Listings");
define("LANG_ORDERS", "Orders");
define("LANG_USERS", "Users");
define("LANG_CATEGORIES", "Categories");
define("LANG_PAYMENT", "Payment");
define("LANG_SETTINGS", "Settings");
define("LANG_SUPPORT_FORUMS", "Support Forums");
define("LANG_LOGOUT", "se dconnecter");
define("LANG_MANAGE_LISTINGS", "Manage Listings");
define("LANG_ADD_LISTING", "Add Listing");
define("LANG_MANAGE_ORDERS", "Manage Orders");
define("LANG_ADD_ORDER", "Add Order");
define("LANG_MANAGE_USERS", "Manage Users");
define("LANG_ADD_USER", "Add Users");
define("LANG_USER_GROUPS", "User Groups");
define("LANG_PRIVATE_MESSAGES", "Private Messages");
define("LANG_MANAGE_CATEGORIES", "Manage Categories");
define("LANG_EXTRA_FIELDS", "Extra Fields");
define("LANG_MANAGE_PRODUCTS", "Manage Products");
define("LANG_COUPONS_DISCOUNTS", "Coupons &amp; Discounts");
define("LANG_PAYMENT_PROVIDERS", "Payment Providers");
define("LANG_TEMPLATE_EDITOR", "Template Editor");
define("LANG_PAGE_EDITOR", "Page Editor");
define("LANG_MODULES", "Modules");

?>                                                                                                                                            administration/listings.php                                                                         0000644 0023433 0004734 00000020611 11102726352 016017  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Listings.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Categories.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Users.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Products.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Orders.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Pagination.php');

$Users= new Users;
$Listings= new Listings;
$Categories = new Categories;
$Products = new Products;
$Orders = new Orders;
if($_SESSION['admin_listings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	// they have selected to change the status
	if(isset($_POST['act']) && $_POST['act'] == "changestatus")
	{
		$newstatus=$_POST["newstatus"];
		foreach($_POST['listingid'] AS $key)
		{
			$Listings->changeDisplay($newstatus, $key);
		}
	}
	//delete image
	if(isset($_GET['imageid']) && isset($_GET['action']) && $_GET['action']=="delete")
	{
		$imageid=(int)$_GET['imageid'];
		if($Listings->removeOneImage($imageid))
		{
			//sucessfull
			$class_tpl->assign('success',TRUE);
			$action="Deleted Image for listing id: ". $listingid;
		}
	}
	//modify rank
	if(isset($_POST['rank']) && isset($_POST['id']) && $_POST['id']<>"")
	{
		$sSQL = sprintf("UPDATE ".PREFIX."prodimages SET rank=%s,title=%s WHERE id=%s",
					GetSQLValueString($_POST['rank'], "int"),
					GetSQLValueString($_POST['title'], "text"),
					GetSQLValueString($_POST['id'], "int"));
		$db->query($sSQL);
		$class_tpl->assign('success',TRUE);
	}
	//add image
	if(isset($_POST['addphoto']) && $_POST['addphoto']=='Y')
	{
		require_once(FILESYSTEM_PATH .'includes/classes/images/class_upload.php');
		require_once(FILESYSTEM_PATH .'includes/classes/images/class_resize.php');
		//first get image settings
		$sSQL="SELECT component,extensions,quality,maxWidth,maxHeight,maxWidthThumb,maxHeightThumb,qualityThumb  FROM ".PREFIX."image_settings WHERE id=1";
		$result=$db->query($sSQL);
		$rs=$result->fetch();
		$component=$rs['component'];
		$extensions=$rs['extensions'];
		$maxWidth=$rs['maxWidth'];
		$maxHeight=$rs['maxHeight'];
		$maxWidthThumb=$rs['maxWidthThumb'];
		$maxHeightThumb=$rs['maxHeightThumb'];
		$quality=$rs['quality'];
		$qualityThumb=$rs['qualityThumb'];
		
		//now upload it
		if(isset($_GET['upload']))
		{
			#$DMX_debug = true; //uncomment for debugging
			$ppu = new pureFileUpload();
			$ppu->path = "../photos";
			$ppu->extensions = $extensions;
			$ppu->formName = "imageupload";
			$ppu->storeType = "file";
			$ppu->sizeLimit = "";
			$ppu->nameConflict = "uniq";
			$ppu->requireUpload = "true";
			$ppu->minWidth = "";
			$ppu->minHeight = "";
			$ppu->maxWidth = "";
			$ppu->maxHeight = "";
			$ppu->saveWidth = "";
			$ppu->saveHeight = "";
			$ppu->timeout = "600";
			$ppu->progressBar = "fileCopyProgress.php";
			$ppu->progressWidth = "300";
			$ppu->progressHeight = "100";
			$ppu->checkVersion("2.1.2");
			$ppu->doUpload();

			$sip = new resizeUploadedFiles($ppu);
			$sip->component = $component;
			$sip->resizeImages = "false";
			$sip->aspectImages = "true";
			$sip->maxWidth = $maxWidth;
			$sip->maxHeight = $maxHeight;
			$sip->quality = $quality;
			$sip->makeThumb = "true";
			$sip->pathThumb = "../thumbs";
			$sip->aspectThumb = "true";
			$sip->naming = "prefix";
			$sip->suffix = "small_";
			$sip->maxWidthThumb = $maxWidthThumb;
			$sip->maxHeightThumb = $maxHeightThumb;
			$sip->qualityThumb = $qualityThumb;
			$sip->checkVersion("1.0.3");
			$sip->doResize();
		}
			
		//now insert it
		$sSQL = sprintf("INSERT INTO ".PREFIX."prodimages (pid, title, image) VALUES (%s, %s, %s)",
				GetSQLValueString($_POST['view'], "text"),
				GetSQLValueString($_POST['title'], "text"),
				GetSQLValueString($_POST['imagename'], "text"));
		$db->query($sSQL);
		if($db->isError()) 
		{
			//error
			echo "error";
		}
		else
		{
			//$action="Added Image for listing id: ". $listingid ."<br />Image Name: ". $HTTP_POST_VARS['imagename'];
			//$Core->log_activity($_SESSION['uid'],$_SESSION['username'],$action,$_SERVER['REMOTE_ADDR']);
			$class_tpl->assign('success',TRUE);
		}
	}
	
	//default actions
	if(isset($_REQUEST['view']))
	{
		$Core->getCheckoutSettings();
		$Users->getAllUsersForSelect();
		$class_tpl->assign('getcats', $Categories->getAdminCatTree("", 0));
		$listing=$Listings->getListingById($_REQUEST['view'], 'modify');
		$class_tpl->assign('body', 'listings/listing_edit.tpl');
	}
	elseif(isset($_POST['action']) && $_POST['action']=="modify")
	{
		$data['id']=(int)@$_POST['id'];
		$data['owner']=(int)@$_POST['owner'];
		$data['section']=(int)@$_POST['section'];
		$data['title']=trim(@$_POST['title']);
		$price=trim(@$_POST['price']);
		$data['price']=$price;
		$data['url']=trim(@$_POST['url']);
		$data['oldstatus']=trim(@$_POST['oldstatus']);
		$data['display']=trim(@$_POST['display']);
		$data['shortDescription']=trim(@$_POST['shortDescription']);
		$data['description']=trim(@$_POST['description']);
		$data['bold']=$_POST['pBold'];
		$data['highlighted']=$_POST['pHighlighted'];
		$data['featured']=$_POST['featured'];
		
		//handle the expiration
		$time=strftime("%H:%M:%S");
		$data['dateadded']=@$_POST['dateadded']." ". $time;
		$data['expiration']=@$_POST['expiration']." ". $time;
		
		if($data['display']=="D")
		{
			$Users->banUser($data['owner']);
			$location="listings.php";
			$class_tpl->assign('title',LANG_FORWARD_SUCESS);
			$class_tpl->assign('forward',TRUE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
		
		if($Listings->editListing($data, TRUE)) 
		{
			//sucessfull
			$location="listings.php";
			$class_tpl->assign('title',LANG_FORWARD_SUCESS);
			$class_tpl->assign('forward',TRUE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
	}
	elseif(isset($_POST['action']) && $_POST['action']=="addlisting")
	{
		//create an order
		$order['userid']=(int)$_POST['owner'];
		$package=explode("|", $_POST['oProductID']);
		$order['oProductID']=$package[0];
		$order['oProduct']=$package[1];
		$order['oType']=1;
		$order['oTotal']=0;
		$order['oSubTotal']=0;
		$order['oBold']='N';
		$order['oHighlighted']='N';
		$order['oFeatured']='N';
		$order['oStatus']=1;
		$order['oAddInfo']='Manually added by '. $_SESSION['username']; 
		$orderid=$Orders->generateOrder($order);
		
		//now the listing
		$data['owner']=(int)@$_POST['owner'];
		$data['title']=trim(@$_POST['title']);
		$price=trim(@$_POST['price']);
		//$price = ereg_replace("[^.[:alnum:]]","",$price);
		$data['price']=$price;
		$data['url']=trim(@$_POST['url']);
		$data['display']=trim(@$_POST['display']);
		$data['section']=(int)@$_POST['section'];
		$data['shortDescription']=trim(@$_POST['shortdescription']);
		$data['description']=trim(@$_POST['description']);
		//handle the expiration
		$time=strftime("%H:%M:%S");
		$expiration=@$_POST['expiration']." ". $time;
		$data['expiration']=$expiration;
		$data['orderID']=$orderid;
		$listingid=$Listings->addListing($data);
		if($listingid<>"")
		{
			//sucessfull
			$location="listings.php?view=".$listingid;
			$class_tpl->assign('title',LANG_FORWARD_SUCESS);
			$class_tpl->assign('forward',TRUE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
	}
	elseif(isset($_GET['action']) && $_GET['action']=="add")
	{
		$Core->getCheckoutSettings();
		$Users->getAllUsersForSelect();
		$class_tpl->assign('products', $Products->getListingPackages());
		$class_tpl->assign('l_DateAdded', date("Y-m-d"));
		$class_tpl->assign('l_DateAdded_Time', date("H:i:s"));
		$class_tpl->assign('body', 'listings/listing_add.tpl');
		$class_tpl->assign('getcats', $Categories->getAdminCatTree("", 0));
		
	}
	else
	{
		$pageNum = 1;
		if(isset($_GET['page']))
		{
			$pageNum = (int)$_GET['page'];
		}
		$options = '';
		$list=$Listings->getAllListings($options, $pageNum, MAX_ROWS_SEARCH);
		$class_tpl->assign('results', $list["list"]);
		$class_tpl->assign('sqlsort', $list["info"]["sqlsort"]);
		$class_tpl->assign('sortorder', $list["info"]["sortorder"]);
		$class_tpl->assign('oppositesort',  $list["info"]["oppositesort"]);
		$class_tpl->assign('body', 'listings/listings_browse.tpl');
	}
$class_tpl->displayTemplate();
?>
                                                                                                                       administration/login.php                                                                            0000644 0023433 0004734 00000006266 11051631516 015305  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
session_start();

	// Configuration data
	define('IN_ADMIN', true);
	if (substr(PHP_OS, 0, 3) == "WIN")
	{
		$base_dir = str_replace('administration\\login.php', '', realpath(__FILE__));
	}
	else
	{
		$base_dir = str_replace('administration/login.php', '', realpath(__FILE__));
	}
	//setup the login sessions 
	$_SESSION['logged'] = false;
	
	define("FILESYSTEM_PATH", $base_dir);
	require_once(FILESYSTEM_PATH .'Connections/classifieds.php');
	require_once(FILESYSTEM_PATH .'includes/classes/database/mysql.php');
	require_once(FILESYSTEM_PATH .'includes/classes/kernel/Core.php');
	require_once(FILESYSTEM_PATH .'includes/functions.php');
	require_once(FILESYSTEM_PATH .'includes/classes/kernel/Template.php');
	require_once(FILESYSTEM_PATH .'includes/classes/kernel/Login.php');	
	require_once(FILESYSTEM_PATH .'includes/classes/kernel/Modules.php');
	$db = &new MySQL($hostname_classifieds,$username_classifieds,$password_classifieds,$database_classifieds);
	$Core = new Core();
	$Login = new Login( $db );
	$class_tpl = new Template();
	$modules=new Modules($db);
	
	//version
	if(LICENSEKEY!="localhost")
	{
		$version=$Core->settings['version'];
		$key=explode('-', LICENSEKEY);
		if($key[4]=='c4ca4238')
		{
			$edition='Developer';
		}
		if($key[4]=='a87ff679')
		{
			$edition='Designer';
		}
		if($key[4]=='eccbc87e')
		{
			$edition='30 Day Trial';
		}
		if($key[4]=='c81e728d')
		{
			$edition='Hosted';
		}
	}
	else
	{
		$version=$Core->settings['version'];
		$edition="Testing";	
	}
	define("VERSION", $version);
	//language
	$language=$Core->settings['cAdminLanguage'];
	require_once(FILESYSTEM_PATH .'administration/'. $language);

	if(isset($_GET['js']) && $_GET['js']==TRUE)
	{
		$class_tpl->assign('js', "true");	
	}
     if(!empty($_POST)) 
	 {
		//they have submitted the form//
		if(isset($_POST['username']) && isset($_POST['password']) && $_POST['username']<>"" && $_POST['password']<>"")
		{
			//data has been filled
			$remember=trim(@$_POST['remember']);
			if($Login->_checkLogin(trim(@$_POST['username']), trim(@$_POST['password']), $remember, 'login.php'))
			{
				//go to the user index page
				if(isset($_POST['goto']) && $_POST['goto']<>"")
				{
					$location=mysql_real_escape_string($_POST['goto']);
					$location=str_replace('...','',$location);	
				}
				else
				{
					$location="index.php";
				}
				$class_tpl->assign('title',LANG_LOGIN_SUCCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','login.tpl');
			}
			else
			{
				// show the form again the user wasn't validated
				$class_tpl->assign('msg', LANG_USER_LOGIN_ERROR);
				$class_tpl->assign('username', $_POST['username']);
				$class_tpl->assign('body','login.tpl');
			}
		}
		else
		{
			// show the form again some value wasn't entered
			$class_tpl->assign('username', $_POST['username']);
			$class_tpl->assign('body','login.tpl');
		}
	}
	else
	{
		$class_tpl->assign('body','login.tpl');
	}

$class_tpl->display('login.tpl');
?>
                                                                                                                                                                                                                                                                                                                                          administration/logout.php                                                                           0000644 0023433 0004734 00000000534 11051631516 015476  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
$Login = new Login( $db );
$Login->_logout();
header("Location: login.php");
?>
                                                                                                                                                                    administration/managemodules.php                                                                    0000644 0023433 0004734 00000005320 11051631517 017005  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
if(isset($_GET['action']))
{
	if($_GET['action']=="regenerate")
	{
		if($modules->regenerate())
		{
			$class_tpl->assign('msg',LANG_MODULE_REGENERATE_SUCCESS);	
		}
	}
}
if(isset($_GET['do']) && isset($_GET['action']) && isset($_GET['id']))
{
	if($_GET['do']=="changestate")
	{
		$modules->changeStatus($_GET['id'], $_GET['action']);
	}
}
if(isset($_POST['act']) && $_POST['act']=="changeorder")
	{
		$currentorder = (int)@$_POST["selectedq"];
		$neworder = (int)@$_POST["newval"];
		$sSQL = "SELECT id FROM ".PREFIX."modules ORDER BY mOrder";
		$result=$db->query($sSQL);
		$rowcounter=1;
		while($rs=$result->fetch())
		{
			$theorder = $rowcounter;
			if($currentorder == $theorder)
				$theorder = $neworder;
			elseif(($currentorder > $theorder) && ($neworder <= $theorder))
				$theorder++;
			elseif(($currentorder < $theorder) && ($neworder >= $theorder))
				$theorder--;
			$sSQL="UPDATE ".PREFIX."modules SET mOrder=" . $theorder . " WHERE id=" . $rs["id"];
			mysql_query($sSQL) or print(mysql_error());
			$rowcounter++;
		}
		$class_tpl->assign('success',TRUE);
	}
$sSQL='SELECT id,name,displayname,description,directory,version,state,admin_capable,mOrder FROM '.PREFIX.'modules ORDER BY mOrder';
$result=$db->query($sSQL);
$data=array();
while($row=$result->fetch())
{
	$admin_capable = 'N';
	switch($row['state'])
	{
		case 1:
			$row['state']=LANG_MODULE_UNINITIALIZED;
			$row['action']="initialize";
			$row['actiontext']=LANG_MODULE_INITIALIZE;
		break;
		case 2:
			$row['state']=LANG_MODULE_INACTIVE;
			$row['action']="activate";
			$row['actiontext']=LANG_MODULE_ACTIVATE;
		break;
		case 3:
			$row['state']=LANG_MODULE_ACTIVE;
			$row['action']="deactivate";
			$row['actiontext']=LANG_MODULE_DEACTIVATE;
			if($row['admin_capable']==1)
			{
				$admin_capable='Y';
			}
		break;
	}
	$row['admin_capable']=$admin_capable;
	$txtfile = FILESYSTEM_PATH.'modules/'.$row['directory'].'/readme.txt';
	$phpfile = FILESYSTEM_PATH.'modules/'.$row['directory'].'/readme.php';
	if (file_exists($txtfile)) {
		$row['help']='../modules/'.$row['directory'].'/readme.txt';
	} elseif( file_exists($phpfile) ) {
		$row['help']='../modules/'.$row['directory'].'/readme.php';
	}
	$data[] = $row;
}
$class_tpl->assign('results', $data);
$class_tpl->assign('max', count($data));
$class_tpl->assign('body','modules/managemodules.tpl');
$class_tpl->displayTemplate();
?>
                                                                                                                                                                                                                                                                                                                administration/modules.php                                                                          0000644 0023433 0004734 00000002653 11051631517 015642  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if(isset($_REQUEST['mod']))
{
	$mod=$modules->getModuleByName($_REQUEST['mod']);
	$class_tpl = new Template($mod['directory']);
	if($mod['admin_capable']==1)
	{
		//include the language file
		if (@file_exists(FILESYSTEM_PATH .'modules/'.$mod['directory'].'/language/'.$language))
		{
			require_once(FILESYSTEM_PATH .'modules/'.$mod['directory'].'/language/'.$language);
		}
		elseif (@file_exists(FILESYSTEM_PATH .'modules/'.$mod['directory'].'/language/english.php'))
		{
				require_once(FILESYSTEM_PATH .'modules/'.$mod['directory'].'/language/english.php');
		}
		
		//now the real file
		if (@file_exists(FILESYSTEM_PATH .'modules/'.$mod['directory'].'/admin.php'))
		{
			require_once(FILESYSTEM_PATH .'modules/'.$mod['directory'].'/admin.php');
		}
		else
		{
			// Goes back to index
			header('Location: index.php');		
			exit();	
		}
	}
	else
	{
		//not successfull
		$class_tpl->assign('title',LANG_FORWARD_ERROR);
		$class_tpl->assign('msg', LANG_ADMIN_NO_MODULE);
		$class_tpl->assign('forward',FALSE);
		$class_tpl->assign('body','forward.tpl');
		$class_tpl->display('layout.tpl');	
	}
}
else
{
	// Goes back to index
	header('Location: index.php');		
	exit();	
}
?>
                                                                                     administration/notes.php                                                                            0000644 0023433 0004734 00000002365 11051631520 015314  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Users.php');
$Users= new Users;
if($_SESSION['admin_users']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	if(isset($_POST['notes']) && isset($_POST['id']))
	{
		$notes=mysql_escape_string($_POST['notes']);
		$id=(int)$_POST['id'];
		$insert=$Users->addNote($id, $notes);
		if($insert==TRUE)
		{
			$class_tpl->assign('action', 'success');
			$class_tpl->assign('msg', LANG_ADD_NOTE_SUCCESS);
		}
		else
		{
			$class_tpl->assign('action', 'error');
			$class_tpl->assign('msg', $insert);
		}
	}
	elseif(isset($_GET['id']))
	{
		$id=(int)$_GET['id'];
		$user=$Users->getUserNameById($id);
		$class_tpl->assign('id', $id);
		$class_tpl->assign('notes', $user['notes']."\n". $_SESSION['username'] . ' '. LANG_WROTE .' '. date("F d Y H:i:s") .' - ');
		$class_tpl->assign('username', $user['username']);
	}
	else
	{
		//error you must have an id	
	
	}
$class_tpl->display('users/users_notes.tpl');
?>
                                                                                                                                                                                                                                                                           administration/orders.php                                                                           0000644 0023433 0004734 00000007102 11051631520 015454  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Orders.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Users.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Products.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Listings.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Pagination.php');

$Users= new Users;
$Orders= new Orders;
$Products= new Products;
$Listings= new Listings;
if($_SESSION['admin_orders']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	// they have selected to change the status
	if(isset($_POST['action']) && $_POST['action'] == "changestatus")
	{
		$newstatus=$_POST["newstatus"];
		foreach($_POST['orderid'] AS $key)
		{
			$Orders->changeDisplay($newstatus, $key);
			$class_tpl->assign('success', 'TRUE');
		}
	}
	if(isset($_REQUEST['cmd']) && $_REQUEST['cmd']=="modify" && isset($_POST['id']))
	{
		$data['id']=(int)@$_POST['id'];
		if($_POST['oType']==2)
		{
			$data['membership']='Y';
			$data['numUsed']=(int)@$_POST['numUsed'];
			$data['fnumUsed']=(int)@$_POST['fnumUsed'];
			$data['hnumUsed']=(int)@$_POST['hnumUsed'];
			$data['bnumUsed']=(int)@$_POST['bnumUsed'];
		}
		$data['oStatus']=(int)@$_POST['oStatus'];
		$data['oldstatus']=(int)@$_POST['oldstatus'];
		if($Orders->editMembershipOrder($data))
		{
			$class_tpl->assign('success', 'TRUE');
		}
		$location="orders.php";
		$class_tpl->assign('title',LANG_FORWARD_SUCESS);
		$class_tpl->assign('forward',TRUE);
		$class_tpl->assign('location',$location);
		$class_tpl->assign('body','forward.tpl');
	}
	elseif(isset($_REQUEST['action']) && $_REQUEST['action']=="add")
	{
		$Users->getAllUsersForSelect();
		$class_tpl->assign('packages', $Products->getProductList());
		$class_tpl->assign('body', 'orders/orders_add.tpl');
	}
	elseif(isset($_REQUEST['action']) && $_REQUEST['action']=="modify" && isset($_REQUEST['id']))
	{
		$id=(int)$_REQUEST['id'];
		$Users->getAllUsersForSelect();
		$list=$Orders->getOrderById($id);
		$class_tpl->assign('packages', $Products->getProductList());
		$transactions=$Orders->getTransactionsByOrderID($id);
		$class_tpl->assign('transactions', $transactions);
		//Order History
		$pageNum = 1;
		$options['owner']=$list['oOwnerID'];
		$list=$Orders->getAllOrders($options, $pageNum, 50);
		$class_tpl->assign('history', $list["info"]["total"]);
		if($transactions==FALSE)
		{
			$class_tpl->assign('transaction_number', 0);
		}
		else
		{
			$class_tpl->assign('transaction_number', count($transactions));
		}
		$class_tpl->assign('results', $list["list"]);
		

		$options['o_ID'] = $id;
		$listings=$Listings->getAllListings($options, $pageNum, 50);
		$class_tpl->assign('listings', $listings["info"]["total"]);
		$class_tpl->assign('listingresults', $listings["list"]);
		$class_tpl->assign('body', 'orders/orders_edit.tpl');
	}
	else
	{
		$pageNum = 1;
		if(isset($_GET['page']))
		{
			$pageNum = (int)$_GET['page'];
		}
		$options = '';
		$list=$Orders->getAllOrders($options, $pageNum, MAX_ROWS_SEARCH);
		$class_tpl->assign('results', $list["list"]);
		$class_tpl->assign('sqlsort', $list["info"]["sqlsort"]);
		$class_tpl->assign('sortorder', $list["info"]["sortorder"]);
		$class_tpl->assign('oppositesort',  $list["info"]["oppositesort"]);
		$class_tpl->assign('body', 'orders/orders_browse.tpl');
	}
$class_tpl->displayTemplate();
?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              administration/pages.php                                                                            0000644 0023433 0004734 00000012636 11051631521 015266  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
 require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	$class_tpl->assign('htmleditor', $Core->settings['htmlEditor']);
	// they have selected delete
	if(isset($_POST["action"]) && $_POST["action"] == "delete" && isset($_POST["pageID"])) 
	{
		$pageID=(int)trim(@$_POST['pageID']);
		$sSQL = "DELETE FROM ".PREFIX."pages WHERE pageID=".$pageID." LIMIT 1";
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$location="pages.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//not successfull
				$location="pages.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	// they have selected modify
	elseif(isset($_POST["action"]) && $_POST["action"] == "modifypage" && isset($_POST["pageID"])) 
	{
		$pageID=(int)trim(@$_POST['pageID']);
		$sSQL = sprintf("UPDATE ".PREFIX."pages SET pPageTitle=%s, pPageContent=%s,pPublish=%s,pNav=%s WHERE pageID=%s",
					GetSQLValueString($_POST['pPageTitle'], "text"),
					GetSQLValueString($_POST['pPageContent'], "text"),
					GetSQLValueString($_POST['pPublish'], "text"),
					GetSQLValueString($_POST['pNav'], "text"),
					GetSQLValueString($pageID, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				if($_POST['save']<>"")
				{
					$class_tpl->assign('success',TRUE);
					$sSQL="SELECT pPageTitle,pPageContent,pPublish,pNav FROM ".PREFIX."pages WHERE pageID=".$pageID;
					$result=$db->query($sSQL);
					$rs=$result->fetch();
					$class_tpl->assign('action','modifypage');
					$class_tpl->assign('pageID',$pageID);
					$class_tpl->assign('pPageTitle',safeStripSlashes(htmlentities($rs['pPageTitle'], ENT_QUOTES, 'UTF-8')));
					$class_tpl->assign('pPageContent',safeStripSlashes(htmlentities($rs['pPageContent'], ENT_QUOTES, 'UTF-8')));
					$class_tpl->assign('pPublish',$rs['pPublish']);
					$class_tpl->assign('pNav',$rs['pNav']);
					$class_tpl->assign('body','pages/pagesform.tpl');
				}
				else
				{
					//sucessfull
					$location="pages.php";
					$class_tpl->assign('title',LANG_FORWARD_SUCESS);
					$class_tpl->assign('forward',TRUE);
					$class_tpl->assign('location',$location);
					$class_tpl->assign('body','forward.tpl');
				}
			}
			else
			{
				//not successfull
				$location="pages.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	// they have selected add page
	elseif(isset($_POST["action"]) && $_POST["action"] == "addpage") 
	{
		$sSQL = sprintf("INSERT INTO ".PREFIX."pages (pPageTitle, pPageContent, pPublish, pNav) VALUES (%s, %s, %s, %s)",
					GetSQLValueString($_POST['pPageTitle'], "text"),
					GetSQLValueString($_POST['pPageContent'], "text"),
					GetSQLValueString($_POST['pPublish'], "text"),
					GetSQLValueString($_POST['pNav'], "text"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$location="pages.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//not successfull
				$location="pages.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	// they have selected to add new page
	elseif(isset($_REQUEST["action"]) && $_REQUEST["action"] == "addnew") 
	{
		$modules->call_hook('add_page', ''); // Call any module functions
		$class_tpl->assign('action','addpage');
		$class_tpl->assign('body','pages/pagesform.tpl');
	}
	// they have selected to modify a page
	elseif(isset($_REQUEST["action"]) && $_REQUEST["action"] == "modify" && isset($_REQUEST["pageID"])) 
	{
		$pageID=(int)trim(@$_REQUEST['pageID']);
		$sSQL="SELECT pPageTitle,pPageContent,pPublish,pNav FROM ".PREFIX."pages WHERE pageID=".$pageID;
		$result=$db->query($sSQL);
		$rs=$result->fetch();
		$class_tpl->assign('action','modifypage');
		$class_tpl->assign('pageID',$pageID);
		$class_tpl->assign('pPageTitle',safeStripSlashes($rs['pPageTitle']));
		$class_tpl->assign('pPageContent',safeStripSlashes($rs['pPageContent']));
		$class_tpl->assign('pPublish',$rs['pPublish']);
		$class_tpl->assign('pNav',$rs['pNav']);
		$class_tpl->assign('body','pages/pagesform.tpl');
		$modules->call_hook('edit_page', $pageID); // Call any module functions
	}
	// final else show all the pages
	else
	{
		$sSQL="SELECT pageID,pPageTitle,pPageContent,pPublish,pNav FROM ".PREFIX."pages ORDER BY pageID";
		$result=$db->query($sSQL);
		$data=array();
		while($rs=$result->fetch())
		{
			$rs['pPageTitle']=htmlentities($rs['pPageTitle'], ENT_QUOTES, 'UTF-8');
			$data[]=$rs;
		}
		$class_tpl->assign('results', $data);
		$class_tpl->assign('body','pages/pages.tpl');
	}
     
$class_tpl->displayTemplate();
?>                                                                                                  administration/privatemessages.php                                                                  0000644 0023433 0004734 00000004763 11051631521 017373  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Users.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Private.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Pagination.php');
require_once(FILESYSTEM_PATH .'includes/classes/wrapper/SuperglobalWrapper.php');
$Users=new Users();
$Private=new PrivateMessage();

if($_SESSION['admin_users']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	// they have selected to change the status
	if(isset($_POST['act']) && $_POST['act'] == "changestatus")
	{
		$newstatus=$_POST["newstatus"];
		foreach($_POST['pmid'] AS $key)
		{
			$Private->deleteMessage($key);
			$class_tpl->assign('success', TRUE);
		}
	}
	if(isset($_POST['action']) && $_POST['action']=="delete")
	{
		$pmid=(int)$_POST['id'];
		$Private->deleteMessage($pmid);
		//sucessfull
		$location="privatemessages.php";
		$class_tpl->assign('title',LANG_FORWARD_SUCESS);
		$class_tpl->assign('forward',TRUE);
		$class_tpl->assign('location',$location);
		$class_tpl->assign('body','forward.tpl');
	}
	if(isset($_REQUEST['read']) && $_REQUEST['read']!='')
	{
		if(isset($_POST['action']) && $_POST['action']=="spam" && isset($_POST['id']))
		{
			$Private->markAsSpam($_POST['id'], $_POST['userid']);
			$class_tpl->assign('success', TRUE);
		}
		if(isset($_POST['action']) && $_POST['action']=="notspam" && isset($_POST['id']))
		{
			$Private->markAsNotSpam($_POST['id'], $_POST['userid']);
			$class_tpl->assign('success', TRUE);
		}
		$id=(int)$_REQUEST['read'];
		$message=$Private->readMessage($id);
		$user=$Users->getUserNameById($message['userid']);
		$class_tpl->assign('username', $user['username']);
		$class_tpl->assign('body', 'private/pm_read.tpl');
	}
	else
	{
		$pageNum = 1;
		if(isset($_GET['page']))
		{
			$pageNum = (int)$_GET['page'];
		}
		//$options = array('l_UID' => 1);
		$options = '';
		$list=$Private->listMessages($options, $pageNum);
		$class_tpl->assign('results', $list["list"]);
		$class_tpl->assign('sqlsort', $list["info"]["sqlsort"]);
		$class_tpl->assign('sortorder', $list["info"]["sortorder"]);
		$class_tpl->assign('oppositesort',  $list["info"]["oppositesort"]);
		$class_tpl->assign('body', 'private/pm_browse.tpl');
	}
$class_tpl->displayTemplate();
?>
             administration/products.php                                                                         0000644 0023433 0004734 00000032400 11051631522 016022  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Products.php');
$Products= new Products;
$Core->getCheckoutSettings();
if($_SESSION['admin_payment']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}

	if(isset($_POST['act']) && $_POST['act']=="changeorder")
	{
		$currentorder = (int)@$_POST["selectedq"];
		$neworder = (int)@$_POST["newval"];
		$sSQL = "SELECT pID FROM ".PREFIX."products ORDER BY pOrder";
		$result=$db->query($sSQL);
		$rowcounter=1;
		while($rs=$result->fetch())
		{
			$theorder = $rowcounter;
			if($currentorder == $theorder)
				$theorder = $neworder;
			elseif(($currentorder > $theorder) && ($neworder <= $theorder))
				$theorder++;
			elseif(($currentorder < $theorder) && ($neworder >= $theorder))
				$theorder--;
			$sSQL="UPDATE ".PREFIX."products SET pOrder=" . $theorder . " WHERE pID=" . $rs["pID"];
			mysql_query($sSQL) or print(mysql_error());
			$rowcounter++;
		}
		$class_tpl->assign('success',TRUE);
	}
	if(isset($_POST['act']) && isset($_POST['id']) && $_POST['act']=="delete")
	{
		$Products->deleteProductByID($_POST['id']);
		$class_tpl->assign('success',TRUE);
	}
	if(isset($_POST['mode']) && $_POST['mode']=="addnewpackage")
	{
		$sql="SELECT MAX(pOrder) AS max FROM ".PREFIX."products";
		$result=$db->query($sql);
		$rs=$result->fetch();
		$max=($rs['max']+1);
		
		//first insert the product
		$sSQL = "INSERT INTO `".PREFIX."products` SET ";
				$sSQL.="pTitle=".GetSQLValueString($_POST['pTitle'], 'text').", ";
				$sSQL.="pWorkingName=".GetSQLValueString($_POST['pWorkingName'], 'text').", ";
				$sSQL.="pDescription=".GetSQLValueString($_POST['pDescription'], 'text').", ";
				$sSQL.="pListPrice=".GetSQLValueString($_POST['pListPrice'], 'double').", ";
				$sSQL.="pPrice=".GetSQLValueString($_POST['pPrice'], 'double').", ";
				$sSQL.="pRenewalPrice=".GetSQLValueString($_POST['pRenewalPrice'], 'double').", ";
				$sSQL.="pType=".GetSQLValueString($_POST['pType'], 'text').", ";
				$sSQL.="pExpiration=".GetSQLValueString($_POST['pExpiration'], 'text').", ";
				$sSQL.="pOrder='$max' ";
		$db->query($sSQL);
		if (!$db->isError()) 
		{
			$pID=$result->insertID();
			//now the actual product listing
			$sSQL="INSERT INTO ".PREFIX."products_packages SET ";
				$sSQL.="pID=".$pID.", ";
				$sSQL.="cTitleCharacters=".GetSQLValueString($_POST['cTitleCharacters'], 'int').", ";
				$sSQL.="cShortDescCharacters=".GetSQLValueString($_POST['cShortDescCharacters'], 'int').", ";
				$sSQL.="cCharacters=".GetSQLValueString($_POST['cCharacters'], 'int').", ";
				$sSQL.="cDisURL=".GetSQLValueString($_POST['cDisURL'], 'text').", ";
				$sSQL.="cAllowImages=".GetSQLValueString($_POST['cAllowImages'], 'text').", ";
				$sSQL.="cNumImages=".GetSQLValueString($_POST['cNumImages'], 'int').", ";
				$sSQL.="cFeatured=".GetSQLValueString($_POST['cFeatured'], 'text').", ";
				$sSQL.="cFeaturedPrice=".GetSQLValueString($_POST['cFeaturedPrice'], 'double').", ";
				$sSQL.="cBold=".GetSQLValueString($_POST['cBold'], 'text').", ";
				$sSQL.="cBoldPrice=".GetSQLValueString($_POST['cBoldPrice'], 'double').", ";
				$sSQL.="cHighlighted=".GetSQLValueString($_POST['cHighlighted'], 'text').", ";
				$sSQL.="cHighlightedPrice=".GetSQLValueString($_POST['cHighlightedPrice'], 'double');
			$db->query($sSQL);
			
			//now the categories
			$cat='';
			if(is_array(@$_POST["cat"]))
			{
				foreach(@$_POST["cat"] as $catObj)
				{
					$cat += $catObj;
					$sSQL= sprintf("INSERT INTO ".PREFIX."products_packages_lookup (cID,cCategoryID) VALUES (%s,%s)",
								GetSQLValueString($pID, "int"),
								GetSQLValueString($catObj, "int"));
					$db->query($sSQL);
				}
			}
			$location="products.php";
			$class_tpl->assign('title',LANG_FORWARD_SUCESS);
			$class_tpl->assign('forward',TRUE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
		else
		{
			//not successfull
			$location="products.php";
			$class_tpl->assign('title',LANG_FORWARD_ERROR);
			$class_tpl->assign('forward',FALSE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
	}
	elseif(isset($_POST['mode']) && $_POST['mode']=="editpackage" && isset($_POST['id']))
	{
		$id=(int)$_POST['id'];
		//first update the product
		
		$sSQL = "UPDATE `".PREFIX."products` SET ";
				$sSQL.="pTitle=".GetSQLValueString($_POST['pTitle'], 'text').", ";
				$sSQL.="pWorkingName=".GetSQLValueString($_POST['pWorkingName'], 'text').", ";
				$sSQL.="pDescription=".GetSQLValueString($_POST['pDescription'], 'text').", ";
				$sSQL.="pListPrice=".GetSQLValueString($_POST['pListPrice'], 'double').", ";
				$sSQL.="pPrice=".GetSQLValueString($_POST['pPrice'], 'double').", ";
				$sSQL.="pRenewalPrice=".GetSQLValueString($_POST['pRenewalPrice'], 'double').", ";
				$sSQL.="pType=".GetSQLValueString($_POST['pType'], 'text').", ";
				$sSQL.="pExpiration=".GetSQLValueString($_POST['pExpiration'], 'int')." ";
				
				$sSQL.="WHERE pID='$id' ";
		$db->query($sSQL);
		if (!$db->isError()) 
		{
			//now the actual product listing
			$sSQL="UPDATE ".PREFIX."products_packages SET ";
				$sSQL.="cTitleCharacters=".GetSQLValueString($_POST['cTitleCharacters'], 'int').", ";
				$sSQL.="cShortDescCharacters=".GetSQLValueString($_POST['cShortDescCharacters'], 'int').", ";
				$sSQL.="cCharacters=".GetSQLValueString($_POST['cCharacters'], 'int').", ";
				$sSQL.="cDisURL=".GetSQLValueString(@$_POST['cDisURL'], 'text').", ";
				$sSQL.="cAllowImages=".GetSQLValueString(@$_POST['cAllowImages'], 'text').", ";
				$sSQL.="cNumImages=".GetSQLValueString($_POST['cNumImages'], 'int').", ";
				$sSQL.="cFeatured=".GetSQLValueString($_POST['cFeatured'], 'text').", ";
				$sSQL.="cFeaturedPrice=".GetSQLValueString($_POST['cFeaturedPrice'], 'double').", ";
				$sSQL.="cBold=".GetSQLValueString($_POST['cBold'], 'text').", ";
				$sSQL.="cBoldPrice=".GetSQLValueString($_POST['cBoldPrice'], 'double').", ";
				$sSQL.="cHighlighted=".GetSQLValueString($_POST['cHighlighted'], 'text').", ";
				$sSQL.="cHighlightedPrice=".GetSQLValueString($_POST['cHighlightedPrice'], 'double')." ";
				$sSQL.="WHERE pID=".$id;
			$db->query($sSQL);
			
			//handle the new categories//
			$sSQL="DELETE FROM ".PREFIX."products_packages_lookup WHERE cID=".$id;
			$db->query($sSQL);
			$cat="";
			if(is_array(@$_POST["cat"]))
			{
				foreach(@$_POST["cat"] as $catObj)
				{
					$cat += $catObj;
						$sSQL= sprintf("INSERT INTO ".PREFIX."products_packages_lookup (cID,cCategoryID) VALUES (%s,%s)",
								GetSQLValueString($id, "int"),
								GetSQLValueString($catObj, "int"));
						$db->query($sSQL);
				}
			}
			$location="products.php";
			$class_tpl->assign('title',LANG_FORWARD_SUCESS);
			$class_tpl->assign('forward',TRUE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
	}
	elseif(isset($_POST['mode']) && $_POST['mode']=="addnewmembership")
	{
		$sql="SELECT MAX(pOrder) AS max FROM ".PREFIX."products";
		$result=$db->query($sql);
		$rs=$result->fetch();
		$max=($rs['max']+1);
		
		//first insert the product
		$sSQL = "INSERT INTO `".PREFIX."products` SET ";
				$sSQL.="pTitle=".GetSQLValueString($_POST['pTitle'], 'text').", ";
				$sSQL.="pWorkingName=".GetSQLValueString($_POST['pWorkingName'], 'text').", ";
				$sSQL.="pDescription=".GetSQLValueString($_POST['pDescription'], 'text').", ";
				$sSQL.="pListPrice=".GetSQLValueString($_POST['pListPrice'], 'double').", ";
				$sSQL.="pPrice=".GetSQLValueString($_POST['pPrice'], 'double').", ";
				$sSQL.="pRenewalPrice=".GetSQLValueString($_POST['pRenewalPrice'], 'double').", ";
				$sSQL.="pType=".GetSQLValueString($_POST['pType'], 'text').", ";
				if(!empty($_POST['package']))
				{
					$sSQL.="pPackage=".GetSQLValueString($_POST['package'], 'int').", ";
				}
				$sSQL.="pExpiration=".GetSQLValueString($_POST['pExpiration'], 'int').", ";
				$sSQL.="pOrder='$max' ";
		$db->query($sSQL);
		if (!$db->isError()) 
		{
			$pID=$result->insertID();
			//now the actual product listing
			$sSQL="INSERT INTO ".PREFIX."products_memberships SET ";
				$sSQL.="pID=".$pID.", ";
				$sSQL.="mNumber=".GetSQLValueString($_POST['mNumber'], 'int').", ";
				$sSQL.="mUserGroup=".GetSQLValueString($_POST['mUserGroup'], 'int').", ";
				$sSQL.="mFeatured=".GetSQLValueString($_POST['mFeatured'], 'int').", ";
				$sSQL.="mBold=".GetSQLValueString($_POST['mBold'], 'int').", ";
				$sSQL.="mHighlighted=".GetSQLValueString($_POST['mHighlighted'], 'int')." ";
			$db->query($sSQL);
			
			//now the categories
			$cat='';
			if(is_array(@$_POST["cat"]))
			{
				foreach(@$_POST["cat"] as $catObj)
				{
					$cat += $catObj;
					$sSQL= sprintf("INSERT INTO ".PREFIX."products_memberships_lookup (mID,packageID) VALUES (%s,%s)",
								GetSQLValueString($pID, "int"),
								GetSQLValueString($catObj, "int"));
					$db->query($sSQL);
				}
			}
			$location="products.php";
			$class_tpl->assign('title',LANG_FORWARD_SUCESS);
			$class_tpl->assign('forward',TRUE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
		else
		{
			//not successfull
			$location="products.php";
			$class_tpl->assign('title',LANG_FORWARD_ERROR);
			$class_tpl->assign('forward',FALSE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
	}
	elseif(isset($_POST['mode']) && $_POST['mode']=="editmembership" && isset($_POST['id']))
	{
		$id=(int)$_POST['id'];
		//first update the product
		$sSQL = "UPDATE `".PREFIX."products` SET ";
				$sSQL.="pTitle=".GetSQLValueString($_POST['pTitle'], 'text').", ";
				$sSQL.="pWorkingName=".GetSQLValueString($_POST['pWorkingName'], 'text').", ";
				$sSQL.="pDescription=".GetSQLValueString($_POST['pDescription'], 'text').", ";
				$sSQL.="pListPrice=".GetSQLValueString($_POST['pListPrice'], 'double').", ";
				$sSQL.="pPrice=".GetSQLValueString($_POST['pPrice'], 'double').", ";
				$sSQL.="pRenewalPrice=".GetSQLValueString($_POST['pRenewalPrice'], 'double').", ";
				$sSQL.="pType=".GetSQLValueString($_POST['pType'], 'text').", ";
				if(!empty($_POST['package']))
				{
					$sSQL.="pPackage=".GetSQLValueString($_POST['package'], 'int').", ";
				}
				$sSQL.="pExpiration=".GetSQLValueString($_POST['pExpiration'], 'int')." ";
				$sSQL.="WHERE pID='$id' ";
		$db->query($sSQL);
		if (!$db->isError()) 
		{
			//now the actual product listing
			$sSQL="UPDATE ".PREFIX."products_memberships SET ";
				$sSQL.="mNumber=".GetSQLValueString($_POST['mNumber'], 'int').", ";
				$sSQL.="mUserGroup=".GetSQLValueString($_POST['mUserGroup'], 'int').", ";
				$sSQL.="mFeatured=".GetSQLValueString($_POST['mFeatured'], 'int').", ";
				$sSQL.="mBold=".GetSQLValueString($_POST['mBold'], 'int').", ";
				$sSQL.="mHighlighted=".GetSQLValueString($_POST['mHighlighted'], 'int')." ";
				$sSQL.="WHERE pID=". $id;
			$db->query($sSQL);
			
			//handle the new categories//
			$sSQL="DELETE FROM ".PREFIX."products_memberships_lookup WHERE mID=".$id;
			$db->query($sSQL);
			$cat="";
			if(is_array(@$_POST["cat"]))
			{
				foreach(@$_POST["cat"] as $catObj)
				{
					$cat += $catObj;
					$sSQL= sprintf("INSERT INTO ".PREFIX."products_memberships_lookup (mID,packageID) VALUES (%s,%s)",
								GetSQLValueString($id, "int"),
								GetSQLValueString($catObj, "int"));
					$db->query($sSQL);
				}
			}
			$location="products.php";
			$class_tpl->assign('title',LANG_FORWARD_SUCESS);
			$class_tpl->assign('forward',TRUE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
	}
	elseif(isset($_REQUEST['act']) && $_REQUEST['act']=="modify")
	{
		$id=@$_REQUEST['id'];
		$Products->getListingPackageById($id);
		for($index=0; $index<=365; $index++)
		{
			$data[]=$index;
		}
		$data['730']='730';
		$data['1825']='1825';
		$data['3650']='3650';
		$class_tpl->assign('data', $data);
		$class_tpl->assign('body', 'products/form.tpl');
	}
	elseif(isset($_REQUEST['act']) && $_REQUEST['act']=="newmembership")
	{
		for($index=0; $index<=365; $index++)
		{
			$data[]=$index;
		}
		$class_tpl->assign('data', $data);
		//now get the user levels
		$sSQL = "SELECT uGroupID,uTitle FROM ".PREFIX."user_groups ORDER BY uGroupID";
		$result=$db->query($sSQL);
		$data=array();
		while($rs=$result->fetch())
		{
			 $data[]=$rs;
		}
		$class_tpl->assign('userlevels', $data);
		$class_tpl->assign('packages', $Products->getListingPackages());
		$class_tpl->assign('action', 'addnewmembership');
		$class_tpl->assign('body', 'products/form.tpl');
	}
	elseif(isset($_REQUEST['act']) && $_REQUEST['act']=="newpackage")
	{
		require_once(FILESYSTEM_PATH .'includes/classes/kernel/Categories.php');
		$Categories= new Categories;
		$class_tpl->assign('getcats', $Categories->getAdminCatTree('',0));
		for($index=0; $index<=365; $index++)
		{
			$data[]=$index;
		}
		$data['730']='730';
		$data['1825']='1825';
		$data['3650']='3650';
		$class_tpl->assign('data', $data);
		$class_tpl->assign('action', 'addnewpackage');
		$class_tpl->assign('body', 'products/form.tpl');
	}
	else
	{
		$list=$Products->getProductList();
		$class_tpl->assign('results', $list);
		$class_tpl->assign('max', count($list));
		$class_tpl->assign('body', 'products/products.tpl');
	}
$class_tpl->displayTemplate();
?>
                                                                                                                                                                                                                                                                administration/settings.php                                                                         0000644 0023433 0004734 00000000743 11051631523 016025  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
$class_tpl->assign('body','settings/settings_list.tpl');
$class_tpl->displayTemplate();
?>                             administration/settingsbadwords.php                                                                 0000644 0023433 0004734 00000010204 11051631524 017545  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}

	if (isset($_POST['action']) && $_POST['action']=="addnew")
	{
		//actually insert the new bad word
		$name=@$_POST['word'];
		$replacement=@$_POST['replacement'];
		$sSQL=sprintf("INSERT INTO ".PREFIX."badwords (wordName, wordReplacement) VALUES (%s, %s)",
							GetSQLValueString($name, "text"),
							GetSQLValueString($replacement, "text"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$location="settingsbadwords.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//not successfull
				$location="settingsbadwords.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	elseif (isset($_POST['action']) && $_POST['action']=="modify")
	{
		//modify a badword
		$id=(int)@$_POST['id'];
		$name=@$_POST['word'];
		$replacement=@$_POST['replacement'];
		$sSQL=sprintf("UPDATE ".PREFIX."badwords SET wordName=%s, wordReplacement=%s WHERE wordID=%s",
								GetSQLValueString($name, "text"),
								GetSQLValueString($replacement, "text"),
								GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$location="settingsbadwords.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');		
			}
			else
			{
				//not successfull
				$location="settingsbadwords.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
	          }
	}
	elseif (isset($_POST['act']) && $_POST['act']=="addnew")
	{
		//add new bad word form
		$class_tpl->assign('title',$title);
		$class_tpl->assign('action',"addnew");
		$class_tpl->assign('body','settings/settings_badwords.tpl');
	}
	elseif (isset($_POST['act']) && $_POST['act']=="modify")
	{
		//modify bad word form
		$id=(int)@$_POST['id'];
		$sSQL="SELECT wordID, wordName, wordReplacement FROM ".PREFIX."badwords WHERE wordID=".$id;
		$result=$db->query($sSQL);
		$rs=$result->fetch();
		$class_tpl->assign('title',$title);
		$class_tpl->assign('word',$rs['wordName']);
		$class_tpl->assign('id',$rs['wordID']);
		$class_tpl->assign('replacement',$rs['wordReplacement']);
		$class_tpl->assign('action',"modify");
		$class_tpl->assign('body','settings/settings_badwords.tpl');
	}
	elseif (isset($_POST['act']) && $_POST['act']=="delete")
	{
		//delete bad word
		$id=(int)@$_POST['id'];
		$sSQL="DELETE FROM ".PREFIX."badwords WHERE wordID=".$id;
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$location="settingsbadwords.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//not successfull
				$location="settingsbadwords.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	else
	{
		//show the default template
		$sSQL="SELECT wordID, wordName, wordReplacement FROM ".PREFIX."badwords";
		$result=$db->query($sSQL);
		$data=array();
			while($rs=$result->fetch())
			{
				$data[]=$rs;
			}
		$class_tpl->assign('title',$title);
		$class_tpl->assign('results', $data);
		$class_tpl->assign('action', "list");
		$class_tpl->assign('body','settings/settings_badwords.tpl');
	}
$class_tpl->displayTemplate();
?>
                                                                                                                                                                                                                                                                                                                                                                                            administration/settingscountries.php                                                                0000644 0023433 0004734 00000011351 11051631524 017757  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}

	if(isset($_POST['act']) && $_POST['act']=="delete" && isset($_POST['id']) && $_POST['id'])
	{
		$id=(int)trim($_POST['id']);
		$sSQL="DELETE FROM ".PREFIX."countries WHERE countryID=".$id." LIMIT 1";
		$db->query($sSQL);
			if($db->isError()) 
			{
				//not successfull
				$location="settingscountries.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//sucessfull
				$action="Deleted Country ID: ". $id;
				$Core->log_activity($_SESSION['uid'],$_SESSION['username'],$action,$ip);
				$location="settingscountries.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	//modify the db
	elseif(isset($_POST['action']) && $_POST['action']=="modify" && isset($_POST['id']) && $_POST['id'])
	{
		$id=(int)trim($_POST['id']);
		$sSQL=sprintf("UPDATE ".PREFIX."countries SET countryName=%s, countryCode=%s, countryOrder=%s WHERE countryID=%s",
	          GetSQLValueString($_POST['name'], "text"),
	          GetSQLValueString($_POST['abbrev'], "text"),
	          GetSQLValueString($_POST['countryOrder'], "int"),
	          GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if($db->isError()) 
			{
				//not successfull
				$location="settingscountries.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//sucessfull
				//$action="Modified Country ID: ". $id;
				//$Core->log_activity($_SESSION['uid'],$_SESSION['username'],$action,$_SERVER['REMOTE_ADDR']);
				$location="settingscountries.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	//modify
	elseif(isset($_POST['act']) && $_POST['act']=="modify" && isset($_POST['id']) && $_POST['id'])
	{
		$id=(int)trim($_POST['id']);
		$sSQL="SELECT countryID,countryName,countryCode,countryOrder FROM ".PREFIX."countries WHERE countryID=".$id;
		$result=$db->query($sSQL);
		$rs=$result->fetch();
          
			$class_tpl->assign('id', $rs['countryID']);
			$class_tpl->assign('name', $rs['countryName']);
			$class_tpl->assign('abbrev', $rs['countryCode']);
			$class_tpl->assign('countryOrder', $rs['countryOrder']);
			$class_tpl->assign('action', 'modify');
			$class_tpl->assign('showform', 'YES');
			$class_tpl->assign('body','settings/settings_countries.tpl');
	}
	//addnew to the db
	elseif(isset($_POST['action']) && $_POST['action']=="add")
	{
	     $sSQL=sprintf("INSERT INTO ".PREFIX."countries (countryName,countryCode,countryEnabled,countryOrder) VALUES (%s,%s,%s,%s)",
	          GetSQLValueString($_POST['name'], "text"),
	          GetSQLValueString($_POST['abbrev'], "text"),
	          GetSQLValueString(1, "int"),
	          GetSQLValueString(0, "int"));
	     $db->query($sSQL);
			if($db->isError()) 
			{
				//not successfull
				$location="settingscountries.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//sucessfull
				$action="Added Country: ". @$_POST['name'];
				$Core->log_activity($_SESSION['uid'],$_SESSION['username'],$action,$ip);
				$location="settingscountries.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	//add new
	elseif(isset($_POST['act']) && $_POST['act']=="addnew")
	{
		$class_tpl->assign('showform', 'YES');
		$class_tpl->assign('action', 'add');
		$class_tpl->assign('body','settings/settings_countries.tpl');
	}
	else
	{
		$sSQL="SELECT countryID, countryName FROM ".PREFIX."countries ORDER BY countryOrder DESC, countryName";
		$result=$db->query($sSQL);
		$countries=array();
		while($rs=$result->fetch())
		{
			$countries[]=$rs;
		}
	     $class_tpl->assign('showcountries', $countries);
	     $class_tpl->assign('body','settings/settings_countries.tpl');
	}

$class_tpl->displayTemplate();
?>                                                                                                                                                                                                                                                                                       administration/settingsimages.php                                                                   0000644 0023433 0004734 00000005132 11051631525 017212  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}

	if (isset($_POST['action']) && $_POST['action']=="modify")
	{
		//modify
		$id=1;
		$sSQL = sprintf("UPDATE ".PREFIX."image_settings SET component=%s,extensions=%s,maxWidth=%s,maxHeight=%s,quality=%s,maxWidthThumb=%s,maxHeightThumb=%s,qualityThumb=%s,maxSize=%s,uploadMaxWidth=%s,uploadMaxHeight=%s WHERE id=%s",
						GetSQLValueString($_POST['component'], "text"),
						GetSQLValueString($_POST['extensions'], "text"),
						GetSQLValueString($_POST['maxWidth'], "text"),
						GetSQLValueString($_POST['maxHeight'], "text"),
						GetSQLValueString($_POST['quality'], "text"),
						GetSQLValueString($_POST['maxWidthThumb'], "text"),
						GetSQLValueString($_POST['maxHeightThumb'], "text"),
						GetSQLValueString($_POST['qualityThumb'], "text"),
						GetSQLValueString($_POST['maxSize'], "text"),
						GetSQLValueString($_POST['uploadMaxWidth'], "text"),
						GetSQLValueString($_POST['uploadMaxHeight'], "text"),
						GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$class_tpl->assign('success',TRUE);
			}
			else
			{
				//not successfull
				$class_tpl->assign('success',FALSE);
			}
	}


		//show the default template
		$sSQL="SELECT component,extensions,maxWidth,maxHeight,quality,maxWidthThumb,maxHeightThumb,qualityThumb,maxSize,uploadMaxWidth,uploadMaxHeight FROM ".PREFIX."image_settings WHERE id=1";
		$result=$db->query($sSQL);
		$rs=$result->fetch();

		//define variables for template
        	$class_tpl->assign('component',$rs['component']);
        	$class_tpl->assign('extensions', $rs['extensions']);
        	$class_tpl->assign('maxWidth', $rs['maxWidth']);
        	$class_tpl->assign('maxHeight', $rs['maxHeight']);
        	$class_tpl->assign('quality', $rs['quality']);
        	$class_tpl->assign('maxWidthThumb', $rs['maxWidthThumb']);
        	$class_tpl->assign('maxHeightThumb', $rs['maxHeightThumb']);
        	$class_tpl->assign('qualityThumb', $rs['qualityThumb']);
        	$class_tpl->assign('uploadMaxWidth', $rs['uploadMaxWidth']);
        	$class_tpl->assign('uploadMaxHeight', $rs['uploadMaxHeight']);
			$class_tpl->assign('maxSize', $rs['maxSize']);

		$class_tpl->assign('body','settings/settings_images.tpl');

$class_tpl->displayTemplate();
?>                                                                                                                                                                                                                                                                                                                                                                                                                                      administration/settingslistings.php                                                                 0000644 0023433 0004734 00000002423 11051631525 017601  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}

	if (isset($_POST['action']) && $_POST['action']=="modify")
	{
		//modify
		$id=1;
		$sSQL = sprintf("UPDATE ".PREFIX."listing_settings SET lDisplay=%s,lCols=%s WHERE lID=%s",
						GetSQLValueString($_POST['lDisplay'], "text"),
						GetSQLValueString($_POST['lCols'], "int"),
						GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$class_tpl->assign('success',TRUE);
			}
			else
			{
				//not successfull
				$class_tpl->assign('success',FALSE);
			}
	}


		//show the default template
		$sSQL="SELECT lDisplay,lCols FROM ".PREFIX."listing_settings WHERE lID=1";
		$result=$db->query($sSQL);
		$rs=$result->fetch();
		
		//define variables for template
		$class_tpl->assign('lDisplay', $rs['lDisplay']);
		$class_tpl->assign('lCols', $rs['lCols']);

		$class_tpl->assign('body','settings/settings_listings.tpl');

$class_tpl->displayTemplate();
?>                                                                                                                                                                                                                                             administration/settingsmain.php                                                                     0000644 0023433 0004734 00000010254 11051631526 016673  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}

	if (isset($_POST['action']) && $_POST['action']=="modify")
	{
		//modify
		$id=1;
		$sSQL = sprintf("UPDATE ".PREFIX."admin SET title=%s, keywords=%s, description=%s, url=%s, urls=%s, email=%s, notify=%s,mainIndexCols=%s,mainCatCols=%s,mainSubCols=%s,mainTakeOffline=%s,mainTakeOfflineReason=%s,mainTemplate=%s,mainEmailValidation=%s,smtp=%s,smtpHost=%s,smtpUsername=%s,smtpPassword=%s,smtpPort=%s,mailHTML=%s,htmlEditor=%s,removeTime=%s,showTotal=%s,adminTemplate=%s WHERE id=%s",
						GetSQLValueString(@$_POST['title'], "text"),
						GetSQLValueString(@$_POST['keywords'], "text"),
						GetSQLValueString(@$_POST['description'], "text"),
						GetSQLValueString(@$_POST['url'], "text"),
						GetSQLValueString(@$_POST['urls'], "text"),
						GetSQLValueString(@$_POST['email'], "text"),
						GetSQLValueString(isset($_POST['notify']) ? "true" : "", "defined","'Y'","'N'"),
						GetSQLValueString(@$_POST['mainIndexCols'], "int"),
						GetSQLValueString(@$_POST['mainCatCols'], "int"),
						GetSQLValueString(@$_POST['mainSubCols'], "int"),
						GetSQLValueString(isset($_POST['mainTakeOffline']) ? "true" : "", "defined","'Y'","'N'"),
						GetSQLValueString(@$_POST['mainTakeOfflineReason'], "text"),
						GetSQLValueString(@$_POST['mainTemplate'], "text"),
						GetSQLValueString(@$_POST['mainEmailValidation'], "text"),
						GetSQLValueString(@$_POST['smtp'], "text"),
						GetSQLValueString(@$_POST['smtpHost'], "text"),
						GetSQLValueString(@$_POST['smtpUsername'], "text"),
						GetSQLValueString(@$_POST['smtpPassword'], "text"),
						GetSQLValueString(@$_POST['smtpPort'], "text"),
						GetSQLValueString(@$_POST['mailHTML'], "text"),
						GetSQLValueString(@$_POST['htmlEditor'], "text"),
						GetSQLValueString(@$_POST['removeTime'], "int"),
						GetSQLValueString(@$_POST['showTotal'], "text"),
						GetSQLValueString($_POST['adminTemplate'], "text"),
						GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$class_tpl->assign('success',TRUE);
			}
			else
			{
				//not successfull
				$class_tpl->assign('success',FALSE);
			}
	}


		//show the default template
		$location = '../language/';
			if ($handle = opendir($location)) 
			{
				while (false !== ($file = readdir($handle))) 
				{
					if ($file != "." && $file != ".." && $file!="CVS" && $file!="index.htm") 
					{
						$languagelist[]="language/".$file;
					}
				}
			   closedir($handle);
			}
		$class_tpl->assign('rslanguage', $languagelist);
		
		$sSQL="SELECT title,keywords,description,url,urls,email,notify,mainIndexCols,mainCatCols,mainSubCols,mainTakeOffline,mainTakeOfflineReason,mainTemplate,adminTemplate,mainEmailValidation,smtp,smtpHost,smtpUsername,smtpPassword,smtpPort,mailHTML,htmlEditor,removeTime,showTotal FROM ".PREFIX."admin WHERE id=1";
		$result=$db->query($sSQL);
		$rs=$result->fetch();

		//define variables for template
       	foreach($rs as $key => $value)
       	{
       		//loop through the results and assign to the template
       		$class_tpl->assign($key, safeStripSlashes($value));
       	}


			
		$location = '../templates/';
		$templates=array();
		if ($handle = opendir($location)) 
		{
			while (false !== ($file = readdir($handle))) 
			{
				if ($file != "." && $file != ".." && $file != "index.htm") 
				{
				   $templates[]=$file;
				}
			}
			closedir($handle);
		}
		$class_tpl->assign('templates', $templates);
		
		//admin templates
		$location = 'templates/';
		$templates=array();
		if ($handle = opendir($location)) 
		{
			while (false !== ($file = readdir($handle))) 
			{
				if ($file != "." && $file != ".." && $file != "index.htm") 
				{
				   $templates[]=$file;
				}
			}
			closedir($handle);
		}
		$class_tpl->assign('admintemplates', $templates);
		$class_tpl->assign('body','settings/settings_main.tpl');

$class_tpl->displayTemplate();
?>                                                                                                                                                                                                                                                                                                                                                    administration/settingspm.php                                                                       0000644 0023433 0004734 00000001774 11051631526 016372  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'/includes/classes/kernel/Private.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}

$Private=new PrivateMessage();
	if (isset($_POST['action']) && $_POST['action']=="modify")
	{
		$data['turnedon']=@$_POST['turnedon'];
		$data['max']=(int)@$_POST['max'];
		$data['allowedTags']=@$_POST['allowedTags'];
		$data['sendNotification']=$_POST['sendNotification'];
		if($Private->updateSettings($data)) 
		{
			$Private=new PrivateMessage();
			$class_tpl->assign('success', TRUE);
		}
	}
//show the default template
$class_tpl->assign('results', $Private);
$class_tpl->assign('body','settings/settings_pm.tpl');
$class_tpl->displayTemplate();
?>
    administration/settingsregional.php                                                                 0000644 0023433 0004734 00000006306 11051631527 017553  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}

	if (isset($_POST['action']) && $_POST['action']=="modify")
	{
		//modify
		$id=1;
		$sSQL = sprintf("UPDATE ".PREFIX."currency_settings SET cAdminDateFormat=%s,cDateFormat=%s,cCurrencySymbol=%s,cCurrencyDecimal=%s,cCurrencyDecimalPlaces=%s,cCurrencyThousands=%s,cCurrencyAfter=%s,cLanguage=%s,cAdminLanguage=%s WHERE cID=%s",
                        GetSQLValueString($_POST['cAdminDateFormat'], "text"),
						GetSQLValueString($_POST['cDateFormat'], "text"),
						GetSQLValueString($_POST['cCurrencySymbol'], "text"),
						GetSQLValueString($_POST['cCurrencyDecimal'], "text"),
						GetSQLValueString($_POST['cCurrencyDecimalPlaces'], "text"),
						GetSQLValueString($_POST['cCurrencyThousands'], "text"),
						GetSQLValueString($_POST['cCurrencyAfter'], "text"),
						GetSQLValueString($_POST['cLanguage'], "text"),
						GetSQLValueString($_POST['cAdminLanguage'], "text"),
						GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$class_tpl->assign('success',TRUE);
			}
			else
			{
				//not successfull
				$class_tpl->assign('success',FALSE);
			}
	}


		//show the default template
		$location = '../language/';
			if ($handle = opendir($location)) 
			{
				while (false !== ($file = readdir($handle))) 
				{
					if ($file != "." && $file != ".." && $file!="CVS" && $file!="index.htm") 
					{
						$languagelist[]="language/".$file;
					}
				}
			   closedir($handle);
			}
          $location = 'language/';
			if ($handle = opendir($location)) 
			{
				while (false !== ($file = readdir($handle))) 
				{
					if ($file != "." && $file != ".." && $file!="CVS") 
					{
						$adminlanguagelist[]="language/".$file;
					}
				}
			   closedir($handle);
			}
	     $sSQL="SELECT cAdminDateFormat,cDateFormat,cCurrencySymbol,cCurrencyDecimal,cCurrencyDecimalPlaces,cCurrencyThousands,cCurrencyAfter,cLanguage,cAdminLanguage FROM ".PREFIX."currency_settings WHERE cID=1";
	     $result=$db->query($sSQL);
	     $rs=$result->fetch();
		
		//define variables for template
		$class_tpl->assign('cAdminDateFormat', $rs['cAdminDateFormat']);
		$class_tpl->assign('cDateFormat', $rs['cDateFormat']);
		$class_tpl->assign('cCurrencySymbol', htmlentities($rs['cCurrencySymbol'], ENT_QUOTES, 'UTF-8'));
		$class_tpl->assign('cCurrencyDecimal', $rs['cCurrencyDecimal']);
		$class_tpl->assign('cCurrencyDecimalPlaces', $rs['cCurrencyDecimalPlaces']);
		$class_tpl->assign('cCurrencyThousands', $rs['cCurrencyThousands']);
		$class_tpl->assign('cCurrencyAfter', $rs['cCurrencyAfter']);
		$class_tpl->assign('cLanguage', $rs['cLanguage']);
		$class_tpl->assign('cAdminLanguage', $rs['cAdminLanguage']);
		$class_tpl->assign('rslanguage', $languagelist);
		$class_tpl->assign('rsAdminLanguage', $adminlanguagelist);

		$class_tpl->assign('body','settings/settings_regional.tpl');

$class_tpl->displayTemplate();
?>                                                                                                                                                                                                                                                                                                                          administration/settingssearch.php                                                                   0000644 0023433 0004734 00000004702 11051631530 017210  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	if (isset($_POST['action']) && $_POST['action']=="modify")
	{
		//modify
		$id=1;
		$sSQL = sprintf("UPDATE ".PREFIX."search_settings SET sState=%s, sCity=%s, sPrice=%s, sCountry=%s,sPagination=%s,sMaxSearch=%s,sProductSort=%s,sProductSortOption=%s,sTemplate =%s WHERE sID=%s",
						GetSQLValueString($_POST['sState'], "text"),
						GetSQLValueString($_POST['sCity'], "text"),
						GetSQLValueString($_POST['sPrice'], "text"),
						GetSQLValueString($_POST['sCountry'], "text"),
						GetSQLValueString($_POST['sPagination'], "int"),
						GetSQLValueString($_POST['sMaxSearch'], "int"),
						GetSQLValueString($_POST['sProductSort'], "text"),
						GetSQLValueString($_POST['sProductSortOption'], "text"),
						GetSQLValueString($_POST['sTemplate'], "int"),
						GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$class_tpl->assign('success',TRUE);
			}
			else
			{
				//not successfull
				$class_tpl->assign('success',FALSE);
			}
	}


		//show the default template
		$sSQL="SELECT sState,sCity,sPrice,sCountry,sPagination,sMaxSearch,sProductSort,sProductSortOption,sTemplate FROM ".PREFIX."search_settings WHERE sID=1";
		$result=$db->query($sSQL);
		$rs=$result->fetch();
		
		//define variables for template
        $class_tpl->assign('sState', $rs['sState']);
        $class_tpl->assign('sCity', $rs['sCity']);
        $class_tpl->assign('sPrice', $rs['sPrice']);
        $class_tpl->assign('sCountry', $rs['sCountry']);
        $class_tpl->assign('sPagination', $rs['sPagination']);
		$class_tpl->assign('sMaxSearch',$rs['sMaxSearch']);
		$class_tpl->assign('sProductSort',$rs['sProductSort']);
		$class_tpl->assign('sProductSortOption',$rs['sProductSortOption']);
		$class_tpl->assign('sTemplate',$rs['sTemplate']);
	
		
		//define variables for template
       	foreach($rs as $key => $value)
       	{
       		//loop through the results and assign to the template
       		$class_tpl->assign($key, safeStripSlashes($value));
       	}
		$class_tpl->assign('body','settings/settings_search.tpl');

$class_tpl->displayTemplate();
?>                                                              administration/settingsstates.php                                                                   0000644 0023433 0004734 00000007705 11051631530 017254  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	if(isset($_POST['act']) && $_POST['act']=="delete" && isset($_POST['id']) && $_POST['id'])
	{
	     $id=(int)trim($_POST['id']);
	     $sSQL="DELETE FROM ".PREFIX."states WHERE id=".$id." LIMIT 1";
	     $db->query($sSQL);
			if($db->isError()) 
			{
				//not successfull
				$location="settingsstates.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//sucessfull
				$location="settingsstates.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	//modify the db
	elseif(isset($_POST['action']) && $_POST['action']=="modify" && isset($_POST['id']) && $_POST['id'])
	{
		$id=(int)trim($_POST['id']);
		$sSQL=sprintf("UPDATE ".PREFIX."states SET name=%s, abbrev=%s WHERE id=%s",
	          GetSQLValueString($_POST['name'], "text"),
	          GetSQLValueString($_POST['abbrev'], "text"),
	          GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if($db->isError()) 
			{
				//not successfull
				$location="settingsstates.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//sucessfull
				$location="settingsstates.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	//modify
	elseif(isset($_POST['act']) && $_POST['act']=="modify" && isset($_POST['id']) && $_POST['id'])
	{
		$id=(int)trim($_POST['id']);
		$sSQL="SELECT id,name,abbrev FROM ".PREFIX."states WHERE id=".$id;
		$result=$db->query($sSQL);
		$rs=$result->fetch();
          
		$class_tpl->assign('id', $rs['id']);
		$class_tpl->assign('name', $rs['name']);
		$class_tpl->assign('abbrev', $rs['abbrev']);
		$class_tpl->assign('action', 'modify');
		$class_tpl->assign('showform', 'YES');
		$class_tpl->assign('body','settings/settings_states.tpl');
	}
	//addnew to the db
	elseif(isset($_POST['action']) && $_POST['action']=="add")
	{
		$sSQL=sprintf("INSERT INTO ".PREFIX."states (name,abbrev) VALUES (%s,%s)",
	          GetSQLValueString($_POST['name'], "text"),
	          GetSQLValueString($_POST['abbrev'], "text"));
		$db->query($sSQL);
			if($db->isError()) 
			{
				//not successfull
				$location="settingsstates.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//sucessfull
				$location="settingsstates.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	//add new
	elseif(isset($_POST['act']) && $_POST['act']=="addnew")
	{
			$class_tpl->assign('showform', 'YES');
			$class_tpl->assign('action', 'add');
			$class_tpl->assign('body','settings/settings_states.tpl');
	}
	else
	{
		//get states
		$sSQL="SELECT id,name FROM ".PREFIX."states ORDER BY name ASC";
			$result=$db->query($sSQL);
			$states=array();
			while($rs=$result->fetch())
			{
				$states[]=$rs;
			}
	     $class_tpl->assign('showstates', $states);
	     $class_tpl->assign('body','settings/settings_states.tpl');
	}

$class_tpl->displayTemplate();
?>                                                           administration/settingsuseradmin.php                                                                0000644 0023433 0004734 00000002474 11051631531 017737  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	if (isset($_POST['action']) && $_POST['action']=="modify")
	{
		//modify
		$id=1;
		$sSQL = sprintf("UPDATE ".PREFIX."user_settings SET uDisHits=%s, uDisSearchHits=%s WHERE uID=%s",
						GetSQLValueString($_POST['uDisHits'], "text"),
						GetSQLValueString($_POST['uDisSearchHits'], "text"),
						GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$class_tpl->assign('success',TRUE);
			}
			else
			{
				//not successfull
				$class_tpl->assign('success',FALSE);
			}
	}


		//show the default template
		$sSQL="SELECT uDisHits,uDisSearchHits FROM ".PREFIX."user_settings WHERE uID=1";
		$result=$db->query($sSQL);
		$rs=$result->fetch();
		
		//define variables for template
		$class_tpl->assign('uDisHits', $rs['uDisHits']);
		$class_tpl->assign('uDisSearchHits', $rs['uDisSearchHits']);

		$class_tpl->assign('body','settings/settings_useradmin.tpl');

$class_tpl->displayTemplate();
?>                                                                                                                                                                                                    administration/settingsusercheckout.php                                                             0000644 0023433 0004734 00000003642 11051631531 020452  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	if (isset($_POST['action']) && $_POST['action']=="modify")
	{
		//modify
		$id=1;
		$sSQL = sprintf("UPDATE ".PREFIX."checkout_settings SET checkoutNotification=%s,checkoutManuallyApprove=%s,checkoutDisPrice=%s,checkoutDisShortDesc=%s,checkoutDisDesc=%s,checkoutRequirePrice=%s,checkoutRequireShortDesc=%s,checkoutRequireDesc=%s,checkoutModifyStatus=%s,renewal=%s,renewalDays=%s,allowedTags=%s WHERE checkoutID=%s",
						GetSQLValueString($_POST['checkoutNotification'], "text"),
						GetSQLValueString($_POST['checkoutManuallyApprove'], "text"),
						GetSQLValueString($_POST['checkoutDisPrice'], "text"),
						GetSQLValueString($_POST['checkoutDisShortDesc'], "text"),
						GetSQLValueString($_POST['checkoutDisDesc'], "text"),
						GetSQLValueString($_POST['checkoutRequirePrice'], "text"),
						GetSQLValueString($_POST['checkoutRequireShortDesc'], "text"),
						GetSQLValueString($_POST['checkoutRequireDesc'], "text"),
						GetSQLValueString($_POST['checkoutModifyStatus'], "text"),
						GetSQLValueString($_POST['renewal'], "text"),
						GetSQLValueString($_POST['renewalDays'], "int"),
						GetSQLValueString($_POST['allowedTags'], "text"),
						GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$class_tpl->assign('success',TRUE);
			}
			else
			{
				//not successfull
				$class_tpl->assign('success',FALSE);
			}
	}


		//show the default template
		$Core->getCheckoutSettings();
		$class_tpl->assign('body','settings/settings_usercheckout.tpl');

$class_tpl->displayTemplate();
?>                                                                                              administration/settingsuserregistration.php                                                         0000644 0023433 0004734 00000011263 11051631532 021356  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	if (isset($_POST['action']) && $_POST['action']=="modify")
	{
		//modify
		$id=1;
		$fname=@$_POST['fname1'] ."|". @$_POST['fname2'] ."|";
		$lname=@$_POST['lname1'] ."|". @$_POST['lname2'] ."|";
		$address=@$_POST['address1'] ."|". @$_POST['address2'] ."|";
		$city=@$_POST['city1'] ."|". @$_POST['city2'] ."|";
		$state=@$_POST['state1'] ."|". @$_POST['state2'] ."|";
		$country=@$_POST['country1'] ."|". @$_POST['country2'] ."|";
		$zip=@$_POST['zip1'] ."|". @$_POST['zip2'] ."|";
		$phone=@$_POST['phone1'] ."|". @$_POST['phone2'] ."|";
		$extra=@$_POST['rExtra01'] ."|". @$_POST['rExtra02'] ."|". @$_POST['rExtra0'];
		$extra1=@$_POST['rExtra11'] ."|". @$_POST['rExtra12'] ."|". @$_POST['rExtra1'];
		$extra3=@$_POST['rExtra31'] ."|". @$_POST['rExtra32'] ."|". @$_POST['rExtra3'];
		$newsletter=@$_POST['rNewsletter'];
		$rTerms=@$_POST['rTerms'];
		$rCaptcha=@$_POST['rCaptcha'];
		
		$sSQL = sprintf("UPDATE ".PREFIX."registration SET rFirstName=%s, rLastName=%s, rAddress=%s, rCity=%s, rState=%s, rCountry=%s, rZip=%s, rPhone=%s, rExtra=%s, rExtra2=%s, rExtra3=%s, rNewsletter=%s,rTerms=%s,rCaptcha=%s WHERE rID=%s",
						GetSQLValueString($fname, "text"),
						GetSQLValueString($lname, "text"),
						GetSQLValueString($address, "text"),
						GetSQLValueString($city, "text"),
						GetSQLValueString($state, "text"),
						GetSQLValueString($country, "text"),
						GetSQLValueString($zip, "text"),
						GetSQLValueString($phone, "text"),
						GetSQLValueString($extra, "text"),
						GetSQLValueString($extra1, "text"),
						GetSQLValueString($extra3, "text"),
						GetSQLValueString($newsletter, "text"),
						GetSQLValueString($rTerms, "text"),
						GetSQLValueString($rCaptcha, "text"),
						GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$class_tpl->assign('success',TRUE);
			}
			else
			{
				//not successfull
				$class_tpl->assign('success',FALSE);
			}
	}


		//show the default template
		$sSQL="SELECT rFirstName,rLastName,rAddress,rCity,rState,rCountry,rZip,rPhone,rExtra,rExtra2,rExtra3,rNewsletter,rTerms,rCaptcha FROM ".PREFIX."registration WHERE rID=1";
		$result=$db->query($sSQL);
		$rs=$result->fetch();
		#now explode them
		$fname = explode("|", $rs['rFirstName']);
		$lname = explode("|", $rs['rLastName']);
		$address = explode("|", $rs['rAddress']);
		$city = explode("|", $rs['rCity']);
		$state = explode("|", $rs['rState']);
		$country = explode("|", $rs['rCountry']);
		$zip = explode("|", $rs['rZip']);
		$phone = explode("|", $rs['rPhone']);
		$extra = explode("|", $rs['rExtra']);
		$extra2 = explode("|", $rs['rExtra2']);
		$extra3 = explode("|", $rs['rExtra3']);
		$rNewsletter=$rs['rNewsletter'];
		$rTerms=$rs['rTerms'];
		$rCaptcha=$rs['rCaptcha'];
		
		//define variables for template
		$class_tpl->assign('fnameDisplay', $fname[0]);
		$class_tpl->assign('fnameRequired', $fname[1]);
		$class_tpl->assign('lnameDisplay', $lname[0]);
		$class_tpl->assign('lnameRequired', $lname[1]);
		$class_tpl->assign('addressDisplay', $address[0]);
		$class_tpl->assign('addressRequired', $address[1]);
		$class_tpl->assign('cityDisplay', $city[0]);
		$class_tpl->assign('cityRequired', $city[1]);
		$class_tpl->assign('stateDisplay', $state[0]);
		$class_tpl->assign('stateRequired', $state[1]);
		$class_tpl->assign('countryDisplay', $country[0]);
		$class_tpl->assign('countryRequired', $country[1]);
		$class_tpl->assign('zipDisplay', $zip[0]);
		$class_tpl->assign('zipRequired', $zip[1]);
		$class_tpl->assign('phoneDisplay', $phone[0]);
		$class_tpl->assign('phoneRequired', $phone[1]);
		
        	$class_tpl->assign('extraText', $extra[2]);
        	$class_tpl->assign('extraDisplay', $extra[0]);
        	$class_tpl->assign('extraRequired', $extra[1]);
        	
        	$class_tpl->assign('extra1Text', $extra2[2]);
        	$class_tpl->assign('extra1Display', $extra2[0]);
        	$class_tpl->assign('extra1Required', $extra2[1]);
        	
        	$class_tpl->assign('extra2Text', $extra3[2]);
        	$class_tpl->assign('extra2Display', $extra3[0]);
        	$class_tpl->assign('extra2Required', $extra3[1]);
        	
        	$class_tpl->assign('rNewsletter', $rNewsletter);
			$class_tpl->assign('rTerms', $rTerms);
			$class_tpl->assign('rCaptcha', $rCaptcha);

		$class_tpl->assign('body','settings/settings_userregistration.tpl');

$class_tpl->displayTemplate();
?>                                                                                                                                                                                                                                                                                                                                             administration/settingsuserview.php                                                                 0000644 0023433 0004734 00000006153 11051631533 017621  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_settings']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	if (isset($_POST['action']) && $_POST['action']=="modify")
	{
		//modify
		$id=1;
		$sSQL = sprintf("UPDATE ".PREFIX."user_settings SET uRateMember=%s,uDisName=%s,uDisAddress=%s,uDisCity=%s,uDisState=%s,uDisZip=%s,uDisCountry=%s,uDisPhone=%s,uDisEmail=%s,uDisExtra=%s,uDisExtra2=%s,uDisExtra3=%s WHERE uID=%s",
                        GetSQLValueString($_POST['uRateMember'], "text"),
						GetSQLValueString($_POST['uDisName'], "text"),
						GetSQLValueString($_POST['uDisAddress'], "text"),
						GetSQLValueString($_POST['uDisCity'], "text"),
						GetSQLValueString($_POST['uDisState'], "text"),
						GetSQLValueString($_POST['uDisZip'], "text"),
						GetSQLValueString($_POST['uDisCountry'], "text"),
						GetSQLValueString($_POST['uDisPhone'], "text"),
						GetSQLValueString($_POST['uDisEmail'], "text"),
						GetSQLValueString($_POST['uDisExtra'], "text"),
						GetSQLValueString($_POST['uDisExtra2'], "text"),
						GetSQLValueString($_POST['uDisExtra3'], "text"),
						GetSQLValueString($id, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$class_tpl->assign('success',TRUE);
			}
			else
			{
				//not successfull
				$class_tpl->assign('success',FALSE);
			}
	}


		//show the default template
		$sSQL="SELECT uRateMember,uDisName,uDisAddress,uDisCity,uDisState,uDisZip,uDisCountry,uDisPhone,uDisEmail,uDisExtra,uDisExtra2,uDisExtra3 FROM ".PREFIX."user_settings WHERE uID=1";
		$result=$db->query($sSQL);
		$rs=$result->fetch();
		
		//define variables for template
		$class_tpl->assign('uRateMember', $rs['uRateMember']);
		$class_tpl->assign('uDisName', $rs['uDisName']);
        	$class_tpl->assign('uDisAddress', $rs['uDisAddress']);
        	$class_tpl->assign('uDisCity', $rs['uDisCity']);
        	$class_tpl->assign('uDisState', $rs['uDisState']);
        	$class_tpl->assign('uDisZip', $rs['uDisZip']);
        	$class_tpl->assign('uDisCountry', $rs['uDisCountry']);
        	$class_tpl->assign('uDisPhone', $rs['uDisPhone']);
        	$class_tpl->assign('uDisEmail', $rs['uDisEmail']);
        	$class_tpl->assign('uDisExtra', $rs['uDisExtra']);
        	$class_tpl->assign('uDisExtra2', $rs['uDisExtra2']);
        	$class_tpl->assign('uDisExtra3', $rs['uDisExtra3']);
			
		//now get the extra field names
		$sSQL="SELECT rExtra,rExtra2,rExtra3,rNewsletter FROM ".PREFIX."registration WHERE rID=1";
		$result=$db->query($sSQL);
		$rs=$result->fetch();
		$extra = explode("|", $rs['rExtra']);
		$extra2 = explode("|", $rs['rExtra2']);
		$extra3 = explode("|", $rs['rExtra3']);
		
		$class_tpl->assign('extraText', $extra[2]);
		$class_tpl->assign('extra2Text', $extra2[2]);
		$class_tpl->assign('extra3Text', $extra3[2]);

		$class_tpl->assign('body','settings/settings_userview.tpl');

$class_tpl->displayTemplate();
?>                                                                                                                                                                                                                                                                                                                                                                                                                     administration/siteinfo.php.txt                                                                     0000644 0023433 0004734 00000000411 11051631533 016614  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>PHP INFO</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
phpinfo();
?>
</body>
</html>                                                                                                                                                                                                                                                       administration/templates/                                                                           0000755 0023433 0004734 00000000000 11036006350 015443  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/                                                                   0000755 0023433 0004734 00000000000 11036006735 017076  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/category/                                                          0000755 0023433 0004734 00000000000 11036006360 020705  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/category/category_browse.tpl                                       0000644 0023433 0004734 00000010242 11051631535 024630  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 {literal}
<script language="javascript" type="text/javascript">
	<!--
		function modify(id) {
			document.mainform.id.value = id;
			document.mainform.action.value = "modify";
			document.mainform.submit();
		}
		function duplicate(id) {
			document.mainform.id.value = id;
			document.mainform.action.value = "duplicate";
			document.mainform.submit();
		}
		function addnew(){
			document.mainform.action.value = "addnew";
			document.mainform.submit();
		}
		function remove(id){
			document.mainform.id.value = id;
			document.mainform.action.value = "deletecat";
			document.mainform.submit();
			/**
			removemsg = "{/literal}{$smarty.const.LANG_JS_DELETE_CONFIRM}\n{$smarty.const.LANG_JS_NOT_UNDONE}{literal}"
			if (confirm(removemsg)) {
				document.mainform.id.value = id;
				document.mainform.action.value = "deletecat";
				document.mainform.submit();
			}
			**/
		}
	// -->
</script>
{/literal}
<h2>{$smarty.const.LANG_CATEGORY_SETUP}</h2>
	<table width="100%" class="wrap">
	<tr>
	<td>
		<form action="category.php" method="post" name="mainform">
		<input type="hidden" name="action" value="xxxxx" />
		<input type="hidden" name="id" value="xxxxx" />
		<table width="40%" align="center">
			<tr>
				<td align="right"><img src="images/page_add.png" alt="{$smarty.const.LANG_ADD_NEW}" /></td>
				<td align="left"><a href="category.php?action=addnew">{$smarty.const.LANG_ADD_NEW}</a></td>  
				<td align="right"><img src="images/page_edit.png" alt="{$smarty.const.LANG_MODIFY}" /></td>
				<td align="left">{$smarty.const.LANG_MODIFY}</td>  
				<td align="right"><img src="images/page_copy.png" alt="{$smarty.const.LANG_DUPLICATE}" /></td>
				<td align="left">{$smarty.const.LANG_DUPLICATE}</td>
				<td align="right"><img src="images/page_delete.png" alt="{$smarty.const.LANG_DELETE}" /></td>
				<td align="left">{$smarty.const.LANG_DELETE}</td>
			</tr>
		</table>
			<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				<tr>
					<th scope="col">{$smarty.const.LANG_ID}</th>
					<th scope="col">{$smarty.const.LANG_FULLNAME}</th>
					<th scope="col">{$smarty.const.LANG_WEIGHT}</th>
					<th scope="col" width="15%">{$smarty.const.LANG_ACTIONS}</th>
				</tr>
				
				{foreach from=$results item="entry" name=status}
				<tr>
					<td width="5%" class="{cycle values="row1,row2" advance=false}">{$entry.id}</td>
					<td class="{cycle values="row1,row2" advance=false}">{$entry.name} (<a href="listings.php?l_Category={$entry.id}">{$entry.listings}</a>)</td>
					<td width="5%" class="{cycle values="row1,row2" advance=false}">{$entry.cOrder}</td>
					<td class="{cycle values="row1,row2" advance=true}">
						<a href="category.php?action=modify&amp;id={$entry.id}"><img src="images/page_edit.png" alt="{$smarty.const.LANG_MODIFY}" border="0" /></a>
						&nbsp;
						<a href="category.php?action=duplicate&amp;id={$entry.id}"><img src="images/page_copy.png" alt="{$smarty.const.LANG_DUPLICATE}" border="0" /></a>
						&nbsp;
						<a href="category.php?action=deletecat&amp;id={$entry.id}"><img src="images/page_delete.png" alt="{$smarty.const.LANG_DELETE}" border="0" /></a>
					</td>
				</tr>
				{foreachelse}
				<tr><td colspan="6">{$smarty.const.LANG_NO_RESULTS}</td></tr>
				{/foreach}
			</table>
			<div align="center" style="padding: 3px;"><input type="button" name="Button" value="{$smarty.const.LANG_ADD_NEW}" onClick="addnew()" /></div>
		</form>
		<table width="40%" align="center">
			<tr>
				<td align="right"><img src="images/page_add.png" alt="{$smarty.const.LANG_ADD_NEW}" /></td>
				<td align="left"><a href="category.php?action=addnew">{$smarty.const.LANG_ADD_NEW}</a></td>  
				<td align="right"><img src="images/page_edit.png" alt="{$smarty.const.LANG_MODIFY}" /></td>
				<td align="left">{$smarty.const.LANG_MODIFY}</td>  
				<td align="right"><img src="images/page_copy.png" alt="{$smarty.const.LANG_DUPLICATE}" /></td>
				<td align="left">{$smarty.const.LANG_DUPLICATE}</td>
				<td align="right"><img src="images/page_delete.png" alt="{$smarty.const.LANG_DELETE}" /></td>
				<td align="left">{$smarty.const.LANG_DELETE}</td>
			</tr>
		</table>
	</td>
	</tr>
	</table>                                                                                                                                                                                                                                                                                                                                                              administration/templates/default/category/category_delete.tpl                                       0000644 0023433 0004734 00000001441 11051631536 024573  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_DELETE_CAT}</h2>
	<table width="100%" class="wrap">
	<tr>
		<td>
			<p><strong>{$smarty.const.LANG_JS_DELETE_CONFIRM} {$smarty.const.LANG_JS_NOT_UNDONE}</strong></p>
			<form action="category.php" method="post">
			<input type="hidden" name="id" value="{$id}" />
			<input type="hidden" name="action" value="delete" />
			 
			{$smarty.const.LANG_SELECT_LISTING_CAT}
				<select name="parent_id" id="parent_id">
					{foreach from=$getcats item=cat}
					<option value="{$cat.id}"{if $parent_id==$cat.id} SELECTED{/if}>{$cat.name}</option>
					{/foreach}
				</select>
				<input type="submit" value="{$smarty.const.LANG_SUBMIT}" />
				<input type="button" onClick="document.location = 'category.php'" value="Cancel" />
			</form>
		</td>
	</tr>
	</table>                                                                                                                                                                                                                               administration/templates/default/category/category_form.tpl                                         0000644 0023433 0004734 00000015051 11051631536 024276  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script language="javascript" type="text/javascript">
<!--
{literal}
function checkform(frm)
{
	if (frm.name.value == '') {
			alert("{/literal}{$smarty.const.LANG_JAVASCRIPT_PLEASE_ENTER} \'{$smarty.const.LANG_TITLE}{literal}\'.");
			frm.name.focus();
			return (false);
	}
}
{/literal}
//-->
</script>

<h2>{$smarty.const.LANG_CATEGORY_SETUP}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
				{if $success}
					<script type="text/javascript" src="javascript/fat.js"></script>
					<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
				{/if}
				
				<script language='javascript' type="text/javascript" src='../javascript/upload.js'></script>
				<form action="category.php?upload=true" method="post" name="mainform" enctype="multipart/form-data" onsubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',false,'','','',100,'','','');return document.MM_returnValue;">
				<input type="hidden" name="action" value="{$action}" />
				<input type="hidden" name="id" value="{$id}" />
				<table width="100%" class="main">
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="name">{$smarty.const.LANG_TITLE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="name" name="name" value="{$name}" size="25" onkeyup="catSlug();" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="slug">{$smarty.const.LANG_CATEGORY_SLUG}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="slug" name="slug" value="{$slug}" size="25" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_CATEGORY_SLUG}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="description">{$smarty.const.LANG_DESCRIPTION}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<textarea name="description" style="width: 90%;" rows="10" id="description">{$description}</textarea>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cKeywords">{$smarty.const.LANG_KEYWORDS}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="cKeywords" name="cKeywords" value="{$cKeywords}" size="25" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_CATEGORY_KEYWORDS}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cOrder">{$smarty.const.LANG_WEIGHT}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="cOrder" name="cOrder" value="{$cOrder}" size="25" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_CATEGORY_WEIGHT}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cLink">{$smarty.const.LANG_CATEGORY_LINK}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="cLink" name="cLink" value="{$cLink}" size="25" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_CATEGORY_LINK}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="allowads">{$smarty.const.LANG_ALLOW_ADS}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="allowads" id="allowads">
								<option value="Y"{if $allowads == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $allowads == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="parent_id">{$smarty.const.LANG_PARENT_CATEGORY}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="parent_id" id="parent_id">
							     <option value="0"{if $parent_id==0} SELECTED{/if}>{$smarty.const.LANG_TOP_CATEGORY}</option>
							{foreach from=$getcats item=cat}
								<option value="{$cat.id}"{if $parent_id==$cat.id} SELECTED{/if}>{$cat.name}</option>
							{/foreach}
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="display">{$smarty.const.LANG_DISPLAY_CATEGORY}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="display" id="display">
								<option value="Y"{if $display == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $display == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					{if $image<>""}
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_CURRENT_CAT_IMAGE}</td>
						<td class="{cycle values="row1,row2" advance=true}">
							<img src="../catimages/{$image}" />
							 <span class="small"><a href="category.php?catimage={$id}&amp;action=modify&amp;id={$id}">{$smarty.const.LANG_DELETE}</a></span>
						</td>
					</tr>
					{/if}
					
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="image">{$smarty.const.LANG_IMAGE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="image" type="file" id="image" onchange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',false,'','','',100,'','','')" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cPromo">{$smarty.const.LANG_PROMO}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<textarea name="cPromo" style="width: 90%;" rows="10" id="cPromo">{$cPromo}</textarea>
							<a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_CATEGORY_PROMO}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a>
						</td>
					</tr>
					<tr>
						<td colspan="2" align="left" class="{cycle values="row1,row2" advance=true}">
							<div align="center">
							<input type="submit" value="{$smarty.const.LANG_SUBMIT}" onClick="return checkform(mainform);" />
							</div>
						</td>
					</tr>
				</table>
				</form>
			</td>
		</tr>
	</table>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       administration/templates/default/content.tpl                                                        0000644 0023433 0004734 00000000157 11051631540 021267  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$title}</h2>
<table width="100%" class="wrap">
	<tr>
	<td>
		{$pPageContent}
	</td>
	</tr>
</table>                                                                                                                                                                                                                                                                                                                                                                                                                 administration/templates/default/coupons/                                                           0000755 0023433 0004734 00000000000 11036006372 020561  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/coupons/coupons.tpl                                                0000644 0023433 0004734 00000004717 11051631542 023001  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_COUPONS_DISCOUNTS}</h2>
{literal}
<script language="javascript" type="text/javascript">
	<!--
		function newopt(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "addnew";
			document.mainform.submit();
		}
		function modify(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "modify";
			document.mainform.submit();
		}
		function deleteid(id) {
		cmsg = "{/literal}{$smarty.const.LANG_JS_DELETE_CONFIRM}\n{$smarty.const.LANG_JS_NOT_UNDONE}{literal}"
			if (confirm(cmsg)) {
				document.mainform.id.value = id;
				document.mainform.act.value = "delete";
				document.mainform.submit();
			}
		}
	// -->
</script>
{/literal}

<form action="coupons.php" method="post" name="mainform">
<input type="hidden" name="act" value="xxxxx" />
<input type="hidden" name="id" value="xxxxx" />
<table width="100%" class="wrap">
	<tr>
		<td>

	<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
		<tr>
			<th scope="col">{$smarty.const.LANG_NAME}</th>
			<th scope="col">{$smarty.const.LANG_COUPON_OR_DISCOUNT}</th>
			<th scope="col">{$smarty.const.LANG_EXPIRATION}</th>
			<th scope="col">{$smarty.const.LANG_ACTIONS}</th>
		</tr>
	{foreach from=$results item="entry"}
          <tr>
			<td class="{cycle values="row1,row2" advance=false}">{$entry.cName}</td>
			<td class="{cycle values="row1,row2" advance=false}">{if $entry.cCoupon=="Y"}{$smarty.const.LANG_COUPON}{else}{$smarty.const.LANG_DISCOUNT}{/if}</td>
			<td class="{cycle values="row1,row2" advance=false}">{$entry.cEndDate}</td>
			<td class="{cycle values="row1,row2" advance=true}">
				<a href="coupons.php?act=modify&amp;id={$entry.cID}" onmouseover="return overlib('{$smarty.const.LANG_MODIFY}')" onmouseout="return nd();"><img src="images/page_edit.png" alt="{$smarty.const.LANG_MODIFY}" border="0" /></a>
				&nbsp;
				<a href="javascript:void(0);" onClick="deleteid('{$entry.cID}')" onmouseover="return overlib('{$smarty.const.LANG_DELETE}')" onmouseout="return nd();"><img src="images/page_delete.png" alt="{$smarty.const.LANG_DELETE}" border="0" /></a>
			</td>
          </tr>
	{foreachelse}
		<tr>
			<td colspan="5" class="row1">{$smarty.const.LANG_NO_RESULTS}</td>
		</tr>
	{/foreach}
        </table>
        
			<div class="options">
				<span class="addnew"><a href="coupons.php?act=addnew">{$smarty.const.LANG_ADD_NEW}</a></span>
			</div>
		</td>
	</tr>
</table>
</form>

                                                 administration/templates/default/coupons/couponsform.tpl                                            0000644 0023433 0004734 00000013373 11051631543 023664  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_COUPONS_DISCOUNTS}</h2>
{literal}
<script language="javascript" type="text/javascript">
<!--
function formvalidator(theForm)
{
	if(theForm.cName.value == "")
	{
		alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} \"{$smarty.const.LANG_ADMIN_COUPON_NAME}{literal}\".");
		theForm.cName.focus();
		return (false);
	}
	if(theForm.cDiscount.value=="")
	{
	     alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} \"{$smarty.const.LANG_ADMIN_DISCOUNT_AMOUNT}{literal}\".");
		theForm.cDiscount.focus();
		return (false);
	}
	if(theForm.cNumAvailable.value=="")
	{
	     alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} \"{$smarty.const.LANG_ADMIN_NUMBER_AVAILABLE}{literal}\".");
		theForm.cNumAvailable.focus();
		return (false);
	}
	return (true);
}

function changeField()
{
	if(document.mainform.cCoupon.selectedIndex==1){
		document.mainform.cNumber.disabled=true;
	}
	else if(document.mainform.cCoupon.selectedIndex==0){
		document.mainform.cNumber.disabled=false;
	}
}
//-->
</script>
{/literal}
<table width="100%" class="wrap">
		<tr>
			<td>
				<form action="coupons.php" method="post" name="mainform" onsubmit="return formvalidator(this)">
				<input type="hidden" name="act" value="{$act}" />
				<input type="hidden" name="id" value="{$cID}" />
				
				<table width="100%" class="main">
					<tr>
						<th colspan="2" class="formstrip">{$smarty.const.LANG_COUPONS_TXT}</th>
					</tr>
					<tr>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=false name=class}">{$smarty.const.LANG_COUPON_OR_DISCOUNT}</td>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=true name=class}">
							<select name="cCoupon" onChange="changeField();">
								<option value="Y"{if $cCoupon == "Y"} selected{/if}>{$smarty.const.LANG_COUPON}</option>
								<option value="N"{if $cCoupon == "N"} selected{/if}>{$smarty.const.LANG_DISCOUNT}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=false name=class}">{$smarty.const.LANG_COUPON_NAME}</td>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=true name=class}"><input type="text" name="cName" size="35" value="{$cName}" /></td>
					</tr>
					<tr>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=false name=class}">{$smarty.const.LANG_COUPON_CODE}<br /><span class="small">{$smarty.const.LANG_COUPON_CODE_TXT}</span></td>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=true name=class}"><input type="text" name="cNumber" size="35" value="{$cNumber}" /></td>
					</tr>
					<tr>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=false name=class}">{$smarty.const.LANG_COUPON_DISCOUNT}</td>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=true name=class}">
							<select name="cType">
								<option value="1"{if $cType == "1"} selected{/if}>{$smarty.const.LANG_COUPON_PERCENTAGE}</option>
								<option value="2"{if $cType == "2"} selected{/if}>{$smarty.const.LANG_COUPON_FLAT_RATE}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=false name=class}">{$smarty.const.LANG_DISCOUNT_AMOUNT}</td>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=true name=class}"><input type="text" name="cDiscount" size="35" value="{$cDiscount}" /></td>
					</tr>
					<tr>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=false name=class}">{$smarty.const.LANG_NUMBER_AVAILABLE}</td>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=true name=class}"><input type="text" name="cNumAvailable" size="35" value="{$cNumAvailable}" /></td>
					</tr>
					<tr>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=false name=class}">{$smarty.const.LANG_COUPON_ENDING_DATE}</td>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=true name=class}">
						<input type="text" name="cEndDate" id="cEndDate" onclick="return showCalendar('cEndDate', '%Y-%m-%d');"  value="{if $cEndDate}{$cEndDate}{else}{$smarty.now|date_format:"%Y-%m-%d"}{/if}" size="12" readonly="1" />&nbsp;<img src="images/calendar.png" onclick="return showCalendar('cEndDate', '%Y-%m-%d');" style="cursor: pointer;" alt="calendar" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false name=class}">{$smarty.const.LANG_COUPON_GROUPS}</td>
						<td class="{cycle values="row1,row2" advance=true name=class}">
							<select name="groups[]" size="10" multiple="multiple">
								{foreach from=$getgroups item=group}
								<option value="{$group.uGroupID}"{if $group.selected==Y} SELECTED{/if}>{$group.uTitle}</option>
								{/foreach}
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false name=class}"><label for="cUserID">{$smarty.const.LANG_COUPON_USER}{$smarty.const.LANG_COLON}</label></td>
							<td class="{cycle values="row1,row2" advance=true name=class}">
								<select name="cUserID" id="cUserID">
									<option value="0">{$smarty.const.LANG_COUPON_USER_ANY}</option>
									{foreach from=$owners item=own}
									<option value="{$own.id}"{if $cUserID==$own.id} SELECTED{/if}>{$own.username}</option>
									{/foreach}
								</select>
							</td>
					</tr>
					<tr>
						<td colspan="2" class="formstrip">
							<div align="center">
								<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" />
			            		</div>
						</td>
					</tr>
				</table>
			</form>
		</td>
	</tr>
</table>
                                                                                                                                                                                                                                                                     administration/templates/default/editor/                                                            0000755 0023433 0004734 00000000000 11036006377 020366  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/editor/editor.tpl                                                  0000644 0023433 0004734 00000003014 11051631545 022371  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script type="text/javascript" src="javascript/fat.js"></script>
{if $edit}
<h2>{$dir}/{$page}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
				{if $error}
					<div id="message" class="error fade"><p>{$error}</p></div>
				{/if}
				<form action="editor.php" method="post" name="mainform">
				<input type="hidden" name="action" value="modify" />
				<input type="hidden" name="page" value="{$page}" />
				<input type="hidden" name="dir" value="{$dir}" />
					<table width="100%">
						<tr>
							<td><img src="images/folder.gif" alt="folder" /><a href="editor.php?dir={$dir}">../</a>  </td>
						</tr>
						<tr>
							<td align="left" valign="top"><textarea name="pPageContent" id="elm1" style="width: 100%" rows="30">{$pPageContent}</textarea></td>		
						</tr>
						<tr>
							<td align="left" class="formstrip">
								{if !$error}
								<div align="center"><input type="submit" value="{$smarty.const.LANG_SUBMIT}" {if $error}DISABLED{/if} /></div>
								{/if}
							</td>
						</tr>
					</table>
				</form>
{else}
<h2>{$smarty.const.LANG_TEMPLATE_EDITOR}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
				<table width="100%" cellspacing="3" cellpadding="3">
					<tr>
						<td>
					{foreach from=$data item="entry" name="editor"}
							{$entry.name}<br />
				            {if $smarty.foreach.editor.iteration == $split}
				            </td><td>
				            {/if}
					{/foreach}
						</td>
					</tr>
				</table>
{/if}
			</td>
		</tr>
	</table>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    administration/templates/default/emails/                                                            0000755 0023433 0004734 00000000000 11036006413 020341  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/emails/html/                                                       0000755 0023433 0004734 00000000000 11036006407 021310  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/emails/html/newlisting.tpl.php                                     0000644 0023433 0004734 00000000746 11051631547 025017  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 {* 
This is the body of the email a friend email template. 
You can edit the template below and if you wish to edit the 
subject that is found in the language file. 
*}
<p>A new listing has been added to your classifieds website.</p>
<fieldset>
<legend>Details</legend>
<p>
Title: {$title}<br />
Price: {$price}<br />
<a href="{$smarty.const.URL}/viewlisting.php?view={$id}">View full details</a> | <a href="{$smarty.const.URL}/listings.php?view={$id}">Edit details</a>
</p>
</fieldset>                          administration/templates/default/emails/text/                                                       0000755 0023433 0004734 00000000000 11036006417 021331  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/emails/text/newlisting.tpl.php                                     0000644 0023433 0004734 00000000523 11051631552 025024  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 {* 
This is the body of the newlisting email template. 
You can edit the template below and if you wish to edit the 
subject that is found in the language file. 
*}

{textformat wrap=40}
A new listing has been added to your classifieds website.

Title: {$title}
Price: {$price}
{$smarty.const.URL}/viewlisting.php?view={$id}
{/textformat}
                                                                                                                                                                             administration/templates/default/fields/                                                            0000755 0023433 0004734 00000000000 11036006440 020335  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/fields/fields.tpl                                                  0000644 0023433 0004734 00000010634 11051631555 022340  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <! -- // Fields Template // -->
{literal}
<script language="javascript" type="text/javascript">
	<!--
		function chi(currindex)
		{
			var i = eval("document.mainform.newpos"+currindex+".selectedIndex");
			document.mainform.newval.value = eval("document.mainform.newpos"+currindex+".options[i].text");
			document.mainform.selectedq.value = currindex;
			document.mainform.act.value = "changeorder";
			document.mainform.submit();
		}
		function newopt(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "addnew";
			document.mainform.submit();
		}
		function newparentopt(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "newparentopt";
			document.mainform.submit();
		}
		function newchildopt(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "newchildopt";
			document.mainform.submit();
		}
		function newtext(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "addnewtext";
			document.mainform.submit();
		}
		function modify(id) {
			document.mainform.id.value = id;
					document.mainform.act.value = "modify";
			document.mainform.submit();
		}
		function deleteid(id) {
		cmsg = "{/literal}{$smarty.const.LANG_JS_DELETE_CONFIRM}\n{$smarty.const.LANG_JS_NOT_UNDONE}{literal}"
			if (confirm(cmsg)) {
				document.mainform.id.value = id;
				document.mainform.act.value = "delete";
				document.mainform.submit();
			}
		}
	// -->
</script>
{/literal}
<form action="fields.php" method="post" name="mainform">
<input type="hidden" name="act" value="xxxxx" />
<input type="hidden" name="id" value="xxxxx" />
<input type="hidden" name="selectedq" value="1" />
<input type="hidden" name="newval" value="1" />
<h2>{$smarty.const.LANG_EXTRA_FIELDS}</h2>
<table width="100%" class="wrap">
	<tr>
		<td>			
			{if $success}
				<script type="text/javascript" src="javascript/fat.js"></script>
				<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
			{/if}
				<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
					<tr>
						<th width="5%" class="formstrip">{$smarty.const.LANG_ORDER}</th>
						<th class="formstrip">{$smarty.const.LANG_ID}</th>
						<th class="formstrip">{$smarty.const.LANG_FIELD_NAME} <em>({$smarty.const.LANG_INTERNAL_NAME})</em></th>
						<th class="formstrip"> {$smarty.const.LANG_FIELD_TYPE} </th>
						<th width="15%" align="left" valign="top" class="formstrip">{$smarty.const.LANG_MODIFY}</th>
						<th width="15%" align="left" valign="top" class="formstrip">{$smarty.const.LANG_DELETE}</th>
					</tr>
					  {foreach from=$results item="entry" name="fields"}
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">
							<select name='newpos{$entry.fOrder}' onChange='chi({$entry.fOrder});'>
								{section name=order loop=$max+1 start=1}
								<option value="{$smarty.section.order.index}"{if $entry.fOrder==$smarty.section.order.index} SELECTED{/if}>{$smarty.section.order.index}</option>
								{/section}
							</select>
						</td>
						<td class="{cycle values="row1,row2" advance=false}">{$entry.fID}</td>
						<td class="{cycle values="row1,row2" advance=false}">{$entry.fName} <em>({$entry.fInternal})</em></td>
						<td class="{cycle values="row1,row2" advance=false}">{$entry.fType}</td>
						<td class="{cycle values="row1,row2" advance=false}"><input type=button value="{$smarty.const.LANG_MODIFY}" onClick="modify('{$entry.fID}')" /></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type=button value="{$smarty.const.LANG_DELETE}" onClick="deleteid('{$entry.fID}')" /></td>
					</tr>
					  {foreachelse}
					<tr>
					     <td class="row1" colspan="6">{$smarty.const.LANG_NO_RESULTS}</td>
					</tr>
					  {/foreach}
				</table>
				<div align="center" style="padding: 5px;">
					<strong>{$smarty.const.LANG_EXTRA_FIELDS_CH}</strong>
					<input type="button" value="{$smarty.const.LANG_NEW_OPTION}" onClick="newopt()" /> or
					<input type="button" value="{$smarty.const.LANG_NEW_TEXT_OPTION}" onClick="newtext()" /><br />
					<strong>{$smarty.const.LANG_EXTRA_FIELDS_ADV}</strong>
					<input type="button" value="{$smarty.const.LANG_PARENT_FIELD}" onClick="newparentopt()" /> or
					<input type="button" value="{$smarty.const.LANG_CHILD_FIELD}" onClick="newchildopt()" />
				</div>
		</td>
	</tr>
</table>
</form>
<!-- // End // -->                                                                                                    administration/templates/default/fields/fieldsform.tpl                                              0000644 0023433 0004734 00000020367 11051631556 023231  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 {literal}
<script language="javascript" type="text/javascript">
<!-- //
function checkform(frm) 
{
	if (frm.fName.value == '') 
	{
		alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} '{$smarty.const.LANG_FIELD_NAME}{literal}'.");
		frm.fName.focus();
		return (false);
	}
	if (frm.fType.value=='')
	{
		alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} '{$smarty.const.LANG_FIELD_TYPE}{literal}'.");
		frm.fType.focus();
		return (false);
	}
	var fRange = frm.fRange.options;
	var sValue = fRange[fRange.selectedIndex].value;
	if (sValue == 'Y') 
	{
		if(frm.fRangeMin.value == '')
		{
			alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} '{$smarty.const.LANG_RANGE_MIN}{literal}'.");
			frm.fRangeMin.focus();
			return (false);
		}
		if(frm.fRangeMax.value == '')
		{
			alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} '{$smarty.const.LANG_RANGE_MAX}{literal}'.");
			frm.fRangeMax.focus();
			return (false);
		}
		if(frm.fRangeStep.value == '' || frm.fRangeStep.value==0)
		{
			alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} '{$smarty.const.LANG_RANGE_STEP}{literal}'.");
			frm.fRangeStep.focus();
			return (false);
		}
	}
}
function displaySec(type){
	var OPT = type.options[type.selectedIndex].value;
	if(OPT=="D")
	{
		document.getElementById('range').style.visibility = 'visible';
	}
	else
	{
		document.getElementById('range').style.visibility = 'collapse';
	}
}

function showOptions(val) {
	var opt = val.options[val.selectedIndex].value;
	if(opt == "Y")
	{
		document.getElementById('optionstext').style.display='none';
	}
	else
	{
		document.getElementById('optionstext').style.display='block';
	}
}
/*
* Extra Fields
* Add new inputs to the table.
*/
window.onload=function()
{
	document.getElementById("myButton").onclick = addRowToTable;
};
function addRowToTable()
{
	for (i = 0; i <= 5; i++) 
	{
		var tbl = document.getElementById('options');
		var lastRow = tbl.rows.length;
		// if there's no header row in the table, then iteration = lastRow + 1
		var iteration = lastRow;
		var row = tbl.insertRow(lastRow);
  		// right cell
  		var cellLeft = row.insertCell(0);
  		var el = document.createElement('input');
  		el.type = 'text';
		el.name = 'optName[]';
		el.id = 'txtRow' + iteration;
		el.size = 35;
		cellLeft.appendChild(el);
  
		// select cell
		var cellRightSel = row.insertCell(1);
		var sel = document.createElement('input');
		sel.type = 'text';
		sel.name = 'optName[]';
		sel.id = 'txtRow' + iteration;
		sel.size = 35;
		cellRightSel.appendChild(sel);
	}
}
//-->
</script>
{/literal}

<h2>{$smarty.const.LANG_EXTRA_FIELDS}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
				<form action="fields.php" method="post" name="add" id="add" onsubmit="return checkform(this)">
				<input type="hidden" name="mode" value="{$action}" />
				<input type="hidden" name="fid" value="{$fid}" />
				
					<table width="100%" class="main">
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fName">{$smarty.const.LANG_FIELD_NAME}</label></td>
							<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="fName" id="fName" size="35" value="{$fName}" /></td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fName">{$smarty.const.LANG_INTERNAL_NAME}</label></td>
							<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="fInternal" id="fInternal" value="{$fInternal}" /></td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fType">{$smarty.const.LANG_FIELD_TYPE}</label></td>
							<td class="{cycle values="row1,row2" advance=true}">
								<select name="fType" id="fType" onChange="displaySec(this);">
									<option value="">Please Select</option>
									<option value="D"{if $fType == "D"} selected{/if}>{$smarty.const.LANG_DPLIST}</option>
									<option value="C"{if $fType == "C"} selected{/if}>{$smarty.const.LANG_CHECKBOX}</option>
								</select>
							</td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_FIELD_SEEN}</td>
							<td class="{cycle values="row1,row2" advance=true}">
								<select name="fSeen">
									<option value="Y"{if $fSeen == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
									<option value="N"{if $fSeen == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
								</select>
							</td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fRequired">{$smarty.const.LANG_REQUIRED}</label></td>
							<td class="{cycle values="row1,row2" advance=true}">
								<select name="fRequired" id="fRequired">
									<option value="Y"{if $fRequired == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
									<option value="N"{if $fRequired == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
								</select>
							</td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fSearch">{$smarty.const.LANG_FIELD_SEARCHABLE}</label></td>
							<td class="{cycle values="row1,row2" advance=true}">
								<select name="fSearch" id="fSearch">
									<option value="Y"{if $fSearch == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
									<option value="N"{if $fSearch == "N" || $fSearch==""} selected{/if}>{$smarty.const.LANG_NO}</option>
								</select>
							</td>
						</tr>
						<tr id="range" style="{if $fType == "D"}visibility:visible;{else}visibility:collapse;{/if}">
							<td class="{cycle values="row1,row2" advance=false}"><label for="fRange">{$smarty.const.LANG_RANGE}</label></td>
							<td class="{cycle values="row1,row2" advance=true}">
								<select name="fRange" id="fRange" onChange="showOptions(this);">
									<option value="Y"{if $fRange == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
									<option value="N"{if $fRange == "N" || $fRange==""} selected{/if}>{$smarty.const.LANG_NO}</option>
								</select>
								<label for="fRangeMin">{$smarty.const.LANG_RANGE_MIN}</label>
								<input type="text" name="fRangeMin" id="fRangeMin" size="5" value="{$fRangeMin}" />
								<label for="fRangeMax">{$smarty.const.LANG_RANGE_MAX}</label>
								<input type="text" name="fRangeMax" id="fRangeMax" size="5" value="{$fRangeMax}" />
								<label for="fRangeStep">{$smarty.const.LANG_RANGE_STEP}</label>
								<input type="text" name="fRangeStep" id="fRangeStep" size="5" value="{$fRangeStep}" />
								<a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_MIN_MAX_STEP}')" onmouseout="return nd();"><img src="images/help.png" border="0" /></a>
							</td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="cat">{$smarty.const.LANG_FIELD_CAT}</label></td>
							<td class="{cycle values="row1,row2" advance=true}">
								<select name="cat[]" id="cat" size="10" multiple="multiple">
									{foreach from=$getcats item=cat}
									<option value="{$cat.id}"{if $cat.selected==Y} SELECTED{/if}>{$cat.name}</option>
									{/foreach}
								</select>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<div id="optionstext" style="display: {if $fRange == "Y"}none;{else}block;{/if}">
								<fieldset>
									<legend>{$smarty.const.LANG_FIELD_OPTIONS}</legend>
									<table width="100%" id="options">
									{section name=tr loop=$data step=2}
										<tr>
											{section name=td start=$smarty.section.tr.index loop=$smarty.section.tr.index+2}
											<td width="50%">
											{if $data[td]<>""}
												<input type="text" size="35" name="optName[]" value="{$data[td].optValue}" />
											{/if}
											&nbsp;
											</td>
											{/section}
										</tr>
									{/section}
									</table>
								<input id="myButton" type="button" value="{$smarty.const.LANG_MORE_FIELDS}" />
								</fieldset>
								</div>
							</td>
						</tr>
						<tr>
							<td colspan="2" class="formstrip">
								<div align="center">
									<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" />
								</div>
							</td>
						</tr>
					</table>
</form>
</td>
		</tr>
	</table>                                                                                                                                                                                                                                                                         administration/templates/default/fields/fieldsformchild.tpl                                         0000644 0023433 0004734 00000007223 11051631556 024231  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 {literal}
<script language="JavaScript" type="text/javascript">
<!-- //
function checkform(frm) 
{
	if (frm.fName.value == '') 
	{
		alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} '{$smarty.const.LANG_ADMIN_EXTRA_FIELDS_NAME}{literal}'.");
		frm.fName.focus();
		return (false);
	}
}
/*
* Extra Fields
* Add new inputs to the table.
*/
window.onload=function()
{
	document.getElementById("myButton").onclick = addRowToTable;
};
function addRowToTable()
{
	for (i = 0; i <= 5; i++) 
	{
		var tbl = document.getElementById('options');
		var lastRow = tbl.rows.length;
		// if there's no header row in the table, then iteration = lastRow + 1
		var iteration = lastRow;
		var row = tbl.insertRow(lastRow);
  		// right cell
  		var cellLeft = row.insertCell(0);
  		var el = document.createElement('input');
  		el.type = 'text';
		el.name = 'optName[]';
		el.id = 'txtRow' + iteration;
		el.size = 35;
		cellLeft.appendChild(el);
  
		// select cell
		var cellRightSel = row.insertCell(1);
		var sel = document.createElement('input');
		sel.type = 'text';
		sel.name = 'optName[]';
		sel.id = 'txtRow' + iteration;
		sel.size = 35;
		cellRightSel.appendChild(sel);
	}
}
//-->
</script>
{/literal}
<h2>{$smarty.const.LANG_EXTRA_FIELDS}</h2>
<table width="100%" class="wrap">
		<tr>
			<td>
				<form action="fields.php" method="post" name="add" onsubmit="return checkform(this)">
				<input type="hidden" name="mode" value="{$action}" />
				<input type="hidden" name="fid" value="{$fid}" />
				<input type="hidden" name="fType" value="Y" />
					
					<table width="100%" class="main">
     					<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fName">{$smarty.const.LANG_FIELD_NAME}</label></td>
							<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="fName" id="fName" size="35" value="{$fName}" /></td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fName">{$smarty.const.LANG_INTERNAL_NAME}</label></td>
							<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="fInternal" id="fInternal" size="35" value="{$fInternal}" /></td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fSeen">{$smarty.const.LANG_FIELD_SEEN}</label></td>
							<td class="{cycle values="row1,row2" advance=true}">
								<select name="fSeen" id="fSeen">
									<option value="Y"{if $fSeen == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
									<option value="N"{if $fSeen == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
								</select>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<fieldset>
									<legend>{$smarty.const.LANG_FIELD_OPTIONS}</legend>
									<table width="100%" id="options">
									{section name=tr loop=$data step=2}
										<tr>
											{section name=td start=$smarty.section.tr.index loop=$smarty.section.tr.index+2}
											<td width="50%">
											{if $data[td]<>""}
												<input type="text" size="35" name="optName[]" value="{$data[td].optValue}" />
											{/if}
											&nbsp;
											</td>
											{/section}
										</tr>
									{/section}
									</table>
									<input id="myButton" type="button" value="{$smarty.const.LANG_MORE_FIELDS}" />
								</fieldset>
							</td>
						</tr>
						<tr>
							<td colspan="2" class="formstrip">
								<div align="center">
									<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" />
								</div>
							</td>
						</tr>
					</table>
				</form>
			</td>
		</tr>
	</table>
                                                                                                                                                                                                                                                                                                                                                                             administration/templates/default/fields/fieldsformparent.tpl                                        0000644 0023433 0004734 00000012435 11051631557 024441  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 {literal}
<script language="JavaScript" type="text/javascript">
<!-- //
function checkform(frm) 
{
	if (frm.fName.value == '') 
	{
		alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} '{$smarty.const.LANG_ADMIN_EXTRA_FIELDS_NAME}{literal}'.");
		frm.fName.focus();
		return (false);
	}
}
/*
* Extra Fields
* Add new inputs to the table.
*/
window.onload=function()
{
	document.getElementById("myButton").onclick = addRowToTable;
};
function addRowToTable()
{
	for (i = 0; i <= 5; i++) 
	{
		var tbl = document.getElementById('options');
		var lastRow = tbl.rows.length;
		// if there's no header row in the table, then iteration = lastRow + 1
		var iteration = lastRow;
		var row = tbl.insertRow(lastRow);
		
  		// right cell
  		var cellLeft = row.insertCell(0);
  		cellLeft.innerHTML = '<input type="text" name="optName[]" size="35" /> {/literal}{$smarty.const.LANG_SUB_ID}{literal}<input type="text" size="3" name="optSub[]" />';
  		
		// left cell
		var cellRightSel = row.insertCell(1);
		cellRightSel.innerHTML = '<input type="text" name="optName[]" size="35" /> {/literal}{$smarty.const.LANG_SUB_ID}{literal}<input type="text" size="3" name="optSub[]" />';
	}
}
//-->
</script>
{/literal}
<h2>{$smarty.const.LANG_EXTRA_FIELDS}</h2>
<table width="100%" class="wrap">
		<tr>
			<td>
				<form action="fields.php" method="post" name="add" onsubmit="return checkform(this)">
				<input type="hidden" name="mode" value="{$action}" />
				<input type="hidden" name="fid" value="{$fid}" />
				<input type="hidden" name="fType" value="P" />
				
					<table width="100%" class="main">
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fName">{$smarty.const.LANG_FIELD_NAME}</label></td>
							<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="fName" id="fName" size="30" value="{$fName}" /></td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fName">{$smarty.const.LANG_INTERNAL_NAME}</label></td>
							<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="fInternal" id="fInternal" size="30" value="{$fInternal}" /></td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fSeen">{$smarty.const.LANG_FIELD_SEEN}</label></td>
							<td class="{cycle values="row1,row2" advance=true}">
								<select name="fSeen" id="fSeen">
									<option value="Y"{if $fSeen == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
									<option value="N"{if $fSeen == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
								</select>
							</td>
						</tr>
						<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="fRequired">{$smarty.const.LANG_REQUIRED}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="fRequired" id="fRequired">
								<option value="Y"{if $fRequired == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $fRequired == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="fSearch">{$smarty.const.LANG_FIELD_SEARCHABLE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="fSearch" id="fSearch">
								<option value="Y"{if $fSearch == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $fSearch == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cats">{$smarty.const.LANG_FIELD_CAT}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="cat[]" id="cats" size="10" multiple="multiple">
								{foreach from=$getcats item=cat}
								<option value="{$cat.id}"{if $cat.selected==Y} SELECTED{/if}>{$cat.name}</option>
								{/foreach}
							</select>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<fieldset>
								<legend>{$smarty.const.LANG_FIELD_OPTIONS}<a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_SUB_ID}')" onmouseout="return nd();"><img src="images/help.png" border="0" alt="Help" /></a></legend>
								<table width="100%" id="options">
									{section name=tr loop=$data step=2}
										<tr>
											{section name=td start=$smarty.section.tr.index loop=$smarty.section.tr.index+2}
											<td width="50%">
											{if $data[td]<>""}
												<input type="text" size="35" name="optName[]" value="{$data[td].optValue}" /> 
												{$smarty.const.LANG_SUB_ID}<input type="text" size="3" name="optSub[]" value="{$data[td].optSub}" />
											{/if}
											&nbsp;
											</td>
											{/section}
										</tr>
									{/section}
									</table>
									<input id="myButton" type="button" value="{$smarty.const.LANG_MORE_FIELDS}" />
							</fieldset>
						</td>
					</tr>
					<tr>
						<td colspan="2" class="formstrip">
							<div align="center">
								<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" />
							</div>
						</td>
					</tr>
				</table>
			</form>
		</td>
	</tr>
</table>
                                                                                                                                                                                                                                   administration/templates/default/fields/fieldsformtext.tpl                                          0000644 0023433 0004734 00000017634 11051631560 024134  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 {literal}
<script language="JavaScript" type="text/javascript">
<!-- //
function checkform(frm) {
	if (frm.fName.value == '') 
	{
		alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} '{$smarty.const.LANG_FIELD_NAME}{literal}'.");
		frm.fName.focus();
		return (false);
	}
	if (frm.fType.value=='')
	{
		alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} '{$smarty.const.LANG_FIELD_TYPE}{literal}'.");
		frm.fType.focus();
		return (false);
	}
	var fRange = frm.fRange.options;
	var sValue = fRange[fRange.selectedIndex].value;
	if (sValue == 'Y') 
	{
		if(frm.fRangeMin.value == '')
		{
			alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} '{$smarty.const.LANG_RANGE_MIN}{literal}'.");
			frm.fRangeMin.focus();
			return (false);
		}
		if(frm.fRangeMax.value == '')
		{
			alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} '{$smarty.const.LANG_RANGE_MAX}{literal}'.");
			frm.fRangeMax.focus();
			return (false);
		}
		if(frm.fRangeStep.value == '')
		{
			alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} '{$smarty.const.LANG_RANGE_STEP}{literal}'.");
			frm.fRangeStep.focus();
			return (false);
		}
	}
}
function displaySec(type){
	var OPT = type.options[type.selectedIndex].value;
	if(OPT=="S")
	{
		document.getElementById('upload').style.visibility = 'collapse';
		document.getElementById('range').style.visibility = 'visible';
	}
	else if(OPT=="B")
	{
		document.getElementById('upload').style.visibility = 'collapse';
		document.getElementById('range').style.visibility = 'collapse';
		document.add.fSearch.value = "N";
		document.add.fSearch.disabled=true;
	}
	else if(OPT=="F")
	{
		document.getElementById('upload').style.visibility = 'visible';
		document.add.fSearch.value = "N";
		document.add.fSearch.disabled=true;
	}
	else
	{
		document.getElementById('upload').style.visibility = 'collapse';
		document.getElementById('range').style.visibility = 'collapse';
	}
}
//-->
</script>
{/literal}
<h2>{$smarty.const.LANG_EXTRA_FIELDS}</h2>
<table width="100%" class="wrap">
		<tr>
			<td>
				<form action="fields.php" method="post" name="add" onsubmit="return checkform(this)">
				<input type="hidden" name="mode" value="{$action}" />
				<input type="hidden" name="fid" value="{$fid}" />
				
					<table width="100%" class="main">
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fName">{$smarty.const.LANG_FIELD_NAME}</label></td>
							<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="fName" id="fName" size="30" value="{$fName}" /></td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fName">{$smarty.const.LANG_INTERNAL_NAME}</label></td>
							<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="fInternal" id="fInternal" size="30" value="{$fInternal}" /></td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fType">{$smarty.const.LANG_FIELD_TYPE}</label></td>
							<td class="{cycle values="row1,row2" advance=true}">
								<select name="fType" id="fType" onChange="displaySec(this);">
									<option value="">Please Select</option>
									<option value="S"{if $fType == "S"} selected{/if}>{$smarty.const.LANG_TXTSINGLE}</option>
									<option value="M"{if $fType == "M"} selected{/if}>{$smarty.const.LANG_TXTMULTI}</option>
									<option value="F"{if $fType == "F"} selected{/if}>{$smarty.const.LANG_FILE_UPLOAD}</option>
									<option value="B"{if $fType == "B"} selected{/if}>{$smarty.const.LANG_DATE_FIELD}</option>
								</select>
							</td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fSeen">{$smarty.const.LANG_FIELD_SEEN}</label></td>
							<td class="{cycle values="row1,row2" advance=true}">
								<select name="fSeen" id="fSeen">
									<option value="Y"{if $fSeen == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
									<option value="N"{if $fSeen == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
								</select>
							</td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fDefault">{$smarty.const.LANG_FIELD_DEFAULT}</label></td>
							<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="fDefault" id="fDefault" size="30" value="{$fDefault}" /></td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fRequired">{$smarty.const.LANG_REQUIRED}</label></td>
							<td class="{cycle values="row1,row2" advance=true}">
								<select name="fRequired" id="fRequired">
									<option value="Y"{if $fRequired == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
									<option value="N"{if $fRequired == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
								</select>
							</td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="fSearch">{$smarty.const.LANG_FIELD_SEARCHABLE}</label></td>
							<td class="{cycle values="row1,row2" advance=true}">
								<select name="fSearch" id="fSearch"{if $fType == "F" || $fType=="B"} disabled{/if}>
									<option value="Y"{if $fSearch == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
									<option value="N"{if $fSearch == "N" || $fSearch==""} selected{/if}>{$smarty.const.LANG_NO}</option>
								</select>
							</td>
						</tr>
						<tr id="range" style="{if $fType == "S"}visibility:visible;{else}visibility:collapse;{/if}">
							<td class="{cycle values="row1,row2" advance=false}"><label for="fRange">{$smarty.const.LANG_RANGE}</label></td>
							<td class="{cycle values="row1,row2" advance=false}">
								<select name="fRange" id="fRange">
									<option value="Y"{if $fRange == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
									<option value="N"{if $fRange == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
								</select>
								<label for="fRangeMin">{$smarty.const.LANG_RANGE_MIN}</label>
								<input type="text" name="fRangeMin" id="fRangeMin" size="5" value="{$fRangeMin}" />
								<label for="fRangeMax">{$smarty.const.LANG_RANGE_MAX}</label>
								<input type="text" name="fRangeMax" id="fRangeMax" size="5" value="{$fRangeMax}" />
								<label for="fRangeStep">{$smarty.const.LANG_RANGE_STEP}</label>
								<input type="text" name="fRangeStep" id="fRangeStep" size="5" value="{$fRangeStep}" />
								<a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_MIN_MAX_STEP}')" onmouseout="return nd();"><img src="images/help.png" border="0" /></a>
							</td>
						</tr>
						<tr id="upload" style="{if $fType == "F"}visibility:visible;{else}visibility:collapse;{/if}">
							<td class="{cycle values="row1,row2" advance=false}"><label for="fExtensions">{$smarty.const.LANG_IMAGE_ALLOWED_EXT}</label></td>
							<td class="{cycle values="row1,row2" advance=false}"><input type="text" name="fExtensions" id="fExtensions" size="30" value="{$fExtensions}" />
								<a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_VALID_EXTENSIONS}')" onmouseout="return nd();"> <img src="images/help.png" border="0" /></a>
							</td>
						</tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="cats">{$smarty.const.LANG_FIELD_CAT}</label></td>
							<td class="{cycle values="row1,row2" advance=true}">
								<select name="cat[]" id="cats" size="10" multiple="multiple">
									{foreach from=$getcats item=cat}
									<option value="{$cat.id}"{if $cat.selected==Y} SELECTED{/if}>{$cat.name}</option>
									{/foreach}
								</select>
							</td>
						</tr>
						<tr>
							<td colspan="2" class="formstrip">
								<div align="center">
									<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" />
								</div>
							</td>
						</tr>
					</table>
				</form>
			</td>
		</tr>
	</table>                                                                                                    administration/templates/default/forward.tpl                                                        0000644 0023433 0004734 00000000714 11051631562 021264  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 {*forward the user *}
{if $forward == TRUE}
<h2>{$title}</h2>
<meta http-equiv="refresh" content="2;URL={$location}" />
<table width="100%" class="wrap">
	<tr>
	<td>
		{$smarty.const.LANG_FORWARD}<br />{$smarty.const.LANG_FORWARD_IF_NOT} <a href="{$location}">{$smarty.const.LANG_FORWARD_CLICK_HERE}.</a>
	</td>
	</tr>
</table>

{else}
<h2>{$title}</h2>
<table width="100%" class="wrap">
	<tr>
	<td>
		{$msg}
	</td>
	</tr>
</table>
{/if}
                                                    administration/templates/default/gateways/                                                          0000755 0023433 0004734 00000000000 11036006452 020716  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/gateways/gateways.tpl                                              0000644 0023433 0004734 00000006102 11051631563 023266  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_PAYMENT_PROVIDERS}</h2>
{literal}
<script language="javascript" type="text/javascript">
	<!--
		function modify(id) {
			document.mainform.id.value = id;
			document.mainform.action.value = "modify";
			document.mainform.submit();
		}
		function deletegateway(id)
		{
			if(confirm('{/literal}{$smarty.const.LANG_GATEWAY_DELETECONFIRM}{literal}'))
			{
				document.location = 'gateways.php?id=' + id + '&do=changestate&action=remove';
			}
		}
		function chi(currindex)
		{
			var i = eval("document.mainform.newpos"+currindex+".selectedIndex");
			document.mainform.newval.value = eval("document.mainform.newpos"+currindex+".options[i].text");
			document.mainform.selectedq.value = currindex;
			document.mainform.act.value = "changeorder";
			document.mainform.submit();
		}
	// -->
</script>
{/literal}

<form action="gateways.php" method="post" name="mainform">
<input type="hidden" name="action" value="xxxxx" />
<input type="hidden" name="act" value="xxxxx" />
<input type="hidden" name="id" value="xxxxx" />
<input type="hidden" name="selectedq" value="1" />
<input type="hidden" name="newval" value="1" />
<table width="100%" class="wrap">
	<tr>
		<td>
	{if $msg}
		<div id="message" class="updated fade"><p>{$msg}</p></div>
	{/if}
			<table width="100%"  border="0" cellspacing="0" cellpadding="3">
				<tr>
					<td>
						
						<input type="button" value="{$smarty.const.LANG_REGENERATE}" onClick="self.location='gateways.php?action=regenerate'" />
					</td>
				</tr>
			</table>
	<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
		<tr>
			<th scope="col" width="5%">{$smarty.const.LANG_ORDER}</th>
			<th scope="col">{$smarty.const.LANG_ID}</th>
			<th scope="col">{$smarty.const.LANG_TITLE}</th>
			<th scope="col">{$smarty.const.LANG_MODIFY}</th>
			<th scope="col">{$smarty.const.LANG_DELETE}</th>
		</tr>
		{foreach from=$results item="entry"}
          <tr>
          	<td class="{cycle values="row1,row2" advance=false}">
				<select name='newpos{$entry.gOrder}' onChange='chi({$entry.gOrder});'>
					{section name=order loop=$max+1 start=1}
						<option value="{$smarty.section.order.index}"{if $entry.gOrder==$smarty.section.order.index} SELECTED{/if}>{$smarty.section.order.index}</option>
					{/section}
				</select>
			</td>
			<td class="{cycle values="row1,row2" advance=false}">{if $entry.active=="Y"}<strong>{/if}{$entry.id}{if $entry.active=="Y"}</strong>{/if}</td>
			<td class="{cycle values="row1,row2" advance=false}">{if $entry.active=="Y"}<strong>{/if}{$entry.displayname}{if $entry.active=="Y"}</strong>{/if}</td>
			<td class="{cycle values="row1,row2" advance=false}"><input type="button" name="Button" value="{$smarty.const.LANG_MODIFY}" onClick="modify('{$entry.id}')" /></td>
			<td class="{cycle values="row1,row2" advance=true}">
				{if $entry.id <> 1}
				<input type="button" name="Button" value="{$smarty.const.LANG_DELETE}" onClick="deletegateway('{$entry.id}')" />
				{/if}
			</td>
          </tr>
		{/foreach}
	</table>
        
		</td>
	</tr>
</table>
</form>

                                                                                                                                                                                                                                                                                                                                                                                                                                                              administration/templates/default/gateways/gatewaysform.tpl                                          0000644 0023433 0004734 00000005432 11051631564 024160  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_PAYMENT_PROVIDERS}</h2>
<table width="100%" class="wrap">
		<tr>
			<td>
				<form action="gateways.php" method="post" name="mainform">
				<input type="hidden" name="action" value="modifypage" />
				<input type="hidden" name="id" value="{$id}" />
				<table width="100%" class="main">
					<tr>
						<td colspan="2" class="{cycle values="row1,row2" advance=true name=class}">{$smarty.const.LANG_NEED_HELP} <a href="javascript:void(0);" onClick="MM_openBrWindow('../includes/paymentapi/{$directory}/readme.php','manual','scrollbars=yes,resizable=yes,width=550,height=500')">{$smarty.const.LANG_CLICK_HERE}</a></td>
					</tr>
					<tr>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=false name=class}">{$smarty.const.LANG_TITLE}</td>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=true name=class}"><input type="text" name="displayname" value="{$displayname}" size="25" /></td>
					</tr>
					<tr>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=false name=class}">{$smarty.const.LANG_SHOW_AS}</td>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=true name=class}"><input type="text" name="showas" value="{$showas}" size="25" /></td>
					</tr>
					<tr>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=false name=class}">{$smarty.const.LANG_ACTIVE}</td>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=true name=class}"><input type="checkbox" name="active" value="Y"{if $active=="Y"} CHECKED{/if} /></td>
					</tr>
					<tr>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=false name=class}">{$smarty.const.LANG_DEMO}</td>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=true name=class}"><input type="checkbox" name="demo" value="Y"{if $demo=="Y"} CHECKED{/if} /></td>
					</tr>
					<tr>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=false name=class}">{$extraTxt}</td>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=true name=class}"><input type="text" name="extra" value="{$extra}" size="25" /></td>
					</tr>
					<tr>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=false name=class}">{$extra2Txt}</td>
						<td align="left" valign="top" class="{cycle values="row1,row2" advance=true name=class}"><input type="text" name="extra2" value="{$extra2}" size="25" /></td>
					</tr>
					<tr>
						<td colspan="2" class="formstrip">
							<div align="center">
								<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" />
			            		</div>
						</td>
					</tr>
				</table>
			</form>
		</td>
	</tr>
</table>
                                                                                                                                                                                                                                      administration/templates/default/home.tpl                                                           0000644 0023433 0004734 00000024355 11051631566 020563  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 {if $error}
<script type="text/javascript" src="javascript/fat.js"></script>
	<div id="message" class="error fade"><p>{$error}</p></div>
{/if}
<h2>{$smarty.const.LANG_DASHBOARD}</h2>
	<div class="wrap">

		<table width="100%"  border="0" cellspacing="3" cellpadding="3">
			<tr>
				<td width="50%" valign="top">
		  
					<table width="100%"  border="0" cellspacing="3" cellpadding="3">
						<tr>
							<td width="22%">{$smarty.const.LANG_RUNNING}</td>
							<td width="18%">{$smarty.const.VERSION}</td>
						</tr>
						<tr>
							<td>{$smarty.const.LANG_LICENSE_KEY}</td>
							<td>{$smarty.const.LICENSEKEY}</td>
						</tr>
						<tr>
							<td>{$smarty.const.LANG_TOTAL_LISTINGS}</td>
							<td>{$total_listings}</td>
						</tr>
						<tr>
							<td>{$smarty.const.LANG_TOTAL_MEMBERS}</td>
							<td>{total_members}</td>
						</tr>
						<tr>
							<td>{$smarty.const.LANG_NEWSLETTER_SUBSCRIBERS}</td>
							<td><a href="users.php?newsletter=Y">{$subscribers}</a> - {$percentage}%</td>
						</tr>
						{if $pmon=="Y"}
						<tr>
							<td>Spam Private Messages</td>
							<td><a href="privatemessages.php?spam=Y">{$totalspam}</a></td>
						</tr>
						{/if}
					</table>
					
				<br />
					{if $smarty.session.admin_orders=="Y"}
					<table width="100%"  border="0" cellpadding="3" cellspacing="0" class="stats">
						<tr>
							<td colspan="2"><strong>{$smarty.const.LANG_INCOME_STATS} </strong></td>
						</tr>
						<tr>
							<td>{$smarty.const.LANG_THIS_MONTH}</td>
							<td>{$thismonth|format_money}</td>
						</tr>
						<tr>
							<td>{$smarty.const.LANG_LAST_MONTH}</td>
							<td>{$lastmonth|format_money}</td>
						</tr>
					</table>
					{/if}
				</td>
				<td width="58%" valign="top">
				
					{literal}
					<script language="JavaScript" type="text/javascript">
					<!-- // 
					function toggleModules(section)
					{
						thestyle=document.getElementById(section).style;
						if(section=='neworders')
						{
							document.getElementById('newordersl').style.display='block';
							document.getElementById('newlistingsl').style.display='none';
							document.getElementById('newusersl').style.display='none';
							document.getElementById('keys1').style.display='none';
							document.getElementById('neworders').className='active';
							document.getElementById('newlistings').className='none';
							document.getElementById('newusers').className='';
							document.getElementById('keys').className='';
						}
						else if(section=='newlistings')
						{
							document.getElementById('newordersl').style.display='none';
							document.getElementById('newlistingsl').style.display='block';
							document.getElementById('newusersl').style.display='none';
							document.getElementById('keys1').style.display='none';
							document.getElementById('neworders').className='';
							document.getElementById('newlistings').className='active';
							document.getElementById('newusers').className='';
							document.getElementById('keys').className='';
						}
						else if(section=='newusers')
						{
							document.getElementById('newordersl').style.display='none';
							document.getElementById('newlistingsl').style.display='none';
							document.getElementById('newusersl').style.display='block';
							document.getElementById('keys1').style.display='none';
							document.getElementById('neworders').className='';
							document.getElementById('newlistings').className='';
							document.getElementById('newusers').className='active';
							document.getElementById('keys').className='';
						}
						else if(section=='keys')
						{
							document.getElementById('newordersl').style.display='none';
							document.getElementById('newlistingsl').style.display='none';
							document.getElementById('newusersl').style.display='none';
							document.getElementById('keys1').style.display='block';
							document.getElementById('neworders').className='';
							document.getElementById('newlistings').className='';
							document.getElementById('newusers').className='';
							document.getElementById('keys').className='active';
						}
					}
					// -->
					</script>
					{/literal}
					
					<div align="right">
						<table width="350" border="0" cellpadding="3" cellspacing="0" class="modules">
							<tr>
								<td class="moduleslinks" align="left">
									<strong>
										<a href="javascript:void(0);" onClick="toggleModules('neworders')" id="neworders" class="active">{$smarty.const.LANG_NEW_ORDERS}</a> | 
										<a href="javascript:void(0);" onClick="toggleModules('newlistings')" id="newlistings" class="">{$smarty.const.LANG_NEW_LISTINGS}</a> | 
										<a href="javascript:void(0);" onClick="toggleModules('newusers')" id="newusers" class="">{$smarty.const.LANG_NEW_USERS}</a> | 
										<a href="javascript:void(0);" onClick="toggleModules('keys')" id="keys" class="">{$smarty.const.LANG_ACCESS_KEYS}</a>
									</strong>
								</td>
							</tr>
							<tr>
								<td align="left">
									<div id="newordersl" style="display:block;">{$neworders}</div>
									<div id="newlistingsl" style="display:none;">{$newlistings}</div>
									<div id="newusersl" style="display:none;">{$newusers}</div>
									<div id="keys1" style="display:none;">
										<ul>
											<li>Alt + <strong>D</strong> - Dashboard
												<ul>
													<li>Alt + <strong>H</strong> - Home</li>
													<li>Alt + <strong>F</strong> - Support Forums</li>
												</ul>
											</li>
											{if $smarty.session.admin_listings=="Y"}
											<li>Alt + <strong>L</strong> - Listings</li>
											{/if}
											{if $smarty.session.admin_orders=="Y"}
											<li>Alt + <strong>O</strong> - Orders</li>
											{/if}
											{if $smarty.session.admin_users=="Y"}
											<li>Alt + <strong>U</strong> - Users</li>
											{/if}
											{if $smarty.session.admin_category=="Y"}
											<li>Alt + <strong>C</strong> - Categories</li>
											{/if}
											{if $smarty.session.admin_payment=="Y"}
											<li>Alt + <strong>P</strong> - Payment</li>
											{/if}
											{if $smarty.session.admin_settings=="Y"}
											<li>Alt + <strong>S</strong> - Settings
												<ul>
													<li>Alt + <strong>M</strong> - Modules</li>
												</ul>
											</li>
											{/if}
										</ul>
									</div>
								</td>
							</tr>
						</table>
					</div>
				<br />
				
					<form name="listings" id="listings" method="get" action="listings.php">
						<div align="right">
							<table width="350"  border="0" cellpadding="3" cellspacing="0" class="modules">
								<tr>
									<td colspan="2" class="moduleslinks" align="left"><strong>{$smarty.const.LANG_QUICK_LISTING_SEARCH}</strong></td>
								</tr>
								<tr>
									<td align="left">{$smarty.const.LANG_LISTING_ID}</td>
									<td align="left"><input type="text" name="l_ID" /></td>
								</tr>
								<tr>
									<td align="left">{$smarty.const.LANG_SEARCH_TEXT}</td>
									<td align="left"><input type="text" name="searchtext" /></td>
								</tr>
								<tr>
									<td colspan="2">
										<div align="center">
											<input type="submit" name="Submit" value="Submit" />
										</div>
									</td>
								</tr>
							</table>
						</div>
					</form>
					
				<br />
				
					<form name="users" id="users" method="post" action="users.php">
						<div align="right">
							<table width="350"  border="0" cellpadding="3" cellspacing="0" class="modules">
								<tr>
									<td colspan="2" class="moduleslinks" align="left"><strong>Quick User Search</strong></td>
								</tr>
								<tr>
									<td align="left">{$smarty.const.LANG_USER_ID}</td>
									<td align="left"><input type="text" name="id" /></td>
								</tr>
								<tr>
									<td align="left">{$smarty.const.LANG_SEARCH_TEXT}</td>
									<td align="left"><input type="text" name="searchtext" /></td>
								</tr>
								<tr>
									<td colspan="2">
										<div align="center">
											<input type="submit" name="Submit" value="Submit" />
										</div>
									</td>
								</tr>
							</table>
						</div>
					</form>
					
				</td>
			</tr>
		</table>
	</div>
	
	{if $results==5}
	{literal}
	<script language="javascript" type="text/javascript">
		<!--
			function modify(id) {
				document.orders.id.value = id;
				document.orders.action.value = "modify";
				document.orders.submit();
			}
		// -->
	</script>
	{/literal}
	<form action="orders.php" method="post" name="orders">
	<input type="hidden" name="action" value="xxxxx" />
	<input type="hidden" name="id" value="xxxxx" />
	<h2>Pending Orders</h2>
	<div class="wrap">
		<table width="100%"  border="0" cellspacing="0" cellpadding="3">
			<tr>
				<th scope="col" width="5%">ID</th>
				<th scope="col">Customer</th>
				<th scope="col">Product</th>
				<th scope="col">Price</th>
				<th scope="col">Date</th>
				<th scope="col">Status</th>
				<th scope="col">Actions</th>
			</tr>
			{foreach from=$results item="entry"}
			<tr>
				<td class="{cycle values="row1,row2" advance=false}" width="5%">{$entry.oID}</td>
				<td class="{cycle values="row1,row2" advance=false}"><a href="users.php?view={$entry.oOwnerID}">{$entry.username}</a></td>
				<td class="{cycle values="row1,row2" advance=false}">{$entry.oProduct}</td>
				<td class="{cycle values="row1,row2" advance=false}">{$entry.total|format_money}</td>
				<td class="{cycle values="row1,row2" advance=false}">{$entry.oDate|date_format:$dateformat}</td>
				<td class="{cycle values="row1,row2" advance=false}">
						<span class="{if $entry.oStatus==1}active{elseif $entry.oStatus==2}inactive{elseif $entry.oStatus==3}pendingpayment{elseif $entry.oStatus==4}notcompleted{else}cancelled{/if}">
							{$entry.oStatusText}
						</span>
					</td>
				<td class="{cycle values="row1,row2" advance=true}"><input type="button" name="Button" value="{$smarty.const.LANG_ADMIN_MODIFY}" onClick="modify('{$entry.oID}')" /></td>
			</tr>
			{/foreach}
		</table>
	</div>
	</form>
	{/if}
	
	{if $news}
	<br />
	<h2>{$smarty.const.LANG_LATEST_NEWS}</h2>
	<div class="wrap">
	{$news}
	</div>
	{/if}                                                                                                                                                                                                                                                                                   administration/templates/default/images/                                                            0000755 0023433 0004734 00000000000 11036006572 020342  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/images/add.png                                                     0000644 0023433 0004734 00000001335 11051631570 021601  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  oIDAT8˥Ka[/Y()%X(olNۖskn.-h;8fEP"jïMGˈ}yພ羹$ I.tulu	AX:𼂒ZHh1DnZJOJB{Z?`2`S=N$ő=;a&jwqJG#<"N2h8޵`6xցn_+~Zto}`x%XЛ͈	hXѿƻ/}BJ_G&|Qr-6AރEL⬡\U3:WUh[C6+	6.f *K͸ܝFqou4܄?d|XҥMvD`*_[#A20liR|xq`4w=\uQ	m+G|%$5Թ5RO*YGMUOGqj4ְ(X&
s1c˭(LVfRdjQ	'-1ATA>U	j4,pV"4L$e@.ArBY a~my Y])Q8tNLܞt2"I	o=CSd)__AF (    IENDB`                                                                                                                                                                                                                                                                                                   administration/templates/default/images/check.gif                                                   0000644 0023433 0004734 00000001031 11051631570 022100  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDAT8˽.Ca{8bnSBT')E)VCJǥj ZՆg/hݿk n^k[ꝿ2P6c=XH*G`?xԅ{77VԨپ%VHyqNtn[J2^53X,S-OƜoDXx2Oܵ	r]L`}Z࿳TU(SiP/a:6͖,A`%S=[
b[a='LaW{xD[u9JBGqzfGN0os6"ffhZR".2H-[{(7h@`%E[IWu3e+ lGQ&' k|<R
H    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       administration/templates/default/images/check.png                                                   0000644 0023433 0004734 00000001031 11051631571 022120  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  IDAT8˽.Ca{8bnSBT')E)VCJǥj ZՆg/hݿk n^k[ꝿ2P6c=XH*G`?xԅ{77VԨپ%VHyqNtn[J2^53X,S-OƜoDXx2Oܵ	r]L`}Z࿳TU(SiP/a:6͖,A`%S=[
b[a='LaW{xD[u9JBGqzfGN0os6"ffhZR".2H-[{(7h@`%E[IWu3e+ lGQ&' k|<R
H    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       administration/templates/default/images/cross.gif                                                   0000644 0023433 0004734 00000001217 11051631572 022164  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   gAMA  7   tEXtSoftware Adobe ImageReadyqe<  !IDAT8˕NQɉϠVȑB[(&^M6M|Dްҙv:官J-%Nd LB>w_3:*WrlNC/-좕B'{ u_a46ҽbߡE%D47;ٻƩ;8ˣ}>6[ӕS@*Z	Qk>~͵hB\9uxZvYb	JCيٽ?BYvn&kft$,d9Zap\^Y7 QJF 9=Q4؜Io
SBps I) Fv(@yՎވc\@%%Z2h'@d(<|áaJuM@O⤁LGjd!X8Af	5J i
K->w62ƾWH}:mP]XB0QX=ib_g=!Fttclr    IENDB`                                                                                                                                                                                                                                                                                                                                                                                 administration/templates/default/images/cross.png                                                   0000644 0023433 0004734 00000001544 11051631573 022207  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR        h   	pHYs        gAMA  o3    cHRM  l  ro      n  A  1t  l-  IDATxb?p   b    bd```jbJ\vhs   bD1nuviEO1<?yj:Xs?q    D1
@ WV%)D9I. .z,TQ1{nw]iF	,y" 6=!!`b{%6 .F  s d
(D%j'/CqWum֯ SM17?5Ge?jP"p{"AO%VGAVnHR P ]MN́hlՋFm9<vAizJlLWãHBO /:%8VP`jfD:ItA+޺I[SEԥP@]w:hi03tRN
mr\+8xsXLDW7oN&)0u`6ㅈ"|͑P@>k TEA4^m^Y:- 2<D{ǭ(W7:JjJOipl.<UViiϗXhgK	;΄KցVR.`PiP 
dS    IENDB`                                                                                                                                                            administration/templates/default/images/logo.gif                                                    0000644 0023433 0004734 00000011342 11051631574 021775  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89aA      lHy;o[{OOO5\???Afф$N}___333ePqv{@d2Yoooܒ;a!Kz_~mJj֯(RDu{ӿ6\s1R@sjPos;]零a޽BkճРJs=q)JzmStEiJs'P~ټ:k                                             !  ,    A  NR#@*h)0EBڑ*7m1mG1!#X âD*\p10)I3 aË3j,ElI .Pɓ(u,#)cʜqeKk^ɳj6@$H6	ӧP9x3ю@dąFe
NΨpʕ4:,՛b a(aǐ#ʷ"02k֡GA?$1iIZPISh|x@B(h`"(  pX1C ́~[.ʆ )bBwE,	+(tQ8@NL4T(B Wx`<'`(~`d  ~ `@]7KpQD
&(bw .q^z90gf
%>@`@*@!bA~<AX 0Ef!Utcwy	 =h-vpXXA@ +<@ XfzgSC#~"pT&j%*B
܅0P#PĉN1zi Fh"R9?&IUuG߮<g^Jf)[ef1hD 8тi\CT!XUH
  kh#y,!bd4lTXe>E
QEEЂUQU(Fy
BÜ|_tD'70<EO,
*f1P
ޙ;`fi2\A[N[rj)"zrBGsl=8L	4ai\_ <~ׅȾ=HۑoD}HN6@5;A30!40zi	4cvo䖀ꬻоz=ߓ:*rx7nyR9byn3Ήo9@oyەA|Psr @( nkNt0\/G
H[h0P{^!`iks3@ѿ
B`;dxhR`(6@`āӒ c~	4  ؀	&@~X( ͉P,'-'Y ΀>*;pi`X4^Wn5b2!w`G?IΪ	IUy㙜.Qx? XB@`A0Dq6@r6(BTQ(CD jGrq/` `WSAGx ?	H9'4mHڏ;	>?

'!(t H/'́im,>Ib"&̌f3VF:9
Wi&F2"	^3>H4Q4)N8" ?FxAXs*?޴9^!툨H@.  @æd .a3MZ:qT 6⨓(Zr & ?-X:a[ī PCG%#)Kfu@坳 H1CpA^A|C@`" 8ZBbNe":TBl#YGúUs~J~- #A
R%8aE @~p-XU 3f`.0ǅ(~*{=ǻ-ďNjV#K	!|/ ` |AD 1%DkiPes"\]A·tl"KV`׳6P+@[+MuhN(P,?QbDLzT#̵Ixi#S&D	H"rDOkr"j&	ԏ0fJE@jR'uEA# `^F&%D:[O1 YuUst!0WFd#pP-D}=kAvӹ.x@X@,PѮ\]@ ڹmN3A8v#6՛rP.3O[My1^a )80!X DHR=0dj Ef;y-R?Cuܠl-y{µМX{a0qruџ6Z0#@BF%# L-+MT8z&sRj%.	-XrELJnQخtz muy0 |.D*TuaU gFor|$W^0G}sA8q&iYePS4I׹c3&N4Rm $y6ӆmN3-(6{E?WB~6kDv`@Ysm}A,!L@?E.k?0Xҧ>q5!ro&zzr{KGP0ȅzQ~r:U/GKTfB)3Ep<Z0.`rY6^W'\I'8]8\0Ag
4UQKdW2$,'o,X]ֳ(PY	3\{`%gǇ~85 HZ&9Chy_ׁPN`U#GADO_(Q @Jd0BO 7#'YT$& \80N0Ї5#ЌC9MhChčWDP37@@W\9]lh @{Np@ ӓI78?B3%i[ИI"\pqW9bS{rLD`SLW_4rAQ9"1tiXx13_Y5  h_S[fH<(l4˒fM- D	uB	%C-.0ʠQ`^1 qf5D"1 yQig%)!:,2.bH*.*pS*^ٝٝuT U: 3`""m |!CFPU@6ԸYYGߡ1@*R(y& ]@WjpN #P \B .J	JP # ,L^`ElHj*},.*JCV +z.^0[%*b:	W: hZZNU)\ 3b,2/2S@1}U!%p6 6@	Pɦ;p8y^a?Y228U,GAP `p^j?zPJ#`6*NP 7*\J%@:&p 6P8z0`\`*6*AJ@q .Jʫ馂0
L:SPVl9;P~JZWj0 WWjh*a7rhߑ'00q'hP { 6?zPڏ@<[P[ rD RJ}HZ,{pV^`NV0&a Z6ADqq*03j
8J0ŪJV^˞~,*d[Z0EqIѯ0	' "+d것@'B(h0˶00	p7@t{`+Na˷Np=; jU )!K$;&,kp4ʲK:4JK+kN *Ëʾ) ۙ7 j?*Rk+k˻ 	t^l\:,ʞB~+ۻJN$ Ij{hp \0+!{+|uKy%KGLN@@@LaJ൙ai0*J^
,QiL*¹Z\p7Pzƃ0Țqrl1 qP#`|
:࢝ɂ*ʬʮʰ˲?lʸL*  GPG<\|\  ̏7KP|؜ڼ? |)  "` M\ <]  ;                                                                                                                                                                                                                                                                                              administration/templates/default/images/menus.htm                                                   0000644 0023433 0004734 00000042221 11051631575 022210  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
    body {
	margin:0;
	padding:0;
	font: bold 11px/1.5em Verdana;
}

h2 {
	font: bold 14px Verdana, Arial, Helvetica, sans-serif;
	color: #000;
	margin: 0px;
	padding: 0px 0px 0px 15px;
}
 
/*- Menu Tabs--------------------------- */ 


    #tabs {
      float:left;
      width:100%;
      background:#BBD9EE;
      font-size:93%;
      line-height:normal;
      }
    #tabs ul {
	margin:0;
	padding:10px 10px 0 50px;
	list-style:none;
      }
    #tabs li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabs a {
      float:left;
      background:url("tableft.gif") no-repeat left top;
      margin:0;
      padding:0 0 0 4px;
      text-decoration:none;
      }
    #tabs a span {
      float:left;
      display:block;
      background:url("tabright.gif") no-repeat right top;
      padding:5px 15px 4px 6px;
      color:#666;
      }
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabs a span {float:none;}
    /* End IE5-Mac hack */
    #tabs a:hover span {
      color:#FF9834;
      }
    #tabs a:hover {
      background-position:0% -42px;
      }
    #tabs a:hover span {
      background-position:100% -42px;
      }


	  
/*- Menu Tabs B--------------------------- */

    #tabsB {
      float:left;
      width:100%;
      background:#F4F4F4;
      font-size:93%;
      line-height:normal;
      }
    #tabsB ul {
	margin:0;
	padding:10px 10px 0 50px;
	list-style:none;
      }
    #tabsB li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabsB a {
      float:left;
      background:url("tableftB.gif") no-repeat left top;
      margin:0;
      padding:0 0 0 4px;
      text-decoration:none;
      }
    #tabsB a span {
      float:left;
      display:block;
      background:url("tabrightB.gif") no-repeat right top;
      padding:5px 15px 4px 6px;
      color:#666;
      }
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsB a span {float:none;}
    /* End IE5-Mac hack */
    #tabsB a:hover span {
      color:#000;
      }
    #tabsB a:hover {
      background-position:0% -42px;
      }
    #tabsB a:hover span {
      background-position:100% -42px;
      }
	
	
	
/*- Menu Tabs C--------------------------- */

    #tabsC {
      float:left;
      width:100%;
      background:#EDF7E7;
      font-size:93%;
      line-height:normal;
      }
    #tabsC ul {
	margin:0;
	padding:10px 10px 0 50px;
	list-style:none;
      }
    #tabsC li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabsC a {
      float:left;
      background:url("tableftC.gif") no-repeat left top;
      margin:0;
      padding:0 0 0 4px;
      text-decoration:none;
      }
    #tabsC a span {
      float:left;
      display:block;
      background:url("tabrightC.gif") no-repeat right top;
      padding:5px 15px 4px 6px;
      color:#464E42;
      }
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsC a span {float:none;}
    /* End IE5-Mac hack */
    #tabsC a:hover span {
      color:#FFF;
      }
    #tabsC a:hover {
      background-position:0% -42px;
      }
    #tabsC a:hover span {
      background-position:100% -42px;
      }  
	
	
	
/*- Menu Tabs D--------------------------- */

    #tabsD {
      float:left;
      width:100%;
      background:#FCF3F8;
      font-size:93%;
      line-height:normal;
	  border-bottom:1px solid #F4B7D6;
      }
    #tabsD ul {
	margin:0;
	padding:10px 10px 0 50px;
	list-style:none;
      }
    #tabsD li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabsD a {
      float:left;
      background:url("tableftD.gif") no-repeat left top;
      margin:0;
      padding:0 0 0 4px;
      text-decoration:none;
      }
    #tabsD a span {
      float:left;
      display:block;
      background:url("tabrightD.gif") no-repeat right top;
      padding:5px 15px 4px 6px;
      color:#C7377D;
      }
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsD a span {float:none;}
    /* End IE5-Mac hack */
    #tabsD a:hover span {
      color:#C7377D;
      }
    #tabsD a:hover {
      background-position:0% -42px;
      }
    #tabsD a:hover span {
      background-position:100% -42px;
      }  
	
	
	
/*- Menu Tabs E--------------------------- */

    #tabsE {
      float:left;
      width:100%;
      background:#000;
      font-size:93%;
      line-height:normal;

      }
    #tabsE ul {
	margin:0;
	padding:10px 10px 0 50px;
	list-style:none;
      }
    #tabsE li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabsE a {
      float:left;
      background:url("tableftE.gif") no-repeat left top;
      margin:0;
      padding:0 0 0 4px;
      text-decoration:none;
      }
    #tabsE a span {
      float:left;
      display:block;
      background:url("tabrightE.gif") no-repeat right top;
      padding:5px 15px 4px 6px;
      color:#FFF;
      }
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsE a span {float:none;}
    /* End IE5-Mac hack */
    #tabsE a:hover span {
      color:#FFF;
      }
    #tabsE a:hover {
      background-position:0% -42px;
      }
    #tabsE a:hover span {
      background-position:100% -42px;
      }  
	
	
	
/*- Menu Tabs F--------------------------- */

    #tabsF {
      float:left;
      width:100%;
      background:#efefef;
      font-size:93%;
      line-height:normal;
	  border-bottom:1px solid #666;
      }
    #tabsF ul {
	margin:0;
	padding:10px 10px 0 50px;
	list-style:none;
      }
    #tabsF li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabsF a {
      float:left;
      background:url("tableftF.gif") no-repeat left top;
      margin:0;
      padding:0 0 0 4px;
      text-decoration:none;
      }
    #tabsF a span {
      float:left;
      display:block;
      background:url("tabrightF.gif") no-repeat right top;
      padding:5px 15px 4px 6px;
      color:#666;
      }
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsF a span {float:none;}
    /* End IE5-Mac hack */
    #tabsF a:hover span {
      color:#FFF;
      }
    #tabsF a:hover {
      background-position:0% -42px;
      }
    #tabsF a:hover span {
      background-position:100% -42px;
      }
	
	
	
/*- Menu Tabs G--------------------------- */

    #tabsG {
      float:left;
      width:100%;
      background:#666;
      font-size:93%;
      line-height:normal;
      }
    #tabsG ul {
	margin:0;
	padding:10px 10px 0 50px;
	list-style:none;
      }
    #tabsG li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabsG a {
      float:left;
      background:url("tableftG.gif") no-repeat left top;
      margin:0;
      padding:0 0 0 4px;
      text-decoration:none;
      }
    #tabsG a span {
      float:left;
      display:block;
      background:url("tabrightG.gif") no-repeat right top;
      padding:5px 15px 4px 6px;
      color:#FFF;
      }
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsG a span {float:none;}
    /* End IE5-Mac hack */
    #tabsG a:hover span {
      color:#FFF;
      }
    #tabsG a:hover {
      background-position:0% -42px;
      }
    #tabsG a:hover span {
      background-position:100% -42px;
      } 


/*- Menu Tabs H--------------------------- */

    #tabsH {
      float:left;
      width:100%;
      background:#000;
      font-size:93%;
      line-height:normal;
      }
    #tabsH ul {
	margin:0;
	padding:10px 10px 0 50px;
	list-style:none;
      }
    #tabsH li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabsH a {
      float:left;
      background:url("tableftH.gif") no-repeat left top;
      margin:0;
      padding:0 0 0 4px;
      text-decoration:none;
      }
    #tabsH a span {
      float:left;
      display:block;
      background:url("tabrightH.gif") no-repeat right top;
      padding:5px 15px 4px 6px;
      color:#FFF;
      }
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsH a span {float:none;}
    /* End IE5-Mac hack */
    #tabsH a:hover span {
      color:#FFF;
      }
    #tabsH a:hover {
      background-position:0% -42px;
      }
    #tabsH a:hover span {
      background-position:100% -42px;
      }


/*- Menu Tabs I--------------------------- */

    #tabsI {
      float:left;
      width:100%;
      background:#EFF4FA;
      font-size:93%;
      line-height:normal;
	  border-bottom:1px solid #DD740B;
      }
    #tabsI ul {
	margin:0;
	padding:10px 10px 0 50px;
	list-style:none;
      }
    #tabsI li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabsI a {
      float:left;
      background:url("tableftI.gif") no-repeat left top;
      margin:0;
      padding:0 0 0 5px;
      text-decoration:none;
      }
    #tabsI a span {
      float:left;
      display:block;
      background:url("tabrightI.gif") no-repeat right top;
      padding:5px 15px 4px 6px;
      color:#FFF;
      }
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsI a span {float:none;}
    /* End IE5-Mac hack */
    #tabsI a:hover span {
      color:#FFF;
      }
    #tabsI a:hover {
      background-position:0% -42px;
      }
    #tabsI a:hover span {
      background-position:100% -42px;
      }


/*- Menu Tabs J--------------------------- */

    #tabsJ {
      float:left;
      width:100%;
      background:#F4F4F4;
      font-size:93%;
      line-height:normal;
	  border-bottom:1px solid #24618E;
      }
    #tabsJ ul {
	margin:0;
	padding:10px 10px 0 50px;
	list-style:none;
      }
    #tabsJ li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabsJ a {
      float:left;
      background:url("tableftJ.gif") no-repeat left top;
      margin:0;
      padding:0 0 0 5px;
      text-decoration:none;
      }
    #tabsJ a span {
      float:left;
      display:block;
      background:url("tabrightJ.gif") no-repeat right top;
      padding:5px 15px 4px 6px;
      color:#24618E;
      }
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsJ a span {float:none;}
    /* End IE5-Mac hack */
    #tabsJ a:hover span {
      color:#FFF;
      }
    #tabsJ a:hover {
      background-position:0% -42px;
      }
    #tabsJ a:hover span {
      background-position:100% -42px;
      }


/*- Menu Tabs K--------------------------- */ 	

    #tabsK {
      float:left;
      width:100%;
      background:#E7E5E2;
      font-size:93%;
      line-height:normal;
	  border-bottom:1px solid #54545C;
      }
    #tabsK ul {
	margin:0;
	padding:10px 10px 0 50px;
	list-style:none;
      }
    #tabsK li {
      display:inline;
      margin:0;
      padding:0;
      }
    #tabsK a {
      float:left;
      background:url("tableftK.gif") no-repeat left top;
      margin:0;
      padding:0 0 0 4px;
      text-decoration:none;
      }
    #tabsK a span {
      float:left;
      display:block;
      background:url("tabrightK.gif") no-repeat right top;
      padding:5px 15px 4px 6px;
      color:#FFF;
      }
    /* Commented Backslash Hack hides rule from IE5-Mac \*/
    #tabsK a span {float:none;}
    /* End IE5-Mac hack */
    #tabsK a:hover span {
      color:#FFF;
	  background-position:100% -42px;
      }
    #tabsK a:hover {
      background-position:0% -42px;
      }
    #tabsK a:hover span {
      background-position:100% -42px;
	  }
</style>
</head>

<body>
<h2>Tab Menu</h2>
<div id="tabs">
  <ul>
    <li><a href="#" title="Link 1"><span>Link 1</span></a></li>
    <li><a href="#" title="Link 2"><span>Link 2</span></a></li>
    <li><a href="#" title="Link 3"><span>Link 3</span></a></li>
    <li><a href="#" title="Longer Link Text"><span>Longer Link Text</span></a></li>
    <li><a href="#" title="Link 5"><span>Link 5</span></a></li>
    <li><a href="#" title="Link 6"><span>Link 6</span></a></li>
	<li><a href="#" title="Link 7"><span>Link 7</span></a></li>
  </ul>
</div>
<br /><br />

<h2>Tab Menu B</h2>
<div id="tabsB">
  <ul>
    <li><a href="#" title="Link 1"><span>Link 1</span></a></li>
    <li><a href="#" title="Link 2"><span>Link 2</span></a></li>
    <li><a href="#" title="Link 3"><span>Link 3</span></a></li>
    <li><a href="#" title="Longer Link Text"><span>Longer Link Text</span></a></li>
    <li><a href="#" title="Link 5"><span>Link 5</span></a></li>
    <li><a href="#" title="Link 6"><span>Link 6</span></a></li>
	<li><a href="#" title="Link 7"><span>Link 7</span></a></li>
  </ul>
</div>
<br /><br />

<h2>Tab Menu C</h2>
<div id="tabsC">
  <ul>
    <li><a href="#" title="Link 1"><span>Link 1</span></a></li>
    <li><a href="#" title="Link 2"><span>Link 2</span></a></li>
    <li><a href="#" title="Link 3"><span>Link 3</span></a></li>
    <li><a href="#" title="Longer Link Text"><span>Longer Link Text</span></a></li>
    <li><a href="#" title="Link 5"><span>Link 5</span></a></li>
    <li><a href="#" title="Link 6"><span>Link 6</span></a></li>
	<li><a href="#" title="Link 7"><span>Link 7</span></a></li>
  </ul>
</div>
<br /><br />

<h2>Tab Menu D</h2>
<div id="tabsD">
  <ul>
    <li><a href="#" title="Link 1"><span>Link 1</span></a></li>
    <li><a href="#" title="Link 2"><span>Link 2</span></a></li>
    <li><a href="#" title="Link 3"><span>Link 3</span></a></li>
    <li><a href="#" title="Longer Link Text"><span>Longer Link Text</span></a></li>
    <li><a href="#" title="Link 5"><span>Link 5</span></a></li>
    <li><a href="#" title="Link 6"><span>Link 6</span></a></li>
	<li><a href="#" title="Link 7"><span>Link 7</span></a></li>
  </ul>
</div>
<br /><br />

<h2>Tab Menu E</h2>
<div id="tabsE">
  <ul>
    <li><a href="#" title="Link 1"><span>Link 1</span></a></li>
    <li><a href="#" title="Link 2"><span>Link 2</span></a></li>
    <li><a href="#" title="Link 3"><span>Link 3</span></a></li>
    <li><a href="#" title="Longer Link Text"><span>Longer Link Text</span></a></li>
    <li><a href="#" title="Link 5"><span>Link 5</span></a></li>
    <li><a href="#" title="Link 6"><span>Link 6</span></a></li>
	<li><a href="#" title="Link 7"><span>Link 7</span></a></li>
  </ul>
</div>
<br /><br />

<h2>Tab Menu F</h2>
<div id="tabsF">
  <ul>
    <li><a href="#" title="Link 1"><span>Link 1</span></a></li>
    <li><a href="#" title="Link 2"><span>Link 2</span></a></li>
    <li><a href="#" title="Link 3"><span>Link 3</span></a></li>
    <li><a href="#" title="Longer Link Text"><span>Longer Link Text</span></a></li>
    <li><a href="#" title="Link 5"><span>Link 5</span></a></li>
    <li><a href="#" title="Link 6"><span>Link 6</span></a></li>
	<li><a href="#" title="Link 7"><span>Link 7</span></a></li>
  </ul>
</div>
<br /><br />

<h2>Tab Menu G</h2>
<div id="tabsG">
  <ul>
    <li><a href="#" title="Link 1"><span>Link 1</span></a></li>
    <li><a href="#" title="Link 2"><span>Link 2</span></a></li>
    <li><a href="#" title="Link 3"><span>Link 3</span></a></li>
    <li><a href="#" title="Longer Link Text"><span>Longer Link Text</span></a></li>
    <li><a href="#" title="Link 5"><span>Link 5</span></a></li>
    <li><a href="#" title="Link 6"><span>Link 6</span></a></li>
	<li><a href="#" title="Link 7"><span>Link 7</span></a></li>
  </ul>
</div>
<br /><br />

<h2>Tab Menu H</h2>
<div id="tabsH">
  <ul>
    <li><a href="#" title="Link 1"><span>Link 1</span></a></li>
    <li><a href="#" title="Link 2"><span>Link 2</span></a></li>
    <li><a href="#" title="Link 3"><span>Link 3</span></a></li>
    <li><a href="#" title="Longer Link Text"><span>Longer Link Text</span></a></li>
    <li><a href="#" title="Link 5"><span>Link 5</span></a></li>
    <li><a href="#" title="Link 6"><span>Link 6</span></a></li>
	<li><a href="#" title="Link 7"><span>Link 7</span></a></li>
  </ul>
</div>
<br /><br />

<h2>Tab Menu I</h2>
<div id="tabsI">
  <ul>
    <li><a href="#" title="Link 1"><span>Link 1</span></a></li>
    <li><a href="#" title="Link 2"><span>Link 2</span></a></li>
    <li><a href="#" title="Link 3"><span>Link 3</span></a></li>
    <li><a href="#" title="Longer Link Text"><span>Longer Link Text</span></a></li>
    <li><a href="#" title="Link 5"><span>Link 5</span></a></li>
    <li><a href="#" title="Link 6"><span>Link 6</span></a></li>
	<li><a href="#" title="Link 7"><span>Link 7</span></a></li>
  </ul>
</div>
<br /><br />

<h2>Tab Menu J</h2>
<div id="tabsJ">
  <ul>
    <li><a href="#" title="Link 1"><span>Link 1</span></a></li>
    <li><a href="#" title="Link 2"><span>Link 2</span></a></li>
    <li><a href="#" title="Link 3"><span>Link 3</span></a></li>
    <li><a href="#" title="Longer Link Text"><span>Longer Link Text</span></a></li>
    <li><a href="#" title="Link 5"><span>Link 5</span></a></li>
    <li><a href="#" title="Link 6"><span>Link 6</span></a></li>
	<li><a href="#" title="Link 7"><span>Link 7</span></a></li>
  </ul>
</div>
<br /><br />

<h2>Tab Menu K</h2>
<div id="tabsK">
  <ul>
    <li><a href="#" title="Link 1"><span>Link 1</span></a></li>
    <li><a href="#" title="Link 2"><span>Link 2</span></a></li>
    <li><a href="#" title="Link 3"><span>Link 3</span></a></li>
    <li><a href="#" title="Longer Link Text"><span>Longer Link Text</span></a></li>
    <li><a href="#" title="Link 5"><span>Link 5</span></a></li>
    <li><a href="#" title="Link 6"><span>Link 6</span></a></li>
	<li><a href="#" title="Link 7"><span>Link 7</span></a></li>
  </ul>
</div>

</body>
</html>
                                                                                                                                                                                                                                                                                                                                                                               administration/templates/default/images/module_tabs_active.gif                                      0000644 0023433 0004734 00000000460 11051631575 024666  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89ad    `ۜu|kcq~ ky   !  ,    d   I8ͻ`(bhlp,tm|pH,Ȥrl:PtJZجvzxzn|Nn~ 	"  ;                                                                                                                                                                                                                administration/templates/default/images/module_tabs_bg.gif                                          0000644 0023433 0004734 00000000135 11051631576 024003  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a                         !     ,       
IEp ;                                                                                                                                                                                                                                                                                                                                                                                                                                   administration/templates/default/images/nav-sep.gif                                                 0000644 0023433 0004734 00000000225 11051631576 022406  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a    ~~}|}yxxwww{z{tttuuutsusrsrqr                                    !     ,       ` C)@`I ;                                                                                                                                                                                                                                                                                                                                                                           administration/templates/default/images/nav.gif                                                     0000644 0023433 0004734 00000000123 11051631577 021617  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a    srs{z{   !  ,       .0I+8s`(䷜h	 ;                                                                                                                                                                                                                                                                                                                                                                                                                                             administration/templates/default/images/nav.jpg                                                     0000644 0023433 0004734 00000000457 11051631600 021627  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                  JFIF  H H   C 		



           C                                                                                     S                                     ? Jp#J                                                                                                                                                                                                                    administration/templates/default/images/page_add.png                                                0000644 0023433 0004734 00000001777 11051631600 022601  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR        h   	pHYs        gAMA  o3    cHRM  l  ro      n  A  1t  l-  uIDATxb````:udN܊    bXz]{N:   bd```h__5}@$>۷    bXvUVe&L+YM#Okk|&jݛv2(++3ppp   41
0 @џIZ8f)	+x'C6,pڭ"!"B5	 M1FKGYc@ uϟi1'xj۵0ooǋbU {R
eU*(n)H.KKkSkC/P[@KP/p3H0h	Aoq#85MsNJEQ,I0aΔRuyRj" dܽ]uE/Va*vh4My2$Q g&`GaB4㆗gdjM~p]m6N!G7\eh8#իʲ$l_$c(?>bؐ"(Q`?h	(©%B¡=h)H
qD	yQny{P,m eYXE0D"L& pCihߏceue-Jb&;o.VndT%lu\.}Eo@r_lZGH1+J'dx~c?x	0z t!/lpEhje=s#4躎TL],3S6@:&
<R #jhLOq'K))
H)O C_ 0;q    IENDB` administration/templates/default/images/round_bl1.gif                                               0000644 0023433 0004734 00000000061 11051631601 022705  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a   !   ,       Db ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                               administration/templates/default/images/round_br1.gif                                               0000644 0023433 0004734 00000000061 11051631601 022713  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a   !   ,       [ ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                               administration/templates/default/images/round_tl1.gif                                               0000644 0023433 0004734 00000000061 11051631602 022730  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a   !   ,       oB ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                               administration/templates/default/images/round_tr1.gif                                               0000644 0023433 0004734 00000000061 11051631603 022737  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a   !   ,       q@ ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                               administration/templates/default/images/tableft.gif                                                 0000644 0023433 0004734 00000000116 11051631603 022444  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T     !   ,     T  sڋ~F |H扦ʶg ;                                                                                                                                                                                                                                                                                                                                                                                                                                                  administration/templates/default/images/tableftB.gif                                                0000644 0023433 0004734 00000000602 11051631604 022547  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T " ޾⺺𿿿                                                                                       !  " ,     T  @am4r<,BD1.`,&>/X.ӹ]7}m~ v`uw]zB!"	Zc		

Ŭ˥A ;                                                                                                                              administration/templates/default/images/tableftC.gif                                                0000644 0023433 0004734 00000001162 11051631605 022553  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T Q oߟˇrKhnޞܛ{VzTڙۚؗcftMxSόԒl_}WҏwQ͉\Ѝ~YяtNbޞݝtK̈ՓӐՓxQZ΋٘וwP֔זeюe֔k]͊ӑ]̉ΊޟϊϋΊiޞlЍܜo٘_ѡ̈ߟ`uPkuPrL}V͉lٗ                                                                                                                                          !  Q ,     T  πQQE>G9  A

P)C)*-11,,%%##$$55//@:((;484<N7"F  QBO?22J=
$ࠠ06X$(@3NdظaÉM*D@A	 `BV,@3ɃB0	bϟ@

4 ;                                                                                                                                                                                                                                                                                                                                                                                                              administration/templates/default/images/tableftD.gif                                                0000644 0023433 0004734 00000001232 11051631605 022552  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T B                                                                                                                                                                                        !  B ,     T  B B    1   + 0 3       
   # = 	 /낇A@@   % 7 A ( !`E )2 N $ (tX	@K -b@ l'@8
Q .@ |H*XT
W @A   ;                                                                                                                                                                                                                                                                                                                                                                      administration/templates/default/images/tableftE.gif                                                0000644 0023433 0004734 00000002134 11051631606 022556  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T   	  		  ))!"    q  n    }&&w~F  N  2Y\t=  -  yB  a  qi**U  |  &&j#u,+      7    d!!      g!"IQ

    l           J(  $$  ([#"  g   >  7     b#$ y('c
$    "" T   iK  $#     0*R                                                                                                                                                                                                                                                                                                                                                                                    !     ,     T   TbГ'.((t!C#C3KXAʈ@iI9eD3>.-X3Á8qP'\IS/t0XaP"P V]A(QD&y@	FcA>#H08A H`bƎY$H!!B	уb&𡵁hm@mrC"D CM62([BE-Pfw.!9@ȎF.ӡ=-UAЉnLO `>   4: ;                                                                                                                                                                                                                                                                                                                                                                                                                                    administration/templates/default/images/tableftF.gif                                                0000644 0023433 0004734 00000000571 11051631606 022562  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T , fffn喺웿펲wzzzvwxwlllmmm                                                         !  , ,     T  @KjTYu:T
 X	8
P6Ab-8Bh$8<^}|B,$""
A ;                                                                                                                                       administration/templates/default/images/tableftG.gif                                                0000644 0023433 0004734 00000000360 11051631607 022560  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T  kݏp؂yvڋ܆ޒrt}{m׉ލᖾ                        !   ,     T  m%
#p	 rpNn_o(,q@4(+Ac:(X@Lx@(b= A$~! ;                                                                                                                                                                                                                                                                                administration/templates/default/images/tableftH.gif                                                0000644 0023433 0004734 00000000553 11051631610 022557  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T # &%dku/29.16)+: 2 "! V[nPSf]bvKN_"#03:<?P,.="+!')6$%7pv/27fm}dkq038ahrbiogm}                                                                                    !  # ,     T  ѧf3 8O':X@$x(b=8\>ϧ{}# "  ýA ;                                                                                                                                                     administration/templates/default/images/tableftI.gif                                                0000644 0023433 0004734 00000000642 11051631610 022557  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T 2 p)`XK>w싳y0~턮텯4At뎵6|퉱:IG2SC,h`MVZbQU^                                       !  2 ,     T  @P V2AdJ2KՉe\c^fczi#1b..1e?cc cB2B#(#)"*(-/1*
	  8/ ;                                                                                              administration/templates/default/images/tableftJ.gif                                                0000644 0023433 0004734 00000001232 11051631611 022555  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T A $a=eVT'd<d	=d&d&c%c&eT ]Fz=gDnMw=g'dIq'f
?j%eWYNy$d
?gK>f	>fDk)d%dHrY&e                                                                                                                                                                                          !  A ,     T  A<A A%  18:>)((@ʠˢϓҚ֚٣ړ)ͧΊ4/A7$A5'6-	
c0@
h " 	Hh ~ C0((bI%O03
1b @ش=^0Q҂M	<jjUKZ]j Nb-zk   ;                                                                                                                                                                                                                                                                                                                                                                      administration/templates/default/images/tableftK.gif                                                0000644 0023433 0004734 00000001224 11051631612 022560  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T Q yy{``juotnhhpvp}kks~ppxz}t[[gggoUUa|snnv{rvjjrxvqwy\\hwlltZZfddleemswx~uvu{]]immuwqupvrvwcck|{xrxw}aaiSS_XXdYYeRR^WWcVVb~tkOOYUU_SS[vmwwyTT`zz|TT\PP\VV`|qk|riOOWLLXRR\ulxxz                                                                                                                                          !  Q ,     T  QQ?OQCK?J		++11&&00//

3344((6=="""7 N@QBM8GLH;@A;AI저x(̑BCH!=ؘBǏkᢤ(GXIb	b"@S@
@-<QrhE%NH=!(	ׯ`z ;                                                                                                                                                                                                                                                                                                                                                                            administration/templates/default/images/tabright.gif                                                0000644 0023433 0004734 00000000630 11051631613 022631  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T  !   ,     T  ցݼ扦K3ZL׶'J
kx*"L	2Ҫj.ڮrlNvw:n?O('GXwh(6Iify)٩	j%:zhj++I[[y9 ,<L\l|=]m}=.n1n~~?O_o,oߎ	,0=j
:<0@+h1<i;18"Kz#i25*[>c222ki3' :k'ЖB,j$Ҥ!2iƨR+R*ֆZ& ذ9j/m-zrnP  ;                                                                                                        administration/templates/default/images/tabrightB.gif                                               0000644 0023433 0004734 00000002101 11051631613 022726  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T ! ݷ                                                                                          !  ! ,     T  pH,Ȥrl:(Tq@vzxL.s\|N~!n!ůٯ
H*\ȰÇ#(ŋ3jHqǏ C|ɓ(S\ɲ˗0cʜIfɎ"sɓ @
sѣH'HʴiТNJΟիXjگ*ׯ`Êuٳh+۷Kvu+w߿YL;`Ǝ#,\ʖ3Ŭ3YC,4VҦSC=֮c˃-]۸z7oվ~ȓ+_μУKN}:	ËOӫ_@XOQth&6F(.P !v ($h(p0(4h8</fDiH&L6PF)TA d\v`)dih!p)tix|駛砄j衈h6裐BVj饘f馜v駠*ꨤRhꪒ꫰yjj ު뮑k&&6F&VkNvfކ+Z
I^{^e춫,+k^K֋*:JLZjfzaL\2-,3A  ;                                                                                                                                                                                                                                                                                                                                                                                                                                                               administration/templates/default/images/tabrightC.gif                                               0000644 0023433 0004734 00000007212 11051631614 022740  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T n ߟoˇrKޞcۚnfڙ͉tMzT̈h{VԒόЍؗюlxSݝӑ~Yܛ]uPZ\}WwQҏixQ٘Փk_eяwPtNΊ٘Փ֔ܜזۜוϋϋl̉tKh΋`}V]_beוޞ֔Ӑ͊ߟ`uPlrLnזЍΊߞޟߞ̈ݜό֕͊Ԓn`kltMozSkn~ZzQbrMnkl͉ޞϊѰٗ                                                   !  n ,     T    n lnŏʅƨFQOP PFm3*\ȰÇ#JHŋpAA7vȐ M,rd˗,G)&˘0Oܩgʜ+OR)4hT)ӤK6]:SPR͊iժJfXeϊٵQn.nd!C^~߾5NX'&lXŖ+Ƭ9fȏw`ŦAƀװc˞M۸sͻnH@\xqǑ^qʣ/N=yأC~{vk}{7$ ^=ﾽ|| |~ _
ІL@B^Z!vb8 X*nhb$1҈0V10D<d?D)$BdOFM&9V&QrɥWczCnPC&nm'oY'vs|"
蝁z2nPv)jʩ%|Zjjj.ꪧ*
k
*멼+W@,.BlR^+:ֆ;↋m[/ʋΛ/ \Lp7#\pWpD)q {̱%"+<r0<s(L9s@MA
F4I+m4ECT7-UG\kmR{b;]6\lKDn6q=7w-t7x-xޅ.xu37nPHNW9gs{~y觷:밯z覻.{nPC:Р;޻<_<'OGo<W?|_?s}kįE/_G	,`:p(~о"A GH(L
W0!p45ar?aDЈA< DDH(6IA   F11caǸ3Qht#G3j8ޑ8@1<G9
_$'IJZ̤&7Nz$#)RL*CIU򕰌,[)Z򖸤$-s^R0IL1Lf-f:n4IPf5MnZ8qf:+t<Izv̧>~3@JЂ3MBO28*ъZF7*Ќr GCJҒӤ(M)7݀ta	<@Kp ./@K.T6LkR.A2O[RMPmjTԧ5e*LԢԪJjPJS~uaVZVX=j
 el-5	?]kךXw-kX.,^&6ݬa;;Y˂mh'K-n*Imd&ammo[v.rkv%nn{\R7m..qk\ZW荮s\_0	V
o|o``/[`	
v
/)\pLbO) "M X0@d;,d"+8ֱ,?Are(_Yv򔻜d(3YW"DA g:u3\9~38ςsm?+ь.mhB/n@@N{ӠCMRkԧF9=Uծ.5cj7 @uk @b:׿a(8qmlj'ػfki_6mkZnmsۺmη~ NnA#a;q//nq@gp\,)^G<9]N|,[.A_΋NrIw	NgaX^g]׺ճS_znvd7{wn;~v=\߻~w}|60%7~w#_W<5xG>W˷=_oz֏n@<{=>~w'W>|7ß~S>|sw ׽/? H 	hЁ<#'؁(X"$&+2؂!&,*@xȃ7)XhDFH?E8@h<Z< ]^`8Z؅bXgH`hjni؆\[q(lr8yXw n 8 ^Px؈舆88X؈n 0xH((h#Ȋx芥HX؋8hh(H#0 pՈ `ܸh؍HX㘍ȎhxȎ߸h䈏#*
 Hy		YI	y	y$-ِ"	Yɒ*i*5n,iG+J,GHɔFQɔP)SUYIVٔXɕRJٔd9W`IaeymPn xzKٗ|ٗ闇9	瘌٘阏)in\0 J0 8d dY9y\J陠)ə)YyɚɛiǉJ 9 )9ΙۙYn虞깞ٞ9Yyyٟ Zz: ڠ

:Zzڡڠ":  ;                                                                                                                                                                                                                                                                                                                                                                                      administration/templates/default/images/tabrightD.gif                                               0000644 0023433 0004734 00000005713 11051631615 022746  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T w                         !  w ,     T  wwb`kkbPbk``ƺvǧ`ΰvDwP	W1.*\]+dHE!JȱGyFXID>Hˊ)5ISJ"ɳϟ>ʄѣ=FLӧ<$xgիX^5µׯ`ZYʒ)ZӪm۱	.YKZx;%L%N⚝bǇ˅Le{sd͌=.yӞK/2)Q 	Hj~|[v;NőD7У'_سWw:#Q^e葏Rz׷?~/lTR~'`t_:A$*XF(_fvءUl(zh FΉ,8aA8B48c+iX`LFdMFdÕXf\ve;1^i_9&l首`dw`x|f`AFjj 䡌6hJ'Vj饘f)@Gg@0Ʀj*马ꪥ~@`뭸뮼ak챾+,6묮;l:TkfFð܆+-覫nN{Ǻn˄k/Bpڛﷴql'|Gm(,/GT̰GDL	20r`8<rFDm}L7t?+F:
TmXgY E
dmv_l6^-6oםuRH R<a\7߀{ 7G.yJ(D}OSn9杇.W~wwak޺O,n98'7+<[d? /w<cƋg_<ݳϾc@>Ջ7@{ ,   H
Zׄ&ԡ	58A$ =Ѕ/<CwJp ;A&:JlXX̢E-!I2[bǈ6YTXE8Q^ c@;yLB1 8d$'IJNBGK2(-	JGjTd)UQ< X,NI -@ĥ+uK_D0M\&#@jZج)Ad6Im&q:'Iv^ӜB:@z!0$n@O}$#AP'ܐZͨF7:JA HGJҒ(MJWҖ0ep@Ӛ8ͩNwӞ@PJT0HMRԦ:PTJժZXEj::ծz`XJֲhMZVp\J׺xͫ^׾k:n@Mb:d'KY¦Cͬf7zhGKҚl:>ֺlgKͭnw[֦pKMr:n:(@ZͮvzxK^Mz|KEo:N LN`C'L
[ΰ7{ p:B@(NW0gLc8αw@L"Hq:L&;PL*[Xβe&`L2hN6ps:*@:xγ>πMh:NF;ѐ'MJ[ҘFt:HN{ӠGMRԨNWjN#gMZָεw^u:T@bNf;ЎMmbcζn{Mrv:,vMzηov NO;x:Z@[ϸ7{ GNrc(OW0gN8Gy:\@ЇNHOҗtPԧN[XϺַ{`z:V@hOpNwxϻO{:$;񐏼'O[ϼ7yƧCGOқOWֻ}:f@ϽwO|ڧ#O;ЏO[G~:b{OO~#OϿ Xx
؀8H؁ "8$X&x( ,؂.0284X6x8(:<Ȃ@B8DXFxHJL؄NP ;                                                     administration/templates/default/images/tabrightE.gif                                               0000644 0023433 0004734 00000012077 11051631616 022751  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T    	      n      q  q  7y      F#|~jw2tNB-U  \a=YlJg          d(Q                                                                        (R
Kgcb  )A9UaYS ,P\             ))		!"&&u,+}&&i**I!!$$

!"$#b#$$i7>""y('*0T  [#"                                                                                                                                                                                                                                          !   ,     T   H*\ȰÇ#JK*`hqF Arq#IF^LyQHCT	bF)kDiǙ/RHL4%ӥN6}:*ԦWVEz5+խ_N*UbX۷mߺv.\w{wo_zWῄ/aFOx yreɔ1gf̞/yhӗ9OFMtԮYVzڟG~)փP~;xqÏG^|9qϗ#>xrգ7wn}{v׷c/9tPz`dƈ{#AY}ǟ^|1_G߁񗠃X`~.8f(a ' [8**Xc/"0ب.":
Id3"89$E&dMV%>'d:DG8!&i:e'j9g|nv'wxthe矋jf&'Gi)?zH Z??*Ɗ*4!JZ*++*&[kBlOK4+=++jK.һ{no/=h S1s,w|c1,\r-L2L/2 D]F' ʹICSK=uU/mY_M\+]J,1MtEm hvoͶgn}{Mnw~7ݷw.ٕD@ qEW !oe>~:gnz먻nzӞ{롗y춫{?|.:Qy0 KyWS_`cЇo>>ï>/>^ =&h  X=.P{ 	>PzD`xrz
zЁԞ%`EJ"AxD$$AءyЈE$C$.qH|C&щ@"8#nQJ"{(R1	=#D%>cX ސ8 @LAq}4)HD.2<8"<:$&IB2%GIV2$+QIIKg+M v	L_4f1)Lb"\f0h
\&4Kc7h"ș/9n2g3ݹu&n"4b @	~3@PeCzPFXh@Pс(HG:ш:hF*"Kc*Q2T% !
KXAiRzԠ=UPZ"6uPS*UR5HUU5R+ZVkV%"SOp?  
UXEa6Q@+6g-VEb1:v,g'{_@E(׸mr+\\.׸֕s]"Ņ.x[b7owry}KXLW	J0 ,/~_Xo|`n0`^x!	s8
;aX&)\_*4Bq  8Ld"7αL!7
@@,!/>V2Ld+oXv2e-c:>d679O	zs\e@3c@A>\hC3:т>3K+Zϗ,iJ[џ4iTyu'd!a>y]&kd/Am? Y(-m3;lnG{>nmnc[u&b~ C೴\(x~07Hx%s|;S\^o|.9E>[9r0! 9Hv>zґ~t@wzϗ> 9  tC=C/:ջKJ:ֵv?^o;>w]Y!C{Nt~ /aիnx?W<%y]z=xkG}?[E0>f@{}m/[]3:{3_`|ɏ~O|~߽>3jX?f ٯ'G(W
~׀82@ 'h20؁!2P (+$8)1-5(.6(3ȃ7@({PPHGKhMIOQ(FXLWZ8\P؅`^V80
PlHlpo(@uxhqy؆|8臀z8xxvX؇XjH XHhȉ艟8Hx؉؊8  ؋8XxȘ،ɸXxؘ @؍ญ8X긎똎ȎH؎8ȏ8H
"	9yIy	)"!)&9(I)I%ɒ%4Y496Y8ɓ:7@9I6i?9@ٓJٔ>K)OPVyXZ\ٕ^`b9dYU	-lɖjٖmpr9u	oyq9nɗt-}闂		h9Yyٙh9Yyٚ)h9yٛ9Yihʹٜ9Yyؙک!9Yy虞깞ٞٝ0Yyٟ :ٝp
ڠ:Zzڝڡ ":$Z&z(*	/2*0:3Z68;j5ڣ74*:J/ CJHZJjKjG.
5PVZv@WjY\^ڥ^Zb
[*ajWg_:dX*q
lv pc
.ZZ)p
j:j
Zڨ
Zʪ(JʪzꪼJz	Țzڬڬ
*+Ԋ
׺*ڭZj&ʮxЮJjz뚯ʯڮk:
 kƺ7u[K{{˱+!K۱˲+&[uk0#<˳zг@@CKE;B{;C˴AN۳QkE;KPkH9.`^a;df{iKce{bh+.q+v;xKyKu˷9{;[{۸+$psK;[k+˺+k*˻tлKū{˼ۻk;kȫ;[{蛾껾۾	 [{ۿ <L[	
,%
, #\
6.r/1<4,6\6l:39/?,7<l0ID<rj;Z\^`b<d\f|hY
 npr<t\v|xz|~ƭ0Ȅ\Ȇ|ȈȊȌȎȐɒ<Ƀ|
ɚɜɞɠʢ<ʤ\ʦ|ʨɢ
ʮʰ˲<˴\˶|˸˺˼˭<\|Ȝʼ |؜ڼ<\l<\|l  -] }Mm= -}m $]&}(*,=.2=4]6]0}:<1>B=> ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                 administration/templates/default/images/tabrightF.gif                                               0000644 0023433 0004734 00000004057 11051631616 022751  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T b fff舫狭wn钶ꎱwnfK\pyyywwwMsz껻nlmmnvvvǛlll`q                                                                                       !  b ,     T  ^HbaZWD[;G\Ub]IIb 
HU(\Ç.HCdq߁ CIɓ(S\ɲKD8mySN<s 4'H,)ѡH2uPMJEJ@D@زhɞE6YږA.in]ze^m EF`LY2˓-_֌rg+M3НQL5jզ7E= NpǋW!yУX^ܹr͙Kn;u_׾= &L˟O>a~~(~0 x?2X>(JXbhrj((Nb.j2ap<;@XDL`$I%G6dS>9[JY`2dihj>)g	'x)ng~ j衈&袌6裐F*餔:hf馜vJ饞*ꨤ
jꪇ꫰Zj뭖뮼Jkk첅&:JKZj
zK）Kｹ⫯opL0?4G,JX"gw ,$l'A$C02Ls.|s;̳9s:@=sHmKTL'0SWZoMXw^eugu\6h{X?%`	x>߀Nx,nx?.9+SO8k碃>HD4.>n/|?C̃7;?Sk}؃=W/Ͻsꬋ!|?~ D @2`%8A π̠%:Ѓ\`CV0a؃p8amxC2aHG &:PE&NX(E+J5X"HF'z1`L6pHG9wG<摏$HHBL"F:\$%	JZҒ%7GfFIRL*QɂVre,]JY򖪤.u0Ib3D1Lf&S͌4(*nrs&8YqDg\Nvf<˩yr'=YOrSh@!HAP
MC:ш.mF5*QZEQ*tiII:ҏzt.5iBQJS# 8ͩNwӞ@PJԢHMԦ:P*R*ժZX*Uծz;*XJֲ&UfMZתT1p%+ZJ׺>uvͫ^׽9+`Wp5,bV2`u,d'URe,f7TrG,hG+Tђ=5-jWVֺ֨}-ic+[Ҷ-n1@  ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 administration/templates/default/images/tabrightG.gif                                               0000644 0023433 0004734 00000001653 11051631617 022752  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T  k׆}pؖ┽ᒻymr؏݄݋߈t{ۍv&&&                     !   ,     T  `%dihlp,WXx|pH,7rl:Zmz`7L.Գzަxw,۟~?9~{rkdso_xQD?:ŐȌˈ΄р|zv݊5
H*\ȰÇ#aŋ3jȱǏ CId)R\ɲ˗0cʜI͛8s ϟ@
JѣH*]ʴi)JJիXjʵׯ`FٳhӪ]˶۷pʝKn)˷߿LÈ"ǐ#KL˘3k̹s)BMӨS^ͺװcҠ۸sͻNx)	+_μУKNس'2ËOӫ_Ͼ})˟OϿ h&6F(VXdv ($h(0(4h8<)DiH&L6PFTiXf\v`)dY
lp)tix矀*蠄j衈&袌6'F*餔Vji^馜vi*ꨤ
j꫰>A֚j+믈
)lzlֺlкlԖ:m(~:kܪzmNm2:nzn
n＋N ;                                                                                     administration/templates/default/images/tabrightH.gif                                               0000644 0023433 0004734 00000003354 11051631620 022745  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T : &%05;$16<dku,.=)+: 2$%7<?P')6"+]bvV[nPSfKN_/29pv% &"gm}/27#'149$.16fm}! 03:038# !"27=.37/4:25:(!'/48#.39ou )dkqeltahrbiodjvelv               !  : ,     T  pH,Ȥrl:Шh6Ry84紺vwyy]cyz~xdz{t_:,,##v#n#+@tgAm&o[Ak
X.za"6%;=+b|iL4ٜcy4hR(M10O
AP˪ժXN*+հbn-kV,YfѦ};xV˗/
zALD^}\Έf WpcÏ#K<rc͔9W\dЋ+_6	cˆM!J]uOnۦe'D̋G@'஀{/~{˯>|(ހg }Hl LhARxaV!ja'x}@a4&-p@n y!id<$CpI.dOLFdXRYXFEl[yg.WlI^If'~$<5裿 ',
饍F餖bVʨ)܅**J#*kj

*lk:lv뱿,:-[&Z-ɖk覫Knk ol7G,@Llqw\,r l,Zr0Or43<s8|s<s@sD?rH;tLtP'|tT;uX|u\'tEvb#\l}pn׽rmwxǭm=݂67j~2H Wn9_o9柇.坏y[XnN{Ʒ:?<'oTogw/_/o  HLou'H
Z̠7z aW(L
W0gHpuȡw@H"HLbWw&:PH*ZX̢.6quH2hL6pcW:x̣> IBquH"F:򑐌$'IJZd"WNz(GIRL*WVvru2,gIZ̥.w9KX0I^ꠘL2L_2Ќ4iZe5nvs8	q,':Z)z̧8~f4*Ђ.M(1І6)ъh0юN(HCjёT&=CSR	})L   ;                                                                                                                                                                                                                                                                                    administration/templates/default/images/tabrightI.gif                                               0000644 0023433 0004734 00000002560 11051631620 022744  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T = p)K>G`C6t4,w쉱0Ay:2~|IS\'&qe	no
:~ZMkUg	#1xQk	g*sm%X      !  = ,     T  @pH,Ȥrl:hG~جvz5%.hpV;|N~3
T++1	.'=:!4!0ƈ!#͵Ӣ	 
H*\ȰÇ	QHŋ3jȱǏ CI(S\ɲ˗0cʜI͛Lɳ@mB@ѣH*]ʴӧPJJ4Xjʵׯ`ÊKٳh@s۷pʝKݻx4LÈ+^̸ǐ1@@˘3k̹ϠCMz4S^ͺװc˞M۸!@Nȓ+_<УKNֳkΝ;Ë;37ΕO<K'H)9IHɇYyʉHA,0(4h8樣UP )DiH&JPPF)Nb*\v`)dih&5 & tix|矀	&&袌6ꨣ܀BVj饘fj9L駠* @騨 pꪰ*+$ꬸj믎k&6F+jfv+kz+k* ,l'7zWlgw ,(,0,4l<@-DmH'PG-TWmXg\wdmhlp-Zx|߀.n7G.Wng砇.褗n騧ꬷ
n/J'o|G/|goœc}ǯo߯ >3 =2s '=	Rɳ 7(<rU  ;                                                                                                                                                administration/templates/default/images/tabrightJ.gif                                               0000644 0023433 0004734 00000003747 11051631621 022756  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T I $a&e=e&d%c&c ]T
?gIq	=d'dY'dMwBmDn<dNy%d'fW$dعVT=g%eFz)dR%cɱ>f
?jHrS}#aK&e	>f                                                                                                                                                                  !  I ,     T  --=II., 70	'  пƿ'2,0,I%'.-
HA=*lg#j(E/j(/#Ǐ yIR\ɲ˗0cʜI͛8sQOϟ@
gH*]ʴӧPJJիXبׯ`ÊKٳhӪ]˶mIHh w\k޻u=<8`_Ŏ#2ɑc4HӧUFzujZ6kرq۾{ܳuMxONҠУKNسkν{Oӫ_Ͼ/ R/C#Fd@a~&~}X~!h
:HGa^_Ja!`~#(G1hE5ިC9cA-($FAi>=;I.d9M>)%8QNi%5U^DEnI]~)&-Y)ef:fJɦn)dryg)蟃J衆Z袈26*飓F&t駠*ꨤjꩨꪬ '5p 뮼+kR@@Z k.lVKfknm-k薛
C$.ޫop#@"wکPIĪ,0,4l8LA
+CDtL#O7TGm5XWZw=t3P I@f}vlprMsmwހ.I  3x?.G^gw盃.礇^:@).߮{[{oȿ|
H$!BW/_}c}o藟~4.oӟ HpL {%a 'H
Z̠7z|R@	L&D	SP0la_(3̡uxCp@a9P	u L&:aОH*ZX~@$<`H2hL6A"09֑v#x>я| G@r$d"F*ґ$'EX̤&7Nz(GIRR:JV|,]IXr%.gy^җ0I`L&2U:8Ќ4IjZ̦6nz@B Nr<:ts'<zӞħ>|Ӝ8YǀMBІ:D'Jъ2ȨF7юz HGJҒ(Ei0LgJӖ8ͩNwQ@P9HMjL1Ԧ:ZJժVDͪVoխz'*XJ֎hYVp[JקuuͫSY׾&~lPW8w ;                         administration/templates/default/images/tabrightK.gif                                               0000644 0023433 0004734 00000005267 11051631621 022756  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a T Q yy{``jUTbvpuoynnvhhpppx~|aai}tggorvwcckkksupvvvqw]]izmmu{rvu{\\h~ujjrswxwqddlllt}x{xw}eemZZf|sw[[gQP^xrPO]~smSR`ON\tn~tk}sjWVdYXfVUcUUaVVbYYeWWc|riulvmUU_SS_YYcVV`WWaON^|qk                                                                                                                                          !  Q ,     T  >>GG=H=Q==IH>ǹ=GI8;;PQ; 'A"d8CȋrǏ CIɓ(S\ɲ(bʜI͛8sɳϟ@ʌbѣH*]ʴӧPJJ(5jʵׯ`ÊKٳhj۷pʝKݻx˷(1LÈ+^̸ǐ#˘3k̹ϠCM(#R^ͺװc˞M۸sNȓ+_μ(2KNسkνKӫ_Ͼ˟O(
Ͽ (h&_4F(Vhfv`-($h(,0(bh8<@)Dic*$L6PF)TViXfdt`)dihle	)tix|矀*g,j衈&袌6裐F*餔Vjhd馜v駠*ꨤjꩨi(꫰*무j뭸뮼j+k&6F+lTkfv+km+knB+D+,0<02K0[q	k1g0!s|Q-̲1\7L3s=2@C4# DD-KmU[M5Ro}Qua]6gmilcvlmvDa|O{}Sm8#77;nyc>9C複>zN꫗κ騿.z쨧N^:Q`~<$|<#C|o=cO}/~='oQ o  L82' R̠+z GH(L!OPQЁ POux֐>a( ?4XD"Jo(X̢.z`H2W|6pH:x̣(K %$"ER|#IFN +YKv F9QB)QJTҔ|%)]Y򕵄-qK[2e0YIKQR	<&2a9ere,LgL&6YgjӚ&8yq~3g@"4!'<لwƓl<N~Ӟ=}AIP	BP}F4M`' (GQ4)J;ҕT,5iLaRԦ-FgS2NoR	Q B 8N]*TBuP*SUFuUWVdUXն5iUY֯2!
0ȫ^׾`KM^0:d'KZͬf7:6
"hGKҚMjWֺhЁͭnwpK6
Hr:ЍtKZͮrzxMz|KQ~ LN8'L
[ΰ7{QxGL(NW0G	8αw@L"Q`&;PL*[Xβx`L2hN6QL:xγ>πЈNF;ѐ'MJ[Q7N{ӠGMRԨN7հgMZָεw^QhMbNf;ЎXζn{MrQЀvMzη	 NO;Q('N[ϸ7{ '(OW0gNQpw@ЇNHOw 8PԧN[XϺַ{MN_; P;N=wϻ.vO}O͎;ZB   ;                                                                                                                                                                                                                                                                                                                                         administration/templates/default/images/th.gif                                                      0000644 0023433 0004734 00000000411 11051631622 021435  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89ad    `u|k愳qgcy                  !  ,    d   I8ͻ`(Zbhlp,tm߮|pH,Ȥrl:PtJZجvzxzn|N~ż  ;                                                                                                                                                                                                                                                       administration/templates/default/layout.tpl                                                         0000644 0023433 0004734 00000015431 11051631625 021137  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>68 Classifieds Administration</title>
<script type="text/javascript" src="javascript/menu.js"></script>
<script type="text/javascript" src="../javascript/overlib/overlib.js"><!-- overLIB (c) Erik Bosrup --></script>
<link href="templates/default/style/default.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" media="all" href="../javascript/calendar/calendar-blue.css" title="winter" />
<script type="text/javascript" src="../javascript/calendar/calendar.js"></script>
<script type="text/javascript" src="../javascript/calendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="../javascript/calendar/calendar-setup.js"></script>
<script type="text/JavaScript">
{literal}
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function disableDefault(){
	event.returnValue = false;
	return false;
}
//-->
{/literal}
{modulehook function="admin_tpl_layout_head" options=""}
</script>
</head>

<body> 
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>

<div id="wrapper">
		<div id="header"><p>{$smarty.const.LANG_LOGGED_IN} {$smarty.session.username} | <a href="logout.php">{$smarty.const.LANG_LOGOUT}</a> | <a href="http://www.68classifieds.com/knowledge-base/" target="_blank">{$smarty.const.LANG_HELP}</a> | <a href="{$smarty.const.URL}">{$smarty.const.LANG_VIEW_SITE}</a></p></div>
		<div id="topmenu">
			<div id="menu">
				<a href="javascript:void(0);" class="active" accesskey="D">{$smarty.const.LANG_DASHBOARD}</a>
				{if $smarty.session.admin_listings=="Y"}
				<a href="javascript:void(0);" accesskey="L">{$smarty.const.LANG_LISTINGS}</a>
				{/if}
				{if $smarty.session.admin_orders=="Y"}
				<a href="javascript:void(0);" accesskey="O">{$smarty.const.LANG_ORDERS}</a>
				{/if}
				{if $smarty.session.admin_users=="Y"}
				<a href="javascript:void(0);" accesskey="U">{$smarty.const.LANG_USERS}</a>
				{/if}
				{if $smarty.session.admin_category=="Y"}
				<a href="javascript:void(0);" accesskey="C">{$smarty.const.LANG_CATEGORIES}</a>
				{/if}
				{if $smarty.session.admin_payment=="Y"}
				<a href="javascript:void(0);" accesskey="P">{$smarty.const.LANG_PAYMENT}</a>
				{/if}
				{if $smarty.session.admin_settings=="Y"}
				<a href="javascript:void(0);" accesskey="S" class="last">{$smarty.const.LANG_SETTINGS}</a>
				{/if}
			</div>
		</div>
		<div id="submenu">
			<div id="submenu_{counter start=1}">
				<a href="index.php" accesskey="H">{$smarty.const.LANG_DASHBOARD}</a>
				<a href="http://www.68classifieds.com/forums/" accesskey="F" target="_blank">{$smarty.const.LANG_SUPPORT_FORUMS}</a>
				<a href="logout.php" class="last">{$smarty.const.LANG_LOGOUT}</a>
			</div>
			{if $smarty.session.admin_listings=="Y"}
			<div id="submenu_{counter}">
				<a href="listings.php">{$smarty.const.LANG_MANAGE_LISTINGS}</a>
				<a href="listings.php?action=add" class="last">{$smarty.const.LANG_ADD_LISTING}</a>
				{modulehook function="admin_tpl_layout_listings" options=""}
			</div>
			{/if}
			{if $smarty.session.admin_orders=="Y"}
			<div id="submenu_{counter}">
				<a href="orders.php" class="last">{$smarty.const.LANG_MANAGE_ORDERS}</a>
				{modulehook function="admin_tpl_layout_orders" options=""}
			</div>
			{/if}
			{if $smarty.session.admin_users=="Y"}
			<div id="submenu_{counter}">
				<a href="users.php">{$smarty.const.LANG_MANAGE_USERS}</a>
				<a href="users.php?action=add">{$smarty.const.LANG_ADD_USER}</a>
				<a href="usergroups.php">{$smarty.const.LANG_USER_GROUPS}</a>
				<a href="privatemessages.php" class="last">{$smarty.const.LANG_PRIVATE_MESSAGES}</a>
				{modulehook function="admin_tpl_layout_users" options=""}
			</div>
			{/if}
			{if $smarty.session.admin_category=="Y"}
			<div id="submenu_{counter}">
				<a href="category.php">{$smarty.const.LANG_MANAGE_CATEGORIES}</a>
				<a href="fields.php" class="last">{$smarty.const.LANG_EXTRA_FIELDS}</a>
				{modulehook function="admin_tpl_layout_category" options=""}
			</div>
			{/if}
			{if $smarty.session.admin_payment=="Y"}
			<div id="submenu_{counter}">
				<a href="products.php">{$smarty.const.LANG_MANAGE_PRODUCTS}</a>
				<a href="coupons.php">{$smarty.const.LANG_COUPONS_DISCOUNTS}</a>
				<a href="gateways.php" class="last">{$smarty.const.LANG_PAYMENT_PROVIDERS}</a>
				{modulehook function="admin_tpl_layout_payment" options=""}
			</div>
			{/if}
			{if $smarty.session.admin_settings=="Y"}
			<div id="submenu_{counter}">
				<a href="settings.php">{$smarty.const.LANG_SETTINGS}</a>
				<a href="editor.php">{$smarty.const.LANG_TEMPLATE_EDITOR}</a>
				<a href="pages.php">{$smarty.const.LANG_PAGE_EDITOR}</a>
				<a href="managemodules.php" accesskey="M" class="last">{$smarty.const.LANG_MODULES}</a>
				{modulehook function="admin_tpl_layout_settings" options=""}
			</div>
			{/if}
		</div>
<script type="text/javascript">
{literal}initMenu();{/literal}
</script>
		
		<div id="content">
		
			<!-- // Content // -->
				{include file=$body}
			<!-- // End Content // -->
		
		</div>
</div>

<div id="footer">
	&copy; 2008 68 Classifieds - A division of 68 Designs, LLC - {$smarty.const.VERSION}
</div>

  {if $benchmark_total}
  {literal}
  <script language="JavaScript" type="text/javascript">
  <!--
  function openBenchmark()
  {
      var f = getForm('benchmark_form');
      var width = 500;
      var height = 450;
      var w_offset = 30;
      var h_offset = 30;
      var location = 'top=' + h_offset + ',left=' + w_offset + ',';
      if (screen.width) {
          location = 'top=' + h_offset + ',left=' + (screen.width - (width + w_offset)) + ',';
      }
      var features = 'width=' + width + ',height=' + height + ',' + location + 'resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,status=no';
      var benchmarkWin = window.open('', '_benchmark', features);
      f.submit();
      benchmarkWin.focus();
  }
  //-->
  </script>
  {/literal}
  <form name="benchmark_form" target="_blank" method="post" action="benchmark.php">
  <input type="hidden" name="encoded_stats" value="{$benchmark_results}" />
  {/if}
  <table border="0" align="center" width="700">
  <tr>
    {if $benchmark_total}
    <td align="right">
      Page generated in {$benchmark_total} seconds {if $total_queries}({$total_queries} queries){/if}<br />
      Total Queries: {$counter}<br />
      <input type="submit" />
    </td>
    {/if}
  </tr>
  </table>
  </form>
  
  
{modulehook function="admin_tpl_layout_footer" options=""}
</body>
</html>
                                                                                                                                                                                                                                       administration/templates/default/listings/                                                          0000755 0023433 0004734 00000000000 11036006606 020727  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/listings/listings_browse.tpl                                       0000644 0023433 0004734 00000013207 11051631627 024674  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_MANAGE_LISTINGS}</h2>
	<table width="100%" class="wrap">
	<tr>
	<td>
		<form action="listings.php" method="get" name="search">
		<input type="hidden" name="sortfield" value="{$smarty.request.sortfield}" />
		<input type="hidden" name="sortorder" value="{$smarty.request.sortorder}" />
			<table width="100%"  border="0" cellspacing="0" cellpadding="3">
				<tr>
					<td>
						<input type="text" name="searchtext" value="{$smarty.request.searchtext}" />
						<input type="submit" name="Submit" value="{$smarty.const.LANG_SEARCH}" />
					</td>
					<td> 
						<div align="right">
							{$smarty.const.LANG_SHOW_LISTINGS_FROM}
							<input type="text" name="fromdate" id="fromdate" onclick="return showCalendar('fromdate', '%Y-%m-%d');" size="12" readonly="1" value="{$smarty.request.fromdate}" />&nbsp;<img src="images/calendar.png" onclick="return showCalendar('fromdate', '%Y-%m-%d');" style="cursor: pointer;" alt="calendar" />&nbsp;
							{$smarty.const.LANG_SHOW_LISTINGS_TO}
							<input type="text" name="enddate" id="enddate" onclick="return showCalendar('enddate', '%Y-%m-%d');" size="12" readonly="1" value="{$smarty.request.enddate}" />&nbsp;<img src="images/calendar.png" onclick="return showCalendar('enddate', '%Y-%m-%d');" style="cursor: pointer;" alt="calendar" />&nbsp;
							<input type="submit" name="Submit" value="{$smarty.const.LANG_SEARCH}" />
						</div>
					</td>
				</tr>
			</table>
		</form>
		<form action="listings.php" method="post" name="listings">
		<input type="hidden" name="act" value="xxxxx" />
			<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				<tr>
					<th scope="col" width="5%"><input type="checkbox" name="checkbox" value="checkbox" onClick="javascript:toggleAll(document.listings);" /></th>
					<th scope="col" width="5%"><a href="listings.php?{$querystring_id}">ID {if $sqlsort=="id"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="listings.php?{$querystring_title}">{$smarty.const.LANG_TITLE} {if $sqlsort=="title"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="listings.php?{$querystring_dateadded}">{$smarty.const.LANG_DATE_ADDED} {if $sqlsort=="dateadded"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="listings.php?{$querystring_expiration}">{$smarty.const.LANG_EXPIRATION} {if $sqlsort=="expiration"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="listings.php?{$querystring_display}">{$smarty.const.LANG_STATUS} {if $sqlsort=="display"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
				</tr>
				
				{foreach from=$results item="entry" name=status}
				<tr>
					<td width="5%" class="{cycle values="row1,row2" advance=false}"><input type="checkbox" name="listingid[]" value="{$entry.id}" class="toggable" /></td>
					<td width="5%" class="{cycle values="row1,row2" advance=false}">{$entry.id}</td>
					<td class="{cycle values="row1,row2" advance=false}" id="listing_{$entry.id}"><a href="listings.php?view={$entry.id}">{$entry.title}</a></td>
					<td class="{cycle values="row1,row2" advance=false}">{$entry.dateadded|date_format:$dateformat}</td>
					<td class="{cycle values="row1,row2" advance=false}">{$entry.expiration|date_format:$dateformat}</td>
					<td class="{cycle values="row1,row2" advance=true}"><span class="{if $entry.status==Y}active{elseif $entry.status==N}inactive{else}notcompleted{/if}">{$entry.l_Status_Text}</span></td>
				</tr>
				{foreachelse}
				<tr><td colspan="6">{$smarty.const.LANG_NO_RESULTS}</td></tr>
				{/foreach}
			</table>

			<table width="100%"  border="0" cellspacing="0" cellpadding="3">
				<tr>
					<td>
						<select name="newstatus">
							<option value="" selected>{$smarty.const.LANG_CHANGE_STATUS}</option>
							<option value="Y">{$smarty.const.LANG_STATUS_ACTIVE}</option>
							<!--<option value="C">{$smarty.const.LANG_NOT_COMPLETED}</option>-->
							<option value="N">{$smarty.const.LANG_STATUS_NOT_ACTIVE}</option>
							<option value="5">{$smarty.const.LANG_DELETE}</option>
						</select>
						<input type="submit" value="{$smarty.const.LANG_UPDATE}" onclick="document.listings.act.value='changestatus';" />
					</td>
					<td align="right">
						{* display pagination *}
						<table class="pagination" cellpadding="3" cellspacing="1" border="0" align="right" style="margin-top:3px">
						<tr>
							<td class="navigationBack" style="font-weight:normal">{$smarty.const.LANG_SHOWING_PAGE} {$pageNum} of {$maxPage}</td>
							{if $first<>""}
							<td class="paginationNum"><a href="listings.php?{$first}">{$smarty.const.LANG_FIRST}</a></td>
							{/if}
							{if $prev<>""}
							<td class="paginationNum"><a href="listings.php?{$prev}">{$smarty.const.LANG_PREVIOUS}</a></td>
							{/if}
							{foreach from=$pageNumber item="entry"}
								{if $entry.number==$pageNum}
									<td class="paginationNum"><strong>{$entry.number}</strong></td>
								{else}
									<td class="paginationNum"><a href="listings.php?{$entry.link}" class="paginationNum">{$entry.number}</a></td>
								{/if}
							{/foreach}
							{if $next<>""}
								<td class="paginationNum"><a href="listings.php?{$next}">{$smarty.const.LANG_NEXT}</a></td>
							{/if}
							{if $last<>""}
								<td class="paginationNum"><a href="listings.php?{$last}">{$smarty.const.LANG_LAST}</a></td>
							{/if}
						</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
	</td>
	</tr>
	</table>                                                                                                                                                                                                                                                                                                                                                                                         administration/templates/default/listings/listings_grid.tpl                                         0000644 0023433 0004734 00000002362 11106621466 024321  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 {* @$Revision: 1.2 $ *}
<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
	<tr>
		<th scope="col" width="5%">ID</th>
		<th scope="col">{$smarty.const.LANG_TITLE}</th>
		<th scope="col">{$smarty.const.LANG_DATE_ADDED}</th>
		<th scope="col">{$smarty.const.LANG_EXPIRATION}</th>
		<th scope="col">{$smarty.const.LANG_STATUS}</th>
	</tr>
	
	{foreach from=$listingresults item="entry" name=status}
	<tr>
		<td width="5%" class="{cycle values="row1,row2" advance=false}">{$entry.id}</td>
		<td class="{cycle values="row1,row2" advance=false}" id="listing_{$entry.id}"><a href="listings.php?view={$entry.id}" title="{$entry.description}">Edit</a> <a href="listings.php?view={$entry.id}" title="{$entry.description}">{$entry.title}</a></td>
		<td class="{cycle values="row1,row2" advance=false}">{$entry.dateadded|date_format:$dateformat}</td>
		<td class="{cycle values="row1,row2" advance=false}">{$entry.expiration|date_format:$dateformat}</td>				
		<td class="{cycle values="row1,row2" advance=true}"><span class="{if $entry.status==Y}active{elseif $entry.status==N}inactive{else}notcompleted{/if}">{$entry.l_Status_Text}</span></td>
	</tr>
	{foreachelse}
		<tr><td colspan="6">No results</td></tr>
	{/foreach}
</table>                                                                                                                                                                                                                                                                              administration/templates/default/listings/listing_add.tpl                                           0000644 0023433 0004734 00000015526 11051631630 023740  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script type="text/javascript" src="../includes/classes/cpaint/cpaint2.inc.compressed.js"></script>
<script language="javascript" type="text/javascript">
<!--
{literal}
function checkform(frm)
{
	if (frm.title.value == '') {
			alert("{/literal}{$smarty.const.LANG_JAVASCRIPT_PLEASE_ENTER} \'{$smarty.const.LANG_TITLE}{literal}\'.");
			frm.title.focus();
			return (false);
	}
	if (frm.expiration.value == '') {
			alert("{/literal}{$smarty.const.LANG_JAVASCRIPT_PLEASE_ENTER} \'{$smarty.const.LANG_EXPIRATION}{literal}\'.");
			frm.expiration.focus();
			return (false);
	}
	{/literal}
	{foreach from=$required item="entry"}
	{literal}
	if(frm.section.value=={/literal}{$entry.id}{literal}){
		alert("{/literal}{$smarty.const.LANG_JS_SELECT_DIF_CAT}{literal}");
		frm.section.focus();
		return (false);
	}
	{/literal}
	{/foreach}
	{literal}
}
	var cp = new cpaint();
	cp.set_transfer_mode('get');
	cp.set_response_type('text');
	cp.set_persistent_connection(false);
	cp.set_async(true);
	cp.set_proxy_url('');
	cp.set_debug(false);
	
		function displaySec(type){
			document.getElementById('response').style.display='block';
			var QSTRING = type.options[type.selectedIndex].value;
			cp.call('{/literal}{$smarty.const.URL}{literal}/administration/ajax.php', 'extra_listing_fields', response, QSTRING);
			return false;
		}
		
		function response(result) {
			document.getElementById('optResponse').innerHTML ="";
			document.getElementById('response').innerHTML = result;
		}
		
		function displayNewSec(opt){
			document.getElementById('optResponse').style.display='block';
			var QSTRING = opt.options[opt.selectedIndex].value;
			cp.call('{/literal}{$smarty.const.URL}{literal}/administration/ajax.php', 'extra_search_fields2', optResponse, QSTRING);
			return false;
		}
		
		function optResponse(result) {
			document.getElementById('optResponse').innerHTML ="";
			document.getElementById('optResponse').innerHTML += result;
		}
{/literal}
//-->
</script>
<h2>{$smarty.const.LANG_ADD_LISTING}</h2>
	<table width="100%" border="0" cellpadding="3" cellspacing="0" class="modules">
		<tr>
			<td align="left">				
				<form action="listings.php" method="post" name="search" enctype="multipart/form-data" onSubmit="return checkform(this)">
					<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
						<tr>
							<th colspan="4">{$smarty.const.LANG_GENERAL_DETAILS}</th>
						</tr>
						<tr>
							<td width="25%"><label for="owner">{$smarty.const.LANG_SELLER}{$smarty.const.LANG_COLON}</label></td>
							<td width="25%">
								<select name="owner" id="owner">
									{foreach from=$owners item=own}
									<option value="{$own.id}"{if $owner==$own.id} SELECTED{/if}>{$own.username}</option>
									{/foreach}
								</select>
							</td>
							<td><label for="section">{$smarty.const.LANG_CATEGORY}{$smarty.const.LANG_COLON}</label></td>
							<td>
								<select name="section" id="section" onChange="displaySec(this);">
									<option value="" SELECTED>{$smarty.const.LANG_PLEASE_SELECT}</option>
									{foreach from=$getcats item=cat}
									<option value="{$cat.id}"{if $section==$cat.id} SELECTED{/if}>{$cat.name}</option>
									{/foreach}
								</select>
							</td>
						</tr>
						<tr>
							<td><label for="status">{$smarty.const.LANG_STATUS}{$smarty.const.LANG_COLON}</label></td>
							<td>
								<select name="display" id="status">
									<option value="Y">{$smarty.const.LANG_STATUS_ACTIVE}</option>
									<option value="N">{$smarty.const.LANG_STATUS_NOT_ACTIVE}</option>
								</select>
							</td>
							<td><label for="expiration">{$smarty.const.LANG_EXPIRATION}{$smarty.const.LANG_COLON}</label></td>
							<td>
								<input type="text" name="expiration" id="expiration" onclick="return showCalendar('expiration', '%Y-%m-%d');" size="12" readonly="1" value="{$expiration}" />&nbsp;
								{$expiration}
							</td>
						</tr>
						<tr>
							<td><label for="oProductID">{$smarty.const.LANG_LISTING_PACKAGE}:</label</td>
							<td>
								<select name="oProductID">
									{foreach from=$products item=entry}
										<option value="{$entry.pID}|{$entry.pTitle}">{$entry.pTitle}</option>
									{/foreach}
								</select>
							</td>
							<td></td>
							<td></td>
						</tr>
					</table>
					<br />
					<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
						<tr>
							<th colspan="2">{$smarty.const.LANG_LISTING_DETAILS}</th>
						</tr>
						<tr>
							<td width="5%" nowrap="nowrap"><label for="title">{$smarty.const.LANG_TITLE}{$smarty.const.LANG_COLON}</label></td>
							<td><input type="text" id="title" name="title" value="{$title}" style="width: 100%" /></td>
						</tr>
						{if $checkoutDisPrice=="Y"}
						<tr>
							<td width="5%" nowrap="nowrap" valign="top"><label for="price">{$smarty.const.LANG_PRICE}{$smarty.const.LANG_COLON}</label></td>
							<td>{$currency_symbol}<input name="price" id="price" type="text" value="{$price}" style="width: 90%" /></td>
						</tr>
						{/if}
						{if $checkoutDisURL=="Y"}
						<tr>
							<td width="5%" nowrap="nowrap" valign="top"><label for="url">{$smarty.const.LANG_URL}{$smarty.const.LANG_COLON}</label></td>
							<td><input name="url" type="text" id="url" value="{$url}" style="width: 100%" /></td>
						</tr>
						{/if}
						{if $checkoutDisShortDesc=="Y"}
						<tr>
							<td width="5%" nowrap="nowrap" valign="top"><label for="shortdescription">{$smarty.const.LANG_SHORT_DESCRIPTION}{$smarty.const.LANG_COLON}</label></td>
							<td><textarea name="shortdescription" id="shortdescription" style="width: 100%" rows="5">{$shortDescription}</textarea></td>
						</tr>
						{/if}
						{if $checkoutDisDesc=="Y"}
						<tr>
							<td width="5%" nowrap="nowrap" valign="top"><label for="description">{$smarty.const.LANG_DESCRIPTION}{$smarty.const.LANG_COLON}</label></td>
							<td><textarea name="description" id="description" style="width: 100%" rows="5">{$description}</textarea></td>
						</tr>
						{/if}
					</table>
					<br />
					<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
						<tr>
							<th>Extra Fields</th>
						</tr>
						<tr>
							<td>
							<div id="response" style="display: none;"><img src="images/ajax-loader.gif" alt="Loading" /> {$smarty.const.LANG_LOADING}</div>
							<div id="optResponse" style="display: none;"><img src="images/ajax-loader.gif" alt="Loading" /> {$smarty.const.LANG_LOADING}</div>
							</td>
						</tr>
					</table>
					<br />	
				<div align="center"><input type="submit" name="submit" value="{$smarty.const.LANG_SUBMIT}" /> <input type="reset" name="reset" value="{$smarty.const.LANG_RESET}" /></div>
				<input type="hidden" name="action" value="addlisting" />
				</form>
			</td>
		</tr>
	</table>                                                                                                                                                                          administration/templates/default/listings/listing_edit.tpl                                          0000644 0023433 0004734 00000031531 11250452725 024136  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$title} #{$id}</h2>
{if $success}
	<script type="text/javascript" src="javascript/fat.js"></script>
	<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
{/if}
<script language="javascript" type="text/javascript">
{literal}
<!--
function confirmDelete(goto)
{
var agree=confirm("{/literal}{$smarty.const.LANG_JS_DELETE_CONFIRM}\n{$smarty.const.LANG_JS_NOT_UNDONE}{literal}");
	if (agree)
	{
		location.href=goto;
		return true;
	}
	else
		return false;
}
{/literal}
// -->
</script>
<script type="text/javascript" src="../includes/classes/cpaint/cpaint2.inc.compressed.js"></script>
<script language="javascript" type="text/javascript">
<!--
{literal}
var display = '{/literal}{$display}{literal}';
function changeStatus(status){
	var nValue = status.options[status.selectedIndex].value;
	if(nValue=="Y")
	{
		document.getElementById('status').className='active';
	}
	else if(nValue=="N")
	{
		document.getElementById('status').className='inactive';
	}
	else if(nValue=="D")
	{
		removemsg = "{/literal}{$smarty.const.LANG_BAN_DELETE_JS}\n{$smarty.const.LANG_JS_NOT_UNDONE}{literal}";
		if (confirm(removemsg)) {
			document.getElementById('status').className='notcompleted';
		} else {
			status.value=display;
		}
	}
	else
	{
		document.getElementById('status').className='notcompleted';
	}
}

function displaySec(section){
	var URL= "listings.php?view={/literal}{$id}{literal}&section="
	var QSTRING = section.options[section.selectedIndex].value;
	window.location.href = URL + QSTRING;
}
	var cp = new cpaint();
	cp.set_transfer_mode('get');
	cp.set_response_type('text');
	cp.set_persistent_connection(false);
	cp.set_async(true);
	cp.set_proxy_url('');
	cp.set_debug(false);
	
		function displayNewSec(opt){
			var QSTRING = opt.options[opt.selectedIndex].value;
			cp.call('{/literal}{$smarty.const.URL}{literal}/administration/ajax.php', 'extra_checkout_fields', optResponse, QSTRING);
			return false;
		}
		function optResponse(result) {
			document.getElementById('optResponse').innerHTML ="";
			document.getElementById('optResponse').innerHTML += result;
			document.getElementByID('child').style.visibility = 'collapse';
		}
		function displayNewSec(opt){
			document.getElementById('optResponse').style.display='block';
			var QSTRING = opt.options[opt.selectedIndex].value;
			cp.call('{/literal}{$smarty.const.URL}{literal}/administration/ajax.php', 'extra_search_fields2', optResponse, QSTRING);
			return false;
		}
		
		function optResponse(result) {
			document.getElementById('optResponse').innerHTML ="";
			document.getElementById('optResponse').innerHTML += result;
		}
		
		function deleteUpload(fID) {
			removemsg = "{/literal}{$smarty.const.LANG_JS_DELETE_CONFIRM}\n{$smarty.const.LANG_JS_NOT_UNDONE}{literal}";
			if (confirm(removemsg)) {
				pID={/literal}{$id}{literal};
				cp.call('{/literal}{$smarty.const.URL}{literal}/administration/ajax.php', 'deleteUpload', deleteResponse, pID, fID);
			}
		}
		function deleteResponse(result) {
			document.getElementById('deleteResponse').innerHTML ="";
		}
{/literal}
//-->
</script>
	<table width="100%" border="0" cellpadding="3" cellspacing="0" class="modules">
		<tr>
			<td align="left">
				<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
					<tr>
						<th>{$smarty.const.LANG_IMAGES}</th>
					</tr>
					<tr>
						<td>
							{if $data<>""}
								<table width="100%">
									{section name=tr loop=$data step=4}
										<tr>
										{section name=td start=$smarty.section.tr.index
											loop=$smarty.section.tr.index+4}
											<td width="25%" style="border: 1px solid #ccc;" align="center">
											{if $data[td]<>""}
												<img src="../thumbs/small_{$data[td].image}" hspace="5" vspace="5" class="image" border="0" alt="{$data[td].title}" />
												<form name="modifyimage{counter}" method="post" action="listings.php">
													<table width="100%">
														<tr>
															<td>{$smarty.const.LANG_TITLE}:</td>
															<td><input name="title" type="text" value="{$data[td].title}" size="15" /></td>
														</tr>
														<tr>
															<td>{$smarty.const.LANG_RANK}:</td>
															<td><input name="rank" type="text" value="{$data[td].rank}" size="5" /></td>
														</tr>
														<tr>
															<td colspan="2" align="center">
																<input name="id" type="hidden" value="{$data[td].id}" />
																<input name="view" type="hidden" value="{$id}" />
																<input type="submit" name="Submit" value="{$smarty.const.LANG_MODIFY}" /> | 
																<input type="button" value="{$smarty.const.LANG_DELETE}" onclick="confirmDelete('listings.php?imageid={$data[td].id}&amp;action=delete&amp;view={$id}')" />
															</td>
														</tr>
													</table>
												</form>
											{/if}
											&nbsp;
											</td>
											<td>
										{/section}
										</tr>
									{/section}
								</table>
							{else}
							<img src="images/nophoto.gif" alt="No Photo" />
							{/if}
						</td>
					</tr>
					<tr>
						<td>
							<form action="listings.php?upload=true" method="post" enctype="multipart/form-data" name="imageupload">
								<table width="100%" cellpadding="0" cellspacing="0" class="imageform">
									<tr>
										<td>
											<label for="imagetitle">{$smarty.const.LANG_TITLE}:</label> <input name="title" id="imagetitle" type="text" size="25" />
											<label for="imagename">{$smarty.const.LANG_IMAGE}:</label> <input name="imagename" type="file" id="imagename" />
											<input name="view" type="hidden" value="{$id}" />
											<input name="addphoto" type="hidden" value="Y" />
											<input type="submit" name="submit" value="{$smarty.const.LANG_SUBMIT}" />
										</td>
									</tr>
								</table>
							</form>
						</td>
					</tr>
				</table>
				<br />
					
				<form action="listings.php" method="post" name="search" enctype="multipart/form-data">
				<input type="hidden" name="action" value="modify" />
				<input type="hidden" name="id" value="{$id}" />
					<table width="100%" border="0" cellspacing="0" cellpadding="3" class="main">
						<tr>
							<th colspan="4">{$smarty.const.LANG_GENERAL_DETAILS}</th>
						</tr>
						<tr>
							<td width="25%"><label for="owner">{$smarty.const.LANG_SELLER}{$smarty.const.LANG_COLON}</label></td>
							<td width="25%" nowrap>
								<select name="owner" id="owner">
									{foreach from=$owners item=own}
									<option value="{$own.id}"{if $owner==$own.id} SELECTED{/if}>{$own.username}</option>
									{/foreach}
								</select>
								<a href="users.php?view={$owner}"><img src="images/user_go.png" border="0" alt="View User" /></a>
							</td>
							<td><label for="section">{$smarty.const.LANG_CATEGORY}{$smarty.const.LANG_COLON}</label></td>
							<td>
								<select name="section" id="section" onChange="displaySec(this);">
									{foreach from=$getcats item=cat}
									
									{if $smarty.get.section == $cat.id} 
										<option value="{$cat.id}" SELECTED>{$cat.name}</option>							
									{elseif $smarty.get.section == '' && $section==$cat.id}
										<option value="{$cat.id}" SELECTED>{$cat.name}</option>
									{else}
										<option value="{$cat.id}">{$cat.name}</option>
									{/if}
									
									{/foreach}
								</select>
							</td>
						</tr>
						<tr>
							<td width="25%"><label for="dateadded">{$smarty.const.LANG_DATE_ADDED}{$smarty.const.LANG_COLON}</label></td>
							<td width="25%">
								<input type="text" name="dateadded" id="dateadded" size="30" value="{$dateadded}" />
							</td>    
							<td><label for="expiration">{$smarty.const.LANG_EXPIRATION}{$smarty.const.LANG_COLON}</label></td>
							<td>
								<input type="text" name="expiration" id="expiration" size="30" value="{$expiration}" />
							</td>
						</tr>
						<tr>
							<td>{$smarty.const.LANG_STATUS}{$smarty.const.LANG_COLON}</td>
							<td>
								<span id="status" class="{if $display=="Y"}active{elseif $display=="N"}inactive{else}notcompleted{/if}">
									<select name="display" onChange="changeStatus(this);">
								     	<option class="active" value="Y"{if $display == "Y"} SELECTED{/if}>{$smarty.const.LANG_STATUS_ACTIVE}</option>
								     	<option class="inactive" value="N"{if $display == "N"} SELECTED{/if}>{$smarty.const.LANG_STATUS_NOT_ACTIVE}</option>
										<!--<option class="notcompleted" value="C"{if $display == "C"} SELECTED{/if}>{$smarty.const.LANG_ADMIN_NOT_COMPLETED}</option>-->
										<option class="notcompleted" value="D"{if $display == "D"} SELECTED{/if}>{$smarty.const.LANG_BAN_DELETE}</option>
									</select>
									<input type="hidden" name="oldstatus" value="{$display}" />
								</span>
							</td>
							<td>{$smarty.const.LANG_VIEWS}{$smarty.const.LANG_COLON}</td>
							<td>{$hitcount}</td>
						</tr>
						<tr>
							<td>{$smarty.const.LANG_SEARCH_VIEWS}{$smarty.const.LANG_COLON}</td>
							<td>{$searchcount}</td>
							<td>{$smarty.const.LANG_CONTACTED}{$smarty.const.LANG_COLON}</td>
							<td>{$repliedcount}</td>
						</tr>
					</table>
					<br />
					<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
						<tr>
							<th colspan="2">{$smarty.const.LANG_LISTING_DETAILS}</th>
						</tr>
						<tr>
							<td width="25%" nowrap="nowrap"><label for="title">{$smarty.const.LANG_TITLE}{$smarty.const.LANG_COLON}</label></td>
							<td><input type="text" id="title" name="title" value="{$title|escape}" style="width: 100%" /></td>
						</tr>
						{if $checkoutDisPrice=="Y"}
						<tr>
							<td width="5%" nowrap="nowrap" valign="top"><label for="price">{$smarty.const.LANG_PRICE}{$smarty.const.LANG_COLON}</label></td>
							<td>{$currency_symbol}<input name="price" id="price" type="text" value="{$price}" style="width: 90%" /></td>
						</tr>
						{/if}
						{if $checkoutDisURL=="Y"}
						<tr>
							<td width="5%" nowrap="nowrap" valign="top"><label for="url">{$smarty.const.LANG_URL}{$smarty.const.LANG_COLON}</label></td>
							<td><input name="url" id="url" type="text" value="{$url}" style="width: 100%" /></td>
						</tr>
						{/if}
						{if $checkoutDisShortDesc=="Y"}
						<tr>
							<td colspan="2"><label for="shortDescription">{$smarty.const.LANG_SHORT_DESCRIPTION}{$smarty.const.LANG_COLON}</label></td>
						</tr>
						<tr>
							<td colspan="2"><textarea name="shortDescription" id="shortDescription" style="width: 100%" rows="5">{$shortDescription|escape}</textarea></td>
						</tr>
						{/if}
						{if $checkoutDisDesc=="Y"}
						<tr>
							<td colspan="2"><label for="description">{$smarty.const.LANG_DESCRIPTION}{$smarty.const.LANG_COLON}</label></td>
						</tr>
						<tr>
							<td colspan="2"><textarea name="description" id="description" style="width: 100%" rows="5">{$description|escape}</textarea></td>
						</tr>
						{/if}
						{$extra_listing_fields}
						<tr>
							<th colspan="2">{$smarty.const.LANG_EXTRA_OPTIONS}</th>
						</tr>
						<tr>
							<td width="5%" nowrap="nowrap"><label for="pBold">{$smarty.const.LANG_BOLD}{$smarty.const.LANG_COLON}</label></td>
							<td>
								<select name="pBold" id="pBold">
									<option value="N">{$smarty.const.LANG_NO_THANKS}</option>
									<option value="Y"{if $pBold=="Y"} SELECTED{/if}>{$smarty.const.LANG_YES}</option>
								</select>
							</td>
						</tr>
						<tr>
							<td width="5%" nowrap="nowrap"><label for="pHighlighted">{$smarty.const.LANG_HIGHLIGHTED}{$smarty.const.LANG_COLON}</label></td>
							<td>
								<select name="pHighlighted" id="pHighlighted">
									<option value="N">{$smarty.const.LANG_NO_THANKS}</option>
									<option value="Y"{if $pHighlighted=="Y"} SELECTED{/if}>{$smarty.const.LANG_YES}</option>
								</select>
							</td>
						</tr>
						<tr>
							<td width="5%" nowrap="nowrap"><label for="featured">{$smarty.const.LANG_FEATURED}{$smarty.const.LANG_COLON}</label></td>
							<td>
								<select name="featured" id="featured">
									<option value="N">{$smarty.const.LANG_NO_THANKS}</option>
									<option value="Y"{if $featured=="Y"} SELECTED{/if}>{$smarty.const.LANG_YES}</option>
								</select>
							</td>
						</tr>
					</table>
					<br />
					
					<hr />
						<fieldset>
							<legend>{$smarty.const.LANG_USER_NOTES}  
								{if $smarty.session.admin_users=="Y"}<a href="javascript:void(0);" onclick="MM_openBrWindow('notes.php?id={$owner}','notes','width=525,height=450,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes,left=0,top=0,screenx=50,screeny=50')" title="Add Notes"><img src="images/attach.png" border="0" alt="Add Notes" /></a>{/if}
							</legend>
							{$usernotes|nl2br}
						</fieldset>
					
				<div align="center"><input type="submit" value="{$smarty.const.LANG_SUBMIT}" /> <input type="reset" name="reset" value="{$smarty.const.LANG_RESET}" /></div>
				</form>
			</td>
		</tr>
	</table>
	<script type="text/javascript">document.getElementById('reciprocallink').style.display='';</script>                                                                                                                                                                       administration/templates/default/login.tpl                                                          0000644 0023433 0004734 00000006623 11051631633 020734  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{$smarty.const.LANG_PLEASE_LOGIN}</title>
<link href="templates/default/style/default.css" rel="stylesheet" type="text/css" />
<meta name="author" content="68 Classifieds - {$smarty.const.VERSION}" />
<script language="javascript" type="text/javascript">
{literal}
		<!--
		{/literal}
		{if !$js}
		window.location = "login.php?js=true&goto={$smarty.get.goto}";
		{/if}
		{literal}
		function checkform(frm) {
			if (frm.username.value == '') {
					alert("{/literal}{$smarty.const.LANG_JAVASCRIPT_PLEASE_ENTER} \"{$smarty.const.LANG_USERNAME}{literal}\".");
					frm.username.focus();
					return(false);
			}
			if (frm.password.value == '') {
					alert("{/literal}{$smarty.const.LANG_JAVASCRIPT_PLEASE_ENTER} \"{$smarty.const.LANG_PASSWORD}{literal}\".");
					frm.password.focus();
					return(false);
			}
		}
		function setfocus()
		{
			document.forms[0].username.focus()
		}
		//-->
{/literal}
</script>
</head>

<!--<body onload="setfocus();">-->
<body>

<form action="login.php?js=true" name="login" method="post" onsubmit="return checkform(this)">
<div id="loginwrapper">
		<div id="header"></div>
		
		<div id="content">
			{if $forward}
				<h2>{$title}</h2>
				<meta http-equiv="refresh" content="2;URL={$location}" />
				<table width="100%" class="wrap">
					<tr>
					<td>
						{$smarty.const.LANG_FORWARD}<br />{$smarty.const.LANG_FORWARD_IF_NOT} <a href="{$location}">{$smarty.const.LANG_FORWARD_CLICK_HERE}.</a>
					</td>
					</tr>
				</table>
			{elseif !$js}
				<h2>{$smarty.const.LANG_ERROR}</h2>
				<p>{$smarty.const.LANG_SUPPORT_JAVASCRIPT}</p>
			{else}
				<h2>{$smarty.const.LANG_PLEASE_LOGIN}</h2>
				<div class="wrap">
					<fieldset>
						<legend>{$smarty.const.LANG_PLEASE_ENTER_DETAILS}</legend>
						<table width="100%">
							{if $msg<>""}
							<tr>
								<td colspan="2"><span class="problem" style="padding: 5px; color: red; text-align: center;">{$msg}</span></td>
							</tr>
							{/if}
							<tr>
								<td><label for="username">{$smarty.const.LANG_USERNAME}{$smarty.const.LANG_COLON}</label></td>
								<td><input name="username" type="text" id="username" tabindex="1" /></td>
							</tr>
							<tr>
								<td><label for="password">{$smarty.const.LANG_PASSWORD}{$smarty.const.LANG_COLON}</label></td>
								<td><input name="password" type="password" id="password" tabindex="2" /></td>
							</tr>
							<tr>
								<td>&nbsp;</td>
								<td><input type="checkbox" name="remember" id="remember" value="Y" />&nbsp;<label for="remember">{$smarty.const.LANG_REMEMBER_ME}</label></td>
							</tr>
							<tr>
								<td colspan="2" valign="top">
								<div align="center">
								<input name="action" type="hidden" id="action" value="login" />
								<input name="submit" type="submit" id="submit" value="{$smarty.const.LANG_SUBMIT}" />
								</div>
								</td>
							</tr>
						</table>
					</fieldset>
				</div>
			{/if}
		</div>
</div>
<input type="hidden" name="goto" value="{$smarty.get.goto}" />
</form>
<div id="footer">&copy; 2007 68 Classifieds - A division of 68 Designs, LLC - {$smarty.const.VERSION}</div>

</body>
</html>
                                                                                                             administration/templates/default/modules/                                                           0000755 0023433 0004734 00000000000 11036006617 020545  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/modules/managemodules.tpl                                          0000644 0023433 0004734 00000010566 11051631635 024120  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script type="text/javascript" src="javascript/fat.js"></script>
{literal}
<script type="text/javascript" language="JavaScript">
	<!--
		function deletemodule(id)
		{
			if(confirm('{/literal}{$smarty.const.LANG_MODULE_DELETECONFIRM}{literal}'))
			{
				document.location = 'managemodules.php?id=' + id + '&do=changestate&action=remove';
			}
		}
		function deactivatemodule(id)
		{
			if(confirm('{/literal}{$smarty.const.LANG_ADMIN_MODULE_DEACTIVATECONFIRM}{literal}'))
			{
				document.location = 'managemodules.php?id=' + id + '&do=changestate&action=remove';
			}
		}
		function chi(currindex)
		{
			var i = eval("document.mainform.newpos"+currindex+".selectedIndex");
			document.mainform.newval.value = eval("document.mainform.newpos"+currindex+".options[i].text");
			document.mainform.selectedq.value = currindex;
			document.mainform.act.value = "changeorder";
			document.mainform.submit();
		}
	// -->
</script>
{/literal}
<h2>{$smarty.const.LANG_MODULES}</h2>
<table width="100%" class="wrap">
		<tr>
			<td>
			{if $mod_info}
    			{include file=$mod_info}
			{/if}
			{if $msg}
				<div id="message" class="updated fade"><p>{$msg}</p></div>
			{/if}
			<table width="100%"  border="0" cellspacing="0" cellpadding="3">
				<tr>
					<td>
						
						<input type="button" value="{$smarty.const.LANG_REGENERATE}" onClick="self.location='managemodules.php?action=regenerate'" />
					</td>
				</tr>
			</table>
			<form method="post" action="managemodules.php" name="mainform">
			<input type="hidden" name="act" value="xxxxx" />
			<input type="hidden" name="id" value="xxxxx" />
			<input type="hidden" name="selectedq" value="1" />
			<input type="hidden" name="newval" value="1" />
	
				<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
					<tr>
						<th scope="col" width="5%">{$smarty.const.LANG_ORDER}</th>
						<th>{$smarty.const.LANG_NAME}</th>
						<th>{$smarty.const.LANG_DESCRIPTION}</th>
						<th width="5%">{$smarty.const.LANG_VERSION}</th>
						<th>{$smarty.const.LANG_STATE}</th>
						<th>{$smarty.const.LANG_ACTIONS}</th>
						<th width="5%">{$smarty.const.LANG_HELP}</th>
					</tr>
					{if $noresults<>""}
						<tr><td colspan="7" class="formstrip">{$noresults}</td></tr>
					{else}
					{foreach from=$results item="entry" name=status}
						<tr>
							<td class="{cycle values="row1,row2" advance=false}">
								<select name='newpos{$entry.mOrder}' onChange='chi({$entry.mOrder});'>
									{section name=order loop=$max+1 start=1}
									<option value="{$smarty.section.order.index}"{if $entry.mOrder==$smarty.section.order.index} SELECTED{/if}>{$smarty.section.order.index}</option>
									{/section}
								</select>
							</td>
							<td class="{cycle values="row1,row2" advance=false}" nowrap>{$entry.displayname}</td>
							<td class="{cycle values="row1,row2" advance=false}">{$entry.description}</td>
							<td class="{cycle values="row1,row2" advance=false}">{$entry.version}</td>
							<td class="{cycle values="row1,row2" advance=false}">
								<span class="{if $entry.state=="Active"}active{elseif $entry.state=="Inactive"}inactive{else}notcompleted{/if}">{$entry.state}</span>
							</td>
							<td class="{cycle values="row1,row2" advance=false}" nowrap>
							<a href='managemodules.php?id={$entry.id}&amp;do=changestate&amp;action={$entry.action}'>{$entry.actiontext}</a>
							{if $entry.action == "initialize" || $entry.action=="activate"}
							| <a href="javascript:deletemodule('{$entry.id}')">{$smarty.const.LANG_DELETE}</a>
							| <a href="managemodules.php?id={$entry.id}&amp;do=changestate&amp;action=upgrade">{$smarty.const.LANG_UPGRADE}</a>
							{/if}
							{if $entry.admin_capable=="Y" && $entry.action=="deactivate"}
							| <a href="modules.php?mod={$entry.name}">{$smarty.const.LANG_ADMIN}</a> 
							{/if}
							</td>
							<td class="{cycle values="row1,row2" advance=true}">
								<a href="javascript:void(0);" onclick="MM_openBrWindow('{$entry.help}','readme','scrollbars=yes,resizable=yes,width=600,height=500')"><img src="images/modulehelp.png" border="0" alt="Read Me" /></a>
							</td>
						</tr>
					{/foreach}
					{/if}
				</table>
			</form>
			<br />
			<fieldset>
				<legend>{$smarty.const.DOC_MODULES_GETMORE}</legend>
				{$smarty.const.DOC_MODULES_GETMORE_TXT}
			</fieldset>
		</td>
	</tr>
</table>                                                                                                                                          administration/templates/default/notallowed.tpl                                                     0000644 0023433 0004734 00000000232 11051631637 021766  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_FORWARD_ERROR}</h2>
<table width="100%" class="wrap">
	<tr>
	<td>
		{$smarty.const.LANG_NOT_ALLOWED}
	</td>
	</tr>
</table>                                                                                                                                                                                                                                                                                                                                                                      administration/templates/default/orders/                                                            0000755 0023433 0004734 00000000000 11036006636 020374  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/orders/customer_table.tpl                                          0000644 0023433 0004734 00000011737 11051631641 024133  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 						<table width="100%">
						<tr>
							<td colspan="2" width="50%" valign="top">
								<fieldset>
									<legend>{$smarty.const.LANG_PERSONAL_INFO}</legend>
									<table width="100%" cellpadding="3" cellspacing="1">
										<tr>
											<td width="50%" align="right">{$smarty.const.LANG_USERNAME}{$smarty.const.LANG_COLON}</td>
											<td width="50%">{$username}</td>
										</tr>
										<tr>
											<td width="50%" align="right">{$smarty.const.LANG_FIRST_NAME}{$smarty.const.LANG_COLON}</td>
											<td width="50%">{$firstname}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_LAST_NAME}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$lastname}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADDRESS}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$address}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_CITY}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$city}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_STATE}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$state}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_COUNTRY}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$country}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ZIP}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$zip}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_PHONE}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$phone}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_IP}{$smarty.const.LANG_COLON}</td>
											<td width="25%"><a href="http://www.dnsstuff.com/tools/whois.ch?ip={$custip}" target="_blank">{$custip}</a></td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_EMAIL}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$email}</td>
										</tr>
									</table>
								</fieldset>
							</td>
							<td colspan="2" valign="top" width="50%">
								<fieldset>
									<legend>{$smarty.const.LANG_BILLING_INFO}</legend>
											{if $b_same=="Y"}
													<img src="images/check.png" alt="yes" />
											{else}
												<img src="images/cross.png" alt="no" />												
											{/if}
											{$smarty.const.LANG_BILLING_SAME}
									<div id="billing"{if $b_same=="Y"}style="display:none;"{/if}>
									<table width="100%" cellpadding="3" cellspacing="1">
										<tr>
											<td colspan="2" align="center">
												
											</td>
										</tr>
										<tr>
											<td width="50%" align="right">{$smarty.const.LANG_FIRST_NAME}{$smarty.const.LANG_COLON}</td>
											<td width="50%">{$b_firstname}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_LAST_NAME}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_lastname}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADDRESS}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_address}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_CITY}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_city}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_STATE}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_state}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_COUNTRY}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_country}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ZIP}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_zip}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_PHONE}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_phone}</td>
										</tr>
									</table>
									</div>
								</fieldset>
							</td>
						</tr>
						{if $usernotes}
						<tr>
							<td colspan="4">
								<hr />
								<fieldset>
									<legend>{$smarty.const.LANG_USER_NOTES}  
										{if $smarty.session.admin_users=="Y"}<a href="javascript:void(0);" onclick="MM_openBrWindow('notes.php?id={$oOwnerID}','notes','width=525,height=450,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes,left=0,top=0,screenx=50,screeny=50')" title="Add Notes"><img src="images/attach.png" border="0" alt="Add Notes" /></a>{/if}
									</legend>
									{$usernotes|nl2br}
								</fieldset>
							</td>
						</tr>
						{/if}
					</table>                                 administration/templates/default/orders/orders_add.tpl                                              0000644 0023433 0004734 00000024734 11051631642 023233  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_ORDER} #{$oID}</h2>
<script type="text/javascript" src="../includes/classes/cpaint/cpaint2.inc.compressed.js"></script>
<script language="javascript" type="text/javascript">
<!--
{literal}
function changeStatus(status){
	var nValue = status.options[status.selectedIndex].value;
	if(nValue=="Y")
	{
		document.getElementById('status').className='active';
	}
	else if(nValue=="N")
	{
		document.getElementById('status').className='inactive';
	}
	else
	{
		document.getElementById('status').className='notcompleted';
	}
}
	var cp = new cpaint();
	cp.set_transfer_mode('get');
	cp.set_response_type('xml');
	cp.set_debug(false);
	function addNumbers() 
	{
		var fileToUse = 'ajax.php';
		cp.call(fileToUse, 'subtract', response, document.getElementById('oTotal').value, document.getElementById('oDiscount').value);
	}	
	
	function response(result) {
		document.getElementById('total').innerHTML = result.getElementsByTagName('ajaxResponse').item(0).firstChild.data;
	}
{/literal}
//-->
</script>
{if $success}
	<script type="text/javascript" src="javascript/fat.js"></script>
	<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
{/if}
	<table width="100%" border="0" cellpadding="3" cellspacing="0" class="wrap">
		<tr>
			<td align="left">
					
				<form action="orders.php" method="post" name="orders">
				<input type="hidden" name="action" value="modify" />
				<input type="hidden" name="oID" value="{$oID}" />
					
					<table width="100%" border="0" cellspacing="2" cellpadding="3">
						<tr>
							<th>{$smarty.const.LANG_ADMIN_PACKAGE}</th>
							<th>Options</th>
							<th width="5%" nowrap>{$smarty.const.LANG_ADMIN_PRICE}</th>
						</tr>
						<tr>
							<td>
								<select name="oProductID " id="oProductID">
									{foreach from=$packages item=pack}
									<option value="{$pack.pID}"{if $oProductID==$pack.pID} SELECTED{/if}>{$pack.pWorkingName}</option>
									{/foreach}
								</select>
							</td>
							<td>- Bold<br />- Highlighted</td>
							<td width="5%" align="right" nowrap>
								{$currency_symbol}<input type="text" id="oTotal" name="oTotal" value="{$oTotal}" size="25" onchange="addNumbers();" />
							</td>
						</tr>
						<tr>
							<td></td>
							<td align="right" class="total"><label for="oBoldPrice">{$smarty.const.LANG_ADMIN_BOLD}{$smarty.const.LANG_COLON}</label></td>
							<td width="5%" class="total" align="right" nowrap>{$currency_symbol}<input name="oBoldPrice" id="oBoldPrice" type="text" value="{$oBoldPrice}" size="25" onchange="addNumbers();" /></td>			
						</tr>
						<tr>
							<td></td>
							<td align="right" class="total"><label for="oHighlightedPrice">{$smarty.const.LANG_ADMIN_HIGHLIGHT}{$smarty.const.LANG_COLON}</label></td>
							<td width="5%"  class="total" align="right" nowrap>{$currency_symbol}<input name="oHighlightedPrice" id="oHighlightedPrice" type="text" value="{$oHighlightedPrice}" size="25" onchange="addNumbers();" /></td>			
						</tr>
						<tr>
							<td></td>
							<td align="right" class="total"><label for="oFeaturedPrice">{$smarty.const.LANG_ADMIN_FEATURED}{$smarty.const.LANG_COLON}</label></td>
							<td width="5%"  class="total" align="right" nowrap>{$currency_symbol}<input name="oFeaturedPrice" id="oFeaturedPrice" type="text" value="{$oFeaturedPrice}" size="25" onchange="addNumbers();" /></td>			
						</tr>
							
						<tr>
							<td></td>
							<td align="right" class="total"><label for="oDiscount">{$smarty.const.LANG_ADMIN_DISCOUNT}{$smarty.const.LANG_COLON}</label> <em>{$oCoupon}</em></td>
							<td width="5%"  class="total" align="right" nowrap>-{$currency_symbol}<input name="oDiscount" id="oDiscount" type="text" value="{$oDiscount}" size="25" onchange="addNumbers();" /></td>			
						</tr>
						<tr>
							<td></td>
							<td align="right" class="total"><strong>{$smarty.const.LANG_ADMIN_TOTAL}{$smarty.const.LANG_COLON}</strong></td>
							<td width="5%" class="total" nowrap><strong><span id="total">{$total}</span></strong></td>
						</tr>
					</table>
					<br />
								<fieldset>
									<legend>{$smarty.const.LANG_ADMIN_ORDER_DETAILS}</legend>
									<table width="100%" cellpadding="2">
										<tr>
											<td>{$smarty.const.LANG_USER_USERNAME}{$smarty.const.LANG_COLON}</td>
											<td>{$username}</td>
											<td>{$smarty.const.LANG_ADMIN_DATE_ADDED}{$smarty.const.LANG_COLON}</td>
											<td>{$oDate}</td>
										</tr>
										<tr>
											<td>{$smarty.const.LANG_ADMIN_STATUS}{$smarty.const.LANG_COLON}</td>
											<td>
												<span id="status" class="{if $display=="Y"}active{elseif $display=="N"}inactive{else}notcompleted{/if}">
													<select name="oStatus" onChange="changeStatus(this);">
												     	<option class="active" value="Y"{if $oStatus == "1"} SELECTED{/if}>{$smarty.const.LANG_ADMIN_ORDER_STATUS_APPROVED}</option>
												     	<option class="inactive" value="N"{if $oStatus == "2"} SELECTED{/if}>{$smarty.const.LANG_ADMIN_ORDER_STATUS_PENDING}</option>
														<option class="notcompleted" value="C"{if $oStatus == "3"} SELECTED{/if}>{$smarty.const.LANG_ADMIN_NOT_COMPLETED}</option>
													</select>
												</span>
											</td>
											<td>Order IP:</td>
											<td>{$oIP}</td>
										</tr>
										<tr>
											<td valign="top">Additional Info{$smarty.const.LANG_COLON}</td>
											<td colspan="3">{$oAddInfo}</td>
										</tr>
									</table>
								</fieldset>
					<br />
					<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
						<tr>
							<th>Transactions</th>
						</tr>
						<tr>
							<td>{$usernotes}</td>
						</tr>
					</table>
					<br />
					<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
						<tr>
							<th colspan="4">Customer Information</th>
						</tr>
						<tr>
							<td width="25%" align="right">{$smarty.const.LANG_USER_USERNAME}{$smarty.const.LANG_COLON}</td>
							<td width="25%">{$username}</td>
							<td width="25%" align="right">{$smarty.const.LANG_ADMIN_EMAIL}{$smarty.const.LANG_COLON}</td>
							<td width="25%">{$email}</td>
						</tr>
						<tr>
							<td width="25%" align="right">{$smarty.const.LANG_ADMIN_IP}{$smarty.const.LANG_COLON}</td>
							<td width="25%"><a href="http://www.dnsstuff.com/tools/whois.ch?ip={$custip}" target="_blank">{$custip}</a></td>
							<td width="25%" align="right">{$smarty.const.LANG_ADMIN_JOIN_DATE}{$smarty.const.LANG_COLON}</td>
							<td width="25%">{$joindate}</td>
						</tr>
						<tr>
							<td colspan="4"><hr /></td>
						</tr>
						<tr>
							<td colspan="2" width="50%" valign="top">
								<fieldset>
									<legend>Personal Information</legend>
									<table width="100%" cellpadding="3" cellspacing="1">
										<tr>
											<td width="50%" align="right">{$smarty.const.LANG_ADMIN_FIRST_NAME}{$smarty.const.LANG_COLON}</td>
											<td width="50%">{$firstname}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_LAST_NAME}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$lastname}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_ADDRESS}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$address}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_CITY}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$city}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_STATE}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$state}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_COUNTRY}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$country}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_ZIP}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$zip}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_PHONE}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$phone}</td>
										</tr>
									</table>
								</fieldset>
							</td>
							<td colspan="2" valign="top" width="50%">
								<fieldset>
									<legend>Billing Information</legend>
									<table width="100%" cellpadding="3" cellspacing="1">
										<tr>
											<td width="50%" align="right">{$smarty.const.LANG_ADMIN_FIRST_NAME}{$smarty.const.LANG_COLON}</td>
											<td width="50%">{$b_firstname}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_LAST_NAME}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_lastname}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_ADDRESS}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_address}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_CITY}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_city}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_STATE}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_state}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_COUNTRY}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_country}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_ZIP}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_zip}</td>
										</tr>
										<tr>
											<td width="25%" align="right">{$smarty.const.LANG_ADMIN_PHONE}{$smarty.const.LANG_COLON}</td>
											<td width="25%">{$b_phone}</td>
										</tr>
									</table>
								</fieldset>
							</td>
						</tr>
					</table>
					<br />
					{if $usernotes}
					<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
						<tr>
							<th>User Notes</th>
						</tr>
						<tr>
							<td>{$usernotes}</td>
						</tr>
					</table>
					<br />
					{/if}
				<div align="center"><input type="submit" value="{$smarty.const.LANG_SUBMIT}" /> <input type="reset" name="reset" value="{$smarty.const.LANG_RESET}" /></div>
				</form>
			</td>
		</tr>
	</table>                                    administration/templates/default/orders/orders_browse.tpl                                           0000644 0023433 0004734 00000020214 11051631643 023772  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_MANAGE_ORDERS}</h2>
{if $success}
	<script type="text/javascript" src="javascript/fat.js"></script>
	<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
{/if}
{literal}
<script language="javascript" type="text/javascript">
	<!--
		function modify(id) {
			document.orders.id.value = id;
			document.orders.action.value = "modify";
			document.orders.submit();
		}
		function duplicate(id) {
			document.orders.id.value = id;
			document.orders.action.value = "duplicate";
			document.orders.submit();
		}
		function addnew(){
			document.orders.action.value = "addnew";
			document.orders.submit();
		}
		function remove(id){
			removemsg = "{/literal}{$smarty.const.LANG_JS_DELETE_CONFIRM}\n{$smarty.const.LANG_JS_NOT_UNDONE}{literal}"
			if (confirm(removemsg)) {
				document.orders.id.value = id;
				document.orders.action.value = "deletecat";
				document.orders.submit();
			}
		}
	// -->
</script>
{/literal}
	<table width="100%" class="wrap">
	<tr>
	<td>
		<form action="orders.php" method="get" name="search" id="search">
		<input type="hidden" name="sortfield" value="{$smarty.request.sortfield}" />
		<input type="hidden" name="sortorder" value="{$smarty.request.sortorder}" />
		
			<fieldset><legend>{$smarty.const.LANG_SEARCH}&hellip;</legend>
				<input type="text" name="searchtext" value="{$smarty.request.searchtext}" size="17" />
			</fieldset>
			<fieldset><legend>Status&hellip;</legend>
				<select name='status'>
					<option value="" selected>{$smarty.const.LANG_ANY}</option>
					<option value="1"{if $smarty.request.status == 1} selected{/if}>{$smarty.const.LANG_ORDER_STATUS_COMPLETED}</option>
					<option value="2"{if $smarty.request.status == 2} selected{/if}>{$smarty.const.LANG_ORDER_STATUS_PENDING_APPROVAL}</option>
					<option value="3"{if $smarty.request.status == 3} selected{/if}>{$smarty.const.LANG_ORDER_STATUS_PENDING_PAYMENT}</option>
					<option value="4"{if $smarty.request.status == 4} selected{/if}>{$smarty.const.LANG_ORDER_STATUS_NOT_COMPLETED}</option>
					<option value="5"{if $smarty.request.status == 5} selected{/if}>{$smarty.const.LANG_ORDER_STATUS_CANCELLED}</option>
				</select>
			</fieldset>
			
			<fieldset><legend>{$smarty.const.LANG_FROM}&hellip;</legend>
				<input type="text" name="fromdate" id="fromdate" onclick="return showCalendar('fromdate', '%Y-%m-%d');" size="12" readonly="1" value="{$smarty.request.fromdate}" />&nbsp;<img src="images/calendar.png" onclick="return showCalendar('fromdate', '%Y-%m-%d');" style="cursor: pointer;" alt="calendar" width="12" height="12" />&nbsp;
			</fieldset>
			
			<fieldset><legend>{$smarty.const.LANG_TO}&hellip;</legend>
				<input type="text" name="enddate" id="enddate" onclick="return showCalendar('enddate', '%Y-%m-%d');" size="12" readonly="1" value="{$smarty.request.enddate}" />&nbsp;<img src="images/calendar.png" onclick="return showCalendar('enddate', '%Y-%m-%d');" style="cursor: pointer;" alt="calendar" width="12" height="12" />&nbsp;
			</fieldset>
			
			<input type="submit" name="Submit" id="submit" value="{$smarty.const.LANG_SEARCH}" />
			<div class="clear"></div>
			
		</form>
		<form action="orders.php" method="post" name="orders">
		<input type="hidden" name="action" value="xxxxx" />
		<input type="hidden" name="id" value="xxxxx" />
			<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				<tr>
					<th scope="col" width="5%"><input type="checkbox" name="checkbox" value="checkbox" onClick="javascript:toggleAll(document.orders);" /></th>
					<th scope="col" width="5%"><a href="orders.php?{$querystring_oID}">ID {if $sqlsort=="oID"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="orders.php?{$querystring_oOwnerID}">{$smarty.const.LANG_USERNAME} {if $sqlsort=="oOwnerID"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="orders.php?{$querystring_oProduct}">{$smarty.const.LANG_PRODUCT} {if $sqlsort=="oProduct"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="orders.php?{$querystring_oDate}">{$smarty.const.LANG_DATE_ADDED} {if $sqlsort=="oDate"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="orders.php?{$querystring_oTotal}">{$smarty.const.LANG_TOTAL} {if $sqlsort=="oTotal"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="orders.php?{$querystring_oStatus}">{$smarty.const.LANG_STATUS} {if $sqlsort=="oStatus"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col" width="10%">{$smarty.const.LANG_MODIFY}</th>
				</tr>
				
				{foreach from=$results item="entry" name=status}
				<tr>
					<td width="5%" class="{cycle values="row1,row2" advance=false}"><input type="checkbox" name="orderid[]" value="{$entry.oID}" class="toggable" /></td>
					<td width="5%" class="{cycle values="row1,row2" advance=false}">{$entry.oID}</td>
					<td class="{cycle values="row1,row2" advance=false}" id="listing_{$entry.oID}"><a href="?action=modify&amp;id={$entry.oID}">{$entry.username}</a></td>
					<td class="{cycle values="row1,row2" advance=false}">{$entry.oProduct}</td>
					<td class="{cycle values="row1,row2" advance=false}">{$entry.oDate|date_format:$dateformat}</td>
					<td class="{cycle values="row1,row2" advance=false}">{$entry.total|format_money}</td>
					<td class="{cycle values="row1,row2" advance=false}">
						<span class="{if $entry.oStatus==1}active{elseif $entry.oStatus==2}inactive{elseif $entry.oStatus==3}pendingpayment{elseif $entry.oStatus==4}notcompleted{else}cancelled{/if}">
							{$entry.oStatusText}
						</span>
					</td>
					<td class="{cycle values="row1,row2" advance=true}"><a href="?action=modify&amp;id={$entry.oID}"><img src="images/page_edit.png" alt="{$smarty.const.LANG_MODIFY}" border="0" /></a></td>
				</tr>
				{foreachelse}
				<tr><td colspan="6">No results</td></tr>
				{/foreach}
			</table>

			<table width="100%"  border="0" cellspacing="0" cellpadding="3">
				<tr>
					<td>
						<select name="newstatus">
							<option value="" selected>{$smarty.const.LANG_CHANGE_STATUS}</option>
							<option value="1">{$smarty.const.LANG_ORDER_STATUS_COMPLETED}</option>
							<option value="2">{$smarty.const.LANG_ORDER_STATUS_PENDING_APPROVAL}</option>
							<option value="3">{$smarty.const.LANG_ORDER_STATUS_PENDING_PAYMENT}</option>
							<option value="4">{$smarty.const.LANG_ORDER_STATUS_NOT_COMPLETED}</option>
							<option value="5">{$smarty.const.LANG_ORDER_STATUS_CANCELLED}</option>
							<option value="6">{$smarty.const.LANG_DELETE}</option>
						</select>
						<input type="submit" value="{$smarty.const.LANG_UPDATE}" onclick="document.orders.action.value='changestatus';" />
					</td>
					<td align="right">
						{* display pagination *}
						<table class="pagination" cellpadding="3" cellspacing="1" border="0" align="right" style="margin-top:3px">
						<tr>
							<td class="navigationBack">{$smarty.const.LANG_SHOWING_PAGE} {$pageNum} of {$maxPage}</td>
							{if $first<>""}
							<td class="paginationNum"><a href="orders.php?{$first}">{$smarty.const.LANG_FIRST}</a></td>
							{/if}
							{if $prev<>""}
							<td class="paginationNum"><a href="orders.php?{$prev}">{$smarty.const.LANG_PREVIOUS}</a></td>
							{/if}
							{foreach from=$pageNumber item="entry"}
								{if $entry.number==$pageNum}
									<td class="paginationNum"><strong>{$entry.number}</strong></td>
								{else}
									<td class="paginationNum"><a href="orders.php?{$entry.link}" class="paginationNum">{$entry.number}</a></td>
								{/if}
							{/foreach}
							{if $next<>""}
								<td class="paginationNum"><a href="orders.php?{$next}">{$smarty.const.LANG_NEXT}</a></td>
							{/if}
							{if $last<>""}
								<td class="paginationNum"><a href="orders.php?{$last}">{$smarty.const.LANG_LAST}</a></td>
							{/if}
						</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
	</td>
	</tr>
	</table>                                                                                                                                                                                                                                                                                                                                                                                    administration/templates/default/orders/orders_edit.tpl                                             0000644 0023433 0004734 00000031074 11051631644 023425  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_ORDER} #{$oID}</h2>
<script type="text/javascript" src="../includes/classes/cpaint/cpaint2.inc.compressed.js"></script>
<script language="javascript" type="text/javascript">
<!--
{literal}
function changeStatus(status){
	var nValue = status.options[status.selectedIndex].value;
	if(nValue=="1")
	{
		document.getElementById('status').className='active';
	}
	else if(nValue=="2")
	{
		document.getElementById('status').className='inactive';
	}
	else if(nValue=="3")
	{
		document.getElementById('status').className='pendingpayment';
	}
	else if(nValue=="4")
	{
		document.getElementById('status').className='notcompleted';
	}
	else
	{
		document.getElementById('status').className='cancelled';
	}
}
{/literal}
//-->
</script>
{if $success}
	<script type="text/javascript" src="javascript/fat.js"></script>
	<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
{/if}
	<table width="100%" border="0" cellpadding="3" cellspacing="0" class="wrap">
		<tr>
			<td align="left">
				{literal}
					<script language="JavaScript" type="text/javascript">
					<!-- // 
					function toggleModules(section)
					{
						thestyle=document.getElementById(section).style;
						if(section=='details')
						{
							document.getElementById('detailsl').style.display='block';
							document.getElementById('transactionsl').style.display='none';
							document.getElementById('ordersl').style.display='none';
							document.getElementById('details').className='active';
							document.getElementById('transactions').className='';
							document.getElementById('orders').className='';
							document.getElementById('listingsl').style.display='none';
							document.getElementById('listings').className='';
						}
						else if(section=='transactions')
						{
							document.getElementById('detailsl').style.display='none';
							document.getElementById('transactionsl').style.display='block';
							document.getElementById('ordersl').style.display='none';
							document.getElementById('details').className='';
							document.getElementById('transactions').className='active';
							document.getElementById('orders').className='';
							document.getElementById('listingsl').style.display='none';
							document.getElementById('listings').className='';
						}
						else if(section=='orders')
						{
							document.getElementById('detailsl').style.display='none';
							document.getElementById('transactionsl').style.display='none';
							document.getElementById('ordersl').style.display='block';
							document.getElementById('details').className='';
							document.getElementById('transactions').className='';
							document.getElementById('orders').className='active';
							document.getElementById('listingsl').style.display='none';
							document.getElementById('listings').className='';
						}
						else if(section=='listings')
						{
							document.getElementById('detailsl').style.display='none';
							document.getElementById('transactionsl').style.display='none';
							document.getElementById('ordersl').style.display='none';
							document.getElementById('listingsl').style.display='block';
							document.getElementById('details').className='';
							document.getElementById('transactions').className='';
							document.getElementById('orders').className='';
							document.getElementById('listings').className='active';
						}
					}
					// -->
					</script>
					{/literal}
				<form action="orders.php" method="post" name="orders">
				<input type="hidden" name="cmd" value="modify" />
				<input type="hidden" name="id" value="{$oID}" />
					<div id="tabs">
						<ul>
							<li><a href="javascript:void(0);" onClick="toggleModules('details')" id="details" class="active"><span>{$smarty.const.LANG_ORDER_DETAILS}</span></a></li>
							<li><a href="javascript:void(0);" onClick="toggleModules('transactions')" id="transactions" class=""><span>{$smarty.const.LANG_TRANSACTIONS} ({$transaction_number})</span></a></li>
							<li><a href="javascript:void(0);" onClick="toggleModules('orders')" id="orders" class=""><span>{$smarty.const.LANG_ORD_HISTORY} ({$history})</span></a></li>
							<li><a href="javascript:void(0);" onClick="toggleModules('listings')" id="listings" class=""><span>{$smarty.const.LANG_LISTINGS} ({if $oType==3}0{else}{$listings}{/if})</span></a></li>
						</ul>
					</div>
					<div class="clear"></div>
					
					<div id="detailsl" style="display:block;">
					<table width="100%" border="0" cellspacing="2" cellpadding="3" class="main">
						<tr>
							<th>{$smarty.const.LANG_PRODUCT}</th>
							<th>Options</th>
							<th></th>
							<th width="5%" nowrap>{$smarty.const.LANG_PRICE}</th>
						</tr>
						<tr>
							<td valign="top">{$oProduct}</td>
							<td valign="top">
								{if $oType==3}
								- {$smarty.const.LANG_RENEWAL}<br /><a href="orders.php?action=modify&amp;id={$oRenewal}">{$smarty.const.LANG_ORIGINAL_ORDER}</a><br />
								{elseif $oType==4}
								- {$smarty.const.LANG_UPGRADE}<br /><a href="orders.php?action=modify&amp;id={$oRenewal}">{$smarty.const.LANG_ORIGINAL_ORDER}</a><br />
								{/if}
								{if $oBold=="Y"}
								- {$smarty.const.LANG_BOLD}<br />
								{/if}
								{if $oHighlighted=="Y"}
								- {$smarty.const.LANG_HIGHLIGHTED}<br />
								{/if}
								{if $oFeatured=="Y"}
								- {$smarty.const.LANG_FEATURED}
								{/if}
							</td>
							<td></td>
							<td valign="top" width="5%" align="right" nowrap>{$oSubTotal|format_money}</td>
						</tr>
						{if $oType==2}
						<tr>
							<td></td>
							<td>{$smarty.const.LANG_LISTINGS_PLACED}: <input type="text" name="numUsed" value="{$numUsed}" size="2" /> /{$mNumber}</td>
							<td></td>
							<td></td>
						</tr>
						<tr>
							<td></td>
							<td>{$smarty.const.LANG_FEATURED}: <input type="text" name="fnumUsed" value="{$fnumUsed}" size="2" /> / {$mFeatured}</td>
							<td></td>
							<td></td>
						</tr>
						<tr>
							<td></td>
							<td>{$smarty.const.LANG_HIGHLIGHTED}: <input type="text" name="hnumUsed" value="{$hnumUsed}" size="2" /> / {$mHighlighted}</td>
							<td></td>
							<td></td>
						</tr>
						<tr>
							<td></td>
							<td>{$smarty.const.LANG_BOLD}: <input type="text" name="bnumUsed" value="{$bnumUsed}" size="2" /> / {$mBold}</td>
							<td></td>
							<td></td>
						</tr>
						{/if}
						<tr>
							<td colspan="4" style="border-bottom: 1px solid #ccc;"></td>
						</tr>
						<tr>
							<td></td>
							<td></td>
							<td align="right" width="5%" class="total" nowrap>{$smarty.const.LANG_DISCOUNT}{$smarty.const.LANG_COLON} <em>{$oCoupon}</em></td>
							<td width="5%" class="total" align="right" nowrap>-{$oDiscount|format_money}</td>
						</tr>
						<tr>
							<td></td>
							<td></td>
							<td align="right" width="5%" class="total" nowrap><strong>{$smarty.const.LANG_TOTAL}{$smarty.const.LANG_COLON}</strong></td>
							<td width="5%" class="total" nowrap><strong><span id="total">{$fomatTotal|format_money}</span></strong></td>
						</tr>
					</table>
					<br />
								<fieldset>
									<legend>{$smarty.const.LANG_ORDER_DETAILS}</legend>
									<table width="100%" cellpadding="2">
										<tr>
											<td>{$smarty.const.LANG_USERNAME}{$smarty.const.LANG_COLON}</td>
											<td>{$username} <a href="users.php?view={$oOwnerID}"><img src="images/user_go.png" border="0" alt="View User" /></a></td>
											<td>{$smarty.const.LANG_DATE_ADDED}{$smarty.const.LANG_COLON}</td>
											<td>{$oDate}</td>
										</tr>
										<tr>
											<td>{$smarty.const.LANG_STATUS}{$smarty.const.LANG_COLON}</td>
											<td>
												<span id="status" class="{if $oStatus=="1"}active{elseif $oStatus=="2"}inactive{elseif $oStatus=="3"}pendingpayment{elseif $oStatus=="4"}notcompleted{else}cancelled{/if}">
													<select name="oStatus" onChange="changeStatus(this);">
												     	<option class="active" value="1"{if $oStatus == "1"} SELECTED{/if}>{$smarty.const.LANG_ORDER_STATUS_COMPLETED}</option>
												     	<option class="inactive" value="2"{if $oStatus == "2"} SELECTED{/if}>{$smarty.const.LANG_ORDER_STATUS_PENDING_APPROVAL}</option>
														<option class="pendingpayment" value="3"{if $oStatus == "3"} SELECTED{/if}>{$smarty.const.LANG_ORDER_STATUS_PENDING_PAYMENT}</option>
														<option class="notcompleted" value="4"{if $oStatus == "4"} SELECTED{/if}>{$smarty.const.LANG_ORDER_STATUS_NOT_COMPLETED}</option>
														<option class="cancelled" value="5"{if $oStatus == "5"} SELECTED{/if}>{$smarty.const.LANG_ORDER_STATUS_CANCELLED}</option>
													</select>
												</span>
												<input type="hidden" name="oldstatus" value="{$oStatus}" />
												<input type="hidden" name="oType" value="{$oType}" />
											</td>
											<td>{$smarty.const.LANG_IP}:</td>
											<td>{$oIP}</td>
										</tr>
										<tr>
											<td valign="top">{$smarty.const.LANG_ADDITIONAL_INFO}{$smarty.const.LANG_COLON}</td>
											<td colspan="3">{$oAddInfo}</td>
										</tr>
									</table>
								</fieldset>
					<br />
					<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
						<tr>
							<th>{$smarty.const.LANG_CUSTOMER_INFO}</th>
						</tr>
						<tr>
							<td>
								<div id="customers" style="visibility:visable;">
									{include file="orders/customer_table.tpl"}
								</div>
							</td>
						</tr>
					</table>
					<br />
						<div align="center"><input type="submit" value="{$smarty.const.LANG_SUBMIT}" /> <input type="reset" name="reset" value="{$smarty.const.LANG_RESET}" /></div>
					</div>
				
					<div id="transactionsl" style="display:none;">
					<!--<h2>{$smarty.const.LANG_TRANSACTIONS}</h2>-->
					<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
						<tr>
							<th>{$smarty.const.LANG_ID}</th>
							<th>{$smarty.const.LANG_GATEWAY}</th>
							<th>{$smarty.const.LANG_STATUS}</th>
							<th>{$smarty.const.LANG_TRANSACTION_ID}</th>
							<th>{$smarty.const.LANG_DATE}</th>
							<th>{$smarty.const.LANG_TOTAL}</th>
						</tr>
						{foreach from=$transactions item=entry}
						<tr>
							<td>{$entry.tID}</td>
							<td>{$entry.displayname}</td>
							<td>{$entry.tStatus}</td>
							<td>{$entry.tTransactionID}</td>
							<td>{$entry.tDate}</td>
							<td>{$entry.tTotal}</td>
						</tr>
						{/foreach}
					</table>
					<br />
					</div>
				</form>
					
					<div id="ordersl" style="display:none;">
						{literal}
<script language="javascript" type="text/javascript">
	<!--
		function modify(id) {
			location.href = "orders.php?action=modify&id="+id;
		}
	// -->
</script>
{/literal}
						<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
							<tr>
								<th scope="col" width="5%">ID</th>
								<th scope="col">{$smarty.const.LANG_USERNAME}</th>
								<th scope="col">{$smarty.const.LANG_PRODUCT}</th>
								<th scope="col">{$smarty.const.LANG_DATE_ADDED}</th>
								<th scope="col">{$smarty.const.LANG_TOTAL}</th>
								<th scope="col">{$smarty.const.LANG_STATUS}</th>
								<th scope="col" width="10%">{$smarty.const.LANG_MODIFY}</th>
							</tr>
							
							{foreach from=$results item="entry" name=status}
							<tr>
								<td width="5%" class="{cycle values="row1,row2" advance=false}">{$entry.oID}</td>
								<td class="{cycle values="row1,row2" advance=false}" id="listing_{$entry.oID}">{$entry.username}</td>
								<td class="{cycle values="row1,row2" advance=false}">{$entry.oProduct}</td>
								<td class="{cycle values="row1,row2" advance=false}">{$entry.oDate|date_format:$dateformat}</td>
								<td class="{cycle values="row1,row2" advance=false}">{$entry.total|format_money}</td>
								<td class="{cycle values="row1,row2" advance=false}">
									<span class="{if $entry.oStatus==1}active{elseif $entry.oStatus==2}inactive{elseif $entry.oStatus==3}pendingpayment{elseif $entry.oStatus==4}notcompleted{else}cancelled{/if}">
										{$entry.oStatusText}
									</span>
								</td>
								<td class="{cycle values="row1,row2" advance=false}"><input type="button" name="Button" value="{$smarty.const.LANG_MODIFY}" onClick="modify('{$entry.oID}')" /></td>
							</tr>
							{foreachelse}
							<tr><td colspan="5">No results</td></tr>
							{/foreach}
						</table>
					</div>
					
					<div id="listingsl" style="display:none;">
						{include file=listings/listings_grid.tpl}
					</div>
			</td>
		</tr>
	</table>                                                                                                                                                                                                                                                                                                                                                                                                                                                                    administration/templates/default/pages/                                                             0000755 0023433 0004734 00000000000 11036006645 020175  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/pages/pages.tpl                                                    0000644 0023433 0004734 00000004210 11051631646 022014  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_MODIFY_PAGES}</h2>
	<table width="100%" class="wrap">
	<tr>
	<td>
	
{literal}
<script language="javascript" type="text/javascript">
	<!--
		function modify(id) {
			document.mainform.pageID.value = id;
			document.mainform.action.value = "modify";
			document.mainform.submit();
		}
		function addnew(){
			document.mainform.action.value = "addnew";
			document.mainform.submit();
		}
		function remove(id){
			removemsg = "{/literal}{$smarty.const.LANG_JS_DELETE_CONFIRM}\n{$smarty.const.LANG_JS_NOT_UNDONE}{literal}"
			if (confirm(removemsg)) {
				document.mainform.pageID.value = id;
				document.mainform.action.value = "delete";
				document.mainform.submit();
			}
		}
	// -->
</script>
{/literal}

<form action="pages.php" method="post" name="mainform">
<input type="hidden" name="action" value="xxxxx" />
<input type="hidden" name="pageID" value="xxxxx" />
	<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
		<tr>
			<th scope="col" width="5%">{$smarty.const.LANG_ID}</th>
			<th scope="col">{$smarty.const.LANG_TITLE}</th>
			<th scope="col">{$smarty.const.LANG_MODIFY}</th>
			<th scope="col">{$smarty.const.LANG_DELETE}</th>
		</tr>
	{foreach from=$results item="entry"}
		<tr>
			<td class="{cycle values="row1,row2" advance=false}"><strong>{$entry.pageID}</strong></td>
			<td class="{cycle values="row1,row2" advance=false}">{$entry.pPageTitle}</td>
			<td class="{cycle values="row1,row2" advance=false}"><input type="button" name="Button" value="{$smarty.const.LANG_MODIFY}" onClick="modify('{$entry.pageID}')" /></td>
			<td class="{cycle values="row1,row2" advance=true}">{if $entry.pageID>5}<input type="button" name="Button" value="{$smarty.const.LANG_DELETE}" onClick="remove('{$entry.pageID}')" />{/if}</td>
		</tr>
	{/foreach}
		<tr>
			<td colspan="4" class="formstrip">
				<div align="center"><input type="button" name="Button" value="{$smarty.const.LANG_ADD_NEW}" onClick="addnew()" /></div>
			</td>
		</tr>
	</table>
</form>
<ul>
	<li>{$smarty.const.LANG_PAGE_LI}</li>
	<li>{$smarty.const.LANG_PAGE_LI2}</li>
</ul>

	</td>
	</tr>
	</table>                                                                                                                                                                                                                                                                                                                                                                                        administration/templates/default/pages/pagesform.tpl                                                0000644 0023433 0004734 00000011765 11051631647 022716  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_MODIFY_PAGES}</h2>
	<table width="100%" class="wrap">
	<tr>
	<td>
	
{if $success}
	<script type="text/javascript" src="javascript/fat.js"></script>
	<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
{/if}

{if $htmleditor=="Y"}
<script type="text/javascript" src="../javascript/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
{literal}
	tinyMCE.init({
		mode: "exact",
		theme : "advanced",
		elements : "elm1",
		theme_advanced_buttons1 : "bold,italic,strikethrough,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,image,separator,undo,redo,code,wphelp",
		theme_advanced_buttons2 : "",
		theme_advanced_buttons3 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_path_location : "bottom",
		theme_advanced_resizing : true,
		browsers : "msie,gecko,opera",
		dialog_type : "modal",
		theme_advanced_resize_horizontal : false,
		entity_encoding : "raw",
		relative_urls : false,
		remove_script_host : false,
		force_p_newlines : true,
		force_br_newlines : false,
		convert_newlines_to_brs : false,
		remove_linebreaks : true,
		plugins : "autosave"
	});
var tinyMCEmode = true;
function toggleEditorMode(sEditorID,eleToggleLink,option) {
    try {
        if(tinyMCEmode) {
            tinyMCE.execCommand("mceRemoveControl", false, sEditorID);
            tinyMCEmode = false;
            if(eleToggleLink)
                eleToggleLink.innerHTML    =    "<span>{/literal}{$smarty.const.LANG_SHOW_EDITOR}{literal}</span>";
        } else {
            tinyMCE.execCommand("mceAddControl", false, sEditorID);
            tinyMCEmode = true;
            if(eleToggleLink)
                eleToggleLink.innerHTML    =    "<span>{/literal}{$smarty.const.LANG_HIDE_EDITOR}{literal}</span>";
        }
    } catch(e) {
        //error handling
    }
}
{/literal}
</script>
{/if}
<script src="../javascript/js_quicktags/js_quicktags.js" type="text/javascript"></script>
					
<form action="pages.php" method="post" name="mainform">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="pageID" value="{$pageID}" />
	<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
		<tr>
			<td align="left" colspan="2"><label for="pPageTitle">{$smarty.const.LANG_PAGE_NAME}</label></td>
		</tr>
		<tr>
			<td align="left" colspan="2"><input type="text" id="pPageTitle" name="pPageTitle" value="{$pPageTitle}" size="55" /></td>
		</tr>
		
		<tr>
			<td align="left" valign="top" class="formleft" colspan="2">
				{if $htmleditor=="Y"}
					<div id="tabs">
						<ul>
							<li><a href="javascript:void(0);" onclick="toggleEditorMode('elm1',this);" id="toggleLink" class=""><span>{$smarty.const.LANG_HIDE_EDITOR}</span></a></li>
						</ul>
					</div>
					<div class="clear"></div>
				{/if}
				<script type="text/javascript">{if $htmleditor!="Y"} edToolbar();{/if}</script>
				<textarea name="pPageContent" id="elm1" style="width: 100%" rows="30">{$pPageContent}</textarea>
				<script type="text/javascript">edCanvas = document.getElementById('elm1');</script>
			</td>		
		</tr>
		{if $pageID!=1 && $pageID!=2 && $pageID!=5}
		<tr>
			<td align="left" valign="top" class="formleft">{$smarty.const.LANG_PAGES_NAV}<br /><span class="small">{$smarty.const.LANG_PAGES_NAV_TXT}</span></td>
			<td align="left" valign="top" class="formright">
				<select name="pNav">
					<option value="Y"{if $pNav=="Y"} SELECTED{/if}>{$smarty.const.LANG_YES}</option>
					<option value="N"{if $pNav=="N"} SELECTED{/if}>{$smarty.const.LANG_NO}</option>
				</select>
			</td>
		</tr>
		{/if}
		<tr>
			<td align="left" valign="top" class="formleft">{$smarty.const.LANG_PAGES_PUBLISH}<br /><span class="small">{$smarty.const.LANG_PAGES_PUBLISH_TXT}</span></td>
			<td align="left" valign="top" class="formright">
				<select name="pPublish">
					<option value="Y"{if $pPublish=="Y"} SELECTED{/if}>{$smarty.const.LANG_YES}</option>
					<option value="N"{if $pPublish=="N"} SELECTED{/if}>{$smarty.const.LANG_NO}</option>
				</select>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="left" class="formstrip">
				<div align="center">
					<input type="submit" name="save" id="save" value="{$smarty.const.LANG_SAVE_AND_CONTINUE}" />
					<input type="submit" value="{$smarty.const.LANG_SAVE}" style="font-weight: bold;" />
				</div>
			</td>
		</tr>
	</table>
</form>
	<br />
	{if $action=="modifypage"}
	<!-- Preview -->
	<h2>{$smarty.const.LANG_PAGE_PREVIEW}</h2>
		{if $pageID==1}
			<iframe src="../index.php?preview=true" width="100%" height="600"></iframe>
		{elseif $pageID==5}
			<iframe src="../contactus.php?preview=true" width="100%" height="600"></iframe>
		{else}
			<iframe src="../pages.php?page={$pageID}&amp;preview=true" width="100%" height="600"></iframe>
		{/if}
	<!-- End Preview --> 
	{/if}
	</td>
	</tr>
	</table>           administration/templates/default/private/                                                           0000755 0023433 0004734 00000000000 11036006654 020550  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/private/pm_browse.tpl                                              0000644 0023433 0004734 00000014753 11051631651 023276  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 {if $success}
	<script type="text/javascript" src="javascript/fat.js"></script>
	<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
{/if}
<h2>{$smarty.const.LANG_PRIVATE_MESSAGES}</h2>
	<table width="100%" class="wrap">
	<tr>
	<td>
		<form action="privatemessages.php" method="get" name="search">
		<input type="hidden" name="sortfield" value="{$smarty.request.sortfield}" />
		<input type="hidden" name="sortorder" value="{$smarty.request.sortorder}" />
			<table width="100%"  border="0" cellspacing="0" cellpadding="3">
				<tr>
					<td>
						<input type="text" name="searchtext" value="{$smarty.request.searchtext}" />
						<input type="submit" name="Submit" value="{$smarty.const.LANG_SEARCH}" />
					</td>
					<td> 
						<div align="right">
							{$smarty.const.LANG_SHOW_MESSAGES_FROM}
							<input type="text" name="fromdate" id="fromdate" onclick="return showCalendar('fromdate', '%Y-%m-%d');" size="12" readonly="1" value="{$smarty.request.fromdate}" />&nbsp;<img src="images/calendar.png" onclick="return showCalendar('fromdate', '%Y-%m-%d');" style="cursor: pointer;" alt="calendar" />&nbsp;
							{$smarty.const.LANG_SHOW_MESSAGES_TO}
							<input type="text" name="enddate" id="enddate" onclick="return showCalendar('enddate', '%Y-%m-%d');" size="12" readonly="1" value="{$smarty.request.enddate}" />&nbsp;<img src="images/calendar.png" onclick="return showCalendar('enddate', '%Y-%m-%d');" style="cursor: pointer;" alt="calendar" />&nbsp;
							<input type="submit" name="Submit" value="{$smarty.const.LANG_SEARCH}" />
						</div>
					</td>
				</tr>
			</table>
		</form>
		<form action="privatemessages.php" method="post" name="pm">
		<input type="hidden" name="act" value="xxxxx" />
			<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				<tr>
					<th scope="col" width="5%"><input type="checkbox" name="checkbox" value="checkbox" onClick="javascript:toggleAll(document.pm);" /></th>
					<th scope="col" width="5%"><a href="privatemessages.php?{$querystring_pmid}">{$smarty.const.LANG_ID} {if $sqlsort=="pmid"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="privatemessages.php?{$querystring_title}"> {$smarty.const.LANG_TITLE} {if $sqlsort=="title"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="privatemessages.php?{$querystring_fromusername}">{$smarty.const.LANG_FROM} {if $sqlsort=="fromusername"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="privatemessages.php?{$querystring_datesent}">{$smarty.const.LANG_DATE} {if $sqlsort=="datesent"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="privatemessages.php?{$querystring_folder}">{$smarty.const.LANG_FOLDER} {if $sqlsort=="folder"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col">{$smarty.const.LANG_FLAGS}</th>
				</tr>
				
				{foreach from=$results item="entry" name=status}
				<tr>
					<td width="5%" class="{cycle values="row1,row2" advance=false}"><input type="checkbox" name="pmid[]" value="{$entry.pmid}" class="toggable" /></td>
					<td width="5%" class="{cycle values="row1,row2" advance=false}">{$entry.pmid}</td>
					<td class="{cycle values="row1,row2" advance=false}" id="listing_{$entry.pmid}"><a href="privatemessages.php?read={$entry.pmid}">{$entry.title}</a></td>
					<td class="{cycle values="row1,row2" advance=false}">{$entry.fromusername}</td>
					<td class="{cycle values="row1,row2" advance=false}">{$entry.datesent|date_format:$dateformat}</td>
					<td class="{cycle values="row1,row2" advance=false}">{if $entry.folder==1}{$smarty.const.LANG_INBOX}{else}{$smarty.const.LANG_OUTBOX}{/if}</td>
					<td class="{cycle values="row1,row2" advance=true}">
						{if $entry.isspam=="Y"}
							<img src="images/spam.png" alt="Spam" />
						{elseif $entry.pmread=="Y"}
							<img src="images/read.png" alt="Read" />
						{else}
							<img src="images/notread.png" alt="Not Read" title="Not Read" />
						{/if}
					</td>
				</tr>
				{foreachelse}
				<tr><td colspan="6">{$smarty.const.LANG_NO_RESULTS}</td></tr>
				{/foreach}
			</table>

			<table width="100%"  border="0" cellspacing="0" cellpadding="3">
				<tr>
					<td width="33%">
						<select name="newstatus">
							<option value="0" selected>{$smarty.const.LANG_PLEASE_SELECT}</option>
							<option value="delete">{$smarty.const.LANG_DELETE}</option>
						</select>
						<input type="submit" value="{$smarty.const.LANG_UPDATE}" onclick="document.pm.act.value='changestatus';" />
					</td>
					<td width="33%" align="right" nowrap="nowrap">
						{* display pagination *}
						<table class="pagination" cellpadding="3" cellspacing="1" border="0" align="right" style="margin-top:3px">
						<tr>
							<td class="navigationBack" style="font-weight:normal">{$smarty.const.LANG_SHOWING_PAGE} {$pageNum} of {$maxPage}</td>
							{if $first<>""}
							<td class="paginationNum"><a href="privatemessages.php?{$first}">{$smarty.const.LANG_FIRST}</a></td>
							{/if}
							{if $prev<>""}
							<td class="paginationNum"><a href="privatemessages.php?{$prev}">{$smarty.const.LANG_PREVIOUS}</a></td>
							{/if}
							{foreach from=$pageNumber item="entry"}
								{if $entry.number==$pageNum}
									<td class="paginationNum"><strong>{$entry.number}</strong></td>
								{else}
									<td class="paginationNum"><a href="privatemessages.php?{$entry.link}" class="paginationNum">{$entry.number}</a></td>
								{/if}
							{/foreach}
							{if $next<>""}
								<td class="paginationNum"><a href="privatemessages.php?{$next}">{$smarty.const.LANG_NEXT}</a></td>
							{/if}
							{if $last<>""}
								<td class="paginationNum"><a href="privatemessages.php?{$last}">{$smarty.const.LANG_LAST}</a></td>
							{/if}
						</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
		<table width="30%" align="center">
			<tr>
				<td align="right"><img src="images/read.png" alt="read" /></td>
				<td align="left">{$smarty.const.LANG_READ}</td>  
				<td align="right"><img src="images/notread.png" alt="not read" /></td>
				<td align="left">{$smarty.const.LANG_NOT_READ}</td>
				<td align="right"><img src="images/spam.png" alt="spam" /></td>
				<td align="left">{$smarty.const.LANG_SPAM}</td>
			</tr>
		</table>
	</td>
	</tr>
	</table>                     administration/templates/default/private/pm_read.tpl                                                0000644 0023433 0004734 00000005303 11051631652 022700  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>#{$pmid} {$title}</h2>
{literal}
<script language="javascript" type="text/javascript">
	<!--
		function spam(id) {
			document.mainform.id.value = id;
			document.mainform.action.value = "spam";
			document.mainform.submit();
		}
		function notspam(id) {
			document.mainform.id.value = id;
			document.mainform.action.value = "notspam";
			document.mainform.submit();
		}
		function remove(id){
			removemsg = "{/literal}{$smarty.const.LANG_JS_DELETE_CONFIRM}\n{$smarty.const.LANG_JS_NOT_UNDONE}{literal}"
			if (confirm(removemsg)) {
				document.mainform.id.value = id;
				document.mainform.action.value = "delete";
				document.mainform.read.value = "";
				document.mainform.submit();
			}
		}
	// -->
</script>
{/literal}

{if $success}
	<script type="text/javascript" src="javascript/fat.js"></script>
	<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
{/if}
<table width="100%" class="wrap">
	<tr>
	<td>
		{if $isspam=="Y"}
					<div class="error">{$smarty.const.LANG_MARKED_SPAM}</div>
					{/if}
					
		<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
			<tr>
				<th>{$smarty.const.LANG_MESSAGE_INFO}</th><th>{$smarty.const.LANG_MESSAGE}</th>
			</tr>
			<tr>
				<td valign="top" style="border-right: 1px solid #ccc;" class="stats" rowspan="2">
					{$smarty.const.LANG_FROM}: <a href="users.php?view={$fromuserid}">{$fromusername}</a><br />
					{$smarty.const.LANG_TO}: <a href="users.php?view={$userid}">{$username}</a><br />
				</td>
				<td style="border-bottom: 1px solid #ccc;">
					<img src="images/calendar.png" alt="Sent On" align="absmiddle" /> Sent on:  {$datesent|date_format:$dateformat}
				</td>
			</tr>
			<tr>
				<td>
					<!--<strong>{$smarty.const.LANG_MESSAGE}</strong>-->
					<p>{$message|nl2br}</p>
				</td>
			</tr>
		</table>		
	</td>
	</tr>
	<tr>
				<td>
					<form action="privatemessages.php" method="post" name="mainform">
					<input type="hidden" name="action" value="xxxxx" />
					<input type="hidden" name="id" value="xxxxx" />
					<input type="hidden" name="read" value="{$pmid}" />
					<input type="hidden" name="userid" value="{$userid}" />
					<div align="center">
						<!-- //
						{if $isspam=="Y"}
							<input type="button" name="Button" value="{$smarty.const.LANG_MARK_NOT_SPAM}" onClick="notspam('{$pmid}')" />
						{else}
							<input type="button" name="Button" value="{$smarty.const.LANG_MARK_SPAM}" onClick="spam('{$pmid}')" />
						{/if}
						&nbsp;
						// -->
						<input type="button" name="Button" value="{$smarty.const.LANG_DELETE}" onClick="remove('{$pmid}')" />
					</div>
					</form>
				</td>
			</tr>
</table>                                                                                                                                                                                                                                                                                                                             administration/templates/default/products/                                                          0000755 0023433 0004734 00000000000 11036006663 020741  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/products/form.tpl                                                  0000644 0023433 0004734 00000007101 11074220561 022421  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 {literal}
<script language="javascript" type="text/javascript">
	<!--
	function checkform(frm) {
		if (frm.pTitle.value == "") {
			alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} \"{$smarty.const.LANG_TITLE}{literal}\".");
			frm.pTitle.focus();
			return (false);
		}
		return(true);
	}
	// -->
</script>
{/literal}
<h2>{$smarty.const.LANG_LISTING_PACKAGES}</h2>
<form action="products.php" method="post" name="add" onSubmit="return checkform(this)">
<input type="hidden" name="mode" value="{$action}" />
<input type="hidden" name="id" value="{$pID}" />
<table width="100%" class="wrap">
	<tr>
		<td>
		
			<table width="100%" class="main">
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="pTitle">{$smarty.const.LANG_TITLE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="pTitle" name="pTitle" value="{$pTitle}" size="25" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="pWorkingName">{$smarty.const.LANG_INTERNAL_NAME}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="pWorkingName" name="pWorkingName" value="{$pWorkingName}" size="25" /> <a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_INTERNAL_NAME}')" onmouseout="return nd();"><img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="pDescription">{$smarty.const.LANG_DESCRIPTION}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><textarea name="pDescription" style="width: 90%" rows="10" id="pDescription">{$pDescription}</textarea></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="pListPrice">{$smarty.const.LANG_LIST_PRICE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">{$currency_symbol}<input name="pListPrice" id="pListPrice" type="text" value="{$pListPrice}" /> <a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_LIST_PRICE}')" onmouseout="return nd();"><img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="pPrice">{$smarty.const.LANG_PRICE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">{$currency_symbol}<input name="pPrice" id="pPrice" type="text" value="{$pPrice}" /></td>
					</tr>
					{if $renewal=="Y"}
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="pRenewalPrice">{$smarty.const.LANG_RENEWAL_PRICE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">{$currency_symbol}<input name="pRenewalPrice" type="text" value="{$pRenewalPrice}" /></td>
					</tr>
					{/if}
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="pExpiration">{$smarty.const.LANG_EXPIRATION}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="pExpiration" id="pExpiration">
								{html_options options=$data selected=$pExpiration}
							</select>
							{$smarty.const.LANG_DAYS}
						</td>
					</tr>
					
					{if $action=="addnewpackage" || $pType==1}
						{include file="products/package_form.tpl"}
					{else}
						{include file="products/membership_form.tpl"}
					{/if}
				</table>
				
				<div align="center" style="padding: 5px;">
					<input type="submit" value="{$smarty.const.LANG_SUBMIT}" />
				</div>
		</td>
	</tr>
</table>
</form>                                                                                                                                                                                                                                                                                                                                                                                                                                                               administration/templates/default/products/membership_form.tpl                                       0000644 0023433 0004734 00000005644 11051631655 024653  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="mNumber">{$smarty.const.LANG_NUMBER_ADS}</label></td>
	<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="mNumber" name="mNumber" value="{$mNumber}" size="25" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_MEMBERSHIP_NUMBER}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
</tr>
<tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="mUserGroup">{$smarty.const.LANG_USER_GROUPS}</label></td>
	<td class="{cycle values="row1,row2" advance=true}">
		<select name="mUserGroup" id="mUserGroup">
			{foreach from=$userlevels item="entry"}
			<option value="{$entry.uGroupID}"{if $mUserGroup==$entry.uGroupID} SELECTED{/if}>{$entry.uTitle}</option>
			{/foreach}
		</select>
		<a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_MEMBERSHIP_GROUP}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a>
	</td>
</tr>
<tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="mFeatured">{$smarty.const.LANG_FEATURED}</label></td>
	<td class="{cycle values="row1,row2" advance=true}"><input name="mFeatured" id="mFeatured" type="text" value="{$mFeatured}" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_MEMBERSHIP_FEATURED}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
</tr>
<tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="mBold">{$smarty.const.LANG_BOLD}</label></td>
	<td class="{cycle values="row1,row2" advance=true}"><input name="mBold" id="mBold" type="text" value="{$mBold}" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_MEMBERSHIP_BOLD}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
</tr>
<tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="mHighlighted">{$smarty.const.LANG_HIGHLIGHTED}</label></td>
	<td class="{cycle values="row1,row2" advance=true}"><input name="mHighlighted" id="mHighlighted" type="text" value="{$mHighlighted}" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_MEMBERSHIP_HIGHLIGHTED}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
</tr>
<tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="cats">{$smarty.const.LANG_LISTING_PACKAGES}</label></td>
	<td class="{cycle values="row1,row2" advance=true}">
		<select multiple="multiple" size="10" name="cat[]" id="cats">
			{foreach from=$packages item=cat}
			<option value="{$cat.pID}"{if $pPackage==$cat.pID} SELECTED{/if}>
				{if $cat.pWorkingName<>""}
				{$cat.pWorkingName}
				{else}
				{$cat.pTitle}
				{/if}
			</option>
			{/foreach}
		</select>
		<input type="hidden" name="pType" value="2" />
	</td>
</tr>                                                                                            administration/templates/default/products/package_form.tpl                                          0000644 0023433 0004734 00000007372 11051631656 024114  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="cTitleCharacters">{$smarty.const.LANG_TITLE_CHARACTERS}</label></td>
	<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="cTitleCharacters" name="cTitleCharacters" value="{$cTitleCharacters}" size="25" /></td>
</tr>
<tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="cShortDescCharacters">{$smarty.const.LANG_SDESC_CHARACTERS}</label></td>
	<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="cShortDescCharacters" name="cShortDescCharacters" value="{$cShortDescCharacters}" size="25" /></td>
</tr>
<tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="cCharacters">{$smarty.const.LANG_DESC_CHARACTERS}</label></td>
	<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="cCharacters" name="cCharacters" value="{$cCharacters}" size="25" /></td>
</tr>
<tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="cDisURL">{$smarty.const.LANG_CHECKOUT_EXTERNAL_URL}</label></td>
	<td class="{cycle values="row1,row2" advance=true}"><input name="cDisURL" id="cDisURL" type="checkbox" value="Y"{if $cDisURL=="Y"} checked{/if} /> <a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_EXTERNAL_URL}')" onmouseout="return nd();"><img src="images/help.png" border="0" alt="help" /></a></td>
</tr>
<tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="cAllowImages">{$smarty.const.LANG_ALLOW_PHOTOS}</label></td>
	<td class="{cycle values="row1,row2" advance=true}">
		<input name="cAllowImages" id="cAllowImages" type="checkbox" value="Y"{if $cAllowImages=="Y"} checked{/if} />
		<label for="cNumImages">{$smarty.const.LANG_ALLOW_PHOTOS_IF}</label> <input name="cNumImages" id="cNumImages" type="text" value="{$cNumImages}" size="4" />
	</td>
</tr>
<tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="cFeatured">{$smarty.const.LANG_ALLOW_FEATURED}</label></td>
	<td class="{cycle values="row1,row2" advance=true}">
		<input name="cFeatured" id="cFeatured" type="checkbox" value="Y"{if $cFeatured=="Y"} checked{/if} />
		<label for="cFeaturedPrice">{$smarty.const.LANG_ALLOW_EXTRA_IF}</label> {$currency_symbol}<input name="cFeaturedPrice" id="cFeaturedPrice" type="text" value="{$cFeaturedPrice}" size="5" />
	</td>
</tr>
<tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="cBold">{$smarty.const.LANG_ALLOW_BOLD}</label></td>
	<td class="{cycle values="row1,row2" advance=true}">
		<input name="cBold" id="cBold" type="checkbox" value="Y"{if $cBold=="Y"} checked{/if} />
		<label for="cBoldPrice">{$smarty.const.LANG_ALLOW_EXTRA_IF}</label> {$currency_symbol}<input name="cBoldPrice" id="cBoldPrice" type="text" value="{$cBoldPrice}" size="5" />
	</td>
</tr>
<tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="cHighlighted">{$smarty.const.LANG_ALLOW_HIGHLIGHTED}</label></td>
	<td class="{cycle values="row1,row2" advance=true}">
		<input name="cHighlighted" id="cHighlighted" type="checkbox" value="Y"{if $cHighlighted=="Y"} checked{/if} />
		<label for="cHighlightedPrice">{$smarty.const.LANG_ALLOW_EXTRA_IF}</label> {$currency_symbol}<input name="cHighlightedPrice" id="cHighlightedPrice" type="text" value="{$cHighlightedPrice}" size="5" />
	</td>
</tr>
<tr>
	<td class="{cycle values="row1,row2" advance=false}"><label for="cats">{$smarty.const.LANG_FIELD_CAT}</label></td>
	<td class="{cycle values="row1,row2" advance=true}">
		<select name="cat[]" id="cats" size="10" multiple="multiple">
			{foreach from=$getcats item=cat}
			<option value="{$cat.id}"{if $cat.selected==Y} SELECTED{/if}>{$cat.name}</option>
			{/foreach}
		</select>
		<input type="hidden" name="pType" value="1" />
	</td>
</tr>                                                                                                                                                                                                                                                                      administration/templates/default/products/products.tpl                                              0000644 0023433 0004734 00000007241 11051631657 023335  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_MANAGE_PRODUCTS}</h2>
{literal}
<script language="javascript" type="text/javascript">
	<!--
		function chi(currindex)
		{
			var i = eval("document.mainform.newpos"+currindex+".selectedIndex");
			document.mainform.newval.value = eval("document.mainform.newpos"+currindex+".options[i].text");
			document.mainform.selectedq.value = currindex;
			document.mainform.act.value = "changeorder";
			document.mainform.submit();
		}
		function newPackage(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "newpackage";
			document.mainform.submit();
		}
		function newMembership(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "newmembership";
			document.mainform.submit();
		}
		function modify(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "modify";
			document.mainform.submit();
		}
		function deleteid(id) {
		cmsg = "{/literal}{$smarty.const.LANG_JS_DELETE_CONFIRM}\n{$smarty.const.LANG_JS_NOT_UNDONE}{literal}"
			if (confirm(cmsg)) {
				document.mainform.id.value = id;
				document.mainform.act.value = "delete";
				document.mainform.submit();
			}
		}
	// -->
</script>
{/literal}
<form action="products.php" method="post" name="mainform">
<input type="hidden" name="act" value="xxxxx" />
<input type="hidden" name="id" value="xxxxx" />
<input type="hidden" name="selectedq" value="1" />
<input type="hidden" name="newval" value="1" />
<table width="100%" class="wrap">
	<tr>
		<td>
			{if $success}
				<script type="text/javascript" src="javascript/fat.js"></script>
				<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
			{/if}
			<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				<tr>
					<th scope="col" width="5%">{$smarty.const.LANG_ORDER}</th>
					<th scope="col">{$smarty.const.LANG_TITLE}</th>
					<th scope="col">{$smarty.const.LANG_TYPE}</th>
					<th scope="col">{$smarty.const.LANG_MODIFY}</th>
					<th scope="col">{$smarty.const.LANG_DELETE}</th>
				</tr>
				{foreach from=$results item="entry"}
				<tr>
					<td class="{cycle values="row1,row2" advance=false}">
						<select name='newpos{$entry.pOrder}' onChange='chi({$entry.pOrder});'>
							{section name=order loop=$max+1 start=1}
							<option value="{$smarty.section.order.index}"{if $entry.pOrder==$smarty.section.order.index} SELECTED{/if}>{$smarty.section.order.index}</option>
							{/section}
						</select>
					</td>
					<td class="{cycle values="row1,row2" advance=false}">
						{if $entry.pWorkingName <> ""}
							{$entry.pWorkingName}
						{else}
							{$entry.pTitle}
						{/if}
					</td>
					<td class="{cycle values="row1,row2" advance=false}">{if $entry.pType==1}{$smarty.const.LANG_LISTING_PACKAGE}{elseif $entry.pType==2}{$smarty.const.LANG_MEMBERSHIP}{/if}</td>
					<td class="{cycle values="row1,row2" advance=false}"><input type="button" name="Button" value="{$smarty.const.LANG_MODIFY}" onClick="modify('{$entry.pID}')" /></td>
					<td class="{cycle values="row1,row2" advance=true}"><input type="button" name="Button" value="{$smarty.const.LANG_DELETE}" onClick="deleteid('{$entry.pID}')" /></td>
				</tr>
				{foreachelse}
				<tr>
					<td colspan="5" class="row1">{$smarty.const.LANG_NO_RESULTS}</td>
				</tr>
				{/foreach}
			</table>
		
			<div align="center" style="padding: 5px;">
				<input type="button" value="{$smarty.const.LANG_NEW_LISTING_PACKAGE}" onClick="newPackage()" />&nbsp;
				<!--<input type="button" value="{$smarty.const.LANG_NEW_MEMBERSHIP_PACKAGE}" onClick="newMembership()" />-->
			</div>
		
		</td>
	</tr>
</table>
</form>                                                                                                                                                                                                                                                                                                                                                               administration/templates/default/settings/                                                          0000755 0023433 0004734 00000000000 11036006706 020734  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/settings/settings_badwords.tpl                                     0000644 0023433 0004734 00000011046 11051631661 025205  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <!-- // Start Badword Page // -->
<script type="text/javascript" src="javascript/fat.js"></script>
<script language="JavaScript" type="text/javascript">
{literal}
	<!--
		function newopt(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "addnew";
			document.mainform.submit();
		}
		function modify(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "modify";
			document.mainform.submit();
		}
		function deleteid(id) {
		cmsg = "{/literal}{$smarty.const.LANG_JS_DELETE_CONFIRM}\n{$smarty.const.LANG_JS_NOT_UNDONE}{literal}"
		if (confirm(cmsg)) {
			document.mainform.id.value = id;
			document.mainform.act.value = "delete";
			document.mainform.submit();
		}
		}
	// -->
{/literal}
</script>
<h2>{$smarty.const.LANG_BAD_WORD_SETTINGS}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
{if $success}
	<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
{/if}
{if $action=="list"}
				<form action="settingsbadwords.php" method="post" name="mainform">
				<input type="hidden" name="act" value="xxxxx" />
				<input type="hidden" name="id" value="xxxxx" />
					<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				          <tr>
				            <th align="left" valign="top">{$smarty.const.LANG_WORD}</th>
				            <th align="left" valign="top"> {$smarty.const.LANG_REPLACEMENT} </th>
				            <th width="15%" align="left">{$smarty.const.LANG_MODIFY}</th>
				            <th width="15%" align="left">{$smarty.const.LANG_DELETE}</th>
				          </tr>
						  {foreach from=$results item="entry"}
				          <tr>
				            <td class="{cycle values="row1,row2" advance=false}">{$entry.wordName}</td>
				            <td class="{cycle values="row1,row2" advance=false}">{$entry.wordReplacement}</td>
				            <td class="{cycle values="row1,row2" advance=false}"><input type="button" value="{$smarty.const.LANG_MODIFY}" onClick="modify('{$entry.wordID}')" /></td>
				            <td class="{cycle values="row1,row2" advance=true}"><input type="button" value="{$smarty.const.LANG_DELETE}" onClick="deleteid('{$entry.wordID}')" /></td>
				          </tr>
						  {/foreach}
				         <tr>
				            <td colspan="4" align="left" class="formstrip"><div align="center">
				            <input type="button" value="{$smarty.const.LANG_ADD_NEW}" onClick="newopt()" />
				            </div></td>
				          </tr>
					</table>
				</form>

<!-- // End // -->
{else}
{literal}
<script language="javascript" type="text/javascript">
<!-- //
function checkform(frm) 
{
	if (frm.word.value == '') 
	{
		alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} '{$smarty.const.LANG_WORD}{literal}'.");
		frm.word.focus();
		return (false);
	}
}
//-->
</script>
{/literal}
				<!-- // Start Badword Page // -->
				<form action="settingsbadwords.php" method="post" name="mainform" onsubmit="return checkform(this)">
				<input type="hidden" name="action" value="{$action}" />
				<input type="hidden" name="id" value="{$id}" />
					<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				     	<tr>
				          	<th colspan="4" align="left" valign="top" class="maintitle">{$smarty.const.LANG_CENSOR}</th>
				          </tr>
				          <tr>
				            <td align="left" valign="top" class="formleft"><label for="word">{$smarty.const.LANG_WORD}</label></td>
				            <td align="left" valign="top" class="formright"><input type="text" id="word" name="word" title="{$smarty.const.LANG_ADMIN_WORD}" value="{$word}" tabindex="1" /></td>
				          </tr>
				          <tr>
				            <td align="left" valign="top" class="formleft"><label for="replacement">{$smarty.const.LANG_REPLACEMENT}</label></td>
				            <td align="left" valign="top" class="formright"><input type="text" id="replacement" name="replacement" title="{$smarty.const.LANG_ADMIN_REPLACEMENT}" value="{$replacement}" tabindex="2" />
				            <a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_BAD_WORDS}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a>
				            </td>
				          </tr>
				         <tr>
				            <td colspan="2" align="left" class="formstrip"><div align="center">
				            <input type="submit" value="{$smarty.const.LANG_SUBMIT}" tabindex="3" />
				            </div></td>
				          </tr>
					</table>
				</form>
				<!-- // End // -->
{/if}
			</td>
		</tr>
	</table>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          administration/templates/default/settings/settings_countries.tpl                                    0000644 0023433 0004734 00000007321 11051631662 025415  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_EDIT_COUNTRIES}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
{if $showform=='YES'}
				<form action="settingscountries.php" method="post" name="mainform">
				<input name="id" type="hidden" value="{$id}" />
				<input name="action" type="hidden" value="{$action}" />
					
					<table width="100%"  border="0" cellspacing="0" cellpadding="3">
				          <tr>
				            <td class="{cycle values="row1,row2" advance=false}"><label for="name">{$smarty.const.LANG_COUNTRY}</label></td>
				            <td class="{cycle values="row1,row2" advance=true}"><input type="text" id="name" name="name" value="{$name}" size="50" tabindex="1" /></td>
				          </tr>
				          <tr>
				            <td class="{cycle values="row1,row2" advance=false}"><label for="abbrev">{$smarty.const.LANG_COUNTRY_CODE}</label></td>
				            <td class="{cycle values="row1,row2" advance=true}"><input type="text" id="abbrev" name="abbrev" value="{$abbrev}" tabindex="2" /></td>
				          </tr>
						<tr>
							<td class="{cycle values="row1,row2" advance=false}"><label for="countryOrder">{$smarty.const.LANG_ORDER}</label></td>
							<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="countryOrder" name="countryOrder" value="{$countryOrder}" tabindex="3" /></td>
						</tr>
				         <tr>
				            <td colspan="2" align="left" class="formstrip"><div align="center">
				            <input type="submit" value="{$smarty.const.LANG_SUBMIT}" tabindex="4" />
				            </div></td>
				          </tr>
					</table>
				</form>

<!-- // End // -->
{else}
{literal}
<script language="JavaScript" type="text/javascript">
	<!--
		function addnew(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "addnew";
			document.mainform.submit();
		}
		function modify(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "modify";
			document.mainform.submit();
		}
		function deleteid(id) {
		cmsg = "{/literal}{$smarty.const.LANG_JS_DELETE_CONFIRM}\n{$smarty.const.LANG_JS_NOT_UNDONE}{literal}"
			if (confirm(cmsg)) {
				document.mainform.id.value = id;
				document.mainform.act.value = "delete";
				document.mainform.submit();
			}
		}
	// -->
</script>
{/literal}
				<form action="settingscountries.php" method="post" name="mainform">
					<input type="hidden" name="act" value="xxxxx" />
					<input type="hidden" name="id" value="xxxxx" />
					<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				          <tr>
				            <th align="left" valign="top">{$smarty.const.LANG_COUNTRY}</th>
				            <th width="15%" align="left" valign="top">{$smarty.const.LANG_MODIFY}</th>
				            <th width="15%" align="left">{$smarty.const.LANG_DELETE}</th>
				          </tr>
						  {foreach from=$showcountries item="entry"}
				          <tr>
				            <td class="{cycle values="row1,row2" advance=false}">{$entry.countryName}</td>
				            <td class="{cycle values="row1,row2" advance=false}"><input type="button" value="{$smarty.const.LANG_MODIFY}" onClick="modify('{$entry.countryID}')" /></td>
				            <td class="{cycle values="row1,row2" advance=true}"><input type="button" value="{$smarty.const.LANG_DELETE}" onClick="deleteid('{$entry.countryID}')" /></td>
				          </tr>
						  {/foreach}
				         <tr>
				            <td colspan="4" align="left" class="formstrip"><div align="center">
				            <input type="button" value="{$smarty.const.LANG_ADD_NEW}" onClick="addnew()" />
				            </div></td>
				          </tr>
					</table>
				</form>
				<!-- // End // -->
{/if}
			</td>
		</tr>
	</table>                                                                                                                                                                                                                                                                                                               administration/templates/default/settings/settings_images.tpl                                       0000644 0023433 0004734 00000015006 11051631663 024647  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script type="text/javascript" src="javascript/fat.js"></script>
<script language="JavaScript" type="text/javascript">
<!--
{literal}
function checkform(frm) {
	if (frm.extensions.value == "") {
		alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} \"{$smarty.const.LANG_IMAGE_ALLOWED_EXT}{literal}\".");
		frm.title.focus();
		return (false);
	}
	return(true);
}
{/literal}
-->
</script>
<h2>{$smarty.const.LANG_IMAGE_SETTINGS}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
			{if $success}
				<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
			{/if}
			<form name="sitesetup" method="post" action="settingsimages.php" onSubmit="return checkform(this)">
				<table width="100%" class="main">
					
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="component">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_IMAGE_COMPONENT}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="component" id="component" tabindex="1">
		                         <option value="NetPBM"{if $component == "NetPBM"} selected{/if}>NetPBM</option>
		                         <option value="GD"{if $component == "GD"} selected{/if}>GD</option>
		                         <option value="GD2"{if $component == "GD2"} selected{/if}>GD2</option>
		                    </select>
		                    <a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.LANG_IMAGE_COMPONENT_TXT}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="extensions">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_IMAGE_ALLOWED_EXT}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="extensions" id="extensions" type="text" value="{$extensions}" size="30" tabindex="2" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.LANG_ADMIN_IMAGE_ALLOWED_EXT_TXT}')" onmouseout="return nd();"><img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
			        <tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="maxWidth">{$smarty.const.LANG_IMAGE_LARGE_WIDTH}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="maxWidth" id="maxWidth" type="text" value="{$maxWidth}" size="30" tabindex="3" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.LANG_ADMIN_IMAGE_LARGE_WIDTH_TXT}')" onmouseout="return nd();"><img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="maxHeight">{$smarty.const.LANG_IMAGE_LARGE_HEIGTH}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="maxHeight" id="maxHeight" type="text" value="{$maxHeight}" size="30" tabindex="4" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.LANG_ADMIN_IMAGE_LARGE_HEIGHT_TXT}')" onmouseout="return nd();"><img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="quality">{$smarty.const.LANG_IMAGE_LARGE_QUALITY}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="quality" id="quality" type="text" value="{$quality}" size="30" tabindex="5" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.LANG_ADMIN_IMAGE_LARGE_QUALITY_TXT}')" onmouseout="return nd();"><img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="maxWidthThumb">{$smarty.const.LANG_IMAGE_THUMB_WIDTH}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="maxWidthThumb" id="maxWidthThumb" type="text" value="{$maxWidthThumb}" size="30" tabindex="6" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.LANG_ADMIN_IMAGE_THUMB_WIDTH_TXT}')" onmouseout="return nd();"><img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="maxHeightThumb">{$smarty.const.LANG_IMAGE_THUMB_HEIGHT}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="maxHeightThumb" id="maxHeightThumb" type="text" value="{$maxHeightThumb}" size="30" tabindex="7" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.LANG_ADMIN_IMAGE_THUMB_HEIGHT_TXT}')" onmouseout="return nd();"><img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="qualityThumb">{$smarty.const.LANG_IMAGE_THUMB_QUALITY}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="qualityThumb" id="qualityThumb" type="text" value="{$qualityThumb}" size="30" tabindex="8" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.LANG_ADMIN_IMAGE_THUMB_QUALITY_TXT}')" onmouseout="return nd();"><img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="maxSize">{$smarty.const.LANG_IMAGE_MAX_SIZE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="maxSize" id="maxSize" type="text" value="{$maxSize}" size="30" tabindex="9" /></td>
					</tr>
					
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uploadMaxWidth">{$smarty.const.LANG_IMAGE_UPLOAD_WIDTH}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="uploadMaxWidth" id="uploadMaxWidth" type="text" value="{$uploadMaxWidth}" size="30" tabindex="9" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uploadMaxHeight">{$smarty.const.LANG_IMAGE_UPLOAD_HEIGHT}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="uploadMaxHeight" id="uploadMaxHeight" type="text" value="{$uploadMaxHeight}" size="30" tabindex="10" /></td>
					</tr>
					<tr>
						<td colspan="2" class="formstrip">
							<div align="center">
								<input name="action" type="hidden" value="modify" />
								<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" tabindex="10" />
			            		</div>
						</td>
					</tr>
				</table>
				</form>
			</td>
		</tr>
	</table>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          administration/templates/default/settings/settings_list.tpl                                         0000644 0023433 0004734 00000012506 11051631663 024357  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_SETTINGS}</h2>
	<table width="100%" class="wrap">
	<tr>
	<td>
			<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				<tr>
					<th scope="col" width="90%">{$smarty.const.LANG_FRONTEND_SETTINGS}</th>
					<th scope="col" width="10%">{$smarty.const.LANG_EDIT}</th>
				</tr>
				
				<tr>
					<td width="90%" class="{cycle values="row1,row2" advance=false}"><a href="settingsmain.php" tabindex="1">{$smarty.const.LANG_MAIN_SETTINGS}</a></td>
					<td width="10%" nowrap="nowrap" class="{cycle values="row1,row2" advance=true}"><a href="settingsmain.php"><img src="images/page_edit.png" alt="{$smarty.const.LANG_EDIT}" border="0" /></a></td>
				</tr>
				<tr>
					<td width="90%" class="{cycle values="row1,row2" advance=false}"><a href="settingssearch.php" tabindex="2">{$smarty.const.LANG_SEARCH_SETTINGS}</a></td>
					<td width="10%" class="{cycle values="row1,row2" advance=true}"><a href="settingssearch.php"><img src="images/page_edit.png" alt="{$smarty.const.LANG_EDIT}" border="0" /></a></td>
				</tr>
				<tr>
					<td width="90%" class="{cycle values="row1,row2" advance=false}"><a href="settingslistings.php" tabindex="3">{$smarty.const.LANG_LISTING_VIEW_SETTINGS}</a></td>
					<td width="10%" class="{cycle values="row1,row2" advance=true}"><a href="settingssearch.php"><img src="images/page_edit.png" alt="{$smarty.const.LANG_EDIT}" border="0" /></a></td>
				</tr>
				<tr>
					<td width="90%" class="{cycle values="row1,row2" advance=false}"><a href="settingsuserview.php" tabindex="4">{$smarty.const.LANG_USER_VIEW_SETTINGS}</a></td>
					<td width="10%" class="{cycle values="row1,row2" advance=true}"><a href="settingsuserview.php"><img src="images/page_edit.png" alt="{$smarty.const.LANG_EDIT}" border="0" /></a></td>
				</tr>
				<tr>
					<td width="90%" class="{cycle values="row1,row2" advance=false}"><a href="settingsimages.php" tabindex="5">{$smarty.const.LANG_IMAGE_SETTINGS}</a></td>
					<td width="10%" class="{cycle values="row1,row2" advance=true}"><a href="settingsimages.php"><img src="images/page_edit.png" alt="{$smarty.const.LANG_EDIT}" border="0" /></a></td>
				</tr>
				<tr>
					<td width="90%" class="{cycle values="row1,row2" advance=false}"><a href="settingsregional.php" tabindex="6">{$smarty.const.LANG_REGIONAL_SETTINGS}</a></td>
					<td width="10%" class="{cycle values="row1,row2" advance=true}"><a href="settingsregional.php"><img src="images/page_edit.png" alt="{$smarty.const.LANG_EDIT}" border="0" /></a></td>
				</tr>
				<tr>
					<td width="90%" class="{cycle values="row1,row2" advance=false}"><a href="settingsbadwords.php" tabindex="7">{$smarty.const.LANG_BAD_WORD_SETTINGS}</a></td>
					<td width="10%" class="{cycle values="row1,row2" advance=true}"><a href="settingsbadwords.php"><img src="images/page_edit.png" alt="{$smarty.const.LANG_EDIT}" border="0" /></a></td>
				</tr>
				<tr>
					<td width="90%" class="{cycle values="row1,row2" advance=false}"><a href="settingspm.php" tabindex="7">{$smarty.const.LANG_PM_SETTINGS}</a></td>
					<td width="10%" class="{cycle values="row1,row2" advance=true}"><a href="settingspm.php"><img src="images/page_edit.png" alt="{$smarty.const.LANG_EDIT}" border="0" /></a></td>
				</tr>
				<tr>
					<th colspan="2">{$smarty.const.LANG_USER_ADMIN_SETTINGS}</th>
				</tr>
				<tr>
					<td width="90%" class="{cycle values="row1,row2" advance=false}"><a href="settingsuseradmin.php" tabindex="7">{$smarty.const.LANG_USER_SETTINGS}</a></td>
					<td width="10%" class="{cycle values="row1,row2" advance=true}"><a href="settingsuseradmin.php"><img src="images/page_edit.png" alt="{$smarty.const.LANG_EDIT}" border="0" /></a></td>
				</tr>
				<tr>
					<td width="90%" class="{cycle values="row1,row2" advance=false}"><a href="settingsuserregistration.php" tabindex="7">{$smarty.const.LANG_REGISTRATION_FIELDS}</a></td>
					<td width="10%" class="{cycle values="row1,row2" advance=true}"><a href="settingsuserregistration.php"><img src="images/page_edit.png" alt="{$smarty.const.LANG_EDIT}" border="0" /></a></td>
				</tr>
				<tr>
					<td width="90%" class="{cycle values="row1,row2" advance=false}"><a href="settingsusercheckout.php" tabindex="7">{$smarty.const.LANG_CHECKOUT_SETTINGS}</a></td>
					<td width="10%" class="{cycle values="row1,row2" advance=true}"><a href="settingsusercheckout.php"><img src="images/page_edit.png" alt="{$smarty.const.LANG_EDIT}" border="0" /></a></td>
				</tr>
				<tr>
					<th colspan="2">{$smarty.const.LANG_STATES_COUNTRIES}</th>
				</tr>
				<tr>
					<td width="90%" class="{cycle values="row1,row2" advance=false}"><a href="settingsstates.php" tabindex="8">{$smarty.const.LANG_EDIT_STATES}</a></td>
					<td width="10%" class="{cycle values="row1,row2" advance=true}"><a href="settingsstates.php"><img src="images/page_edit.png" alt="{$smarty.const.LANG_EDIT}" border="0" /></a></td>
				</tr>
				<tr>
					<td width="90%" class="{cycle values="row1,row2" advance=false}"><a href="settingscountries.php" tabindex="9">{$smarty.const.LANG_EDIT_COUNTRIES}</a></td>
					<td width="10%" class="{cycle values="row1,row2" advance=true}"><a href="settingscountries.php"><img src="images/page_edit.png" alt="{$smarty.const.LANG_EDIT}" border="0" /></a></td>
				</tr>
				{modulehook function="admin_tpl_settings_list" options=""}
			</table>

	</td>
	</tr>
	</table>                                                                                                                                                                                          administration/templates/default/settings/settings_listings.tpl                                     0000644 0023433 0004734 00000003367 11051631664 025246  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script type="text/javascript" src="javascript/fat.js"></script>
<h2>{$smarty.const.LANG_LISTING_VIEW_SETTINGS}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
			{if $success}
				<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
			{/if}
			<form name="sitesetup" method="post" action="settingslistings.php" onSubmit="return checkform(this)">
				<table width="100%" class="main">
					
					<tr>
						<td colspan="2">{$smarty.const.LANG_DISPLAY_LISTINGS_DESC}</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="lDisplay">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_DISPLAY_IMAGE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="lDisplay" id="lDisplay" tabindex="1">
								<option value="1"{if $lDisplay == "1"} selected{/if}>{$smarty.const.LANG_DISPLAY_IMAGE_ONE}</option>
								<option value="2"{if $lDisplay == "2"} selected{/if}>{$smarty.const.LANG_DISPLAY_IMAGE_TWO}</option>
							</select>
						</td>
					</tr>
			        <tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="lCols">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_DISPLAY_IMAGE_COLS}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="lCols" id="lCols" value="{$lCols}" size="4" tabindex="2" /></td>
					</tr>
					
					<tr>
						<td colspan="2" class="formstrip">
							<div align="center">
								<input name="action" type="hidden" value="modify" />
								<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" tabindex="4" />
			            		</div>
						</td>
					</tr>
				</table>
				</form>
			</td>
		</tr>
	</table>                                                                                                                                                                                                                                                                         administration/templates/default/settings/settings_main.tpl                                         0000644 0023433 0004734 00000030146 11051631665 024332  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script type="text/javascript" src="javascript/fat.js"></script>
<script language="JavaScript" type="text/javascript">
<!--
{literal}
function checkform(frm) {
	if (frm.title.value == "") {
		alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} \"{$smarty.const.LANG_SITE_TITLE}{literal}\".");
		frm.title.focus();
		return (false);
	}
	if (frm.url.value == "") {
		alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} \"{$smarty.const.LANG_SITE_URL}{literal}\".");
		frm.url.focus();
		return (false);
	}
	if (frm.email.value == "") {
		alert("{/literal}{$smarty.const.LANG_JS_PLEASE_ENTER} \"{$smarty.const.LANG_SITE_EMAIL}{literal}\".");
		frm.email.focus();
		return (false);
	}
	if (frm.mainIndexCols.value == "" || frm.mainIndexCols.value < 1) {
		alert("{/literal}{$smarty.const.LANG_SITE_CAT_COLUMNS} {$smarty.const.LANG_JS_GREATER_ZERO}{literal}");
		frm.mainIndexCols.focus();
		return (false);
	}
	if (frm.mainCatCols.value == "" || frm.mainCatCols.value < 1) {
		alert("{/literal}{$smarty.const.LANG_SITE_CAT_COLUMNS_CAT} {$smarty.const.LANG_JS_GREATER_ZERO}{literal}");
		frm.mainCatCols.focus();
		return (false);
	}
	if (frm.mainSubCols.value == "" || frm.mainSubCols.value < 1) {
		alert("{/literal}{$smarty.const.LANG_SITE_SUBCAT_COLUMNS} {$smarty.const.LANG_JS_GREATER_ZERO}{literal}");
		frm.mainSubCols.focus();
		return (false);
	}
	return(true);
}
{/literal}
-->
</script>
<h2>{$smarty.const.LANG_MAIN_SETTINGS}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
			{if $success}
				<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
			{/if}
			<form name="sitesetup" method="post" action="settingsmain.php" onSubmit="return checkform(this)">
				<table width="100%" class="main">
					
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_SITE_TITLE}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="title" type="text" value="{$title}" size="{$smarty.const.ADMIN_FIELD_SIZE}" tabindex="1" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_TITLE}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_SITE_KEYWORDS}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="keywords" type="text" id="keywords" value="{$keywords}" size="{$smarty.const.ADMIN_FIELD_SIZE}" tabindex="2" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_KEYWORDS}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
			          </tr>
			          <tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_DESCRIPTION} </td>
						<td class="{cycle values="row1,row2" advance=true}"><textarea name="description" cols="35" rows="4" tabindex="3">{$description}</textarea></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_SITE_URL}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="url" type="text" value="{$url}" size="{$smarty.const.ADMIN_FIELD_SIZE}" tabindex="4" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"> {$smarty.const.LANG_SITE_SECURE_URL}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="urls" type="text" value="{$urls}" size="{$smarty.const.ADMIN_FIELD_SIZE}" tabindex="5" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_SITE_EMAIL}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="email" type="text" id="email" value="{$email}" size="{$smarty.const.ADMIN_FIELD_SIZE}" tabindex="6" /></td>
					</tr>
					
					<!-- SMTP -->
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_SMTP}</td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="smtp" tabindex="7">
								<option value="Y"{if $smtp == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $smtp == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
							<a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_SMTP}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_SMTPHOST}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="smtpHost" type="text" id="smtpHost" value="{$smtpHost}" size="{$smarty.const.ADMIN_FIELD_SIZE}" tabindex="8" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_SMTP_SERVER}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_SMTPUSERNAME}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="smtpUsername" type="text" id="smtpUsername" value="{$smtpUsername}" size="{$smarty.const.ADMIN_FIELD_SIZE}" tabindex="9" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_SMTP_USERNAME}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_SMTPPASSWORD}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="smtpPassword" type="text" id="smtpPassword" value="{$smtpPassword}" size="{$smarty.const.ADMIN_FIELD_SIZE}" tabindex="10" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_SMTP_PASSWORD}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_SMTPPORT}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="smtpPort" type="text" id="smtpPort" value="{$smtpPort}" size="{$smarty.const.ADMIN_FIELD_SIZE}" tabindex="11" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_SMTP_PORT}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_HTML_EMAILS}</td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="mailHTML" tabindex="12">
								<option value="Y"{if $mailHTML == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $mailHTML == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<!-- SMTP -->
					
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_HTML_EDITOR}</td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="htmlEditor" tabindex="12">
								<option value="Y"{if $htmlEditor == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $htmlEditor == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
							<a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_HTML_EDITOR}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_SITE_TEMPLATE}</td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="mainTemplate" tabindex="13">
							     {foreach from=$templates item="entry"}
							     <option value="{$entry}"{if $entry==$mainTemplate} SELECTED{/if}>{$entry}</option>
								{/foreach}
							</select>
							<a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_SITE_TEMPLATE}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_ADMINISTRATION_TEMPLATE}</td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="adminTemplate" tabindex="13">
							     {foreach from=$admintemplates item="entry"}
							     <option value="{$entry}"{if $entry==$adminTemplate} SELECTED{/if}>{$entry}</option>
								{/foreach}
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_EMAIL_VALIDATION}</td>
						<td class="{cycle values="row1,row2" advance=true}">
							<input {if $mainEmailValidation=="Y"} checked{/if} name="mainEmailValidation" type="checkbox" id="mainEmailValidation" value="Y" tabindex="14" />
							<a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_EMAIL_VALIDATION}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a>
						</td>
					</tr>
					
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_SITE_CAT_COLUMNS}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="mainIndexCols" type="text" value="{$mainIndexCols}" size="2" tabindex="15" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_SITE_CAT_COLUMNS_CAT}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="mainCatCols" type="text" value="{$mainCatCols}" size="2" tabindex="16" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_SITE_SUBCAT_COLUMNS}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="mainSubCols" type="text" value="{$mainSubCols}" size="2" tabindex="17" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_ENABLE_CAT_TOTAL}</td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="showTotal" tabindex="12">
								<option value="Y"{if $showTotal == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $showTotal == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
							<a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_CAT_TOTAL}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_REMOVE_TIME}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="removeTime" type="text" value="{$removeTime}" size="2" tabindex="18" /></td>
					</tr>
					
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_SITE_TAKE_OFFLINE}</td>
						<td class="{cycle values="row1,row2" advance=true}"><input {if $mainTakeOffline=="Y"} checked{/if} name="mainTakeOffline" type="checkbox" id="mainTakeOffline" value="Y" tabindex="19" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_SITE_OFFLINE_REASON}</td>
						<td class="{cycle values="row1,row2" advance=true}"><textarea name="mainTakeOfflineReason" cols="35" rows="4" id="mainTakeOfflineReason" tabindex="20">{$mainTakeOfflineReason}</textarea></td>
					</tr>
					<tr>
						<td colspan="2" class="formstrip">
							<div align="center">
								<input name="action" type="hidden" value="modify" />
								<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" tabindex="20" />
			            		</div>
						</td>
					</tr>
				</table>
				</form>
			</td>
		</tr>
	</table>                                                                                                                                                                                                                                                                                                                                                                                                                          administration/templates/default/settings/settings_pm.tpl                                           0000644 0023433 0004734 00000004555 11051631665 024027  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script type="text/javascript" src="javascript/fat.js"></script>
<h2>Private Messaging Settings</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
			{if $success}
				<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
			{/if}
			<form name="sitesetup" method="post" action="settingspm.php">
				<table width="100%" class="main">
					
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="turnedon">{$smarty.const.LANG_TURNED_ON}:</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="turnedon" id="turnedon" tabindex="1">
								<option value="Y"{if $turnedon == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $turnedon == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="max">{$smarty.const.LANG_MAX_STORED}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="max" id="max" tabindex="2" value="{$max}" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="turnedon">{$smarty.const.LANG_PM_SEND_NOTIFICATION}:</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="sendNotification" id="sendNotification" tabindex="3">
								<option value="Y"{if $sendNotification == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $sendNotification == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					
					<tr>
						<td colspan="2" class="{cycle values="row1,row2" advance=false}"><label for="spam">{$smarty.const.LANG_ALLOWED_HTML}: </label></td>
					</tr>
					<tr>
						<td colspan="2" class="{cycle values="row1,row2" advance=true}"><textarea name="allowedTags" id="allowedTags" tabindex="4" style="width: 100%">{$allowedTags}</textarea></td>
					</tr>
					<tr>
						<td colspan="2" class="formstrip">
							<div align="center">
								<input name="action" type="hidden" value="modify" />
								<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" tabindex="5" />
			            		</div>
						</td>
					</tr>
				</table>
				</form>
			</td>
		</tr>
	</table>                                                                                                                                                   administration/templates/default/settings/settings_regional.tpl                                     0000644 0023433 0004734 00000011761 11051631666 025211  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script type="text/javascript" src="javascript/fat.js"></script>
{literal}
<script language="JavaScript" type="text/JavaScript">
function writit(field)
{
     document.getElementById('cCurrencySymbol').innerHTML = trim(field.value);
}
</script>
{/literal}
			{if $success}
				<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
			{/if}
<h2>{$smarty.const.LANG_REGIONAL_SETTINGS}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
			<form name="sitesetup" method="post" action="settingsregional.php" onSubmit="return checkform(this)">
				<table width="100%" class="main">
					
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cLanguage">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_SITE_LANGUAGE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="cLanguage" id="cLanguage">
							     {foreach from=$rslanguage item="entry"}
							     <option value="{$entry}"{if $entry==$cLanguage} SELECTED{/if}>{$entry}</option>
								{/foreach}
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cAdminLanguage">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_ADMINSITE_LANGUAGE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="cAdminLanguage" id="cAdminLanguage">
							     {foreach from=$rsAdminLanguage item="entry"}
							     <option value="{$entry}"{if $entry==$cAdminLanguage} SELECTED{/if}>{$entry}</option>
								{/foreach}
							</select>
						</td>
			          </tr>
			          <tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cDateFormat">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_DATE_FORMAT}</label><br /><span class="small">{$smarty.const.LANG_DATE_FORMAT_TXT}<br />See: <a href="http://us2.php.net/strftime" target="_blank">http://us2.php.net/strftime</a></span></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="cDateFormat" name="cDateFormat" value="{$cDateFormat}" size="30" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cAdminDateFormat">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_ADMINDATE_FORMAT}</label><br /><span class="small">{$smarty.const.LANG_ADMINDATE_FORMAT_TXT}<br />See: <a href="http://us2.php.net/strftime" target="_blank">http://us2.php.net/strftime</a></span></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" id="cAdminDateFormat" name="cAdminDateFormat" value="{$cAdminDateFormat}" size="{$smarty.const.ADMIN_FIELD_SIZE}" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cCurrencySymbol">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_ADMIN_CURRENCY_SYMBOL}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="cCurrencySymbol" id="cCurrencySymbol" value="{$cCurrencySymbol}" size="10" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cCurrencyDecimal">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_ADMIN_CURRENCY_DECIMAL}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="cCurrencyDecimal" id="cCurrencyDecimal" value="{$cCurrencyDecimal}" size="4" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cCurrencyDecimalPlaces">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_ADMIN_CURRENCY_DECIMAL_PLACES}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="cCurrencyDecimalPlaces" id="cCurrencyDecimalPlaces" value="{$cCurrencyDecimalPlaces}" size="4" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cCurrencyThousands">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_ADMIN_THOUSANDS}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="cCurrencyThousands" id="cCurrencyThousands" value="{$cCurrencyThousands}" size="4" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="cCurrencyAfter">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_CURRENCY_BEFORE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="cCurrencyAfter" id="cCurrencyAfter">
								<option value="Y"{if $cCurrencyAfter == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $cCurrencyAfter == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td colspan="2" class="formstrip">
							<div align="center">
								<input name="action" type="hidden" value="modify" />
								<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" />
			            		</div>
						</td>
					</tr>
				</table>
				</form>
			</td>
		</tr>
	</table>               administration/templates/default/settings/settings_search.tpl                                       0000644 0023433 0004734 00000012614 11051631667 024655  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script type="text/javascript" src="javascript/fat.js"></script>
<h2>{$smarty.const.LANG_SEARCH_SETTINGS}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
			{if $success}
				<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
			{/if}
			<form name="sitesetup" method="post" action="settingssearch.php">
				<table width="100%" class="main">
					
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="sPrice">{$smarty.const.LANG_SEARCH_PRICE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="sPrice" id="sPrice">
								<option value="Y"{if $sPrice == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $sPrice == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="sCity">{$smarty.const.LANG_SEARCH_CITY}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="sCity" id="sCity">
								<option value="Y"{if $sCity == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $sCity == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="sState">{$smarty.const.LANG_SEARCH_STATE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="sState" id="sState">
								<option value="Y"{if $sState == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $sState == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="sCountry">{$smarty.const.LANG_SEARCH_COUNTRY}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="sCountry" id="sCountry">
								<option value="Y"{if $sCountry == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $sCountry == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="sPagination">{$smarty.const.LANG_SEARCH_PAGINATION}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="sPagination" id="sPagination">
								<option value="1"{if $sPagination == "1"} selected{/if}>{$smarty.const.LANG_TOP}</option>
								<option value="2"{if $sPagination == "2"} selected{/if}>{$smarty.const.LANG_BOTTOM}</option>
								<option value="3"{if $sPagination == "3"} selected{/if}>{$smarty.const.LANG_BOTH}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="sMaxSearch">{$smarty.const.LANG_SITE_MAX_SEARCH}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="sMaxSearch" id="sMaxSearch" type="text" value="{$sMaxSearch}" size="2" /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="sProductSort">{$smarty.const.LANG_SITE_SORT}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="sProductSort" id="sProductSort">
								<option value="id"{if $sProductSort == "id"} selected{/if}>{$smarty.const.LANG_ID}</option>
								<option value="title"{if $sProductSort == "title"} selected{/if}>{$smarty.const.LANG_TITLE}</option>
								<option value="featured"{if $sProductSort == "featured"} selected{/if}>{$smarty.const.LANG_FEATURED}</option>
								<option value="price"{if $sProductSort == "price"} selected{/if}>{$smarty.const.LANG_PRICE}</option>
								<option value="hitcount"{if $sProductSort == "hitcount"} selected{/if}>{$smarty.const.LANG_VIEWS}</option>
								<option value="dateadded"{if $sProductSort == "dateadded"} selected{/if}>{$smarty.const.LANG_DATE_ADDED}</option>
								<option value="expiration"{if $sProductSort == "expiration"} selected{/if}>{$smarty.const.LANG_EXPIRATION}</option>
							</select>
							&nbsp;
							<select name="sProductSortOption" id="sProductSortOption">
								<option value="ASC"{if $sProductSortOption == "ASC"} selected{/if}>{$smarty.const.LANG_SITE_SORT_ASC}</option>
								<option value="DESC"{if $sProductSortOption == "DESC"} selected{/if}>{$smarty.const.LANG_SITE_SORT_DESC}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="sTemplate">{$smarty.const.LANG_SHOW_LISTING_TEMPLATE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="sTemplate" id="sTemplate">
								<option value="1"{if $sTemplate == 1} selected{/if}>{$smarty.const.LANG_SHOW_LISTING_TEMPLATE_1}</option>
								<option value="2"{if $sTemplate == 2} selected{/if}>{$smarty.const.LANG_SHOW_LISTING_TEMPLATE_2}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td colspan="2" class="formstrip">
							<div align="center">
								<input name="action" type="hidden" value="modify" />
								<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" />
			            		</div>
						</td>
					</tr>
				</table>
				</form>
			</td>
		</tr>
	</table>                                                                                                                    administration/templates/default/settings/settings_states.tpl                                       0000644 0023433 0004734 00000006477 11051631667 024725  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_EDIT_STATES}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
{if $showform=='YES'}
				<form action="settingsstates.php" method="post" name="mainform">
				<input name="id" type="hidden" value="{$id}" />
				<input name="action" type="hidden" value="{$action}" />
					
					<table width="100%"  border="0" cellspacing="0" cellpadding="3">
				          <tr>
				            <td class="{cycle values="row1,row2" advance=false}"><label for="name">{$smarty.const.LANG_STATE}</label></td>
				            <td class="{cycle values="row1,row2" advance=true}"><input type="text" id="name" name="name" value="{$name}" /></td>
				          </tr>
				          <tr>
				            <td class="{cycle values="row1,row2" advance=false}"><label for="abbrev">{$smarty.const.LANG_STATE_ABBR}</label></td>
				            <td class="{cycle values="row1,row2" advance=true}"><input type="text" id="abbrev" name="abbrev" value="{$abbrev}" /></td>
				          </tr>
				         <tr>
				            <td colspan="2" align="left" class="formstrip"><div align="center">
				            <input type="submit" value="{$smarty.const.LANG_SUBMIT}" />
				            </div></td>
				          </tr>
					</table>
				</form>

<!-- // End // -->
{else}
{literal}
<script language="JavaScript" type="text/javascript">
	<!--
		function addnew(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "addnew";
			document.mainform.submit();
		}
		function modify(id) {
			document.mainform.id.value = id;
			document.mainform.act.value = "modify";
			document.mainform.submit();
		}
		function deleteid(id) {
		cmsg = "{/literal}{$smarty.const.LANG_JS_DELETE_CONFIRM}\n{$smarty.const.LANG_JS_NOT_UNDONE}{literal}"
			if (confirm(cmsg)) {
				document.mainform.id.value = id;
				document.mainform.act.value = "delete";
				document.mainform.submit();
			}
		}
	// -->
</script>
{/literal}
				<form action="settingsstates.php" method="post" name="mainform">
					<input type="hidden" name="act" value="xxxxx" />
					<input type="hidden" name="id" value="xxxxx" />
					<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				          <tr>
				            <th align="left" valign="top">{$smarty.const.LANG_STATE}</th>
				            <th width="15%" align="left" valign="top">{$smarty.const.LANG_MODIFY}</th>
				            <th width="15%" align="left">{$smarty.const.LANG_DELETE}</th>
				          </tr>
						  {foreach from=$showstates item="entry"}
				          <tr>
				            <td class="{cycle values="row1,row2" advance=false}">{$entry.name}</td>
				            <td class="{cycle values="row1,row2" advance=false}"><input type="button" value="{$smarty.const.LANG_MODIFY}" onClick="modify('{$entry.id}')" /></td>
				            <td class="{cycle values="row1,row2" advance=true}"><input type="button" value="{$smarty.const.LANG_DELETE}" onClick="deleteid('{$entry.id}')" /></td>
				          </tr>
						  {/foreach}
				         <tr>
				            <td colspan="4" align="left" class="formstrip"><div align="center">
				            <input type="button" value="{$smarty.const.LANG_ADD_NEW}" onClick="addnew()" />
				            </div></td>
				          </tr>
					</table>
				</form>
				<!-- // End // -->
{/if}
			</td>
		</tr>
	</table>                                                                                                                                                                                                 administration/templates/default/settings/settings_useradmin.tpl                                    0000644 0023433 0004734 00000003523 11051631670 025370  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script type="text/javascript" src="javascript/fat.js"></script>
<h2>{$smarty.const.LANG_USER_ADMIN_SETTINGS}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
			{if $success}
				<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
			{/if}
			<form name="sitesetup" method="post" action="settingsuseradmin.php">
				<table width="100%" class="main">
					
					<tr>
						<td colspan="2">{$smarty.const.LANG_USER_SETTINGS_TXT}</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uDisHits">{$smarty.const.LANG_USER_SHOW_HITS}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="uDisHits" id="uDisHits" tabindex="1">
								<option value="Y"{if $uDisHits == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $uDisHits == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uDisSearchHits">{$smarty.const.LANG_USER_SHOW_SEARCH_HITS}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="uDisSearchHits" id="uDisSearchHits" tabindex="2">
								<option value="Y"{if $uDisSearchHits == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $uDisSearchHits == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td colspan="2" class="formstrip">
							<div align="center">
								<input name="action" type="hidden" value="modify" />
								<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" tabindex="12" />
			            		</div>
						</td>
					</tr>
				</table>
				</form>
			</td>
		</tr>
	</table>                                                                                                                                                                             administration/templates/default/settings/settings_usercheckout.tpl                                 0000644 0023433 0004734 00000016621 11051631671 026111  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script type="text/javascript" src="javascript/fat.js"></script>
<h2>{$smarty.const.LANG_CHECKOUT_SETTINGS}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
			{if $success}
				<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
			{/if}
			<form name="sitesetup" method="post" action="settingsusercheckout.php">
				<table width="100%" class="main">
					
					<tr>
						<th colspan="2">{$smarty.const.LANG_CHECKOUT_SETTINGS_TXT}</th>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="checkoutNotification">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_CHECKOUT_NOTIFICATION}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="checkoutNotification" id="checkoutNotification" tabindex="1">
								<option value="Y"{if $checkoutNotification == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $checkoutNotification == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="checkoutManuallyApprove">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_CHECKOUT_MANUALLY_APPROVE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="checkoutManuallyApprove" id="checkoutManuallyApprove" tabindex="2">
								<option value="Y"{if $checkoutManuallyApprove == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $checkoutManuallyApprove == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="checkoutModifyStatus">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_MODIFY_AD_STATUS}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="checkoutModifyStatus" id="checkoutModifyStatus" tabindex="3">
								<option value="Y"{if $checkoutModifyStatus == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $checkoutModifyStatus == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="checkoutDisPrice">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_CHECKOUT_DISPLAY_PRICE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="checkoutDisPrice" id="checkoutDisPrice" tabindex="4">
								<option value="Y"{if $checkoutDisPrice == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $checkoutDisPrice == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="checkoutDisShortDesc">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_CHECKOUT_DISPLAY_SHORT_DESC}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="checkoutDisShortDesc" id="checkoutDisShortDesc" tabindex="5">
								<option value="Y"{if $checkoutDisShortDesc == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $checkoutDisShortDesc == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="checkoutDisDesc">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_CHECKOUT_DISPLAY_DESC}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="checkoutDisDesc" id="checkoutDisDesc" tabindex="6">
								<option value="Y"{if $checkoutDisDesc == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $checkoutDisDesc == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="checkoutRequirePrice">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_CHECKOUT_REQUIRE_PRICE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="checkoutRequirePrice" id="checkoutRequirePrice" tabindex="7">
								<option value="Y"{if $checkoutRequirePrice == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $checkoutRequirePrice == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="checkoutRequireShortDesc">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_CHECKOUT_REQUIRE_SDESC}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="checkoutRequireShortDesc" id="checkoutRequireShortDesc" tabindex="8">
								<option value="Y"{if $checkoutRequireShortDesc == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $checkoutRequireShortDesc == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="checkoutRequireDesc">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_CHECKOUT_REQUIRE_DESC}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="checkoutRequireDesc" id="checkoutRequireDesc" tabindex="9">
								<option value="Y"{if $checkoutRequireDesc == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $checkoutRequireDesc == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="renewal">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_RENEWAL_ALLOW}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="renewal" id="renewal" tabindex="10">
								<option value="Y"{if $renewal == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $renewal == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="renewalDays">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_RENEWAL_DAYS}</label></td>
						<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="renewalDays" id="renewalDays" value="{$renewalDays}" /><a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.LANG_RENEWAL_DAYS_TXT}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></td>
					</tr>
					<tr>
						<td colspan="2" class="{cycle values="row1,row2" advance=false}"><label for="allowedTags">{$smarty.const.LANG_ALLOWED_HTML}: </label></td>
					</tr>
					<tr>
						<td colspan="2" class="{cycle values="row1,row2" advance=true}"><textarea name="allowedTags" id="allowedTags" style="width: 100%">{$allowedTags}</textarea></td>
					</tr>
					<tr>
						<td colspan="2" class="formstrip">
							<div align="center">
								<input name="action" type="hidden" value="modify" />
								<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" tabindex="10" />
			            	</div>
						</td>
					</tr>
				</table>
				</form>
			</td>
		</tr>
	</table>                                                                                                               administration/templates/default/settings/settings_userregistration.tpl                             0000644 0023433 0004734 00000014701 11051631671 027013  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script type="text/javascript" src="javascript/fat.js"></script>
{if $success}
	<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
{/if}
<h2>{$smarty.const.LANG_REGISTRATION_FIELDS}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
			<form name="sitesetup" method="post" action="settingsuserregistration.php">
				<table width="100%" class="main">
					
					<tr>
						<th>{$smarty.const.LANG_NAME}</th>
						<th>{$smarty.const.LANG_DISPLAY}</th>
						<th>{$smarty.const.LANG_REQUIRED}</th>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><input name="rExtra0" type="text" value="{$extraText}" /></td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="rExtra01" type="checkbox" value="Y"{if $extraDisplay=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="rExtra02" type="checkbox" value="Y"{if $extraRequired=="Y"}CHECKED{/if} /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_FIRST_NAME}</td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="fname1" type="checkbox" value="Y"{if $fnameDisplay=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="fname2" type="checkbox" value="Y"{if $fnameRequired=="Y"}CHECKED{/if} /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_LAST_NAME}</td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="lname1" type="checkbox" value="Y"{if $lnameDisplay=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="lname2" type="checkbox" value="Y"{if $lnameRequired=="Y"}CHECKED{/if} /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_ADDRESS}</td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="address1" type="checkbox" value="Y"{if $addressDisplay=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="address2" type="checkbox" value="Y"{if $addressRequired=="Y"}CHECKED{/if} /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_CITY}</td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="city1" type="checkbox" value="Y"{if $cityDisplay=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="city2" type="checkbox" value="Y"{if $cityRequired=="Y"}CHECKED{/if} /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_STATE}</td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="state1" type="checkbox" value="Y"{if $stateDisplay=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="state2" type="checkbox" value="Y"{if $stateRequired=="Y"}CHECKED{/if} /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_COUNTRY}</td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="country1" type="checkbox" value="Y"{if $countryDisplay=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="country2" type="checkbox" value="Y"{if $countryRequired=="Y"}CHECKED{/if} /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_ZIP}</td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="zip1" type="checkbox" value="Y"{if $zipDisplay=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="zip2" type="checkbox" value="Y"{if $zipRequired=="Y"}CHECKED{/if} /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_PHONE}</td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="phone1" type="checkbox" value="Y"{if $phoneDisplay=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="phone2" type="checkbox" value="Y"{if $phoneRequired=="Y"}CHECKED{/if} /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_NEWSLETTER}</td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="rNewsletter" type="checkbox" value="Y"{if $rNewsletter=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_TERMS}</td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="rTerms" type="checkbox" value="Y"{if $rTerms=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}">{$smarty.const.LANG_CAPTCHA}</td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="rCaptcha" type="checkbox" value="Y"{if $rCaptcha=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><input name="rExtra1" type="text" value="{$extra1Text}" /></td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="rExtra11" type="checkbox" value="Y"{if $extra1Display=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="rExtra12" type="checkbox" value="Y"{if $extra1Required=="Y"}CHECKED{/if} /></td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><input name="rExtra3" type="text" value="{$extra2Text}" /></td>
						<td class="{cycle values="row1,row2" advance=false}"><input name="rExtra31" type="checkbox" value="Y"{if $extra2Display=="Y"}CHECKED{/if} /></td>
						<td class="{cycle values="row1,row2" advance=true}"><input name="rExtra32" type="checkbox" value="Y"{if $extra2Required=="Y"}CHECKED{/if} /></td>
					</tr>
					<tr>
						<td colspan="3" class="formstrip">
							<div align="center">
								<input name="action" type="hidden" value="modify" />
								<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" tabindex="12" />
			            		</div>
						</td>
					</tr>
				</table>
				</form>
			</td>
		</tr>
	</table>                                                               administration/templates/default/settings/settings_userview.tpl                                     0000644 0023433 0004734 00000014764 11051631672 025265  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <script type="text/javascript" src="javascript/fat.js"></script>
{if $success}
	<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
{/if}
<h2>{$smarty.const.LANG_DISPLAY_USER}</h2>
	<table width="100%" class="wrap">
		<tr>
			<td>
			<form name="sitesetup" method="post" action="settingsuserview.php">
				<table width="100%" class="main">
					
					<tr>
						<td colspan="2">{$smarty.const.LANG_DISPLAY_USER_DESC}</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uDisName">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_DISPLAY_NAME}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="uDisName" id="uDisName" tabindex="1">
								<option value="Y"{if $uDisName == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $uDisName == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uDisAddress">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_DISPLAY_ADDRESS}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="uDisAddress" id="uDisAddress" tabindex="2">
								<option value="Y"{if $uDisAddress == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $uDisAddress == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uDisCity">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_DISPLAY_CITY}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="uDisCity" id="uDisCity" tabindex="3">
								<option value="Y"{if $uDisCity == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $uDisCity == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uDisState">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_DISPLAY_STATE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="uDisState" id="uDisState" tabindex="4">
								<option value="Y"{if $uDisState == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $uDisState == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uDisCountry">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_DISPLAY_COUNTRY}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="uDisCountry" id="uDisCountry" tabindex="5">
								<option value="Y"{if $uDisCountry == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $uDisCountry == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uDisCountry">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_DISPLAY_ZIP}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="uDisZip" id="uDisZip" tabindex="6">
								<option value="Y"{if $uDisZip == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $uDisZip == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uDisPhone">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_DISPLAY_PHONE}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="uDisPhone" id="uDisPhone" tabindex="7">
								<option value="Y"{if $uDisPhone == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $uDisPhone == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uDisEmail">{$smarty.const.LANG_JS_STAR} {$smarty.const.LANG_DISPLAY_EMAIL}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="uDisEmail" id="uDisEmail" tabindex="8">
								<option value="Y"{if $uDisEmail == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $uDisEmail == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uDisExtra">{$smarty.const.LANG_JS_STAR} {$extraText}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="uDisExtra" id="uDisExtra" tabindex="9">
								<option value="Y"{if $uDisExtra == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $uDisExtra == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uDisExtra">{$smarty.const.LANG_JS_STAR} {$extra2Text}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="uDisExtra2" id="uDisExtra2" tabindex="10">
								<option value="Y"{if $uDisExtra2 == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $uDisExtra2 == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td class="{cycle values="row1,row2" advance=false}"><label for="uDisExtra">{$smarty.const.LANG_JS_STAR} {$extra3Text}</label></td>
						<td class="{cycle values="row1,row2" advance=true}">
							<select name="uDisExtra3" id="uDisExtra3" tabindex="11">
								<option value="Y"{if $uDisExtra3 == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
								<option value="N"{if $uDisExtra3 == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
							</select>
						</td>
					</tr>
					<tr>
						<td colspan="2" class="formstrip">
							<div align="center">
								<p>{$smarty.const.DOC_USER_VIEW}</p>
								<input name="action" type="hidden" value="modify" />
								<input type="submit" name="Submit" value="{$smarty.const.LANG_SUBMIT}" tabindex="12" />
			            		</div>
						</td>
					</tr>
				</table>
				</form>
			</td>
		</tr>
	</table>            administration/templates/default/style/                                                             0000755 0023433 0004734 00000000000 11036006716 020235  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/style/default.css                                                  0000644 0023433 0004734 00000017146 11051631676 022412  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 /* @$Revision: 1.3 $ */
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
	color: #000000;
}
body {
	background-color: #CACACA;
}
#header{
	background: url(../images/logo.gif) no-repeat;
	width: 700px;
	height: 65px;
}
#header p{
	float: right;
	text-align: right;
	padding: 0;
}
/* ######## Wrapper ######### */
#wrapper{
	text-align:left;
	margin: 0px auto;
	border: 1px solid #000;
	width: 780px;
	background-color: #FFF;
}
/* ######## TOP MENU ######### */
div#topmenu {
	background: url(../images/nav.jpg) repeat-x;
	height: 21px;
	border-bottom: 1px solid #000;
}
#menu a {
	display: block;
	font-family: Verdana,Tahoma, Helvetica, sans-serif;
	float: left;
	line-height: 21px;
	padding: 0px 25px;
	text-decoration:none;
	font-size: 11px;
	font-weight:bold;
	color:#fff;
	border-right: 1px solid #000;
}
#menu a.last{
	border: 0px;
}

#menu a.hover {
	background:#333;
}
#menu .activeMenuItem{
		/* Border options */
		border-bottom: 1px solid #6C9CE8;
		background-color: #6C9CE8;	/* Background color */
		cursor:pointer;	/* Cursor like a hand when the user moves the mouse over the menu item */
}
/* ######## SUB MENU ######### */
#submenu{
	background-color: #6C9CE8;
	padding-left: 1px; 
	padding-top: 5px; 
	padding-bottom: 5px; 
	height: 10px;
	border-bottom: 1px solid #747474;
	width:100%;
}
#submenu a {
	display: block;
	font-family: Verdana,Tahoma, Helvetica, sans-serif;
	float: left;
	line-height: 12px;
	padding: 0px 25px;
	text-decoration:none;
	font-size: 10px;
	color:#fff;
	border-right: 1px solid #fff;
}
#submenu a.last{
	border: 0px;
}
#submenu a.left{
	border-left: 1px solid #fff;
}
#submenu a.hover {
	background:#333;
}
#submenu div{
	white-space:nowrap;	/* Don't change this option */
}
/* ######## LINK STYLES ######### */
a:link{
	color: #448;
}
a:visited{
	color: #667;
}
a:hover{
	color: #5487BF;
}
a:active {
	color: #FF0000;
}
/* Main Table
 * This class handles the appearence of the
 * the main tables used with 68classifieds
 *
*/
table.main {
	border: 1px solid #000000;
	background-color: #FFFFFF;
}
/* ######## CONTENT ######### */
#content{
	padding: 10px;
}
.wrap {
	background: #fff;
	border: 1px solid #ccc;
	clear: both;
	padding: .5em;
}
th{
	background:url(../images/th.gif) repeat-x;
	color: #FFF;
}
th a:link{
	color: #fff;
	text-decoration: none;
}
th a:visited{
	color: #fff;
	text-decoration: none;
}

/* ######## HEADINGS ######### */
h1 {
	margin-left: 0;
	color: #B4D0FB;
	margin-bottom: 0px;
	font: normal 30px/5px serif;
}
h2{
	margin-top: 0px;
	margin-bottom: 0px;
	color: #B4D0FB;
	font: normal 30px/25px serif;
}
h2 span{	
	padding-left: 10px;
}
/* ============ FORMS =========== */
input,select
{
	background-color: #FFFFFF;
	color: #000000;
	font-family: Verdana, Tahoma;
	font-size: 10px;
	border: 1px SOLID #666666;
}
input:focus,textarea:focus, select:focus { 
	background-color: #DEEFFF;
	border-color: #758a9e;
}
textarea {
	font-family: Verdana, Helvetica, sans-serif;
	border: 1px solid #999999;
	font-size: 10px;
	background-color: #fafafa;
}
.imageform { border: 1px SOLID #CCCCCC; background-color: #EEE;}
/* ====== MODULES ====== */
.modules{
	border-left: 1px solid #CCC;
	border-right: 1px solid #CCC;
	border-bottom: 1px solid #CCC;
}
.moduleslinks{
	background-image: url(../images/module_tabs_bg.gif);
	color: #747474;
}
.moduleslinks a{
	color: #747474;
	text-decoration: none;
}
.moduleslinks a:hover{
	color: #747474;
	text-decoration: none;
}
.moduleslinks .active {
	color: #000;
}

.stats{
	background-color: #FFFFEC;
	border: 1px solid #FFF4bc;
}
.total{
	background-color: #F5F5DC;
}
/* row1 & row2
 * This section handles alternating rows
 *
*/
.row1{
	background-color:#F1F1F1;
	padding: 5px;
	margin: 5px;
}
.row2{
    background-color:#FFF;
	padding: 5px;
	margin: 5px;
}
.clearit {
	clear: both;
	display: block;
	background-color:#FFF;
	width: 200px;
}
/* ======= TOGGLE TABS ======= */
/* http://www.exploding-boy.com/2005/12/15/free-css-navigation-designs/ */
.clear{
	clear: both;
}
#tabs{
	float:left;
	width:100%;
	font-size:93%;
	line-height:normal;
	background:#FFF;
	/*border-bottom:1px solid #24618E;*/
	font-weight:bold;
	clear: both;
}
#tabs ul {
	margin:0;
	padding:0px 10px 0 50px;
	list-style:none;
}
#tabs li {
	display:inline;
	margin:0;
	padding:0;
}
#tabs a {
	float:left;
	background:url("../images/tableftJ.gif") no-repeat left top;
	margin:0;
	padding:0 0 0 5px;
	text-decoration:none;
}
#tabs a span {
	float:left;
	display:block;
	background:url("../images/tabrightJ.gif") no-repeat right top;
	padding:5px 15px 4px 6px;
	color:#666;
}
/* Commented Backslash Hack hides rule from IE5-Mac \*/
#tabs a span {float:none;}
/* End IE5-Mac hack */
#tabs a:hover span{
	color:#FFF;
}
#tabs a:hover, #tabs #current a, #tabs a:visited#current, #tabs a.active{
	background-position:0% -42px;
	color:#FFF;
}
#tabs a:hover span, #tabs #current span, #tabs .active span {
	background-position:100% -42px;
	color:#FFF;
}
option.active {
	background: #BEB;
}
option.inactive {
	background: #FFFF99;
}
option.notcompleted {
	background: #FF5959;
	color: #FFF;
}
option.pendingpayment{
	background: #BEBBEB;
	color: #000;
}
option.cancelled{
	background: #BCBC7A;
	color: #000;
}
span.active {
	background: #BEB;
	text-align: center;
	padding: 3px;
	display: block;
}
span.inactive{
	background: #FFFF99;
	text-align: center;
	padding: 3px;
	display: block;
}
span.notcompleted {
	background: #FF5959;
	color: #FFF;
	text-align: center;
	padding: 3px;
	display: block;
}
span.pendingpayment{
	background: #BEBBEB;
	color: #FFF;
	text-align: center;
	padding: 3px;
	display: block;
}
span.cancelled{
	background: #BCBC7A;
	color: #FFF;
	text-align: center;
	padding: 3px;
	display: block;
}
span.expired {
	background: #000;
	color: #FFF;
	text-align: center;
	padding: 3px;
	display: block;
}
/* FieldSets */
fieldset { margin-bottom: 6px; border: 1px solid #ccc; padding: 4px}
fieldset.newsletter{ background-color: #FFF; margin-bottom: 6px; border: 1px solid #999; padding: 6px}
legend
{
	color: #000;
	font-weight: bold;
}

#search fieldset {
	margin-bottom: 0px;
	float: left;
	margin: 0 1.5ex 1em 0;
	padding: 0;
	border: none;
}

#search fieldset legend {
	padding: 0 0 .2em 1px; font-weight: normal;
}
#search #submit {
	float: left;
	margin: 10px 0 1em;
	position: relative;
	top: .35em;
}
/* Pagination
 * This class handles the appearence of the
 * previous and next section
 *
*/
.pageNav td { padding: 2px 4px 2px 4px; }
.pageNav a { text-decoration: none; }

.pagination{
	text-align: right;
	background-color: #CFCFCF;
	color: #333333;
}
.paginationNum{
	background-color: #F6F6F6;
	color: #333333;
}
.navigationBack{
	background-color: #6C9CE8;
	color: #FFFFFF;
	font: bold 11px tahoma, verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
	padding: 3px 6px 3px 6px;
	white-space: nowrap;
}
.navigation{
	font: x-small verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}
.letter{
	border: 1px solid #5487BF;
	padding: 3px;
}   
.error{
	background: #E8EFF5 url(../images/cross.png) no-repeat 1em ;
	border: 1px solid #2580B2;
	margin: 1em 5% 10px;
	padding: 3px 1em 3px 3em;
}
.updated {
	background: #E8EFF5 url(../images/check.png) no-repeat 1em ;
	border: 1px solid #2580B2;
	margin: 1em 5% 10px;
	padding: 0 1em 0 3em;
}
.options,
.options a {
	margin: 7px 0 auto;
	font-size: 1em;
	text-align: center;
	}
.addnew {
	background: url('../images/page_add.png') left top no-repeat;
	padding: 0px 0 7px 20px;
	margin-left: 10px;
	height: 18px;
}
blockquote {
	margin: 10px 0;
	padding: 5px;
	color: #666;
	border:1px inset;
	}
#loginwrapper{
	width: 450px;
	text-align:left;
	margin: 0px auto;
	border: 1px solid #000;
	background-color: #FFF;
}
#footer{
	text-align:center;
	color: #000;
}                                                                                                                                                                                                                                                                                                                                                                                                                          administration/templates/default/usergroups/                                                        0000755 0023433 0004734 00000000000 11036006726 021314  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/usergroups/usergroups.tpl                                          0000644 0023433 0004734 00000004744 11051631701 024256  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 {literal}
<script language="javascript" type="text/javascript">
	<!--
		function modify(id) {
			document.mainform.groupID.value = id;
			document.mainform.action.value = "modify";
			document.mainform.submit();
		}
		function addnew(){
			document.mainform.action.value = "addnew";
			document.mainform.submit();
		}
		function remove(id){
			removemsg = "{/literal}{$smarty.const.LANG_JS_DELETE_CONFIRM}\n{$smarty.const.LANG_JS_NOT_UNDONE}\n{$smarty.const.LANG_DELETE_USER_GROUP}{literal}"
			if (confirm(removemsg)) {
				document.mainform.groupID.value = id;
				document.mainform.action.value = "delete";
				document.mainform.submit();
			}
		}
	// -->
</script>
{/literal}
<h2>{$smarty.const.LANG_USER_GROUPS}</h2>
	<table width="100%" class="wrap">
	<tr>
	<td>
		<form action="usergroups.php" method="post" name="mainform">
		<input type="hidden" name="action" value="xxxxx" />
		<input type="hidden" name="groupID" value="xxxxx" />
		<div align="center" style="padding: 3px;"><input type="button" name="Button" value="{$smarty.const.LANG_ADD_NEW}" onClick="addnew()" /></div>
			<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				<tr>
					<th scope="col">{$smarty.const.LANG_ID}</th>
					<th scope="col">{$smarty.const.LANG_TITLE}</th>
					<th scope="col">{$smarty.const.LANG_TOTAL_MEMBERS}</th>
					<th scope="col" width="10%">{$smarty.const.LANG_MODIFY}</th>
					<th scope="col" width="10%">{$smarty.const.LANG_DELETE}</th>
				</tr>
				
				{foreach from=$results item="entry"}
				<tr>
					<td class="{cycle values="row1,row2" advance=false}">{$entry.uGroupID}</td>
					<td class="{cycle values="row1,row2" advance=false}">{$entry.uTitle}</td>
					<td class="{cycle values="row1,row2" advance=false}"><a href="users.php?level={$entry.uGroupID}">{$entry.total}</a></td>
					<td class="{cycle values="row1,row2" advance=false}"><input type="button" name="Button" value="{$smarty.const.LANG_MODIFY}" onClick="modify('{$entry.uGroupID}')" /></td>
					<td class="{cycle values="row1,row2" advance=true}">{if $entry.uGroupID>5}<input type="button" name="Button" value="{$smarty.const.LANG_DELETE}" onClick="remove('{$entry.uGroupID}')" />{/if}</td>
				</tr>
				{foreachelse}
				<tr><td colspan="5">No results</td></tr>
				{/foreach}
			</table>
			<div align="center" style="padding: 3px;"><input type="button" name="Button" value="{$smarty.const.LANG_ADD_NEW}" onClick="addnew()" /></div>
		</form>
	</td>
	</tr>
	</table>                            administration/templates/default/usergroups/usergroupsform.tpl                                      0000644 0023433 0004734 00000034634 11051631702 025144  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_USER_GROUPS}</h2>
	<table width="100%" class="wrap">
	<tr>
	<td>
		<form action="usergroups.php" method="post" name="mainform">
		<input type="hidden" name="action" value="{$action}" />
		<input type="hidden" name="groupID" value="{$uGroupID}" />
			<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				<tr>
					<th colspan="2">{$smarty.const.LANG_USER_GROUPS}</th>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uTitle">{$smarty.const.LANG_TITLE}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}"><input type="text" name="uTitle" id="uTitle" value="{$uTitle}" tabindex="1" /></td>
				</tr>
				<tr>
					<td class="{cycle values="row1,row2" advance=false}"><label for="uDescription">{$smarty.const.LANG_DESCRIPTION}</label></td>
					<td class="{cycle values="row1,row2" advance=true}"><input type="text" name="uDescription" id="uDescription" value="{$uDescription}" size="50" tabindex="2" /></td>
				</tr>
				<tr>
					<td class="{cycle values="row1,row2" advance=false}"><label for="uBanned">{$smarty.const.LANG_BANNED_GROUP}</label></td>
					<td class="{cycle values="row1,row2" advance=true}">
						<select name="uBanned" id="uBanned" tabindex="3"{if $uGroupID==1} disabled{/if}>
							<option value="Y"{if $uBanned == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uBanned == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td class="{cycle values="row1,row2" advance=false}"><label for="uViewSite">{$smarty.const.LANG_USERGROUP_VIEW_SITE}</label></td>
					<td class="{cycle values="row1,row2" advance=true}">
						<select name="uViewSite" id="uViewSite" tabindex="4">
							<option value="Y"{if $uViewSite == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uViewSite == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
			</table>
			
			<br />
			
			<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				<tr>
					<th colspan="2">{$smarty.const.LANG_LISTINGS_DISPLAY_TXT}</th>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="sDisPhoto">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_PHOTO}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="sDisPhoto" id="sDisPhoto" tabindex="5">
							<option value="Y"{if $sDisPhoto == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $sDisPhoto == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td class="{cycle values="row1,row2" advance=false}"><label for="sDisTitle">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_TITLE}</label></td>
					<td class="{cycle values="row1,row2" advance=true}">
						<select name="sDisTitle" id="sDisTitle" tabindex="6">
							<option value="Y"{if $sDisTitle == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $sDisTitle == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td class="{cycle values="row1,row2" advance=false}"><label for="sDisPrice">{$smarty.const.LANG_USERGROUP_VIEW_PRICE}</label></td>
					<td class="{cycle values="row1,row2" advance=true}">
						<select name="sDisPrice" id="sDisPrice" tabindex="7">
							<option value="Y"{if $sDisPrice == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $sDisPrice == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td class="{cycle values="row1,row2" advance=false}"><label for="sDisDateAdded">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_DATEADDED}</label></td>
					<td class="{cycle values="row1,row2" advance=true}">
						<select name="sDisDateAdded" id="sDisDateAdded" tabindex="8">
							<option value="Y"{if $sDisDateAdded == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $sDisDateAdded == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td class="{cycle values="row1,row2" advance=false}"><label for="sDisExpiration">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_EXPIRATION}</label></td>
					<td class="{cycle values="row1,row2" advance=true}">
						<select name="sDisExpiration" id="sDisExpiration" tabindex="9">
							<option value="Y"{if $sDisExpiration == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $sDisExpiration == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td class="{cycle values="row1,row2" advance=false}"><label for="sDisCity">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_DISPLAY_CITY}</label></td>
					<td class="{cycle values="row1,row2" advance=true}">
						<select name="sDisCity" id="sDisCity" tabindex="10">
							<option value="Y"{if $sDisCity == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $sDisCity == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td class="{cycle values="row1,row2" advance=false}"><label for="sDisState">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_DISPLAY_STATE}</label></td>
					<td class="{cycle values="row1,row2" advance=true}">
						<select name="sDisState" id="sDisState" tabindex="11">
							<option value="Y"{if $sDisState == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $sDisState == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td class="{cycle values="row1,row2" advance=false}"><label for="sDisCountry">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_DISPLAY_COUNTRY}</label></td>
					<td class="{cycle values="row1,row2" advance=true}">
						<select name="sDisCountry" id="sDisCountry" tabindex="12">
							<option value="Y"{if $sDisCountry == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $sDisCountry == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
			</table>
			
			<br />
			
			<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				<tr>
					<th colspan="2">{$smarty.const.LANG_DISPLAY_LISTINGS_DESC}</th>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uAllowContact">{$smarty.const.LANG_USERGROUP_CONTACT_OWNER}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uAllowContact" id="uAllowContact" tabindex="13">
							<option value="Y"{if $uAllowContact == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uAllowContact == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uAllowEmailFriend">{$smarty.const.LANG_USERGROUP_FRIEND_MAIL}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uAllowEmailFriend" id="uAllowEmailFriend" tabindex="14">
							<option value="Y"{if $uAllowEmailFriend == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uAllowEmailFriend == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uViewPhotos">{$smarty.const.LANG_USERGROUP_VIEW_PHOTOS}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uViewPhotos" id="uViewPhotos" tabindex="15">
							<option value="Y"{if $uViewPhotos == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uViewPhotos == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uViewPrice">{$smarty.const.LANG_USERGROUP_VIEW_PRICE}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uViewPrice" id="uViewPrice" tabindex="16">
							<option value="Y"{if $uViewPrice == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uViewPrice == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uViewSeller">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_DISPLAY_SELLER}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uViewSeller" id="uViewSeller" tabindex="17">
							<option value="Y"{if $uViewSeller == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uViewSeller == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uViewAddress">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_DISPLAY_ADDRESS}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uViewAddress" id="uViewAddress" tabindex="18">
							<option value="Y"{if $uViewAddress == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uViewAddress == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uViewCity">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_DISPLAY_CITY}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uViewCity" id="uViewCity" tabindex="19">
							<option value="Y"{if $uViewCity == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uViewCity == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uViewState">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_DISPLAY_STATE}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uViewState" id="uViewState" tabindex="20">
							<option value="Y"{if $uViewState == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uViewState == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uViewCountry">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_DISPLAY_COUNTRY}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uViewCountry" id="uViewCountry" tabindex="21">
							<option value="Y"{if $uViewCountry == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uViewCountry == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uViewPhone">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_DISPLAY_PHONE}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uViewPhone" id="uViewPhone" tabindex="22">
							<option value="Y"{if $uViewPhone == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uViewPhone == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uViewDateAdded">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_DISPLAY_DATE}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uViewDateAdded" id="uViewDateAdded" tabindex="23">
							<option value="Y"{if $uViewDateAdded == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uViewDateAdded == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uViewExpiration">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_DISPLAY_EXPIRATION}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uViewExpiration" id="uViewExpiration" tabindex="24">
							<option value="Y"{if $uViewExpiration == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uViewExpiration == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uViewHits">{$smarty.const.LANG_THIS_USERGROUP} {$smarty.const.LANG_DISPLAY_HITS}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uViewHits" id="uViewHits" tabindex="24">
							<option value="Y"{if $uViewHits == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uViewHits == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="50%" class="{cycle values="row1,row2" advance=false}"><label for="uViewFavorites">{$smarty.const.LANG_USER_FAVORITES}</label></td>
					<td width="50%" class="{cycle values="row1,row2" advance=true}">
						<select name="uViewFavorites" id="uViewFavorites" tabindex="24">
							<option value="Y"{if $uViewFavorites == "Y"} selected{/if}>{$smarty.const.LANG_YES}</option>
							<option value="N"{if $uViewFavorites == "N"} selected{/if}>{$smarty.const.LANG_NO}</option>
						</select>
					</td>
				</tr>
			</table>
			<br />
			<div align="center"><input type="submit" value="{$smarty.const.LANG_SUBMIT}" /> <input type="reset" name="reset" value="{$smarty.const.LANG_RESET}" /></div>
			</form>
	</td>
	</tr>
	</table>                                                                                                    administration/templates/default/users/                                                             0000755 0023433 0004734 00000000000 11036006743 020236  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 administration/templates/default/users/users_add.tpl                                                0000644 0023433 0004734 00000031600 11051631704 022726  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_ADD_USER}</h2>
{if $success}
	<script type="text/javascript" src="javascript/fat.js"></script>
	<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
{/if}
	{literal}
	<script language="javascript" type="text/javascript">
	<!-- //
		var level = 2;
		function changeStatus(status)
		{
			var nValue = status.options[status.selectedIndex].value;
			if(nValue==1)
			{
				if(!confirm("{/literal}{$smarty.const.LANG_MEMBER_ADMINISTRATOR}{literal}"))
				{
					//status.options[status.selectedIndex].value=2;
					status.value = level;
				}
				else
				{
					document.getElementById('capabilities').style.display='block';
				}
			}
		}
		function checkform(frm) 
		{
			{/literal}
			{$validation}
			{literal}
			if (frm.password.value == "" ) 
			{
				alert("{/literal}{$smarty.const.LANG_JS_PASSWORD_ERROR}{literal}"); 
				frm.password.focus(); 
				return (false);
			}
		}
		function displayID(id, status)
		{
			if (document.getElementById(id)) {
				if (status == true || status == false) {
					document.getElementById(id).style.display = (status == true)?"none":"";
				} else {
					document.getElementById(id).style.display = (document.getElementById(id).style.display == "")?"none":"";
				}
			}
		}
	//-->
	</script>
	{/literal}
<form method="post" action="users.php" name="userdetails" onsubmit="return checkform(this)">
<table width="100%" border="0" cellpadding="3" cellspacing="0" class="modules">
	<tr>
		<td align="left">
			
			<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				<tr>
					<th colspan="4">{$smarty.const.LANG_ACCOUNT_INFO}</th>
				</tr>
				<tr>
					<td width="25%" align="right"><label for="level">{$smarty.const.LANG_USER_GROUP}{$smarty.const.LANG_COLON}</label></td>
					<td colspan="3">
						<select name="level" id="level" onChange="changeStatus(this);">
							{foreach from=$userlevels item="entry"}
							<option value="{$entry.uGroupID}"{if $entry.uGroupID==2} SELECTED{/if}>{$entry.uTitle}</option>
							{/foreach}
						</select>
					</td>
				</tr>
				<tr>
					<td width="25%" align="right"><label for="username">{$smarty.const.LANG_USERNAME}{$smarty.const.LANG_COLON}</label></td>
					<td width="25%"><input type="text" size="25" id="username" name="username" /></td>
					<td width="25%" align="right"><label for="password">{$smarty.const.LANG_PASSWORD}{$smarty.const.LANG_COLON}</label></td>
					<td width="25%"><input name="password" type="password" id="password" size="25" /></td>
				</tr>
				<tr>
					<td width="25%" align="right"><label for="email">{$smarty.const.LANG_EMAIL}{$smarty.const.LANG_COLON}</label></td>
					<td width="25%"><input name="email" type="text" id="email" size="25" /></td>
					<td width="25%" align="right"><label for="passwordconfirm">{$smarty.const.LANG_PLEASE_CONFIRM} {$smarty.const.LANG_PASSWORD}{$smarty.const.LANG_COLON}</label></td>
					<td width="25%"><input name="passwordconfirm" type="password" id="passwordconfirm" size="25" /></td>
				</tr>
				<tr>
					<td width="25%" align="right">{$smarty.const.LANG_NEWSLETTER}</td>
					<td width="25%">
						<label for="newsletteryes"><input type="radio" name="newsletter" id="newsletteryes" value="Y"{if $newsletter=="Y"} checked="checked"{/if} />Yes</label>
						<label for="newsletterno"><input type="radio" name="newsletter" id="newsletterno" value="N"{if $newsletter!="Y"} checked="checked"{/if} />No</label>
					</td>
					<td width="25%" align="right"></td>
					<td width="25%"></td>
				</tr>
				<tr>
					<td colspan="4"><hr /></td>
				</tr>
				<tr>
					<td colspan="2" width="50%" valign="top">
						<fieldset>
							<legend>{$smarty.const.LANG_PERSONAL_INFO}</legend>
							<table width="100%" cellpadding="3" cellspacing="1">
								{if $dis_extra=="Y"}
          						<tr>
            						<td width="25%" align="right">{if $req_extra=="Y"}<span class='required'>{$smarty.const.LANG_STAR}</span>{/if}<label for="extra">{$extra_text}{$smarty.const.LANG_COLON}</label></td>
						            <td><input name="extra" type="text" id="extra" value="{$extra}" size="25" /></td>
          						</tr>
          						{/if}
								<tr>
									<td width="50%" align="right"><label for="firstname">{$smarty.const.LANG_FIRST_NAME}{$smarty.const.LANG_COLON}</label></td>
									<td width="50%"><input name="firstname" type="text" id="firstname" value="{$firstname}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="lastname">{$smarty.const.LANG_LAST_NAME}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="lastname" type="text" id="lastname" value="{$lastname}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="address">{$smarty.const.LANG_ADDRESS}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="address" type="text" id="address" value="{$address}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="city">{$smarty.const.LANG_CITY}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="city" type="text" id="city" value="{$city}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="state">{$smarty.const.LANG_STATE}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%">
										<select name="state" id="state">
											<option value="none"{if $state=="none"} selected="SELECTED"{/if}>{$smarty.const.LANG_STATE_NONE}</option>
											{section name=entry loop=$showstates}
											<option value="{$showstates[entry].name}"{if $state==$showstates[entry].name} selected="selected"{/if}>{$showstates[entry].name}</option>
											{/section}
										</select>
									</td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="country">{$smarty.const.LANG_COUNTRY}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%">
										<select name="country" id="country">
											{section name=entry loop=$showcountries}
											<option value="{$showcountries[entry].countryName}"{if $country==$showcountries[entry].countryName} selected="selected"{/if}>{$showcountries[entry].countryName}</option>
											{/section}
										</select>
									</td>
								</tr>
								{modulehook function="admin_tpl_userjoin" options=""}
								<tr>
									<td width="25%" align="right"><label for="zip">{$smarty.const.LANG_ZIP}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="zip" type="text" id="zip" value="{$zip}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="phone">{$smarty.const.LANG_PHONE}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="phone" type="text" id="phone" value="{$phone}" size="25" /></td>
								</tr>
								{if $dis_extra2=="Y"}
								<tr>
									<td width="25%" align="right">{if $req_extra2=="Y"}<span class='required'>{$smarty.const.LANG_STAR}</span>{/if}<label for="extra2">{$extra2_text}{$smarty.const.LANG_COLON}</label></td>
            						<td width="25%"><input name="extra2" type="text" id="extra2" value="{$extra2}" size="25" /></td>
          						</tr>
          						{/if}
								{if $dis_extra3=="Y"}
								<tr>
									<td width="25%" align="right">{if $req_extra3=="Y"}<span class='required'>{$smarty.const.LANG_STAR}</span>{/if}<label for="extra3">{$extra3_text}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="extra3" type="text" id="extra3" value="{$extra3}" size="25" /></td>
								</tr>
								{/if}
							</table>
						</fieldset>
					</td>
					<td colspan="2" valign="top" width="50%">
						<fieldset>
							<legend>Billing Information</legend>
								<div align="center">
									<label><input type="checkbox" name="b_same" value="Y" onclick="javascript: displayID('billing',this.checked);" />{$smarty.const.LANG_BILLING_SAME}</label>
								</div>
							<div id="billing"{if $b_same=="Y"}style="display:none;"{/if}>
							<table width="100%" cellpadding="3" cellspacing="1">
								<tr>
									<td width="50%" align="right"><label for="b_firstname">{$smarty.const.LANG_FIRST_NAME}{$smarty.const.LANG_COLON}</label></td>
									<td width="50%"><input name="b_firstname" type="text" id="b_firstname" value="{$b_firstname}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_lastname">{$smarty.const.LANG_LAST_NAME}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="b_lastname" type="text" id="b_lastname" value="{$b_lastname}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_address">{$smarty.const.LANG_ADDRESS}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="b_address" type="text" id="b_address" value="{$b_address}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_city">{$smarty.const.LANG_CITY}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="b_city" type="text" id="b_city" value="{$b_city}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_state">{$smarty.const.LANG_STATE}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%">
										<select name="b_state" id="b_state">
											<option value="none"{if $state=="none"} selected="SELECTED"{/if}>{$smarty.const.LANG_STATE_NONE}</option>
											{section name=entry loop=$showstates}
											<option value="{$showstates[entry].name}"{if $b_state==$showstates[entry].name} selected="selected"{/if}>{$showstates[entry].name}</option>
											{/section}
										</select>
									</td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_country">{$smarty.const.LANG_COUNTRY}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%">
										<select name="b_country" id="b_country">
											{section name=entry loop=$showcountries}
											<option value="{$showcountries[entry].countryName}"{if $b_country==$showcountries[entry].countryName} selected="selected"{/if}>{$showcountries[entry].countryName}</option>
											{/section}
										</select>
									</td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_zip">{$smarty.const.LANG_ZIP}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="b_zip" type="text" id="b_zip" value="{$b_zip}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_phone">{$smarty.const.LANG_PHONE}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="b_phone" type="text" id="b_phone" value="{$b_phone}" size="25" /></td>
								</tr>
							</table>
							</div>
						</fieldset>
						<div id="capabilities" style="display:none;">
						<fieldset>
							<legend>{$smarty.const.LANG_ADMIN_CAPABILITIES} <a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_USER_CAPABILITIES}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></legend>
							<table width="100%" cellpadding="3" cellspacing="1">
								<tr>
									
									<td width="50%">
										<label><input type="checkbox" name="adminCapabilities[]" value="listings"{if $admin_listings=="Y"} checked{/if} />{$smarty.const.LANG_LISTINGS}</label>
									</td>
									<td>
										<label><input type="checkbox" name="adminCapabilities[]" value="orders"{if $admin_orders=="Y"} checked{/if} />{$smarty.const.LANG_ORDERS}</label>
									</td>
								</tr>
								<tr>
									<td><label><input type="checkbox" name="adminCapabilities[]" value="users"{if $admin_users=="Y"} checked{/if} />{$smarty.const.LANG_USERS}</label></td>
									<td><label><input type="checkbox" name="adminCapabilities[]" value="category"{if $admin_category=="Y"} checked{/if} />{$smarty.const.LANG_CATEGORIES}</label></td>
								</tr>
								<tr>
									<td><label><input type="checkbox" name="adminCapabilities[]" value="payment"{if $admin_payment=="Y"} checked{/if} />{$smarty.const.LANG_PAYMENT}</label></td>
									<td><label><input type="checkbox" name="adminCapabilities[]" value="settings"{if $admin_settings=="Y"} checked{/if} />{$smarty.const.LANG_SETTINGS}</label></td>
								</tr>
							</table>
						</fieldset>
						</div>
					</td>
				</tr>
			</table>
			<br />
			<div align="center" style="padding: 5px;">
			<input type="submit" name="submit" value="{$smarty.const.LANG_SUBMIT}" /> <input type="reset" name="reset" value="{$smarty.const.LANG_RESET}" /></div>
			<input name="action" type="hidden" id="action" value="add" />
	        <input name="member" type="hidden" value="{$id}" />
			
		</td>
	</tr>
</table>
</form>                                                                                                                                administration/templates/default/users/users_browse.tpl                                             0000644 0023433 0004734 00000017712 11051631705 023510  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$smarty.const.LANG_MANAGE_USERS}</h2>
	<table width="100%" class="wrap">
	<tr>
	<td>
		<form action="users.php" method="get" name="search">
		<input type="hidden" name="sortfield" value="{$smarty.request.sortfield}" />
		<input type="hidden" name="sortorder" value="{$smarty.request.sortorder}" />
			<table width="100%"  border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>
						<input type="text" name="searchtext" value="{$smarty.request.searchtext}" />
						<input type="submit" name="Submit" value="{$smarty.const.LANG_SEARCH}" />
					</td>
					<td>
						<table border="0" align="center" cellpadding="0" cellspacing="3">
							<tr>
								<td class="letter"><a href="users.php?q=a">A</a></td>
								<td class="letter"><a href="users.php?q=b">B</a></td>
								<td class="letter"><a href="users.php?q=c">C</a></td>
								<td class="letter"><a href="users.php?q=d">D</a></td>
								<td class="letter"><a href="users.php?q=e">E</a></td>
								<td class="letter"><a href="users.php?q=f">F</a></td>
								<td class="letter"><a href="users.php?q=g">G</a></td>
								<td class="letter"><a href="users.php?q=h">H</a></td>
								<td class="letter"><a href="users.php?q=i">I</a></td>
								<td class="letter"><a href="users.php?q=j">J</a></td>
								<td class="letter"><a href="users.php?q=k">K</a></td>
								<td class="letter"><a href="users.php?q=l">L</a></td>
								<td class="letter"><a href="users.php?q=m">M</a></td>
								<td class="letter"><a href="users.php?q=n">N</a></td>
								<td class="letter"><a href="users.php?q=o">O</a></td>
								<td class="letter"><a href="users.php?q=p">P</a></td>
								<td class="letter"><a href="users.php?q=q">Q</a></td>
								<td class="letter"><a href="users.php?q=r">R</a></td>
								<td class="letter"><a href="users.php?q=s">S</a></td>
								<td class="letter"><a href="users.php?q=t">T</a></td>
								<td class="letter"><a href="users.php?q=u">U</a></td>
								<td class="letter"><a href="users.php?q=v">V</a></td>
								<td class="letter"><a href="users.php?q=w">W</a></td>
								<td class="letter"><a href="users.php?q=x">X</a></td>
								<td class="letter"><a href="users.php?q=y">Y</a></td>
								<td class="letter"><a href="users.php?q=z">Z</a></td>
								<td class="letter"><a href="users.php?q=all">all</a></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
		<form action="users.php" method="post" name="users">
		<input type="hidden" name="act" value="xxxxx" />
			<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				<tr>
					<th scope="col" width="5%"><input type="checkbox" name="checkbox" value="checkbox" onClick="javascript:toggleAll(document.users);" /></th>
					<th scope="col" width="5%"><a href="users.php?{$querystring_id}">{$smarty.const.LANG_ID} {if $sqlsort=="id"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="users.php?{$querystring_username}">{$smarty.const.LANG_USERNAME} {if $sqlsort=="username"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="users.php?{$querystring_lastname}">{$smarty.const.LANG_FULLNAME} {if $sqlsort=="lastname"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="users.php?{$querystring_email}">{$smarty.const.LANG_EMAIL} {if $sqlsort=="email"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col"><a href="users.php?{$querystring_phone}">{$smarty.const.LANG_PHONE} {if $sqlsort=="phone"}<img src="images/sort{$oppositesort}.gif" border="0" alt="Sort" />{/if}</a></th>
					<th scope="col">Flag</th>
				</tr>
				
				{foreach from=$results item="entry" name=status}
				<tr>
					<td width="5%" class="{cycle values="row1,row2" advance=false}"><input type="checkbox" name="userid[]" value="{$entry.id}" class="toggable" /></td>
					<td width="5%" class="{cycle values="row1,row2" advance=false}">{$entry.id}</td>
					<td class="{cycle values="row1,row2" advance=false}" id="listing_{$entry.id}"><a href="users.php?view={$entry.id}">{$entry.username}</a></td>
					<td class="{cycle values="row1,row2" advance=false}">{$entry.lastname}, {$entry.firstname}</td>
					<td class="{cycle values="row1,row2" advance=false}">{$entry.email}</td>
					<td class="{cycle values="row1,row2" advance=false}">{$entry.phone}</td>
					<td class="{cycle values="row1,row2" advance=true}">
						<a href="javascript:void(0);" onmouseover="return overlib('{foreach from=$group item="groupicon"}{if $entry.level==$groupicon.uGroupID}{$groupicon.uTitle}{/if}{/foreach}')" onmouseout="return nd();">
						{if $entry.level==1}
							<img src="images/flag_blue.png" border="0" alt="Administrator" />
						{elseif $entry.level==2}
							<img src="images/flag_green.png" border="0" alt="Registered Users" />
						{elseif $entry.level==3}
							<img src="images/flag_orange.png" border="0" alt="Users Awaiting Email Confirmation" />
						{elseif $entry.level==4}
							<img src="images/flag_red.png" border="0" alt="Banned" />
						{elseif $entry.level==5}
							<img src="images/flag_yellow.png" border="0" alt="Guest" />
						{else}
							<img src="images/flag_purple.png" border="0" alt="Custom" />
						{/if}
						</a>
					</td>
				</tr>
				{foreachelse}
				<tr><td colspan="6">No results</td></tr>
				{/foreach}
			</table>

			<table width="100%"  border="0" cellspacing="0" cellpadding="3">
				<tr>
					<td width="33%">
						<select name="newstatus">
							<option value="0" selected>{$smarty.const.LANG_PLEASE_SELECT}</option>
							<option value="Ban">{$smarty.const.LANG_BLACKLIST}</option>
							<option value="Delete">{$smarty.const.LANG_DELETE}</option>
						</select>
						<input type="submit" value="{$smarty.const.LANG_UPDATE}" onclick="document.users.act.value='changestatus';" />
					</td>
					<td width="33%" align="center">
						<a href="csv.php?{$smarty.server.QUERY_STRING}" onmouseover="return overlib('{$smarty.const.LANG_EXPORT_TO_EXCEL}');" onmouseout="return nd();"><img src="images/page_excel.gif" border="0" alt="Export to Excel" /></a>
						<!--<a href="javascript:void(0);" onmouseover="return overlib('{foreach from=$group item="groupicon"}<img src=images/{$groupicon.image} />{$groupicon.uTitle}<br />{/foreach}')" onmouseout="return nd();">-->
					</td>
					<td width="33%" align="right" nowrap="nowrap">
						{* display pagination *}
						<table class="pagination" cellpadding="3" cellspacing="1" border="0" align="right" style="margin-top:3px">
						<tr>
							<td class="navigationBack" style="font-weight:normal">{$smarty.const.LANG_SHOWING_PAGE} {$pageNum} of {$maxPage}</td>
							{if $first<>""}
							<td class="paginationNum"><a href="users.php?{$first}">{$smarty.const.LANG_FIRST}</a></td>
							{/if}
							{if $prev<>""}
							<td class="paginationNum"><a href="users.php?{$prev}">{$smarty.const.LANG_PREVIOUS}</a></td>
							{/if}
							{foreach from=$pageNumber item="entry"}
								{if $entry.number==$pageNum}
									<td class="paginationNum"><strong>{$entry.number}</strong></td>
								{else}
									<td class="paginationNum"><a href="users.php?{$entry.link}" class="paginationNum">{$entry.number}</a></td>
								{/if}
							{/foreach}
							{if $next<>""}
								<td class="paginationNum"><a href="users.php?{$next}">{$smarty.const.LANG_NEXT}</a></td>
							{/if}
							{if $last<>""}
								<td class="paginationNum"><a href="users.php?{$last}">{$smarty.const.LANG_LAST}</a></td>
							{/if}
						</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
		
		<table width="150" align="center"><tr>
		{foreach from=$group item="groupicon"}
			<td nowrap><img src=images/{$groupicon.image} /></td><td nowrap><a href="users.php?level={$groupicon.uGroupID}">{$groupicon.uTitle}</a></td>
		{/foreach}
		</tr></table>
	</td>
	</tr>
	</table>                                                      administration/templates/default/users/users_info.tpl                                               0000644 0023433 0004734 00000033645 11051631706 023146  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <h2>{$username}</h2>
{if $success}
	<script type="text/javascript" src="javascript/fat.js"></script>
	<div id="message" class="updated fade"><p>{$smarty.const.LANG_SETTINGS_SAVED}</p></div>
{/if}
	{literal}
	<script language="javascript" type="text/javascript">
	<!-- //
		var level = {/literal}{$level}{literal};
		function changeStatus(status)
		{
			var nValue = status.options[status.selectedIndex].value;
			if(nValue==1)
			{
				if(!confirm("{/literal}{$smarty.const.LANG_MEMBER_ADMINISTRATOR}{literal}"))
				{
					//document.getElementById('level').className='inactive';
					//status.options[status.selectedIndex].value=2;
					status.value = level;
				}
			}
		}
		function checkform(frm) 
		{
			{/literal}
			{$validation}
			{literal}
		}
		function displayID(id, status)
		{
			if (document.getElementById(id)) {
				if (status == true || status == false) {
					document.getElementById(id).style.display = (status == true)?"none":"";
				} else {
					document.getElementById(id).style.display = (document.getElementById(id).style.display == "")?"none":"";
				}
			}
		}
	//-->
	</script>
	{/literal}
<form method="post" action="users.php" name="userdetails" onsubmit="return checkform(this)">
<table width="100%" border="0" cellpadding="3" cellspacing="0" class="modules">
	<tr>
		<td align="left">
			
			<table width="100%"  border="0" cellspacing="0" cellpadding="3" class="main">
				<tr>
					<th colspan="4">Account Information</th>
				</tr>
				<tr>
					<td width="25%" align="right"><label for="level">{$smarty.const.LANG_USER_GROUP}{$smarty.const.LANG_COLON}</label></td>
					<td colspan="3">
						<select name="level" id="level" onChange="changeStatus(this);">
							{foreach from=$userlevels item="entry"}
							<option value="{$entry.uGroupID}"{if $level==$entry.uGroupID} SELECTED{/if}>{$entry.uTitle}</option>
							{/foreach}
						</select>
					</td>
				</tr>
				<tr>
					<td width="25%" align="right"><label for="username">{$smarty.const.LANG_USERNAME}{$smarty.const.LANG_COLON}</label></td>
					<td width="25%"><input type="text" size="25" id="username" name="username" value="{$username}" /></td>
					<td width="25%" align="right"><label for="password">{$smarty.const.LANG_PASSWORD}{$smarty.const.LANG_COLON}</label></td>
					<td width="25%"><input name="password" type="password" id="password" size="25" /></td>
				</tr>
				<tr>
					<td width="25%" align="right"><label for="email">{$smarty.const.LANG_EMAIL}{$smarty.const.LANG_COLON}</label></td>
					<td width="25%"><input name="email" type="text" id="email" value="{$email}" size="25" /></td>
					<td width="25%" align="right"><label for="passwordconfirm">{$smarty.const.LANG_PLEASE_CONFIRM} {$smarty.const.LANG_PASSWORD}{$smarty.const.LANG_COLON}</label></td>
					<td width="25%"><input name="passwordconfirm" type="password" id="passwordconfirm" size="25" /></td>
				</tr>
				<tr>
					<td width="25%" align="right">{$smarty.const.LANG_NEWSLETTER}</td>
					<td width="25%">
						<label for="newsletteryes"><input type="radio" name="newsletter" id="newsletteryes" value="Y"{if $newsletter=="Y"} checked="checked"{/if} />Yes</label>
						<label for="newsletterno"><input type="radio" name="newsletter" id="newsletterno" value="N"{if $newsletter!="Y"} checked="checked"{/if} />No</label>
					</td>
					<td width="25%" align="right">{$smarty.const.LANG_JOIN_DATE}{$smarty.const.LANG_COLON}</td>
					<td width="25%">{$joindate}</td>
				</tr>
				<tr>
					<td width="25%" align="right">{$smarty.const.LANG_IP}{$smarty.const.LANG_COLON}</td>
					<td width="25%"><a href="http://www.dnsstuff.com/tools/whois.ch?ip={$custip}" target="_blank">{$custip}</a></td>
					<td width="25%" align="right">{$smarty.const.LANG_LAST_LOGIN}{$smarty.const.LANG_COLON}</td>
					<td width="25%">{$lastlogin}</td>					
				</tr>
				<tr>
					<td width="25%" align="right">Number of Listings:</td>
					<td width="25%"><a href="listings.php?owner={$id}">{$numberoflistings}</a></td>
					<td width="25%" align="right">Number of PM's Sent:</td>
					<td width="25%">
						<a href="privatemessages.php?fromuserid={$id}">{$totalpm}</a>
					</td>
				</tr>
				<tr>
					<td colspan="4"><hr /></td>
				</tr>
				<tr>
					<td colspan="2" width="50%" valign="top">
						<fieldset>
							<legend>Personal Information</legend>
							<table width="100%" cellpadding="3" cellspacing="1">
								{if $dis_extra=="Y"}
          						<tr>
            						<td width="25%" align="right">{if $req_extra=="Y"}<span class='required'>{$smarty.const.LANG_STAR}</span>{/if}<label for="extra">{$extra_text}{$smarty.const.LANG_COLON}</label></td>
						            <td><input name="extra" type="text" id="extra" value="{$extra}" size="25" /></td>
          						</tr>
          						{/if}
								<tr>
									<td width="50%" align="right"><label for="firstname">{$smarty.const.LANG_FIRST_NAME}{$smarty.const.LANG_COLON}</label></td>
									<td width="50%"><input name="firstname" type="text" id="firstname" value="{$firstname}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="lastname">{$smarty.const.LANG_LAST_NAME}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="lastname" type="text" id="lastname" value="{$lastname}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="address">{$smarty.const.LANG_ADDRESS}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="address" type="text" id="address" value="{$address}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="city">{$smarty.const.LANG_CITY}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="city" type="text" id="city" value="{$city}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="state">{$smarty.const.LANG_STATE}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%">
										<select name="state" id="state">
											<option value="none"{if $state=="none"} selected="selected"{/if}>{$smarty.const.LANG_STATE_NONE}</option>
											{section name=entry loop=$showstates}
											<option value="{$showstates[entry].name}"{if $state==$showstates[entry].name} selected="selected"{/if}>{$showstates[entry].name}</option>
											{/section}
										</select>
									</td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="country">{$smarty.const.LANG_COUNTRY}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%">
										<select name="country" id="country">
											{section name=entry loop=$showcountries}
											<option value="{$showcountries[entry].countryName}"{if $country==$showcountries[entry].countryName} selected="selected"{/if}>{$showcountries[entry].countryName}</option>
											{/section}
										</select>
									</td>
								</tr>
								{modulehook function="admin_tpl_userinfo" options=""}
								<tr>
									<td width="25%" align="right"><label for="zip">{$smarty.const.LANG_ZIP}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="zip" type="text" id="zip" value="{$zip}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="phone">{$smarty.const.LANG_PHONE}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="phone" type="text" id="phone" value="{$phone}" size="25" /></td>
								</tr>
								{if $dis_extra2=="Y"}
								<tr>
									<td width="25%" align="right">{if $req_extra2=="Y"}<span class='required'>{$smarty.const.LANG_STAR}</span>{/if}<label for="extra2">{$extra2_text}{$smarty.const.LANG_COLON}</label></td>
            						<td width="25%"><input name="extra2" type="text" id="extra2" value="{$extra2}" size="25" /></td>
          						</tr>
          						{/if}
								{if $dis_extra3=="Y"}
								<tr>
									<td width="25%" align="right">{if $req_extra3=="Y"}<span class='required'>{$smarty.const.LANG_STAR}</span>{/if}<label for="extra3">{$extra3_text}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="extra3" type="text" id="extra3" value="{$extra3}" size="25" /></td>
								</tr>
								{/if}
							</table>
						</fieldset>
					</td>
					<td colspan="2" valign="top" width="50%">
						<fieldset>
							<legend>Billing Information</legend>
								<div align="center">
									<label><input type="checkbox" name="b_same" value="Y" onclick="javascript: displayID('billing',this.checked);"{if $b_same=="Y"} checked{/if} />{$smarty.const.LANG_BILLING_SAME}</label>
								</div>
							<div id="billing"{if $b_same=="Y"}style="display:none;"{/if}>
							<table width="100%" cellpadding="3" cellspacing="1">
								<tr>
									<td width="50%" align="right"><label for="b_firstname">{$smarty.const.LANG_FIRST_NAME}{$smarty.const.LANG_COLON}</label></td>
									<td width="50%"><input name="b_firstname" type="text" id="b_firstname" value="{$b_firstname}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_lastname">{$smarty.const.LANG_LAST_NAME}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="b_lastname" type="text" id="b_lastname" value="{$b_lastname}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_address">{$smarty.const.LANG_ADDRESS}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="b_address" type="text" id="b_address" value="{$b_address}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_city">{$smarty.const.LANG_CITY}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="b_city" type="text" id="b_city" value="{$b_city}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_state">{$smarty.const.LANG_STATE}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%">
										<select name="b_state" id="b_state">
											<option value="none"{if $state=="none"} selected="selected"{/if}>{$smarty.const.LANG_STATE_NONE}</option>
											{section name=entry loop=$showstates}
											<option value="{$showstates[entry].name}"{if $b_state==$showstates[entry].name} selected="selected"{/if}>{$showstates[entry].name}</option>
											{/section}
										</select>
									</td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_country">{$smarty.const.LANG_COUNTRY}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%">
										<select name="b_country" id="b_country">
											{section name=entry loop=$showcountries}
											<option value="{$showcountries[entry].countryName}"{if $b_country==$showcountries[entry].countryName} selected="selected"{/if}>{$showcountries[entry].countryName}</option>
											{/section}
										</select>
									</td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_zip">{$smarty.const.LANG_ZIP}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="b_zip" type="text" id="b_zip" value="{$b_zip}" size="25" /></td>
								</tr>
								<tr>
									<td width="25%" align="right"><label for="b_phone">{$smarty.const.LANG_PHONE}{$smarty.const.LANG_COLON}</label></td>
									<td width="25%"><input name="b_phone" type="text" id="b_phone" value="{$b_phone}" size="25" /></td>
								</tr>
							</table>
							</div>
						</fieldset>
						{if $level==1}
						<fieldset>
							<legend>{$smarty.const.LANG_ADMIN_CAPABILITIES} <a href="javascript:void(0);" onmouseover="return overlib('{$smarty.const.DOC_USER_CAPABILITIES}')" onmouseout="return nd();"> <img src="images/help.png" border="0" alt="help" /></a></legend>
							<table width="100%" cellpadding="3" cellspacing="1">
								<tr>
									
									<td width="50%">
										<label><input type="checkbox" name="adminCapabilities[]" value="listings"{if $admin_listings=="Y"} checked{/if} />{$smarty.const.LANG_LISTINGS}</label>
									</td>
									<td>
										<label><input type="checkbox" name="adminCapabilities[]" value="orders"{if $admin_orders=="Y"} checked{/if} />{$smarty.const.LANG_ORDERS}</label>
									</td>
								</tr>
								<tr>
									<td><label><input type="checkbox" name="adminCapabilities[]" value="users"{if $admin_users=="Y"} checked{/if} />{$smarty.const.LANG_USERS}</label></td>
									<td><label><input type="checkbox" name="adminCapabilities[]" value="category"{if $admin_category=="Y"} checked{/if} />{$smarty.const.LANG_CATEGORIES}</label></td>
								</tr>
								<tr>
									<td><label><input type="checkbox" name="adminCapabilities[]" value="payment"{if $admin_payment=="Y"} checked{/if} />{$smarty.const.LANG_PAYMENT}</label></td>
									<td><label><input type="checkbox" name="adminCapabilities[]" value="settings"{if $admin_settings=="Y"} checked{/if} />{$smarty.const.LANG_SETTINGS}</label></td>
								</tr>
							</table>
						</fieldset>
						{/if}
					</td>
				</tr>
				<tr>
					<td colspan="4">
						<fieldset>
							<legend>{$smarty.const.LANG_USER_NOTES}  
							<a href="javascript:void(0);" onclick="MM_openBrWindow('notes.php?id={$id}','notes','width=525,height=450,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes,left=0,top=0,screenx=50,screeny=50')" title="Add Notes"><img src="images/attach.png" border="0" alt="Add Notes" /></a>
							</legend>
							{$notes|nl2br}
						</fieldset>
					</td>
				</tr>
			</table>
			<br />
			<div align="center" style="padding: 5px;">
			<input type="submit" name="submit" value="Update" /> <input type="reset" name="reset" value="Reset" /></div>
			<input name="action" type="hidden" id="action" value="modify" />
	        <input name="member" type="hidden" value="{$id}" />
			
		</td>
	</tr>
</table>
</form>                                                                                           administration/templates/default/users/users_notes.tpl                                              0000644 0023433 0004734 00000002572 11051631707 023337  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>{$smarty.const.LANG_NOTES}</title>
<link href="templates/default/style/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
{literal}
		<!--
		function setfocus()
		{
			document.forms[0].notes.focus()
		}
		//-->
{/literal}
</script>
</head>

<body onload="setfocus();">
	<div id="loginwrapper">
		<div class="wrap">
			{if $action=="success"}
				<h2>{$smarty.const.LANG_FORWARD_SUCESS}</h2>
				{$msg}
				<div align="center">
					<input type="button" value="{$smarty.const.LANG_CLOSE}" onclick="window.close()" />
				</div>
			{else}
				<form method="post" name="notes" action="notes.php">
					<fieldset>
						<legend>{$username} {$smarty.const.LANG_NOTES}</legend>
						{$smarty.const.LANG_NOTES_TXT}
						
						<textarea name="notes" style="width: 100%" rows="25">{$notes}</textarea>
					</fieldset>
					<input type="hidden" name="id" value="{$id}" />
					<div align="center"><input type="submit" name="submit" value="Update" /> <input type="reset" name="reset" value="Reset" /></div>
				</form>
			{/if}
		</div>
	</div>
</body>
</html>                                                                                                                                      administration/usergroups.php                                                                       0000644 0023433 0004734 00000023472 11051631712 016407  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
if($_SESSION['admin_users']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	// they have selected delete
	if(isset($_POST["action"]) && $_POST["action"] == "delete" && isset($_POST["groupID"])) 
	{
		$groupID=(int)trim(@$_POST['groupID']);
		$sSQL = "DELETE FROM ".PREFIX."user_groups WHERE uGroupID=".$groupID." LIMIT 1";
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				$sSQL="UPDATE ".PREFIX."users SET level=2 WHERE level=".$groupID;
				$db->query($sSQL);
				//sucessfull
				$location="usergroups.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//not successfull
				$location="usergroups.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	// they have selected modify
	elseif(isset($_POST["action"]) && $_POST["action"] == "modifygroup" && isset($_POST["groupID"])) 
	{
		$groupID=(int)trim(@$_POST['groupID']);
		$sSQL = sprintf("UPDATE ".PREFIX."user_groups SET uTitle=%s,uDescription=%s,uBanned=%s,uAllowContact=%s,uAllowEmailFriend=%s,uViewSite=%s,uViewPhotos=%s,uViewPrice=%s,uViewSeller=%s,uViewAddress=%s,uViewCity=%s,uViewState=%s,uViewCountry=%s,uViewDateAdded=%s,uViewExpiration=%s,uViewHits=%s,uViewFavorites=%s,sDisPhoto=%s,sDisTitle=%s,sDisPrice=%s,sDisDateAdded=%s,sDisExpiration=%s,sDisCity=%s,sDisState=%s,sDisCountry=%s,uViewPhone=%s WHERE uGroupID=%s",
					GetSQLValueString($_POST['uTitle'], "text"),
					GetSQLValueString($_POST['uDescription'], "text"),
					GetSQLValueString($_POST['uBanned'], "text"),
					GetSQLValueString($_POST['uAllowContact'], "text"),
					GetSQLValueString($_POST['uAllowEmailFriend'], "text"),
					GetSQLValueString($_POST['uViewSite'], "text"),
					GetSQLValueString($_POST['uViewPhotos'], "text"),
					GetSQLValueString($_POST['uViewPrice'], "text"),
					GetSQLValueString($_POST['uViewSeller'], "text"),
					GetSQLValueString($_POST['uViewAddress'], "text"),
					GetSQLValueString($_POST['uViewCity'], "text"),
					GetSQLValueString($_POST['uViewState'], "text"),
					GetSQLValueString($_POST['uViewCountry'], "text"),
					GetSQLValueString($_POST['uViewDateAdded'], "text"),
					GetSQLValueString($_POST['uViewExpiration'], "text"),
					GetSQLValueString($_POST['uViewHits'], "text"),
					GetSQLValueString($_POST['uViewFavorites'], "text"),
					GetSQLValueString($_POST['sDisPhoto'], "text"),
					GetSQLValueString($_POST['sDisTitle'], "text"),
					GetSQLValueString($_POST['sDisPrice'], "text"),
					GetSQLValueString($_POST['sDisDateAdded'], "text"),
					GetSQLValueString($_POST['sDisExpiration'], "text"),
					GetSQLValueString($_POST['sDisCity'], "text"),
					GetSQLValueString($_POST['sDisState'], "text"),
					GetSQLValueString($_POST['sDisCountry'], "text"),
					GetSQLValueString($_POST['uViewPhone'], "text"),
					GetSQLValueString($groupID, "int"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$location="usergroups.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//not successfull
				$location="usergroups.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
		}
	}
	// they have selected add page
	elseif(isset($_POST["action"]) && $_POST["action"] == "addgroup") 
	{
	     $sSQL = sprintf("INSERT INTO ".PREFIX."user_groups (uTitle,uDescription,uBanned,uAllowContact,uAllowEmailFriend,uViewSite,uViewPhotos,uViewPrice,uViewSeller,uViewAddress,uViewCity,uViewState,uViewCountry,uViewDateAdded,uViewExpiration,uViewHits,uViewFavorites,sDisPhoto,sDisTitle,sDisPrice,sDisDateAdded,sDisExpiration,sDisCity,sDisState,sDisCountry,uViewPhone) VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)",
					GetSQLValueString($_POST['uTitle'], "text"),
					GetSQLValueString($_POST['uDescription'], "text"),
                         GetSQLValueString($_POST['uBanned'], "text"),
                         GetSQLValueString($_POST['uAllowContact'], "text"),
                         GetSQLValueString($_POST['uAllowEmailFriend'], "text"),
                         GetSQLValueString($_POST['uViewSite'], "text"),
                         GetSQLValueString($_POST['uViewPhotos'], "text"),
                         GetSQLValueString($_POST['uViewPrice'], "text"),
                         GetSQLValueString($_POST['uViewSeller'], "text"),
                         GetSQLValueString($_POST['uViewAddress'], "text"),
                         GetSQLValueString($_POST['uViewCity'], "text"),
                         GetSQLValueString($_POST['uViewState'], "text"),
                         GetSQLValueString($_POST['uViewCountry'], "text"),
                         GetSQLValueString($_POST['uViewDateAdded'], "text"),
                         GetSQLValueString($_POST['uViewExpiration'], "text"),
                         GetSQLValueString($_POST['uViewHits'], "text"),
                         GetSQLValueString($_POST['uViewFavorites'], "text"),
                         GetSQLValueString($_POST['sDisPhoto'], "text"),
                         GetSQLValueString($_POST['sDisTitle'], "text"),
                         GetSQLValueString($_POST['sDisPrice'], "text"),
                         GetSQLValueString($_POST['sDisDateAdded'], "text"),
                         GetSQLValueString($_POST['sDisExpiration'], "text"),
                         GetSQLValueString($_POST['sDisCity'], "text"),
                         GetSQLValueString($_POST['sDisState'], "text"),
                         GetSQLValueString($_POST['sDisCountry'], "text"),
						 GetSQLValueString($_POST['uViewPhone'], "text"));
		$db->query($sSQL);
			if(!$db->isError()) 
			{
				//sucessfull
				$location="usergroups.php";
				$class_tpl->assign('title',LANG_FORWARD_SUCESS);
				$class_tpl->assign('forward',TRUE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
			else
			{
				//not successfull
				$location="usergroups.php";
				$class_tpl->assign('title',LANG_FORWARD_ERROR);
				$class_tpl->assign('forward',FALSE);
				$class_tpl->assign('location',$location);
				$class_tpl->assign('body','forward.tpl');
			}
	}
	// they have selected to add new page
	elseif(isset($_POST["action"]) && $_POST["action"] == "addnew") 
	{
	     $class_tpl->assign('action','addgroup');
	     $class_tpl->assign('body','usergroups/usergroupsform.tpl');
	}
	// they have selected to modify a page
	elseif(isset($_POST["action"]) && $_POST["action"] == "modify" && isset($_POST["groupID"])) 
	{
		$groupID=(int)trim(@$_POST['groupID']);
		$sSQL="SELECT uTitle,uDescription,uBanned,uAllowContact,uAllowEmailFriend,uViewSite,uViewPhotos,uViewPrice,uViewSeller,uViewAddress,uViewCity,uViewState,uViewCountry,uViewDateAdded,uViewExpiration,uViewHits,uViewFavorites,sDisPhoto,sDisTitle,sDisPrice,sDisDateAdded,sDisExpiration,sDisCity,sDisState,sDisCountry,uViewPhone FROM ".PREFIX."user_groups WHERE uGroupID=".$groupID;
		$result=$db->query($sSQL);
		$rs=$result->fetch();
		$class_tpl->assign('action','modifygroup');
		$class_tpl->assign('uGroupID',$groupID);
		$class_tpl->assign('uTitle',safeStripSlashes($rs['uTitle']));
		$class_tpl->assign('uDescription',safeStripSlashes($rs['uDescription']));
		$class_tpl->assign('uBanned',$rs['uBanned']);
		$class_tpl->assign('uAllowContact',$rs['uAllowContact']);
		$class_tpl->assign('uAllowEmailFriend',$rs['uAllowEmailFriend']);
		$class_tpl->assign('uViewSite',$rs['uViewSite']);
		$class_tpl->assign('uViewPhotos',$rs['uViewPhotos']);
		$class_tpl->assign('uViewPrice',$rs['uViewPrice']);
		$class_tpl->assign('uViewSeller', $rs['uViewSeller']);
		$class_tpl->assign('uViewAddress',$rs['uViewAddress']);
		$class_tpl->assign('uViewCity',$rs['uViewCity']);
		$class_tpl->assign('uViewState',$rs['uViewState']);
		$class_tpl->assign('uViewPhone', $rs['uViewPhone']);

		$class_tpl->assign('uViewCountry',$rs['uViewCountry']);
		$class_tpl->assign('uViewDateAdded',$rs['uViewDateAdded']);
		$class_tpl->assign('uViewExpiration',$rs['uViewExpiration']);
		$class_tpl->assign('uViewHits',$rs['uViewHits']);
		$class_tpl->assign('uViewFavorites',$rs['uViewFavorites']);
		
		$class_tpl->assign('sDisPhoto',$rs['sDisPhoto']);
		$class_tpl->assign('sDisTitle',$rs['sDisTitle']);
		$class_tpl->assign('sDisPrice',$rs['sDisPrice']);
		$class_tpl->assign('sDisDateAdded',$rs['sDisDateAdded']);
		$class_tpl->assign('sDisExpiration',$rs['sDisExpiration']);
		$class_tpl->assign('sDisCity',$rs['sDisCity']);
		$class_tpl->assign('sDisState',$rs['sDisState']);
		$class_tpl->assign('sDisCountry',$rs['sDisCountry']);
		
          $class_tpl->assign('body','usergroups/usergroupsform.tpl');
	}
	// final else show all the pages
	else
	{
		$sSQL="SELECT uGroupID,uTitle,uDescription FROM ".PREFIX."user_groups ORDER BY uGroupID";
		$result=$db->query($sSQL);
		$data=array();
		while($rs=$result->fetch())
		{
		     $rs['uTitle']=safeStripSlashes($rs['uTitle']);
		     $sSQL="SELECT COUNT(*) AS total FROM ".PREFIX."users WHERE level=".$rs['uGroupID'];
		     $result2=$db->query($sSQL);
		     $rs2=$result2->fetch();
		     $rs['total']=$rs2['total'];
		     $data[]=$rs;
		}
		$class_tpl->assign('results', $data);
		$class_tpl->assign('body','usergroups/usergroups.tpl');
	}

$class_tpl->displayTemplate();
?>
                                                                                                                                                                                                      administration/users.php                                                                            0000644 0023433 0004734 00000017306 11051631713 015332  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Listings.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Categories.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Users.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Register.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Pagination.php');
require_once(FILESYSTEM_PATH .'includes/classes/wrapper/SuperglobalWrapper.php');

$Users= new Users;
$Listings= new Listings;
$Categories = new Categories;
$Register = new Register;

if($_SESSION['admin_users']!="Y")
{
	$class_tpl->assign('body','notallowed.tpl');
	$class_tpl->displayTemplate();
	die;
}
	// they have selected to change the status
	if(isset($_POST['act']) && $_POST['act'] == "changestatus")
	{
		$newstatus=$_POST["newstatus"];
		foreach($_POST['userid'] AS $key)
		{
			if($newstatus=='Ban')
			{
				$Users->banUser($key);
			}
			elseif($newstatus=='Delete')
			{
				$Users->deleteUser($key);
			}
		}
	}
	
	if(isset($_POST['action']) && $_POST['action']=="add")
	{
		//the form has been submitted so lets validate it and update the info
		$modules->call_hook('admin_users_add', ''); // Call any module functions
		$password=trim(@$_POST['password']);
		$passwordconfirm=trim($_POST['passwordconfirm']);
		
		// Build an array from the submitted form values
		
			$submitVars=array (
				'username'=>trim($_POST['username']),
				'password'=>trim($_POST['password']),
				'email'=>trim($_POST['email']),
				'firstname'=>trim($_POST['firstname']),
				'lastname'=>trim($_POST['lastname']),
				'address'=>trim($_POST['address']),
				'city'=>trim($_POST['city']),
				'state'=>trim(@$_POST['state']),
				'zip'=>trim(@$_POST['zip']),
				'country'=>trim(@$_POST['country']),
				'email'=>trim($_POST['email']),
				'phone'=>trim($_POST['phone']),
				'b_same'=>trim($_POST['b_same']),
				'b_firstname'=>trim($_POST['b_firstname']),
				'b_lastname'=>trim($_POST['b_lastname']),
				'b_address'=>trim($_POST['b_address']),
				'b_city'=>trim($_POST['b_city']),
				'b_state'=>trim(@$_POST['b_state']),
				'b_zip'=>trim(@$_POST['b_zip']),
				'b_country'=>trim(@$_POST['b_country']),
				'b_phone'=>trim($_POST['b_phone']),
				'newsletter'=>trim(@$_POST['newsletter']),
				'extra'=>trim(@$_POST['extra']),
				'extra2'=>trim(@$_POST['extra2']),
				'extra3'=>trim(@$_POST['extra3']),
				'level'=>trim(@$_POST['level']),
				'adminCapabilities'=>$_POST['adminCapabilities']
			);
		
		$location="users.php";
		$class_tpl->assign('forward',FALSE);
		switch($Register->createSignup($submitVars))
		{
			case 4:
				$title=LANG_FORWARD_ERROR;
				$msg=LANG_USER_BLACKLISTED;
			break;
			case 3:
				$title=LANG_FORWARD_ERROR;
				$msg=LANG_ALREADY_REGISTERED;
			break;
			case 1:
				$title=LANG_FORWARD_SUCESS;
				$class_tpl->assign('forward',TRUE);
			break;
			default:
				$title=LANG_FORWARD_ERROR;
		}
		$class_tpl->assign('title',$title);
		$class_tpl->assign('location',$location);
		$class_tpl->assign('msg', $msg);
		$class_tpl->assign('body','forward.tpl');	
	}
	elseif(isset($_POST['action']) && $_POST['action']=="modify" && @$_POST['member']<>"")
	{
		//the form has been submitted so lets validate it and update the info
		$modules->call_hook('admin_users_modify', ''); // Call any module functions
		$password=trim(@$_POST['password']);
		$passwordconfirm=trim($_POST['passwordconfirm']);
		
		// Build an array from the submitted form values
			$submitVars=array (
				'username'=>trim($_POST['username']),
				'password'=>trim($_POST['password']),
				'email'=>trim($_POST['email']),
				'firstname'=>trim($_POST['firstname']),
				'lastname'=>trim($_POST['lastname']),
				'address'=>trim($_POST['address']),
				'city'=>trim($_POST['city']),
				'state'=>trim(@$_POST['state']),
				'zip'=>trim(@$_POST['zip']),
				'country'=>trim(@$_POST['country']),
				'email'=>trim($_POST['email']),
				'phone'=>trim($_POST['phone']),
				'b_same'=>trim($_POST['b_same']),
				'b_firstname'=>trim($_POST['b_firstname']),
				'b_lastname'=>trim($_POST['b_lastname']),
				'b_address'=>trim($_POST['b_address']),
				'b_city'=>trim($_POST['b_city']),
				'b_state'=>trim(@$_POST['b_state']),
				'b_zip'=>trim(@$_POST['b_zip']),
				'b_country'=>trim(@$_POST['b_country']),
				'b_phone'=>trim($_POST['b_phone']),
				'newsletter'=>trim(@$_POST['newsletter']),
				'extra'=>trim(@$_POST['extra']),
				'extra2'=>trim(@$_POST['extra2']),
				'extra3'=>trim(@$_POST['extra3']),
				'level'=>trim(@$_POST['level']),
				'id'=>(int)$_POST['member'],
				'notes'=>trim(@$_POST['notes']),
				'adminCapabilities'=>$_POST['adminCapabilities']
			);
		if($Register->modifySignup($submitVars))
		{
			//sucess
			$location="users.php?view=".(int)$_POST['member'];
			$class_tpl->assign('title',LANG_FORWARD_SUCESS);
			$class_tpl->assign('forward',TRUE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');	
		}
		else
		{
			//no sucess
			$location="users.php?uid=".$member;
			$class_tpl->assign('title',LANG_FORWARD_ERROR);
			$class_tpl->assign('forward',FALSE);
			$class_tpl->assign('location',$location);
			$class_tpl->assign('body','forward.tpl');
		}
	}
	elseif(isset($_GET['view']))
	{
		$pageNum = 1;
		if(isset($_GET['page']))
		{
			$pageNum = (int)$_GET['page'];
		}
		$Users->getUser($_GET['view']);
		$options = array('owner' => $_GET['view']);
		$list=$Listings->getAllListings($options, $pageNum, 9999);
		$class_tpl->assign('results', $list["list"]);
		$class_tpl->assign('userlevels', $Users->getUserGroupsList());
		$class_tpl->assign('showstates', $Users->getStates());
		$class_tpl->assign('showcountries', $Users->getCountries());
		$class_tpl->assign('numberoflistings', $Users->getNumberOfListingsByUserID($_GET['view']));
		$Register->createJavascriptValidation();
		$class_tpl->assign('body', 'users/users_info.tpl');
		$modules->call_hook('admin_users_view', ''); // Call any module functions
	}
	elseif(isset($_GET['action']) && $_GET['action']=="add")
	{
		$class_tpl->assign('userlevels', $Users->getUserGroupsList());
		$class_tpl->assign('showstates', $Users->getStates());
		$class_tpl->assign('showcountries', $Users->getCountries());
		$Register->createJavascriptValidation();
		$class_tpl->assign('body', 'users/users_add.tpl');
	}
	elseif(isset($_GET['action']) && $_GET['action']=="csv")
	{
		$pageNum = 1;
		$list=$Users->getAllUsers($options, $pageNum, TRUE);
	}
	else
	{
		$pageNum = 1;
		if(isset($_GET['page']))
		{
			$pageNum = (int)$_GET['page'];
		}
		//$options = array('l_UID' => 1);
		$options = '';
		$list=$Users->getAllUsers($options, $pageNum);
		$class_tpl->assign('results', $list["list"]);
		$class_tpl->assign('sqlsort', $list["info"]["sqlsort"]);
		$class_tpl->assign('sortorder', $list["info"]["sortorder"]);
		$class_tpl->assign('oppositesort',  $list["info"]["oppositesort"]);
		
		$sSQL="SELECT uGroupID,uTitle FROM ".PREFIX."user_groups ORDER BY uGroupID";
		$result=$db->query($sSQL);
		$data=array();
		while($rs=$result->fetch())
		{
			$rs['uTitle']=safeStripSlashes($rs['uTitle']);
			switch($rs['uGroupID'])
			{
				case "1":
					$rs['image']='flag_blue.png';
				break;
				case "2":
					$rs['image']='flag_green.png';
				break;
				case 3:
					$rs['image']='flag_orange.png';
				break;
				case 4:
					$rs['image']='flag_red.png';
				break;
				case 5:
					$rs['image']='flag_yellow.png';
				break;
				default:
					$rs['image']='flag_purple.png';
			}
			$data[]=$rs;
		}
		$class_tpl->assign('group', $data);
		$class_tpl->assign('body', 'users/users_browse.tpl');
	}
$class_tpl->displayTemplate();
?>
                                                                                                                                                                                                                                                                                                                          administration/bulk_listings.php                                                                    0000644 0023433 0004734 00000023072 11244314662 017044  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Listings.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Categories.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Users.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Products.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Orders.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Pagination.php');

$Users= new Users;
$Listings= new Listings;
$Categories = new Categories;
$Products = new Products;
$Orders = new Orders;
/*
$cats = "Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
District of Columbia
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming";
*/
/*
$cats .= "
Abilene 
Akron 
Albuquerque 
Alexandria 
Allentown 
Amarillo 
Amherst 
Anchorage 
Ann Arbor 
Arlington 
Arlington 
Arvada 
Athens 
Atlanta 
Augusta 
Aurora 
Aurora 
Austin 
Babylon 
Bakersfield 
Baltimore 
Baton Rouge 
Beaumont 
Bellevue 
Birmingham 
Boise 
Boston 
Bridgeport 
Brookhaven 
Brownsville 
Buffalo 
Cambridge 
Cape Coral 
Carrollton 
Cedar Rapids 
Chandler 
Charlotte 
Chattanooga 
Chesapeake 
Chicago 
Cincinnati 
Clarksville 
Clearwater 
Cleveland 
Colorado Springs 
Columbia 
Columbus 
Columbus 
Coral Springs 
Corpus Christi 
Dallas 
Dayton 
Denver 
Des Moines 
Detroit 
Durham 
El Paso 
Elizabeth 
Erie 
Eugene 
Evansville 
Fayetteville 
Flint 
Fort Collins 
Fort Lauderdale 
Fort Wayne 
Fort Worth 
Fresno 
Garland 
Gary 
Gilbert 
Glendale 
Grand Junction 
Grand Prairie 
Grand Rapids 
Green Bay 
Greensboro 
Hampton 
Harrisburg 
Hartford 
Hempstead 
Henderson 
Hialeah 
Hollywood 
Honolulu 
Houston 
Huntington 
Huntsville 
Independence 
Indianapolis 
Irving 
Islip 
Jackson 
Jacksonville 
Jacksonville 
Jersey City 
Joliet 
Kansas City 
Kansas City 
Knoxville 
Lafayette 
Lakewood 
Lancaster 
Lansing 
Laredo 
Las Vegas 
Lexington 
Lincoln 
Little Rock 
Livonia 
Los Angeles 
Louisville 
Lowell 
Lubbock 
Madison 
Manchester 
McAllen 
Memphis 
Mesa 
Mesquite 
Metairie 
Miami 
Milwaukee 
Minneapolis 
Mobile 
Montgomery 
Naperville 
Nashville 
New Haven 
New Orleans 
New York 
Newark 
Newport News 
Norfolk 
North Hempstead 
North Las Vegas 
Oakland 
Oklahoma City 
Omaha 
Orange County 
Orlando 
Overland Park 
Oyster Bay 
Paradise 
Pasadena 
Paterson 
Pembroke Pines 
Peoria 
Peoria 
Philadelphia 
Phoenix 
Pittsburgh 
Plano 
Portland 
Portsmouth 
Providence 
Provo 
Pueblo 
Raleigh 
Ramapo 
Reno 
Richmond 
Riverside 
Rochester 
Rockford 
Sacramento 
Salem 
Salinas 
Salt Lake City 
San Antonio 
San Diego 
San Francisco 
San Jose 
Santa Rosa 
Savannah 
Scottsdale 
Seattle 
Shreveport 
Sioux Falls 
Smithtown 
South Bend 
Spokane 
Spring Valley 
Springfield 
Springfield 
Springfield 
St. Louis 
St. Paul 
St. Petersburg 
Stamford 
Sterling Heights 
Sunrise Manor 
Syracuse 
Tacoma 
Tallahassee 
Tampa 
Tempe 
Toledo 
Topeka 
Tri-Cities 
Tucson 
Tulsa 
Vancouver 
Virginia Beach 
Waco 
Warren 
Waterbury 
West Valley City 
Westminster 
Wichita 
Wichita Falls 
Winston-Salem 
Worcester 
Yonkers 
York";
*/
/*
$cats .= "
British Columbia
Calgary
Edmonton
London
Montreal
Niagara Falls
Nova Scotia
Ontario
Prince Edward Island
Quebec
Saskatoon
Sydney
Toronto
Vancouver
Winnipeg
Brisbane
Melbourne
Perth
Prahran
Sandringham
Sydney
Avon
Bedfordshire
Berkshire
Bristol
Buckinghamshire
Cambridgeshire
Cheshire
Cornwall
Cumbria
Derbyshire
Devon
Dorset
Durham
East Sussex
Essex
Gloucestershire
Greater London
Greater Manchester
Hampshire
Herefordshire
Hertfordshire
Humberside / East Yorkshire
Isle of Wight
Kent
Lancashire
Leicestershire
Lincolnshire
Merseyside
Middlesex
Norfolk
North Yorkshire
Northamptonshire
Northern Ireland
Northumberland
Nottinghamshire
Oxfordshire
Scotland
Shropshire
Somerset
South Yorkshire
Staffordshire
Suffolk
Surrey
Tyne and Wear
Wales
Warwickshire
West Midlands
West Sussex
West Yorkshire
Wiltshire
Worcestershire";
*/
/*
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
District of Columbia
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming";
*/
/*
$cats .= "Accountant Website Design
Church Website Design
Contractor Website Design
Doctor/Physician Website Design
Educational Website Design
Government Website Design
Law Firm Website Design
Non-Profit Website Design
Photography Website Design
Real Estate Website Design
Restaurant Website Design
Wedding Website Design";
*/
/*
//Gravitate
$cats = "Oregon 
Portland
Washington
Seattle
California
Los Angeles
San Diego
San Francisco
San Jose
Arizona
Phoenix
District of
New York
New York 
Georgia
Atlanta
Illinois
Chicago
Texas
Houston
San Antonio
Dallas
Pennsylvania
Philadelphia
Colorado
Denver
Nevada
Las Vegas
Florida
Miami";
*/
/*
$cats .= "
.Net
Database
E-Commerce
Enterprise
Flash
Freelance
Multilingual
PHP
Small Business
Template
Web Application";
*/
/*
$cats .= "
Banner Ad Design Companies
Brochure Design Companies
Business Card Design Companies
Icon Design Companies
Logo Design Firms";
*/
/*
$cats .= "
Offshore";
*/
/*
$cats .= "
Affiliat
Blog & Viral
E-mail
Online Marketing
Pay-Per-Click Management
Search Engine Marketing
Search Engine Optimization
Accountant Website Design";
*/

$cats .= "
Winnipeg
Kent";
/*
$sSQL = "select * from dircategories where parent_id != 0 ";
$result=$db->query($sSQL);
while ($cat = $result->fetch()) {
	$test = $db->query("select * from dirlistings where section = $cat[id] and owner = 25820");
	$test2 = $test->fetch();
	if (!$test2) {
		echo "$cat[name] $cat[id]<br>";
	}
}

exit;
*/

$sSQL = "select * from dirlistings where owner = 19751 and expiration = '2008-09-04 00:00:00'";
$result = $db->query($sSQL);
$cats = array();
while ($cat = $result->fetch()) {
	$cats[] = $cat["section"];
}

//$cats = "Contractor Website Design";
//$cats = "Wyoming";
$cats = explode("\n", $cats);
//$real_name = explode(\"n", $catS);
/*
foreach ($cats as $id => $cat_name) {
	$cat_name = trim($cat_name);
	if ($cat_name) {
	*/
	
	//everything but international
	/*
	
	$result = $db->query("select * from dirlistings where id = 26980");
	while($cat = $result->fetch()) {
		var_dump($cat);
	}
	exit;
	*/
//	$sSQL = "select * from dircategories where parent_id = 735 or parent_id = 822 or parent_id = 818"; // id = $cat_name"; 
	$sSQL = "select * from dircategories where id = 794 
	";

	$result=$db->query($sSQL);
	while($cat = $result->fetch()) {
//	echo $sSQL . "\n";
	
			//echo $cat["name"] . " ! " . $cat["parent_id"] . "<br />";

		//$sSQL = "SELECT p.cFeaturedPrice FROM dirproducts_packages as p, dirproducts_packages_lookup as pl where pl.cID = p.pID AND pl.cCategoryID = " . $cat["id"];
//		$result = $db->query($sSQL);
//		$product = $result->fetch();
//		$price += $product["cFeaturedPrice"];
		//echo $cat["name"] . "\t" . $product["cFeaturedPrice"] . "<br>";
		$order['userid']=27851;

		$existing = $db->query("select * from dirlistings where section = $cat[id] and owner = $order[userid]");
		$existing = $existing->fetch($existing);
	//	echo "select * from dirlistings where section = $cat[id] and owner = $order[userid]<br>";
//		var_dump($existing);
		if (!$existing) {		
			$order['oProductID']=25;
			$order['oProduct']="Directory Listing";
			$order['oType']=1;
			$order['oTotal']=0;
			$order['oSubTotal']=0;
			$order['oBold']='N';
			$order['oHighlighted']='N';
			$order['oFeatured']='Y';
			$order['oStatus']=1;
			$order['oAddInfo']='Manually added by Xemion'; 
		//	var_dump($order);
			$orderid=$Orders->generateOrder($order);
		
			$data['owner']=$order['userid'];
			//if ($cat["parent_id"] != 822 && $cat["parent_id"] != 818 && $cat["parent_id"] != 819) {
			//	$data['title']= $cat["name"] . " Web Design from Gravitate Design Studio";
			//} else {
			//	$data['title']= $cat["name"] . " from Gravitate Design Studio";
			//}
			$data['title'] = "Build your own website with Website Builder 360!";
			$data['price']=0;
			$data['url']="http://www.WebsiteBuilder360.com";
			$data['display']="Y";
			$data['section']=$cat["id"];
			$data['shortDescription']="";
			$data['featured'] = "Y";
			$data['pHighlighted']='N';
			$data['description']="Website Builder 360 makes it easy for anyone to quickly create a professional and highly-functional website.  All packages include e-commerce, video, photo galleries, member-only pages, contact forms and more.  Sign up today for an instant free trial!";
			$time=strftime("%H:%M:%S");
			$expiration="2020-10-04"." ". $time;
			$data['expiration']=$expiration;
			$data['orderID']=$orderid;
			//$_POST["opt1"] = "Anywhere";
			//$_POST["opt2"] = "866.822.4335";
		//	var_dump($data);
			echo "\n\n\n";
			$listingid=$Listings->addListing($data);
			echo $cat["name"] . " : " . $listingid . "<br />";
			$sSQL = "insert into dirprodimages (pid, image) VALUES ($listingid, 'websitebuilder360.gif')";
			$db->query($sSQL);
		}
	}
/*
	}
}
*/
//echo $price;
?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                      administration/bulk_pricing.php                                                                     0000644 0023433 0004734 00000017346 11450166712 016652  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php 
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Listings.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Categories.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Users.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Products.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Orders.php');
require_once(FILESYSTEM_PATH .'includes/classes/kernel/Pagination.php');

$Users= new Users;
$Listings= new Listings;
$Categories = new Categories;
$Products = new Products;
$Orders = new Orders;
/*
$cats = "Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
District of Columbia
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming";
*/
/*
$cats .= "
Abilene 
Akron 
Albuquerque 
Alexandria 
Allentown 
Amarillo 
Amherst 
Anchorage 
Ann Arbor 
Arlington 
Arlington 
Arvada 
Athens 
Atlanta 
Augusta 
Aurora 
Aurora 
Austin 
Babylon 
Bakersfield 
Baltimore 
Baton Rouge 
Beaumont 
Bellevue 
Birmingham 
Boise 
Boston 
Bridgeport 
Brookhaven 
Brownsville 
Buffalo 
Cambridge 
Cape Coral 
Carrollton 
Cedar Rapids 
Chandler 
Charlotte 
Chattanooga 
Chesapeake 
Chicago 
Cincinnati 
Clarksville 
Clearwater 
Cleveland 
Colorado Springs 
Columbia 
Columbus 
Columbus 
Coral Springs 
Corpus Christi 
Dallas 
Dayton 
Denver 
Des Moines 
Detroit 
Durham 
El Paso 
Elizabeth 
Erie 
Eugene 
Evansville 
Fayetteville 
Flint 
Fort Collins 
Fort Lauderdale 
Fort Wayne 
Fort Worth 
Fresno 
Garland 
Gary 
Gilbert 
Glendale 
Grand Junction 
Grand Prairie 
Grand Rapids 
Green Bay 
Greensboro 
Hampton 
Harrisburg 
Hartford 
Hempstead 
Henderson 
Hialeah 
Hollywood 
Honolulu 
Houston 
Huntington 
Huntsville 
Independence 
Indianapolis 
Irving 
Islip 
Jackson 
Jacksonville 
Jacksonville 
Jersey City 
Joliet 
Kansas City 
Kansas City 
Knoxville 
Lafayette 
Lakewood 
Lancaster 
Lansing 
Laredo 
Las Vegas 
Lexington 
Lincoln 
Little Rock 
Livonia 
Los Angeles 
Louisville 
Lowell 
Lubbock 
Madison 
Manchester 
McAllen 
Memphis 
Mesa 
Mesquite 
Metairie 
Miami 
Milwaukee 
Minneapolis 
Mobile 
Montgomery 
Naperville 
Nashville 
New Haven 
New Orleans 
New York 
Newark 
Newport News 
Norfolk 
North Hempstead 
North Las Vegas 
Oakland 
Oklahoma City 
Omaha 
Orange County 
Orlando 
Overland Park 
Oyster Bay 
Paradise 
Pasadena 
Paterson 
Pembroke Pines 
Peoria 
Peoria 
Philadelphia 
Phoenix 
Pittsburgh 
Plano 
Portland 
Portsmouth 
Providence 
Provo 
Pueblo 
Raleigh 
Ramapo 
Reno 
Richmond 
Riverside 
Rochester 
Rockford 
Sacramento 
Salem 
Salinas 
Salt Lake City 
San Antonio 
San Diego 
San Francisco 
San Jose 
Santa Rosa 
Savannah 
Scottsdale 
Seattle 
Shreveport 
Sioux Falls 
Smithtown 
South Bend 
Spokane 
Spring Valley 
Springfield 
Springfield 
Springfield 
St. Louis 
St. Paul 
St. Petersburg 
Stamford 
Sterling Heights 
Sunrise Manor 
Syracuse 
Tacoma 
Tallahassee 
Tampa 
Tempe 
Toledo 
Topeka 
Tri-Cities 
Tucson 
Tulsa 
Vancouver 
Virginia Beach 
Waco 
Warren 
Waterbury 
West Valley City 
Westminster 
Wichita 
Wichita Falls 
Winston-Salem 
Worcester 
Yonkers 
York";
*/
/*
$cats .= "
British Columbia
Calgary
Edmonton
London
Montreal
Niagara Falls
Nova Scotia
Ontario
Prince Edward Island
Quebec
Saskatoon
Sydney
Toronto
Vancouver
Winnipeg
Brisbane
Melbourne
Perth
Prahran
Sandringham
Sydney
Avon
Bedfordshire
Berkshire
Bristol
Buckinghamshire
Cambridgeshire
Cheshire
Cornwall
Cumbria
Derbyshire
Devon
Dorset
Durham
East Sussex
Essex
Gloucestershire
Greater London
Greater Manchester
Hampshire
Herefordshire
Hertfordshire
Humberside / East Yorkshire
Isle of Wight
Kent
Lancashire
Leicestershire
Lincolnshire
Merseyside
Middlesex
Norfolk
North Yorkshire
Northamptonshire
Northern Ireland
Northumberland
Nottinghamshire
Oxfordshire
Scotland
Shropshire
Somerset
South Yorkshire
Staffordshire
Suffolk
Surrey
Tyne and Wear
Wales
Warwickshire
West Midlands
West Sussex
West Yorkshire
Wiltshire
Worcestershire";
*/
/*
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
District of Columbia
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming";
*/
/*
$cats .= "Accountant Website Design
Church Website Design
Contractor Website Design
Doctor/Physician Website Design
Educational Website Design
Government Website Design
Law Firm Website Design
Non-Profit Website Design
Photography Website Design
Real Estate Website Design
Restaurant Website Design
Wedding Website Design";
*/
/*
//Gravitate
$cats = "Oregon 
Portland
Washington
Seattle
California
Los Angeles
San Diego
San Francisco
San Jose
Arizona
Phoenix
District of
New York
New York 
Georgia
Atlanta
Illinois
Chicago
Texas
Houston
San Antonio
Dallas
Pennsylvania
Philadelphia
Colorado
Denver
Nevada
Las Vegas
Florida
Miami";
*/
/*
$cats .= "
.Net
Database
E-Commerce
Enterprise
Flash
Freelance
Multilingual
PHP
Small Business
Template
Web Application";
*/
/*
$cats .= "
Banner Ad Design Companies
Brochure Design Companies
Business Card Design Companies
Icon Design Companies
Logo Design Firms";
*/
/*
$cats .= "
Offshore";
*/
/*
$cats .= "
Affiliat
Blog & Viral
E-mail
Online Marketing
Pay-Per-Click Management
Search Engine Marketing
Search Engine Optimization
Accountant Website Design";
*/

$cats .= "
Winnipeg
Kent";
/*
$sSQL = "select * from dircategories where parent_id != 0 ";
$result=$db->query($sSQL);
while ($cat = $result->fetch()) {
	$test = $db->query("select * from dirlistings where section = $cat[id] and owner = 25820");
	$test2 = $test->fetch();
	if (!$test2) {
		echo "$cat[name] $cat[id]<br>";
	}
}

exit;
*/

$sSQL = "select * from dirlistings where owner = 19751 and display='Y' and date(expiration) = '2010-10-04'";
$result = $db->query($sSQL);
$cats = array();
while ($cat = $result->fetch()) {
  $sSQL = "SELECT cFeaturedPrice, c.name FROM dirproducts_packages as p, dirproducts_packages_lookup as pl, dircategories as c where pl.cID = p.pID AND pl.cCategoryID = $cat[section] and c.id = $cat[section]";
  $result2 = $db->query($sSQL);
  $product = $result2->fetch();
  $price += $product["cFeaturedPrice"];
	echo $product["name"] . "\t" . $product["cFeaturedPrice"] . "\n";
}
echo $price;

exit;

//$cats = "Contractor Website Design";
//$cats = "Wyoming";
//$cats = explode("\n", $cats);
//$real_name = explode(\"n", $catS);

/*foreach ($cats as $id => $cat_name) {
	$cat_name = trim($cat_name);
	if ($cat_name) {*/


		$sSQL = "select * from dircategories where parent_id = 740"; 
		$result=$db->query($sSQL);
		while($cat = $result->fetch()) {
		//echo $sSQL . "<Br>";
		
				//echo $cat["name"] . " ! " . $cat["parent_id"] . "<br />";
	
			$sSQL = "SELECT * FROM dirproducts_packages as p, dirproducts_packages_lookup as pl where pl.cID = p.pID AND pl.cCategoryID = " . $cat["id"];
			$result2 = $db->query($sSQL);
			$product = $result2->fetch();
//			var_dump($product);
			$product["cFeaturedPrice"] = $cat["price"];
			$price += $product["cFeaturedPrice"];
			echo $cat["name"] . "\t" . $product["cFeaturedPrice"] . "\n";
		}
/*
	}
}*/

//echo $price;
?>
                                                                                                                                                                                                                                                                                          advertise.php                                                                                       0000644 0023433 0004734 00000001037 11321003647 013123  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
	require_once('includes/init.php');


	$sSQL="SELECT * from dircategories where id = '" . (int)$_REQUEST["catid"] . "'";
	$result=$db->query($sSQL);
	$category=$result->fetch();
	$class_tpl->assign("category", $category);
	$class_tpl->assign('body','advertise.tpl');
	$class_tpl->display('layout.tpl',$page);
?>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ajax.php                                                                                            0000644 0023433 0004734 00000025670 11036011254 012065  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/

require_once('includes/init.php');
require_once(FILESYSTEM_PATH .'includes/classes/cpaint/cpaint2.inc.php');
$cp = new cpaint();
$cp->register('removeFavorite');
$cp->register('saveFavorite');
$cp->register('deleteUpload');
$cp->register('ajax_extra_search_fields');
$cp->register('extra_search_fields2');
$cp->register('extra_checkout_fields');
$cp->start();
$cp->return_data();

function removeFavorite($userid, $view)
{
	global $db, $cp;
	//first check//
	$userid=(int)$userid;
	$view = (int)$view;
	$sSQL = sprintf("DELETE FROM ".PREFIX."favorites WHERE uID=%s AND pID=%s", $userid, $view);
	$db->query($sSQL);
	$output=LANG_FAV_REMOVED;
	$cp->set_id("deleteResponse");
	$cp->set_data();
	$cp->set_data($output);
	return;
}
function saveFavorite($userid, $view)
{
	global $db, $cp;
	//first check//
	$userid=(int)$userid;
	$view = (int)$view;
	$sSQL = sprintf("SELECT pID FROM ".PREFIX."favorites WHERE uID=%s AND pID=%s", $userid, $view);
	$result=$db->query($sSQL);
	$rows=$result->size();
	if($rows > 0)
	{
		//not sucessfull
		$output=LANG_FAV_ALREADY_SAVED;
	}
	else
	{
		$sSQL = sprintf("INSERT INTO ".PREFIX."favorites SET uID=%s, pID=%s", $userid, $view);
		$db->query($sSQL);
		//sucessfull
		$output=LANG_FAV_SAVED;
	}
	$cp->set_id("deleteResponse");
	$cp->set_data();
	$cp->set_data($output);
	return;
}
function deleteUpload($id, $fid)
{
	global $db, $cp;
	$id=(int)$id;
	$fid = (int)$fid;
	$sSQL="SELECT sValue FROM ".PREFIX."products_fields WHERE pID=".$id." AND fID=".$fid;
	$result=$db->query($sSQL);
	$rs=$result->fetch();
	@unlink(FILESYSTEM_PATH .'uploads/'.$rs['sValue']);
	$sSQL="DELETE FROM ".PREFIX."products_fields WHERE pID=".$id." AND fID=".$fid;
	$db->query($sSQL);
	$cp->set_id("deleteResponse");
	$cp->set_data();
	return;
}
function ajax_extra_search_fields($type)
{
	global $db, $cp;
	$type=(int)$type;
	$optdata='<table width="100%">';
	//$sSQL = "SELECT fID, fOrder FROM `".PREFIX."fields`WHERE fSearch = 'Y' ORDER BY fOrder ASC";
	$sSQL = "SELECT f.fID, f.fOrder FROM `".PREFIX."fields` AS f INNER JOIN ".PREFIX."fields_bindings AS fb ON fb.fieldID = f.fID AND fb.catID = ".$type." AND f.fSearch ='Y' ORDER BY fOrder ASC";
	$test=$sSQL;
	$result2 = $db->query($sSQL);
	$rows=$result2->size();
		if($rows>0)
		{
			while($rs2=$result2->fetch())
			{
				$sql="SELECT fID,fName,fDefault,fType,fRequired,fRange,fRangeValue FROM `".PREFIX."fields` WHERE fID='".$rs2['fID']."' ORDER BY fOrder ASC";
				$result3 = $db->query($sql);
				$row = $result3->fetch();
						if($row['fType']=="D" || $row['fType']=="C")
						{
							if($row['fRange']=='Y')
							{
								if($row['fRangeValue']!="0|0|0")
								{
									$fRangeValue=explode("|", $row['fRangeValue']);
									$optdata.="<tr><td width=\"50%\">".$row['fName'].":</td><td width=\"50%\">";
									$optdata.="<select name=\"optmin".$row['fID']."\" id=\"minopt".$row['fID']."\">";
									for ( $counter = $fRangeValue[0]; $counter <= $fRangeValue[1]; $counter += $fRangeValue[2]) 
									{
										if($fRangeValue[0]==$counter)
										{
											$selected=" SELECTED";
										}
										else
										{
											$selected='';
										}
										$optdata.='<option value="'.$counter.'"'.$selected.'>'.$counter.'</option>';
									}
									$optdata.="</select>";
									$optdata.="&nbsp;".LANG_TO."&nbsp;";
									$optdata.="<select name=\"optmax".$row['fID']."\" id=\"optmax".$row['fID']."\">";
									for ( $counter = $fRangeValue[0]; $counter <= $fRangeValue[1]; $counter += $fRangeValue[2]) 
									{
										if($fRangeValue[1]==$counter)
										{
											$selected=" SELECTED";	
										}
										$optdata.='<option value="'.$counter.'"'.$selected.'>'.$counter.'</option>';
									}
									$optdata.="</select>";
									$optdata.="</td></tr>\n";
								}
								else
								{
									$optdata.="<tr><td width=\"50%\">".$row['fName'].":</td><td width=\"50%\"><input type=\"text\" name=\"optmin".$row['fID']."\" />&nbsp;".LANG_TO."&nbsp;<input type=\"text\" name=\"optmax".$row['fID']."\" /></td></tr>\n";
								}
							}
							else
							{
							//it is a select list//
							$optdata.="<tr><td width=\"50%\">".$row['fName'].":</td><td width=\"50%\"><select name=\"opt".$row['fID']."\">";
							$optdata.="<option value=\"\">". LANG_SEARCH_ALLCAT ."</option>";
							$ssql="SELECT optID,fieldID,optValue,optOrder FROM ".PREFIX."fields_options WHERE fieldID='".$row['fID']."' ORDER BY optValue ASC";
							$resultsets=$db->query($ssql);
							while($opt=$resultsets->fetch())
							{
								$optdata.="<option value=\"".$opt['optValue']."\">".$opt['optValue']."</option>\n";
							}
							$optdata.="</select></td></tr>";
							}
						}
						if($row['fType']=="P")
						{
							//it is a select list//
							$optdata.="<tr><td width=\"50%\">".$row['fName'].":</td><td width=\"50%\"><select name=\"opt".$row['fID']."\" onChange=\"displayNewSec(this);\">";
							$optdata.="<option value=\"\">". LANG_SEARCH_ALLCAT ."</option>";
							$ssql="SELECT optID,fieldID,optValue,optOrder FROM ".PREFIX."fields_options WHERE fieldID='".$row['fID']."' ORDER BY optValue";
							$resultsets=$db->query($ssql);
							while($opt=$resultsets->fetch())
							{
								$optdata.="<option value=\"".$opt['optValue']."\">".$opt['optValue']."</option>\n";
							}
							$optdata.="</select></td></tr>";
						}
						elseif($row['fType']=="S" || $row['fType']=="M")
						{
							if($row['fRange']=='Y')
							{
								if($row['fRangeValue']!="0|0|0")
								{
									$fRangeValue=explode("|", $row['fRangeValue']);
									$optdata.="<tr><td width=\"50%\">".$row['fName'].":</td><td width=\"50%\">";
									$optdata.="<select name=\"optmin".$row['fID']."\" id=\"minopt".$row['fID']."\">";
									for ( $counter = $fRangeValue[0]; $counter <= $fRangeValue[1]; $counter += $fRangeValue[2]) 
									{
										if($fRangeValue[0]==$counter)
										{
											$selected=" SELECTED";
										}
										else
										{
											$selected='';
										}
										$optdata.='<option value="'.$counter.'"'.$selected.'>'.$counter.'</option>';
									}
									$optdata.="</select>";
									$optdata.="&nbsp;".LANG_TO."&nbsp;";
									$optdata.="<select name=\"optmax".$row['fID']."\" id=\"optmax".$row['fID']."\">";
									for ( $counter = $fRangeValue[0]; $counter <= $fRangeValue[1]; $counter += $fRangeValue[2]) 
									{
										if($fRangeValue[1]==$counter)
										{
											$selected=" SELECTED";	
										}
										$optdata.='<option value="'.$counter.'"'.$selected.'>'.$counter.'</option>';
									}
									$optdata.="</select>";
									$optdata.="</td></tr>\n";
								}
								else
								{
									$optdata.="<tr><td width=\"50%\">".$row['fName'].":</td><td width=\"50%\"><input type=\"text\" name=\"optmin".$row['fID']."\" />&nbsp;".LANG_TO."&nbsp;<input type=\"text\" name=\"optmax".$row['fID']."\" /></td></tr>\n";
								}
							}
							else
							{
								//single text field
								$optdata.="<tr><td width=\"50%\">".$row['fName'].":</td><td width=\"50%\"><input type=\"text\" name=\"opt".$row['fID']."\" /></td></tr>\n";
							}
						}
			}
		}
	$optdata.="</table>";
	$cp->set_id("response");
	#$add_result_node =& $cp->add_node("add");
	#$add_result_node->set_data($optdata);
	$cp->set_data($optdata);
	return;
}

function extra_search_fields2($type)
{
	global $db, $cp;
	$type=mysql_real_escape_string($type);
	//$sSQL = "SELECT fID, fOrder FROM `".PREFIX."fields`WHERE fSearch = 'Y' ORDER BY fOrder ASC";
	$sSQL = "SELECT optSub FROM `".PREFIX."fields_options`WHERE optValue='".$type."'";
	$test=$sSQL;
	$result2 = $db->query($sSQL);
	$rows=$result2->size();
		if($rows>0)
		{
			$optdata2='<table width="100%" cellpadding="0" cellspacing="0">';
			while($rs2=$result2->fetch())
			{
				$sql="SELECT fID,fName,fDefault,fType,fRequired FROM `".PREFIX."fields` WHERE fID='".$rs2['optSub']."' ORDER BY fOrder ASC";
				$test.="<br>".$sql;
				$result3 = $db->query($sql);
				$row = $result3->fetch();
						if($row['fType']=="Y")
						{
							//it is a child select list//
							$optdata2.="<tr><td align='left' class=\"formleft\" width=\"50%\">".$row['fName'].":</td><td align='left' class=\"formright\"  width=\"50%\"><select name=\"opt".$row['fID']."\">";
							$optdata2.="<option value=\"\">". LANG_SEARCH_ALLCAT ."</option>";
							$ssql="SELECT optID,fieldID,optValue,optOrder FROM ".PREFIX."fields_options WHERE fieldID='".$row['fID']."' ORDER BY optValue";
							$resultsets=$db->query($ssql);
							while($opt=$resultsets->fetch())
							{
								$optdata2.="<option value=\"".$opt['optValue']."\">".$opt['optValue']."</option>\n";
							}
							$optdata2.="</select></td></tr>";
						}
						elseif($row['fType']=="S")
						{
							//single text field
							$optdata2.="<tr><td align='left' class='formleft'  width=\"50%\">".$row['fName'].":</td><td><input type=\"text\" name=\"opt".$row['fID']."\" /></td></tr>\n";
						}
			}
				$optdata2.="</table>";
		}
	$cp->set_id("optResponse");
	#$add_result_node =& $cp->add_node("add");
	#$add_result_node->set_data($optdata);
	$cp->set_data($optdata2);
	return;
}

function extra_checkout_fields($type)
{
	global $db, $cp;
	//$sSQL = "SELECT fID, fOrder FROM `".PREFIX."fields`WHERE fSearch = 'Y' ORDER BY fOrder ASC";
	$sSQL = "SELECT optSub FROM `".PREFIX."fields_options`WHERE optValue='".mysql_real_escape_string($type)."'";
	$test=$sSQL;
	$result2 = $db->query($sSQL);
	$rows=$result2->size();
		if($rows>0)
		{
			$optdata2='<table width="100%" cellpadding="0" cellspacing="0">';
			while($rs2=$result2->fetch())
			{
				$sql="SELECT fID,fName,fDefault,fType,fRequired FROM `".PREFIX."fields` WHERE fID='".$rs2['optSub']."' ORDER BY fOrder ASC";
				$test.="<br>".$sql;
				$result3 = $db->query($sql);
				$row = $result3->fetch();
						if($row['fType']=="Y")
						{
							//it is a select list//
							$optdata2.="<tr><td align='left' class=\"formleft\" width=\"50%\">".LANG_STAR ." ".$row['fName'].":</td><td align='left' class=\"formright\"  width=\"50%\"><select name=\"opt".$row['fID']."\">";
							$optdata2.="<option value=\"\">". LANG_PLEASE_SELECT ."</option>";
							$ssql="SELECT optID,fieldID,optValue,optOrder FROM ".PREFIX."fields_options WHERE fieldID='".$row['fID']."' ORDER BY optValue";
							$resultsets=$db->query($ssql);
							while($opt=$resultsets->fetch())
							{
								$optdata2.="<option value=\"".$opt['optValue']."\">".$opt['optValue']."</option>\n";
							}
							$optdata2.="</select></td></tr>";
						}
						elseif($row['fType']=="S")
						{
							//single text field
							$optdata2.="<tr><td>".$row['fName'].":</td><td><input type=\"text\" name=\"opt".$row['fID']."\" /></td></tr>\n";
						}
			}
				$optdata2.="</table>";
		}
	$cp->set_id("optResponse");
	#$add_result_node =& $cp->add_node("add");
	#$add_result_node->set_data($optdata);
	$cp->set_data($optdata2);
	return;
}
?>
                                                                        banners.php                                                                                         0000644 0023433 0004734 00000006717 11455356424 012613  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**********************************
* 68 Classifieds
* http://www.68classifieds.com/
*
* All source code & content (c) Copyright 2007, 68 Classifieds
* unless specifically noted otherwise.
***********************************/
	require_once('includes/init.php');

	require_once(FILESYSTEM_PATH .'includes/classes/kernel/Products.php');
	$Products=new Products();
	$Listings=new Listings();
	
	$sSQL="SELECT section, count(*) as listingcount from dirlistings where section in (864, 865, 869) and display = 'Y' and expiration > now() group by section";
	$result=$db->query($sSQL);
	while ($rs=$result->fetch()) {
		$banners[$rs["section"]] = $rs["listingcount"];
	}

	$sSQL="SELECT * from dirproducts where pID in (13, 14, 15, 16, 17, 18, 28, 29, 30)"; //13 = directory, 16 = home
	$result=$db->query($sSQL);
	while ($rs=$result->fetch()) {
		$products[$rs["pID"]] = $rs;
	}	
	$home["listingmax"] = 8;
	$home["listingcount"] = $banners[865];
	$home["listingavail"] = $home["listingmax"] - $home["listingcount"];
	$home["30price"] = $products["16"]["pPrice"];
	$home["30listprice"] = $products["16"]["pListPrice"];
	$home["30savings"] = round((($home["30listprice"] - $home["30price"]) / $home["30listprice"]) * 100);
	$home["90price"] = $products["17"]["pPrice"];
	$home["90listprice"] = $products["17"]["pListPrice"];
	$home["90savings"] = round((($home["90listprice"] - $home["90price"]) / $home["90listprice"]) * 100);
	$home["365price"] = $products["18"]["pPrice"];
	$home["365listprice"] = $products["18"]["pListPrice"];
	$home["365savings"] = round((($home["365listprice"] - $home["365price"]) / $home["365listprice"]) * 100);

	$directory["listingmax"] = 12;

	$directory["listingcount"] = $banners[864];
	$directory["listingavail"] = $directory["listingmax"] - $directory["listingcount"];
	$directory["30price"] = $products["13"]["pPrice"];
	$directory["30listprice"] = $products["13"]["pListPrice"];
	$directory["30savings"] = round((($directory["30listprice"] - $directory["30price"]) / $directory["30listprice"]) * 100);
	$directory["90price"] = $products["14"]["pPrice"];
	$directory["90listprice"] = $products["14"]["pListPrice"];
	$directory["90savings"] = round((($directory["90listprice"] - $directory["90price"]) / $directory["90listprice"]) * 100);
	$directory["365price"] = $products["15"]["pPrice"];
	$directory["365listprice"] = $products["15"]["pListPrice"];
	$directory["365savings"] = round((($directory["365listprice"] - $directory["365price"]) / $directory["365listprice"]) * 100);
	
	$header["listingmax"] = 10;
	$header["listingcount"] = $banners[869];
	$header["listingavail"] = $header["listingmax"] - $header["listingcount"];
	$header["30price"] = $products["28"]["pPrice"];
	$header["30listprice"] = $products["28"]["pListPrice"];
	$header["30savings"] = round((($header["30listprice"] - $header["30price"]) / $header["30listprice"]) * 100);
	$header["90price"] = $products["29"]["pPrice"];
	$header["90listprice"] = $products["29"]["pListPrice"];
	$header["90savings"] = round((($header["90listprice"] - $header["90price"]) / $header["90listprice"]) * 100);
	$header["365price"] = $products["30"]["pPrice"];
	$header["365listprice"] = $products["30"]["pListPrice"];
	$header["365savings"] = round((($header["365listprice"] - $header["365price"]) / $header["365listprice"]) * 100);
	
	$class_tpl->assign("home", $home);
	$class_tpl->assign("directory", $directory);
	$class_tpl->assign("headerbanner", $header);
	$class_tpl->assign('body','banners.tpl');
	$class_tpl->display('layout.tpl',$page);
?>
                                                 blog/                                                                                               0000755 0023433 0004734 00000000000 11102617343 011347  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 blog/wp-admin/                                                                                      0000755 0023433 0004734 00000000000 11060471041 013057  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 blog/wp-admin/css/                                                                                  0000755 0023433 0004734 00000000000 11060470625 013656  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 blog/wp-admin/css/colors-classic-rtl.css                                                            0000755 0023433 0004734 00000001102 11060470604 020101  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 .post-com-count {
}
#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
	background-image: url(../images/comment-stalk-rtl.gif);
	background-position:right bottom;
}
#footer {
	background-position:99% 10px;
}
#poststuff .closed .togbox, #poststuff .togbox {
	background-image: url(../images/toggle-arrow-rtl.gif) !important;
}
.bar {
	border-right-color: transparent;
	border-left-color: #99d;
}
.plugins .togl {
	border-right-color: transparent;
	border-left-color: #ccc;
}
#upload-menu li.current {
	border-right-color: transparent;
	border-left-color: #448abd;
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              blog/wp-admin/css/colors-classic.css                                                                0000755 0023433 0004734 00000033340 11060470605 017314  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 a.page-numbers:hover {
	border-color: #999;
}

body, .form-table .pre {
	background-color: #fff;
	color: #333;
}

body > #upload-menu {
	border-bottom-color: #fff;
}

div#current-widgets, #postcustomstuff table, #your-profile fieldset, a.page-numbers, #rightnow, div.dashboard-widget, .widefat {
	border-color: #ccc;
}

div.dashboard-widget-error {
	background-color: #c43;
}

div.dashboard-widget-notice {
	background-color: #F0F6FB;
}

div.dashboard-widget-submit, ul.widget-control-list div.widget-control-actions {
	border-top-color: #ccc;
}

input.disabled, textarea.disabled {
	background-color: #ccc;
}

#user_info a:hover, li.widget-list-control-item h4.widget-title a:hover, .submit a, #dashmenu a:hover, #footer a, #upload-menu li a.upload-tab-link, li.widget-list-control-item h4.widget-title a,
#dragHelper li.widget-list-control-item h4.widget-title a,
#draghelper li.widget-list-control-item h4.widget-title a:visited, .login #backtoblog a:hover {
	color: #fff;
}

ul#category-tabs li.ui-tabs-selected, li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form, h3.info-box-title {
	background-color: #cfebf7;
}

div.ui-tabs-panel {
	border-color: #cfebf7;
}

select {
	background-color: #fff;
	border-color: #ddd;
}

strong .post-com-count span {
	background-color: #2583ad;
}

.button-secondary, #login form .submit input {
	background-color: #8ebddc !important;
}

ul#widget-list li.widget-list-item h4.widget-title {
	background-color: #f0f0f0;
	color: #000;
}

.sorthelper {
	background-color: #ccf3fa;
}

.ac_match, .subsubsub a.current, h2 {
	color: #000;
}

.ac_over {
	background-color: #f0f0b8;
}

.ac_results {
	background-color: #fff;
	border-color: #808080;
}

.ac_results li {
	color: #101010;
}

.alternate {
	background-color: #f9f9f9;
}

.available-theme a.screenshot {
	background-color: #f1f1f1;
	border-color: #ccc;
}

.bar {
	background-color: #e8e8e8;
	border-right-color: #99d;
}

.describe {
	border-top-color: #d0d0d0;
}

.error, #login #login_error {
	background-color: #ffebe8;
	border-color: #c00;
}

.error a {
	color: #c00;
}

.form-invalid {
	background-color: #ffebe8 !important;
}

.form-invalid input {
	border-color: #c00 !important;
}

.form-table input, .form-table textarea {
	border-color: #c6d9e9;
}

.form-table td, .form-table th {
	border-bottom-color: #fff;
}

.highlight {
	background-color: #cfebf7;
	color: #d54e21;
}

.howto, .nonessential, #sidemenu, #edit-slug-box, .form-input-tip, #dashboard_primary span.rss-date, .subsubsub, #dashboard_secondary div.dashboard-widget-content ul li a cite {
	color: #999;
}

#dashmenu a, #user_info a {
	color: #88b4d7;
}

.media-item {
	border-bottom-color: #d0d0d0;
}

.media-upload-form label.form-help, td.help {
	color: #9a9a9a;
}

.page-numbers {
	background-color: #fff;
	border-color: #fff;
}

.page-numbers.current {
	background-color: #328ab2;
	border-color: #328ab2;
	color: #fff;
}

.post-com-count {
	background-image: url(../images/bubble_bg.gif);
	color: #fff;
}

.post-com-count span {
	background-color: #bbb;
	color: #fff;
}

.post-com-count:hover span {
	background-color: #d54e21;
}

.quicktags, .search {
	background-color: #ccc;
	color: #000;
}

.side-info h5, .bordertitle {
	border-bottom-color: #dadada;
}

.side-info ul, .widget-description {
	color: #666;
}

.submit input, .button, .button-secondary, #login form .submit input, div.dashboard-widget-submit input, #edit-slug-buttons a.save {
	background-color: #e5e5e5;
	color: #07273e;
	border-color: #a3a3a3;
}

.button[disabled], .button:disabled {
	background-color: #999;
}

.tablenav .button-secondary {
	border-color: #5396c5;
}

.submit input:hover, .button:hover, #edit-slug-buttons a.save:hover {
	border-color: #535353;
}

.submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover, #media-upload a.del-link:hover {
	color: #d54e21;
}

#adminmenu a:hover, #sidemenu a:hover, .ui-tabs-nav a:hover {
	color: #97c4d8;
}

.button-secondary:hover, #login form .submit input:hover {
	border-color: #328ab2;
	background-color: #a6d2e5 !important;
}

.submitbox #autosave .error, ul.view-switch li.current a {
	color: #333;
}

.submitbox #previewview {
	background-color: #5488af;
}

.submitbox #previewview a, #rightnow .rbutton {
	background-color: #ebebeb;
	color: #264761;
}

.submitbox .submit {
	background-color: #464646;
	color: #ccc;
}

.submitbox .submitdelete {
	border-bottom-color: #999;
}

.submitbox .submitdelete:hover,
#media-upload a.delete:hover {
	color: #fff;
	background-color: #f00;
	border-bottom-color: #f00;
}

.tablenav .dots {
	background-color: #cfebf7;
	border-color: #cfebf7;
}

.tablenav .next, .tablenav .prev{
	background-color: #cfebf7;
	border-bottom-color: #cfebf7;
	border-color: #cfebf7;
	color: #2583ad;
}

.tablenav .next:hover, .tablenav .prev:hover {
	border-bottom-color: #d54e21;
	border-color: #cfebf7;
	color: #d54e21;
}

.updated, .login #login_error, .login .message {
	background-color: #ffffe0;
	border-color: #e6db55;
}

.updated a {
	border-bottom-color: #2583ad;
}

.widefat td, .widefat th, div#available-widgets-filter, ul#widget-list li.widget-list-item, .commentlist li {
	border-bottom-color: #ccc;
}

.widefat thead, .thead {
	background-color: #464646;
	color: #d7d7d7;
}

.widget-control-save, .widget-control-remove {
	background-color: #83b4d5;
	color: #246;
}

.wrap h2 {
	border-bottom-color: #dadada;
	color: #5a5a5a;
}

#poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, #media-upload a.del-link, #media-upload a.delete, a {
	color: #2e7ca0;
}

#adminmenu a, .ui-tabs-nav a {
	color: #cfebf6;
}

#submenu a {
	color: #2782af
}
/* Because we don't want visited on these links */
#adminmenu a.current, #sidemenu a.current, body.press-this .ui-tabs-selected a, body.press-this .ui-tabs-selected a:hover {
	background-color: #fff;
	border-color: #07273e;
	border-bottom-color: #fff;
	color: #d54e21;
	font-weight: bold;
}

#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
	background-image: url(../images/comment-stalk-classic.gif);
}

#adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span {
	background-color: #d54e21;
	color: #fff;
}

#rightnow .reallynow {
	background-color: #114973;
	color: #fff;
}


#adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span {
	background-color: #07273E;
}

#adminmenu, div#media-upload-header {
	background-color: #14568a;
	border-bottom-color: #07273e;
}

#currenttheme img {
	border-color: #666;
}

#current-widgets .drop-widget-here {
	background-color: #ffc;
}

#dashboard_secondary div.dashboard-widget-content ul li a {
	background-color: #f9f9f9;
}

input.readonly {
	background-color: #ddd;
}

#dashmenu a.current {
	background-color: #14568a;
	color: #cfebf6;
}

#dragHelper h4.widget-title, li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4 {
	background-color: #2683ae;
	color: #fff;
}

#ed_toolbar input {
	background: url( ../images/fade-butt.png ) #fff repeat-x 0 -2px;
}

#editable-post-name {
	background-color: #fffbcc;
}

#edit-slug-box strong, .login #nav a {
	color: #777;
}

#edit-slug-buttons a.save {
	background-color: #ebebeb;
}

#footer {
	background: url(../images/logo-ghost.png) #464646 no-repeat 20px 10px;
	color: #999;
}

#media-items {
	border-color: #c0c0c0;
}

#pass-strength-result {
	background-color: #e3e3e3;
	border-color: #000;
}

#pass-strength-result.bad {
	background-color: #ffeff7;
	border-color: #c69;
}

#pass-strength-result.good {
	background-color: #effff4;
	border-color: #66cc87;
}

#pass-strength-result.short {
	background-color: #e3e3e3;
}

#pass-strength-result.strong {
	background-color: #59ef86;
	border-color: #319f52;
}

.checkbox, .side-info, #your-profile #rich_editing {
	background-color: #fff;
}

.plugins .active {
	background-color: #BBEEBB;
}

.plugins .togl {
	border-right-color: #ccc;
}

#the-comment-list .unapproved {
	background-color: #ffffe0;
}

.plugins tr {
	background-color: #fff;
}

#poststuff #editor-toolbar .active {
	background-color: #83b4d5;
	color: #333;
}

#poststuff .closed .togbox {
	background-color: #2583ad;
	background-image: url(../images/toggle-arrow.gif);
}

#poststuff .postbox, #titlediv, #poststuff .postarea, #poststuff .stuffbox {
	border-color: #ebebeb;
	border-right-color: #ccc;
	border-bottom-color: #ccc;
}

#poststuff .togbox {
	background-color: #b2b2b2;
	background-image: url(../images/toggle-arrow.gif);
}

#quicktags #ed_link {
	color: #00f;
}

#rightnow .youhave {
	background-color: #f0f6fb;
}

#rightnow a {
	color: #448abd;
}

#sidemenu a {
	background-color: #14568a;
	border-bottom-color: #07273e;
	border-top-color: #14568a;
	color: #cfebf6;
}

#tagchecklist span a {
	background: url(../images/xit.gif) no-repeat;
}

#tagchecklist span a:hover {
	background: url(../images/xit.gif) no-repeat -10px 0;
}

#the-comment-list .comment a {
	border-bottom-color: #ababab;
	color: #666;
}

#update-nag, .plugin-update {
	background-color: #fffeeb;
	border-bottom-color: #ccc;
	border-top-color: #ccc;
	color: #555;
}

#upload-files a.file-link {
	background-color: #d1e2ef;
}

#upload-file-view a img {
	border-bottom-color: #69c;
}

#upload-menu li #current-tab-nav, #upload-file {
	background-color: #f9fcfe;
}

#upload-menu li span a.page-numbers {
	color: #00019b;
}

#upload-menu li.current {
	border-right-color: #448abd;
	color: #000;
}

#upload-menu li.current a.upload-tab-link, #upload-menu li a:hover {
	background-color: #f9fcfe;
	color: #000;
}

#upload-menu, #upload-menu li {
	border-top-color: #247fab;
}

#user_info, .login #backtoblog a {
	color: #ccc;
}

#wphead {
	background-color: #14568a;
}

#wphead, body.login {
	border-top-color: #07273e;
}

#wphead #viewsite a {
	background-color: #5488af;
	color: #cfebf7;
	border-color: #0b3d64;
}

#wphead #viewsite a:hover {
	color: #07273e;
}

#wphead h1, #dashmenu a.current:hover {
	color: #cfebf6;
}

div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover, .delete:hover {
	color: #f00;
}

/* TinyMCE */
.wp_themeSkin *,
.wp_themeSkin a:hover, 
.wp_themeSkin a:link, 
.wp_themeSkin a:visited, 
.wp_themeSkin a:active {
	 color: #000;
}

/* Containers */
.wp_themeSkin table, #wp_editbtns {
	background: #83B4D5;
}

.wp_themeSkin iframe {
	background: #fff;
}

/* Layout */
.wp_themeSkin .mceStatusbar {
	 color:#000;
	 background-color: #eaf3fa;
}

/* Button */
.wp_themeSkin .mceButton { 
	background-color: #e9e8e8;
	border-color: #83B4D5;
}

.wp_themeSkin a.mceButtonEnabled:hover,
.wp_themeSkin a.mceButtonActive, 
.wp_themeSkin a.mceButtonSelected {
	background-color: #d6d8da;
	border-color: #7789ba !important;
}

.wp_themeSkin .mceButtonDisabled {
	border-color: #83B4D5 !important;
}

/* ListBox */
.wp_themeSkin .mceListBox .mceText,
.wp_themeSkin .mceListBox .mceOpen  {
	border-color: #83B4D5;
	background-color: #e9e8e8;
}

.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, 
.wp_themeSkin .mceListBoxHover .mceOpen,
.wp_themeSkin .mceListBoxSelected .mceOpen,
.wp_themeSkin .mceListBoxSelected .mceText {
	border-color: #7789ba !important;
	background-color: #d6d8da;
}

.wp_themeSkin table.mceListBoxEnabled:hover .mceText, 
.wp_themeSkin .mceListBoxHover .mceText {
	border-color: #7789ba !important;
}

.wp_themeSkin select.mceListBox {
	border-color: #b3c7e1; 
	background-color: #fff;
}

/* SplitButton */
.wp_themeSkin .mceSplitButton a.mceAction, 
.wp_themeSkin .mceSplitButton a.mceOpen {
	background-color: #e9e8e8;
	border-color: #83B4D5;
}

.wp_themeSkin .mceSplitButton a.mceOpen:hover,
.wp_themeSkin .mceSplitButtonSelected a.mceOpen,
.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,
.wp_themeSkin .mceSplitButton a.mceAction:hover {
	background-color: #d6d8da;
	border-color: #7789ba !important;
} 

.wp_themeSkin .mceSplitButtonActive {
	background-color: #d6d8da;
}

/* ColorSplitButton */
.wp_themeSkin div.mceColorSplitMenu table {
	background-color: #ebeaeb;
	border-color: #808080;
}

.wp_themeSkin .mceColorSplitMenu a {
	border-color: #808080;
}

.wp_themeSkin .mceColorSplitMenu a.mceMoreColors {
	border-color: #fff;
}

.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover {
	border-color: #0A246A;
	background-color: #B6BDD2;
}

.wp_themeSkin a.mceMoreColors:hover {
	border-color: #0A246A;
}

/* Menu */
.wp_themeSkin .mceMenu {
	border-color: #ddd;
}

.wp_themeSkin .mceMenu table {
	background-color: #ebeaeb;
}

.wp_themeSkin .mceMenu .mceText {
	color: #000; 
}

.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,
.wp_themeSkin .mceMenu .mceMenuItemActive, #quicktags {
	background-color: #83B4D5;
}
.wp_themeSkin td.mceMenuItemSeparator {
	background-color: #aaa;
}
.wp_themeSkin .mceMenuItemTitle a {
	background-color: #ccc; 
	border-bottom-color: #aaa;
}
.wp_themeSkin .mceMenuItemTitle span.mceText {
	color: #000;
}
.wp_themeSkin .mceMenuItemDisabled .mceText {
	color: #888;
}

/* pop-up */
.clearlooks2 .mceTop .mceLeft, .clearlooks2 .mceTop .mceRight {
	background-color: #cee1ef;
	border-color: #c6d9e9;
}

.clearlooks2 .mceFocus .mceTop .mceLeft, .clearlooks2 .mceFocus .mceTop .mceRight {
	background-color: #5488AF;
	border-color: #464646;
}

#editorcontainer {
	border-color: #ccc;
}

#poststuff #titlewrap {
	border-color: #ccc;
}

#tTips p#tTips_inside {
	background-color: #ddd;
	color: #333;
}

/* Diff */

table.diff .diff-deletedline {
	background-color: #ffdddd;
}
table.diff .diff-deletedline del {
	background-color: #ff9999;
}
table.diff .diff-addedline {
	background-color: #ddffdd;
}
table.diff .diff-addedline ins {
	background-color: #99ff99;
}
                                                                                                                                                                                                                                                                                                blog/wp-admin/css/colors-fresh-rtl.css                                                              0000755 0023433 0004734 00000001066 11060470605 017601  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 .bar {
	border-right-color: transparent;
	border-left-color: #99d;
}
.post-com-count {
}
#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
	background-image: url(../images/comment-stalk-rtl.gif);
	background-position:right bottom;
}
#footer {
	background-position:99% 10px;
}
.plugins .togl {
	border-right-color: transparent;
	border-left-color: #ccc;
}
#poststuff .closed .togbox, #poststuff .togbox {
	background-image: url(../images/toggle-arrow-rtl.gif);
}
#upload-menu li.current {
	border-right-color:transparent;
	border-left-color: #448abd;
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                          blog/wp-admin/css/colors-fresh.css                                                                  0000755 0023433 0004734 00000033023 11060470606 017001  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 a.page-numbers:hover {
	border-color: #999;
}

body, .form-table .pre {
	background-color: #fff;
	color: #333;
}

body > #upload-menu {
	border-bottom-color: #fff;
}

div#current-widgets, #postcustomstuff table, #your-profile fieldset, a.page-numbers, #rightnow, div.dashboard-widget, .widefat {
	border-color: #ccc;
}

div.dashboard-widget-error {
	background-color: #c43;
}

div.dashboard-widget-notice {
	background-color: #cfe1ef;
}

div.dashboard-widget-submit, ul.widget-control-list div.widget-control-actions {
	border-top-color: #ccc;
}

div.ui-tabs-panel {
	border-color: #cee1ef;
}

input.disabled, textarea.disabled {
	background-color: #ccc;
}

#user_info a:hover, li.widget-list-control-item h4.widget-title a:hover, .submit a, #dashmenu a:hover, #footer a, #upload-menu li a.upload-tab-link, li.widget-list-control-item h4.widget-title a,
#dragHelper li.widget-list-control-item h4.widget-title a,
#draghelper li.widget-list-control-item h4.widget-title a:visited, .login #backtoblog a:hover {
	color: #fff;
}

li.widget-list-control-item, div.nav, .tablenav, .submitbox, h3.dashboard-widget-title, h3.dashboard-widget-title span, h3.dashboard-widget-title small, ul.view-switch li.current, .form-table tr, #poststuff h3, .login form, h3.info-box-title {
	background-color: #eaf3fa;
}

select {
	background-color: #fff;
	border-color: #ddd;
}

strong .post-com-count span {
	background-color: #2583ad;
}

ul#category-tabs li.ui-tabs-selected, .button-secondary, #quicktags, #login form .submit input {
	background-color: #cee1ef !important;
}

ul#widget-list li.widget-list-item h4.widget-title {
	background-color: #f0f0f0;
	color: #000;
}

.sorthelper {
	background-color: #ccf3fa;
}

.ac_match, .subsubsub a.current, h2 {
	color: #000;
}

.ac_over {
	background-color: #f0f0b8;
}

.ac_results {
	background-color: #fff;
	border-color: #808080;
}

.ac_results li {
	color: #101010;
}

.alternate {
	background-color: #f9f9f9;
}

.available-theme a.screenshot {
	background-color: #f1f1f1;
	border-color: #ccc;
}

.bar {
	background-color: #e8e8e8;
	border-right-color: #99d;
}

.describe {
	border-top-color: #d0d0d0;
}

.error, #login #login_error {
	background-color: #ffebe8;
	border-color: #c00;
}

.error a {
	color: #c00;
}

.form-invalid {
	background-color: #ffebe8 !important;
}

.form-invalid input {
	border-color: #c00 !important;
}

.form-table input, .form-table textarea {
	border-color: #c6d9e9;
}

.form-table td, .form-table th {
	border-bottom-color: #fff;
}

.highlight {
	background-color: #e4f2fd;
	color: #d54e21;
}

#user_info, .howto, .nonessential, #dashmenu a, #sidemenu, #edit-slug-box, .form-input-tip, #dashboard_primary span.rss-date, .subsubsub, #dashboard_secondary div.dashboard-widget-content ul li a cite {
	color: #999;
}

.media-item {
	border-bottom-color: #d0d0d0;
}

.media-upload-form label.form-help, td.help {
	color: #9a9a9a;
}

.page-numbers {
	background-color: #fff;
	border-color: #fff;
}

.page-numbers.current {
	background-color: #328ab2;
	border-color: #328ab2;
	color: #fff;
}

.post-com-count {
	background-image: url(../images/bubble_bg.gif);
	color: #fff;
}

.post-com-count span {
	background-color: #bbb;
	color: #fff;
}

.post-com-count:hover span {
	background-color: #d54e21;
}

.quicktags, .search {
	background-color: #ccc;
	color: #000;
}

.side-info h5, .bordertitle {
	border-bottom-color: #dadada;
}

.side-info ul, .widget-description {
	color: #666;
}

.submit input, .button, .button-secondary, #login form .submit input, div.dashboard-widget-submit input, #edit-slug-buttons a.save {
	background-color: #e5e5e5;
	color: #246;
	border-color: #80b5d0;
}

.button[disabled], .button:disabled {
	background-color: #999;
}

.submit input:hover, .button:hover, #edit-slug-buttons a.save:hover {
	border-color: #535353;
}

.submit input:hover, .button:hover, .button-secondary:hover, #wphead #viewsite a:hover, #adminmenu a:hover, #sidemenu a:hover, #submenu a.current, #submenu a:hover, .submitbox #previewview a:hover, #the-comment-list .comment a:hover, #rightnow a:hover, a:hover, .subsubsub a:hover, .subsubsub a.current:hover, #login form .submit input:hover, div.dashboard-widget-submit input:hover, #edit-slug-buttons a.save:hover, #media-upload a.delete:hover, #media-upload a.del-link:hover, .ui-tabs-nav a:hover {
	color: #d54e21;
}

.button-secondary:hover, #login form .submit input:hover {
	border-color: #328ab2;
}

.submitbox #autosave .error, ul.view-switch li.current a {
	color: #333;
}

.submitbox #previewview {
	background-color: #2683ae;
}

.submitbox #previewview a, #rightnow .rbutton {
	background-color: #ebebeb;
	color: #264761;
}

.submitbox .submit {
	background-color: #464646;
	color: #ccc;
}

.submitbox .submitdelete {
	border-bottom-color: #999;
}

.submitbox .submitdelete:hover,
#media-upload a.delete:hover {
	color: #fff;
	background-color: #f00;
	border-bottom-color: #f00;
}

.tablenav .dots {
	background-color: #e4f2fd;
	border-color: #e4f2fd;
}

.tablenav .next, .tablenav .prev{
	background-color: #e4f2fd;
	border-bottom-color: #2583ad;
	border-color: #e4f2fd;
	color: #2583ad;
}

.tablenav .next:hover, .tablenav .prev:hover {
	border-bottom-color: #d54e21;
	border-color: #e4f2fd;
	color: #d54e21;
}

.updated, .login #login_error, .login .message {
	background-color: #ffffe0;
	border-color: #e6db55;
}

.updated a {
	border-bottom-color: #2583ad;
}

.widefat td, .widefat th, div#available-widgets-filter, ul#widget-list li.widget-list-item, .commentlist li {
	border-bottom-color: #ccc;
}

.widefat thead, .thead {
	background-color: #464646;
	color: #d7d7d7;
}

.widget-control-save, .widget-control-remove {
	background-color: #cee1ef;
	color: #246;
}

.wrap h2 {
	border-bottom-color: #dadada;
	color: #666;
}

#adminmenu a, #submenu a, #poststuff #edButtonPreview, #poststuff #edButtonHTML, #the-comment-list p.comment-author strong a, #media-upload a.del-link, #media-upload a.delete, .ui-tabs-nav a, a {
	color: #2583ad;
}

/* Because we don't want visited on these links */
#adminmenu a.current, #sidemenu a.current, body.press-this .ui-tabs-selected a, body.press-this .ui-tabs-selected a:hover {
	background-color: #fff;
	border-color: #c6d9e9;
	border-bottom-color: #fff;
	color: #d54e21;
}

#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
	background-image: url(../images/comment-stalk-fresh.gif);
}

#adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span, #rightnow .reallynow {
	background-color: #d54e21;
	color: #fff;
}

#adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span {
	background-color: #264761;
}

#adminmenu, div#media-upload-header {
	background-color: #e4f2fd;
	border-bottom-color: #c6d9e9;
}

#currenttheme img {
	border-color: #666;
}

#current-widgets .drop-widget-here {
	background-color: #ffc;
}

#dashboard_secondary div.dashboard-widget-content ul li a {
	background-color: #f9f9f9;
}

input.readonly {
	background-color: #ddd;
}

#dashmenu a.current {
	background-color: #e4f2fd;
	color: #555;
}

#dragHelper h4.widget-title, li.widget-list-control-item h4, #dragHelper li.widget-list-control-item h4 {
	background-color: #2683ae;
	color: #fff;
}

#ed_toolbar input {
	background: url( ../images/fade-butt.png ) #fff repeat-x 0 -2px;
}

#editable-post-name {
	background-color: #fffbcc;
}

#edit-slug-box strong, .login #nav a {
	color: #777;
}

#footer {
	background: url(../images/logo-ghost.png) #464646 no-repeat 20px 10px;
	color: #999;
}

#media-items {
	border-color: #c0c0c0;
}

#pass-strength-result {
	background-color: #e3e3e3;
	border-color: #000;
}

#pass-strength-result.bad {
	background-color: #ffeff7;
	border-color: #c69;
}

#pass-strength-result.good {
	background-color: #effff4;
	border-color: #66cc87;
}

#pass-strength-result.short {
	background-color: #e3e3e3;
}

#pass-strength-result.strong {
	background-color: #59ef86;
	border-color: #319f52;
}

.checkbox, .side-info, #your-profile #rich_editing {
	background-color: #fff;
}

.plugins .active {
	background-color: #e7f7d3;
}

.plugins .togl {
	border-right-color: #ccc;
}

#the-comment-list .unapproved {
	background-color: #ffffe0;
}

.plugins tr {
	background-color: #fff;
}

#poststuff #editor-toolbar .active {
	background-color: #cee1ef;
	color: #333;
}

#poststuff .closed .togbox {
	background-color: #2583ad;
	background-image: url(../images/toggle-arrow.gif);
}

#poststuff .postbox, #titlediv, #poststuff .postarea, #poststuff .stuffbox {
	border-color: #ebebeb;
	border-right-color: #ccc;
	border-bottom-color: #ccc;
}

#poststuff .togbox {
	background-color: #b2b2b2;
	background-image: url(../images/toggle-arrow.gif);
}

#quicktags #ed_link {
	color: #00f;
}

#rightnow .youhave {
	background-color: #f0f6fb;
}

#rightnow a {
	color: #448abd;
}

#sidemenu a {
	background-color: #e4f2fd;
	border-bottom-color: #c6d9e9;
	border-top-color: #e4f2fd;
}

#tagchecklist span a {
	background: url(../images/xit.gif) no-repeat;
}

#tagchecklist span a:hover {
	background: url(../images/xit.gif) no-repeat -10px 0;
}

#the-comment-list .comment a {
	border-bottom-color: #ababab;
	color: #666;
}

#update-nag, .plugin-update {
	background-color: #fffeeb;
	border-bottom-color: #ccc;
	border-top-color: #ccc;
	color: #555;
}

#upload-files a.file-link {
	background-color: #d1e2ef;
}

#upload-file-view a img {
	border-bottom-color: #69c;
}

#upload-menu li #current-tab-nav, #upload-file {
	background-color: #f9fcfe;
}

#upload-menu li span a.page-numbers {
	color: #00019b;
}

#upload-menu li.current {
	border-right-color: #448abd;
	color: #000;
}

#upload-menu li.current a.upload-tab-link, #upload-menu li a:hover {
	background-color: #f9fcfe;
	color: #000;
}

#upload-menu, #upload-menu li {
	border-top-color: #247fab;
}

.login #backtoblog a, .curtime, #user_info a {
	color: #ccc;
}

#wphead {
	background-color: #e4f2fd;
}

#wphead, body.login {
	border-top-color: #464646;
}

#wphead #viewsite a {
	background-color: #c6d9e9;
	color: #246;
	border-color: #80b5d0;
}

#wphead #viewsite a:hover {
	border-color: #328ab2;
}

#wphead h1, #dashmenu a.current:hover, #login form input {
	color: #555;
}

div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover, .delete:hover {
	color: #f00;
}

#media-upload a.delete {
	color: #888;
}

/* TinyMCE */
.wp_themeSkin *,
.wp_themeSkin a:hover, 
.wp_themeSkin a:link, 
.wp_themeSkin a:visited, 
.wp_themeSkin a:active {
	 color: #000;
}

/* Containers */
.wp_themeSkin table, #wp_editbtns {
	background: #cee1ef;
}

.wp_themeSkin iframe {
	background: #fff;
}

/* Layout */
.wp_themeSkin .mceStatusbar {
	 color:#000;
	 background-color: #eaf3fa;
}

/* Button */
.wp_themeSkin .mceButton { 
	background-color: #e9e8e8;
	border-color: #abc0fb;
}

.wp_themeSkin a.mceButtonEnabled:hover,
.wp_themeSkin a.mceButtonActive, 
.wp_themeSkin a.mceButtonSelected {
	background-color: #d6d8da;
	border-color: #7789ba !important;
}

.wp_themeSkin .mceButtonDisabled {
	border-color: #bdd !important;
}

/* ListBox */
.wp_themeSkin .mceListBox .mceText,
.wp_themeSkin .mceListBox .mceOpen  {
	border-color: #abc0fb;
	background-color: #e9e8e8;
}

.wp_themeSkin table.mceListBoxEnabled:hover .mceOpen, 
.wp_themeSkin .mceListBoxHover .mceOpen,
.wp_themeSkin .mceListBoxSelected .mceOpen,
.wp_themeSkin .mceListBoxSelected .mceText {
	border-color: #7789ba !important;
	background-color: #d6d8da;
}

.wp_themeSkin table.mceListBoxEnabled:hover .mceText, 
.wp_themeSkin .mceListBoxHover .mceText {
	border-color: #7789ba !important;
}

.wp_themeSkin select.mceListBox {
	border-color: #b3c7e1; 
	background-color: #fff;
}

/* SplitButton */
.wp_themeSkin .mceSplitButton a.mceAction, 
.wp_themeSkin .mceSplitButton a.mceOpen {
	background-color: #e9e8e8;
	border-color: #abc0fb;
}

.wp_themeSkin .mceSplitButton a.mceOpen:hover,
.wp_themeSkin .mceSplitButtonSelected a.mceOpen,
.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,
.wp_themeSkin .mceSplitButton a.mceAction:hover {
	background-color: #d6d8da;
	border-color: #7789ba !important;
} 

.wp_themeSkin .mceSplitButtonActive {
	background-color: #d6d8da;
}

/* ColorSplitButton */
.wp_themeSkin div.mceColorSplitMenu table {
	background-color: #ebeaeb;
	border-color: #808080;
}

.wp_themeSkin .mceColorSplitMenu a {
	border-color: #808080;
}

.wp_themeSkin .mceColorSplitMenu a.mceMoreColors {
	border-color: #fff;
}

.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover {
	border-color: #0A246A;
	background-color: #B6BDD2;
}

.wp_themeSkin a.mceMoreColors:hover {
	border-color: #0A246A;
}

/* Menu */
.wp_themeSkin .mceMenu {
	border-color: #ddd;
}

.wp_themeSkin .mceMenu table {
	background-color: #ebeaeb;
}

.wp_themeSkin .mceMenu .mceText {
	color: #000; 
}

.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,
.wp_themeSkin .mceMenu .mceMenuItemActive {
	background-color: #CEE1EF;
}
.wp_themeSkin td.mceMenuItemSeparator {
	background-color: #aaa;
}
.wp_themeSkin .mceMenuItemTitle a {
	background-color: #ccc; 
	border-bottom-color: #aaa;
}
.wp_themeSkin .mceMenuItemTitle span.mceText {
	color: #000;
}
.wp_themeSkin .mceMenuItemDisabled .mceText {
	color: #888;
}

/* pop-up */
.clearlooks2 .mceTop .mceLeft, .clearlooks2 .mceTop .mceRight {
	background-color: #cee1ef;
	border-color: #c6d9e9;
}

.clearlooks2 .mceFocus .mceTop .mceLeft, .clearlooks2 .mceFocus .mceTop .mceRight {
	background-color: #2683ae;
	border-color: #464646;
}

#editorcontainer {
	border-color: #ccc;
}

#poststuff #titlewrap {
	border-color: #ccc;
}

.curtime {
	color: #666;
}

#tTips p#tTips_inside {
	background-color: #ddd;
	color: #333;
}

/* Diff */

table.diff .diff-deletedline {
	background-color: #ffdddd;
}
table.diff .diff-deletedline del {
	background-color: #ff9999;
}
table.diff .diff-addedline {
	background-color: #ddffdd;
}
table.diff .diff-addedline ins {
	background-color: #99ff99;
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             blog/wp-admin/css/dashboard-rtl.css                                                                 0000755 0023433 0004734 00000002372 11060470607 017125  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 /* Right Now */
#rightnow {
	margin-right:0;
	margin-left: 7px;
}
#rightnow .reallynow span {
	text-align: right;
	float: right;
}
#rightnow .reallynow a {
	text-align: left;
	float: left;
	margin: 1px 0 0 6px;
}
/* Widgets */
div#dashboard-widgets-wrap {
	margin-right:0;
	margin-left:-13px;
}
div.dashboard-widget-holder {
	float:right;
}
div.dashboard-widget {
	margin-right:0;
	margin-left: 20px;
}
h3.dashboard-widget-title span {
	text-align: right;
	float: right;
}
h3.dashboard-widget-title small {
	text-align: left;
	float:left;
}
div.dashboard-widget-submit input  {
	font-family: Tahoma;
}
div.dashboard-widget-content ul, div.dashboard-widget-content ol, div.dashboard-widget-content dl {
	padding-left:0;
	padding-right:15px;
}
#dashboard_secondary div.dashboard-widget-content ul li {
	float:right;
}
#dashboard_secondary div.dashboard-widget-content ul li .post {
	font-family:arial;
}
#dashboard_secondary div.dashboard-widget-content ul li a {
	border-right:0 none;
	border-left: 1px solid #dadada;
	height:110px;
}
#dashboard_secondary div.dashboard-widget-content ul li a cite {
	font-family: Tahoma;
}
#dashboard-widgets .widget_rss ul li span.rss-date {
	float:right;
}
#dashboard-widgets .widget_rss ul li a {
	float: right;
	margin: 0 0 .2em .5em;
}
                                                                                                                                                                                                                                                                      blog/wp-admin/css/dashboard.css                                                                     0000755 0023433 0004734 00000011271 11060470610 016316  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 /* Right Now */

#rightnow {
	border-width: 1px;
	border-style: solid;
	padding: 2px;
	margin-top: 10px;
	margin-right: 7px;
}

#rightnow .reallynow {
	padding: 6px;
	font-size: 15px;
	line-height: 2;
	margin: 0;
}

#rightnow .rbutton {
	font-weight: normal;
	padding: 6px;
	border-bottom: none;
	-moz-border-radius: 2px;
	-khtml-border-radius: 2px;
	-webkit-border-radius: 2px;
	border-radius: 2px;
	text-decoration: none;
}

#rightnow .reallynow span {
	display: block;
	text-align: left;
	float: left;
	padding: 0 6px;
}

#rightnow .reallynow a {
	display: block;
	text-align: right;
	float: right;
	padding: 0 6px;
	font-size: 14px;
	margin: 1px 6px 0 0;
}

#rightnow .youhave {
	font-size:  14px;
	padding: 10px;
}

#rightnow h3, #rightnow p {
	padding: 0 10px;
}

#rightnow a {
	font-weight: bold;
}

/* Widgets */

div#dashboard-widgets-wrap {
	margin-top: -20px;
	margin-right: -13px; /* 20 (div.dashboard-widget margin-right) - 7 (#rightnow margin-right) */
}

div#dashboard-widgets {
	width: 100%;
}

div.dashboard-widget-holder {	
	margin-top: 20px;
	width: 50%;
	float: left;
}

div.dashboard-widget-holder.third {
	width: 33.3%;
}

div.dashboard-widget-holder.fourth {
	width: 25%;
}

div.dashboard-widget-holder.full {
	width: 100%;
}

div.dashboard-widget-holder.double div.dashboard-widget {
	height: 54em;
	padding-bottom: 28px /* lame */
}

div.dashboard-widget {
	position: relative;
	margin-right: 20px;
	border-width: 1px;
	border-style: solid;
	padding: 2px;
	height: 27em;
	overflow: auto;
	font-size: 11px;
}

h3.dashboard-widget-title  {
	margin: 0;
	padding: 0 7px;
	font-size: 14px;
	line-height: 2;
}

h3.dashboard-widget-title span {
	display: block;
	text-align: left;
	float: left;
}

h3.dashboard-widget-title small {
	display: block;
	text-align: right;
	float: right;
	font-size: 75%;
	line-height: 2.67; /* math: it works, bitches */
}

h3.dashboard-widget-title img.rss-icon {
	vertical-align: middle;
	margin: .5em 0;
}

div.dashboard-widget-notice {
	padding: 0 14px;
	font-size: 1.2em;
	line-height: 2;
}

div.dashboard-widget-error {
	padding: 0 20px;
	font-size: 1.2em;
	line-height: 2;
}

div.dashboard-widget-content {
	padding: 10px 15px;
}

div.dashboard-widget-submit {
	border-top: 1px solid #ccc;
	padding: 1em 0 0 0;
	margin: 10px 0 0 0;
}
div.dashboard-widget-submit input {
	font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
	padding: 4px 6px;
	border: none;
	font-size: 13px;
	-moz-border-radius: 3px;
	-khtml-border-radius: 3px;
	-webkit-border-radius: 3px;
	border-radius: 3px;
	cursor: pointer;
	text-decoration: none;	
}

div.dashboard-widget-content ul, div.dashboard-widget-content ol, div.dashboard-widget-content dl {
	margin: 0;
	text-indent: 0;
	padding-left: 15px;
}
div.dashboard-widget-content li {
	margin: .5em 0 1em;
}

div.dashboard-widget-content blockquote {
	margin: -1em 0;
}

div#dashboard_recent_comments p {
	font-size: 14px;
}

div.dashboard-widget-content p.comment-meta {
	font-size: 11px !important;
}

#dashboard_secondary div.dashboard-widget {
	height: auto;
}

#dashboard_secondary div.dashboard-widget-content ul {
	list-style: none;
	padding: 0;
}

#dashboard_secondary div.dashboard-widget-content ul li {
	display: block;
	width: 19.95%;
	padding-bottom: 10px;
	margin: 0;
	float: left;
	font-size: 95%;
}

#dashboard_secondary div.dashboard-widget-content {
	margin: 10px 5px;
	padding: 0;
}

#dashboard_secondary div.dashboard-widget-content ul li .post {
	display:block;
	font-family:Georgia,"Times New Roman",Times,serif;
	font-size:18px;
	line-height: 1.2em;
	height:90px;
	overflow:hidden;
}

#dashboard_secondary div.dashboard-widget-content ul li a {
	display: block;
	height:100%;
	overflow:hidden;
	margin: 5px 10px;
	text-decoration: none;
	padding: .5em;
	border-right: 1px solid #dadada;
	border-bottom: 1px solid #dadada;
}

#dashboard_secondary div.dashboard-widget-content ul li a cite {
	display: block;
	font-family: "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
}

#dashboard-widgets .widget_rss ul {
	list-style: none;
	padding: 0;
}

#dashboard-widgets .widget_rss ul li {
	clear: both;
}

#dashboard-widgets .widget_rss ul li span.rss-date {
	float: left;
	margin: 0;
}

#dashboard-widgets .widget_rss ul li a {
	float: left;
	margin: 0 .5em .2em 0;
	font-weight: bold;
}

#dashboard-widgets .widget_rss ul li div {
	clear: both;
	line-height: 1.5em;
}

#dashboard_primary a.rsswidget, #dashboard_plugins h5 {
	font-size: 14px;
}

#dashboard_primary span.rss-date {
	font-size: 14px;
}

#dashboard_plugins h4 {
	font-size: 1em;
	margin: 0 0 .1em;
}

#dashboard_plugins h5 {
	margin: 0;
	display: inline;
	line-height: 1.4em;
}

#dashboard_plugins p {
	margin: 0 0 1em;
	line-height: 1.5em;
}

.widget-loading {
}
                                                                                                                                                                                                                                                                                                                                       blog/wp-admin/css/global-rtl.css                                                                    0000755 0023433 0004734 00000000711 11060470610 016423  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 body, td {
	font-family: Tahoma;
}
textarea, input, select {
	font-family: Tahoma;
}
h1, h2, h3 {
	font-family:arial;
}
.widefat td {
	padding: 7px 10px 9px 15px;
}
.widefat th {
	padding: 9px 10px 6px 15px;
	text-align: right;
}
.widefat th input {
	margin: 0 8px 0 0;
}
.widefat .check-column {
	text-align: left;
}
.wrap h2 {
	font-family:arial;
	margin: 5px -4px 0 0;
	padding-right:0;
	padding-left: 280px;
}
.wrap h2.long-header {
	padding-left: 0;
}
                                                       blog/wp-admin/css/global.css                                                                        0000755 0023433 0004734 00000005713 11060470611 015634  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 /* styles for use by people extending the WordPress interface */


body	{
	margin: 0;
	padding: 0;
}

body, td {
	font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
}

form, label input { margin: 0; padding: 0; }

img { border: 0; }

label { cursor: pointer; }

li, dd { margin-bottom: 6px; }

p, li, dl, dd, dt { line-height: 140%; }

textarea, input, select {
	font: 13px Verdana, Arial, Helvetica, sans-serif;
	margin: 1px;
	padding: 3px;
}

.alignleft { float: left; }
.alignright { float: right; }

.textleft { text-align: left; }
.textright { text-align: right; }

.clear { clear: both; height: 2px; }

.hidden { display: none; }

h1 {
  display: block;
  font-size: 2em;
  font-weight: bold;
  margin: .67em 0;
}

h2 {
  display: block;
  font-size: 1.5em;
  font-weight: bold;
  margin: .83em 0;
}

h3 {
  display: block;
  font-size: 1.17em;
  font-weight: bold;
  margin: 1em 0;
}

h4 {
  display: block;
  font-weight: bold;
  margin: 1.33em 0;
}

h5 {
  display: block;
  font-size: 0.83em;
  font-weight: bold;
  margin: 1.67em 0;
}

h6 {
  display: block;
  font-size: 0.67em;
  font-weight: bold;
  margin: 2.33em 0;
}

.subsubsub {
	list-style: none;
	margin: 14px 0 8px 0;
	padding: 0;
	white-space: nowrap;
	font-size: 12px;
}

.subsubsub a { line-height: 200%; padding: 3px; text-decoration: none; }

.subsubsub a.current { font-weight: bold; background: none; border: none;}

.subsubsub li { display: inline; margin: 0; padding: 0; }

.widefat {
	border-width: 1px;
	border-style: solid;
	border-collapse: collapse;
	width: 100%;
	clear: both;
	margin: 0;
}

.widefat a {
	text-decoration: none;
}

.widefat abbr {
	white-space: nowrap;
}

.widefat td, .widefat th {
	border-bottom-width: 1px;
	border-bottom-style: solid;
	border-bottom-color: #ccc;
	font-size: 11px;
	vertical-align: text-top;
}

.widefat td {
	padding: 7px 15px 9px 10px;
	vertical-align: top;
}

.widefat th {
	padding: 9px 15px 6px 10px;
	text-align: left;
	line-height: 1.3em;
}

.widefat th input {
	margin: 0 0 0 8px;
	padding: 0;
}

.widefat .check-column {
	text-align: right;
	width: 1.5em;
	padding: 0;

}

.widefat tbody th.check-column {
	padding: 8px 0 22px;
}
/*
th.check-column + th, th.check-column + td {
	padding-left: 5px;
}
*/
.widefat .num {
	text-align: center;
}

.wrap, .updated, .error {
	margin: 0;
	margin-left: 15px;
	margin-right: 15px;
	padding: 0;
	max-width: 980px;
}

.updated, .error {
	border-width: 1px;
	border-style: solid;
	padding: 0 0.6em;
	max-width: 950px;
	margin-bottom: 1em;
}

.updated p, .error p {
	margin: 0.6em 0;
}

.wrap .updated, .wrap .error {
	margin: auto 0 0;
}

.updated a, .error a {
	text-decoration: underline;
}

.updated a {
	text-decoration: none;
	padding-bottom: 2px;
}

.wrap h2 {
	border-bottom-width: 1px;
	border-bottom-style: solid;
	clear: both;
	font: 24px Georgia, "Times New Roman", Times, serif;
	margin: 5px 0 0 -4px;
	padding: 0;
	padding-bottom: 7px;
	padding-right: 280px;
}

.wrap h2.long-header {
	padding-right: 0;
}
                                                     blog/wp-admin/css/ie-rtl.css                                                                        0000755 0023433 0004734 00000002351 11060470612 015564  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 #poststuff .postbox h3 {
	padding-left:0;
	padding-right: 23px;
}
* html #poststuff .postarea, * html #poststuff #titlediv {
	margin-left:0;
	margin-right: 3%;
}
* html #poststuff h2 {
	margin-right: 0;
}
#bh {
	padding-right:0;
	padding-left: 15px;
}
div#dashboard-widgets {
	padding-right:0;
	padding-left: 1px;
}
#tagchecklist span a {
	margin: 4px -9px 0 0;
}
#poststuff .togbox {
	margin-left:0;
	margin-right: -19px;
}
.widefat th input {
	margin: 0 5px 0 0;
}
/* ---------- add by navid */
#dashmenu { /* fix top right bottom in admin */
	direction:ltr;
}
#sidemenu a { /* fix left admin buttom ex. plugins, options */
	float:left;
}
.wrap h2 {
	margin:5px 4px 0 0;
}
#editor-toolbar {/* fix hover in media uploader icon */
	direction:ltr;
}
#TB_window { /* fix theme preview */
	left:2%;
}
/* fix widget page */
form#widgets-filter {
	position:static;
}
#widget-search {
	display:none;
}
/* fix manage comment page */
ul.view-switch li {
	float:left;
}
form#posts-filter {
	position:static;
}
#post-search {
	display:none;
}
#submenu {
	margin-right: 20px;
}
/* Fixes for media-upload window */
/* Center media-upload panel on screen */
#TB_window { 
	width: 670px; 
	position: absolute; 
	top: 50%; 
	left: 50%; 
	margin-right: 335px !important; }
                                                                                                                                                                                                                                                                                       blog/wp-admin/css/ie.css                                                                            0000755 0023433 0004734 00000004437 11060470612 014774  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 /* Fixes for IE bugs */

#poststuff .postbox h3 {
	padding-left: 23px;
}

#submenu li a.current {
	background:none;
	border:none;
}

* html body.minwidth {
	_width: expression(document.documentElement.clientWidth < 810 ? "808px" : "99.9%");
}

* html #wpbody {
	_width: expression(document.documentElement.clientWidth > 982 ? "980px" : "99.9%");
}

* html #poststuff .postarea, * html #poststuff #titlediv {
	width: 95%;
	margin-left: 3%;
}

.submitbox {
	margin-top: 10px;
}

* html div.widget-liquid-left-holder, * html div.widget-liquid-right {
	display: block;
	position: relative;
}

#wpwrap, #wpcontent, #post, #wrap, #postdivrich, #postdiv, #poststuff, #titlediv, #post-body, #editorcontainer, .tablenav, .widget-control-list, li.widget-list-control-item, #dragHelper, li.widget-list-control-item h4, .widget-sortable, .widget-control-actions {
	display: block;
	zoom: 100%;
}

* html #editorcontainer {
	padding: 0;
}

* html #editorcontainer #content {
	position: relative;
	overflow: auto;
	padding: 6px;
	margin: auto;
	width: 98%;
}

form#template div {
	width: 100%;
}

#ed_toolbar input {
	overflow: visible;
	padding: 0 4px;
}

#poststuff h2 {
	font-size: 1.6em;
}

* html #poststuff h2 {
	margin-left: 0;
}

#bh {
	padding-right: 15px;
}

/* without this dashboard widgets appear in one column for some screen widths */
div#dashboard-widgets {
	padding-right: 1px;
}

#tagchecklist {
	display: block;
	zoom: 100%;
}

#tagchecklist span, #tagchecklist span a {
	display: inline-block;
	display: block;
}

#tagchecklist span a {
	margin: 4px 0 0 -9px;
}

#poststuff .togbox {
	margin-left: -19px;
}

.tablenav .button-secondary, .nav .button-secondary {
	padding: 0 1px;
	vertical-align: middle;
}

.tablenav select {
	font-size: 13px;
	display: inline-block;
	vertical-align: top;
	margin-top: 2px;
}

.tablenav-pages .page-numbers {
	display: inline-block;
}

.tablenav-pages {
	display: block;
	margin-top: -3px;
}

table.ie-fixed {
	table-layout: fixed;
}

#post-search .button, #widget-search .button {
	padding: 1px;
}

.widefat tr, .widefat th {
	margin-bottom: 0;
	border-spacing: 0;
}

.widefat th input {
	margin: 0 0 0 5px;
}

.widefat .check-column {
	padding: 6px 0 2px;
}

.widefat tbody th.check-column {
	padding: 4px 0 22px;
}

.tablenav a.button-secondary {
	display: inline-block;
	padding: 2px 5px;
}
                                                                                                                                                                                                                                 blog/wp-admin/css/install-rtl.css                                                                   0000755 0023433 0004734 00000000623 11060470613 016636  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 body {
	font-family: Tahoma;
}
/* Half the page disapears on IE6 */
* html body {
	width: 700px; 
	position: absolute; 
	left: 50%; 
	margin-right: 350px;
}
ul, ol {
	padding: 5px 22px 5px 5px;
}
.step, th {
	text-align:right;
}
.submit input, .button, .button-secondary  {
	font-family: Tahoma;
	margin-right:0;
}
.form-table th {
	text-align:right;
}
h1 {
	font-family:arial;
	margin: 5px -4px 0 0;
}
                                                                                                             blog/wp-admin/css/install.css                                                                       0000755 0023433 0004734 00000004245 11060470614 016044  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 html { background: #f1f1f1; }

body {
	background: #fff;
	color: #333;
	font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
	margin: 2em auto 0 auto;
	width: 700px;
	padding: 1em 2em;
	-moz-border-radius: 12px;
	-khtml-border-radius: 12px;
	-webkit-border-radius: 12px;
	border-radius: 12px;
}

a { color: #2583ad; text-decoration: none; }

a:hover { color: #d54e21; }


h1 {
	font-size: 18px;
	margin-bottom: 0;
}

h2 { font-size: 16px; }

p, li {
	padding-bottom: 2px;
	font-size: 13px;
	line-height: 18px;
}

code {
	font-size: 13px;
}

ul, ol { padding: 5px 5px 5px 22px; }

#logo { margin: 6px 0 14px 0px; border-bottom: none;}

.step {
	margin: 20px 0 15px;
}

.step input {
	font-size: 18px;
}

a.button {
	font-size: 18px;
}

.step, th { text-align: left; padding: 0; }

.submit input, .button, .button-secondary {
	font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
	padding: 5px 7px 7px;
	border: 1px solid #a3a3a3;
	margin-left: 0;
	-moz-border-radius: 3px;
	-khtml-border-radius: 3px;
	-webkit-border-radius: 3px;
	border-radius: 3px;
	color: #246;
	background: #e5e5e5;
}

.button-secondary {
	background: #cee1ef;
}

.submit input:hover, .button:hover, .button-secondary:hover {
	color: #d54e21;
	border-color: #535353;
}

.form-table {
	border-collapse: collapse;
	margin-top: 1em;
	width: 100%;
}

.form-table td {
	margin-bottom: 9px;
	padding: 10px;
	border-bottom: 8px solid #fff;
	font-size: 12px;
}

.form-table th {
	font-size: 13px;
	text-align: left;
	padding: 16px 10px 10px 10px;
	border-bottom: 8px solid #fff;
	width: 110px;
	vertical-align: top;
}

.form-table tr {
	background: #eaf3fa;
}

.form-table code {
	line-height: 18px;
	font-size: 18px;
}

.form-table p {
	margin: 4px 0 0 0;
	font-size: 11px;
}

.form-table input {
	line-height: 20px;
	font-size: 15px;
	padding: 2px;
}

h1 {
	border-bottom: 1px solid #dadada;
	clear: both;
	color: #666666;
	font: 24px Georgia, "Times New Roman", Times, serif;
	margin: 5px 0 0 -4px;
	padding: 0;
	padding-bottom: 7px;
}

#error-page {
	margin-top: 50px;
}

#error-page p {
	font-size: 14px;
	line-height: 16px;
	margin: 25px 0 20px;
}

#error-page code {
	font-size: 15px;
}                                                                                                                                                                                                                                                                                                                                                           blog/wp-admin/css/login-rtl.css                                                                     0000755 0023433 0004734 00000000745 11060470614 016306  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 body {
	font-family: Tahoma;
}
form {
	margin-left:0;
	margin-right: 8px;
}
form .forgetmenot {
	float:right;
}
#login form .submit input  {
	font-family: Tahoma;
}
form .submit {
	float:left;
}
#backtoblog a {
	left:auto;
	right:15px;
}
#login_error, .message {
	margin: 0 8px 16px 0;
}
#nav {
	margin:0 8px 0 0;
}
#user_pass, #user_login, #user_email {
	margin-right:0;
	margin-left: 6px;
}
h1 a {
	text-decoration:none;
}
/* ltr input */
#user_login, #user_pass {
	direction:ltr;
}
                           blog/wp-admin/css/login.css                                                                         0000755 0023433 0004734 00000002634 11060470615 015507  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 * { margin: 0; padding: 0; }

body {
	border-top-width: 30px;
	border-top-style: solid;
	font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
}

form {
	margin-left: 8px;
	padding: 16px 16px 40px 16px;
	font-weight: bold;
	-moz-border-radius: 5px;
	-khtml-border-radius: 5px;
	-webkit-border-radius: 5px;
	border-radius: 5px;
}

form .forgetmenot { font-weight: normal; float: left; margin-bottom: 0;}

#login form .submit input {
	font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
	padding: 3px 5px;
	border: none;
	font-size: 13px;
	border-width: 1px;
	border-style: solid;
	-moz-border-radius: 3px;
	-khtml-border-radius: 3px;
	-webkit-border-radius: 3px;
	border-radius: 3px;
	cursor: default;
	text-decoration: none;	
	margin-top: -6px;
}

form .submit { float: right; }

form p { margin-bottom: 24px; }

h1 a {
	background: url(../images/logo-login.gif) no-repeat;
	width: 292px;
	height: 66px;
	text-indent: -9999px;
	overflow: hidden;
	padding-bottom: 15px;
	display: block;
}

#backtoblog a {
	position: absolute;
	top: 7px;
	left: 15px;
	text-decoration: none;
}

#login { width: 292px; margin: 7em auto; }

#login_error, .message {
	margin: 0 0 16px 8px;
	border-width: 1px;
	border-style: solid;
	padding: 12px;
}

#nav { margin: 0 0 0 8px; padding: 16px; }

#user_pass, #user_login, #user_email {
	font-size: 20px;
	width: 97%;
	padding: 3px;
	margin-right: 6px;
}                                                                                                    blog/wp-admin/css/media-rtl.css                                                                     0000755 0023433 0004734 00000002027 11060470616 016252  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 body#media-upload ul#sidemenu {
	left:auto;
	right:0;
	width: 620px;
}
#search-filter {
	text-align:left;
}
.align .field label {
	padding: 0 28px 0 0;
	margin: 0 0 0 1em;
}
.image-align-none-label, .image-align-left-label, .image-align-center-label, .image-align-right-label {
	background-position:center right;
}
tr.image-size label {
	margin: 0 0 0 1em;
}
.filename.original {
	float: right;
}
.crunching {
	text-align: left;
	margin-right:0;
	margin-left: 5px;
}
button.dismiss {
	right:auto;
	left:5px;
}
.file-error {
	margin: 0 50px 5px 0;
}
.progress {
	left:auto;
	right:0;
}
.bar {
	border-right-width:0;
	border-left-width: 3px;
	border-left-style: solid;
}
.media-item .pinkynail {
	float:right;
}
.describe-toggle-on, .describe-toggle-off {
	float: left;
	margin-right:0;
	margin-left: 20px;
}
/* Specific to Uploader */

#media-upload .media-upload-form p {
	margin: 0 0 1em 1em;
}
.filename {
	float: right;
	margin-left:0;
	margin-right: 10px;
}
#media-upload .describe th.label {
	text-align:right;
}
.menu_order {
	float:left;
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         blog/wp-admin/css/media.css                                                                         0000755 0023433 0004734 00000011336 11060470617 015457  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 div#media-upload-header {
	margin: 0;
	padding: 0 5px;
	font-weight: bold;
	position: relative;
	border-bottom-width: 1px;
	border-bottom-style: solid;
	height: 2.5em;
}

body#media-upload ul#sidemenu {
	font-weight: normal;
	margin: 0 5px;
	position: absolute;
	left: 0px;
	bottom: -1px;
}

div#media-upload-error {
	margin: 1em;
	font-weight: bold;
}

form {
	margin: 1em;
}

#search-filter {
	text-align: right;
}

.media-upload-form label, .media-upload-form legend {
	display:block;
	font-weight: bold;
	font-size: 13px;
	margin-bottom: 0.5em;
	margin: 0 0 0.5em 0;
}

th { position: relative; }

.media-upload-form label.form-help, td.help {
	font-style: italic;
	font-weight: normal;
}

.media-upload-form p.help {
	margin: 0;
	padding: 0;
}

.media-upload-form fieldset {
	width: 100%;
	border: none;
	text-align: justify;
	margin: 0 0 1em 0;
	padding: 0;
}

/* specific to the image upload form */
.align .field label {
	display: inline;
	padding: 0 0 0 28px;
	margin: 0 1em 0 0;
}
.image-align-none-label {
	background: url(../images/align-none.png) no-repeat center left;
}

.image-align-left-label {
	background: url(../images/align-left.png) no-repeat center left;
}

.image-align-center-label {
	background: url(../images/align-center.png) no-repeat center left;
}

.image-align-right-label {
	background: url(../images/align-right.png) no-repeat center left;
}

#flash-upload-ui, .insert-gallery {
	display: none;
}

tr.image-size label {
	display: inline;
	margin: 0 1em 0 0;
}
.pinkynail {
	max-width: 40px;
	max-height: 40px;
}

.filename.original {
	float: left;
}
.crunching {
	display: block;
	line-height: 32px;
	text-align: right;
	margin-right: 5px;
}
button.dismiss {
	position: absolute;
	top: 5px;
	right: 5px;
	z-index: 4;
}
.file-error {
	margin: 0 0 5px 50px;
	font-weight: bold;
}

.progress {
	position: absolute;
	top: 0px;
	left: 0px;
	width: 623px;
	height: 36px;
}
.bar {
	width: 0px;
	height: 100%;
	border-right-width: 3px;
	border-right-style: solid;
}

#library-form .progress, #gallery-form .progress {
	display: none;
}

.media-item .thumbnail {
	max-width: 128px;
	max-height: 128px;
}
.media-item .pinkynail {
	float: left;
	margin: 2px;
	height: 32px;
	max-width: 40px;
}

thead.media-item-info tr {
	background-color: transparent;
}
thead.media-item-info th, thead.media-item-info td {
	border: none;
	margin: 0;
}

.form-table thead.media-item-info {
	border: 8px solid #fff;
}

.describe.startopen, .describe.startclosed {
	display: none;
}
abbr.required {
	text-decoration: none;
	border: none;
}
.describe label {
	display: inline;
}
.describe td {
	vertical-align: middle;
}
.describe td.A1 {
	width: 132px;
}
.describe input[type="text"], .describe textarea {
	width: 460px;
}
.describe-toggle-on, .describe-toggle-off {
	display: block;
	line-height: 36px;
	float: right;
	margin-right: 20px;
}
.describe-toggle-off {
	display: none;
}

.clickmask {
}

.hidden {
	height: 0px;
	width: 0px;
	overflow: hidden;
	border: none;
}

/* Specific to Uploader */

#media-upload .media-upload-form p {
	margin: 0 1em 1em 0;
}

#media-upload .media-upload-form p.ml-submit {
	padding: 1em 0;
}

#media-upload p.help {
	font-style: italic;
	font-weight: normal;
}
#media-upload tr.image-size td.field {
	text-align: center;
}
#media-upload #media-items {
	border-width: 1px;
	border-style: solid;
	border-bottom: none;
	width: 623px;
}

#media-upload .media-item {
	position: relative;
	border-bottom-width: 1px;
	border-bottom-style: solid;
	min-height: 36px;
	width: 100%;
}

#media-upload .ui-sortable .media-item {
	cursor: move;
}

.filename {
	float: left;
	line-height: 36px;
	margin-left: 10px;
	overflow: hidden;
	max-width: 430px;
}
#media-upload .describe {
	border-top-width: 1px;
	border-top-style: solid;
	padding: 5px;
	width: 100%;
	clear: both;
	cursor: default;
}
#media-upload .describe th.label {
	padding-top: .5em;
	text-align: left;
}
#media-upload tr.align td.field {
	text-align: center;
}
#media-upload tr.image-size {
	margin-bottom: 1em;
	height: 3em;
}

#media-upload #filter {
	width: 623px;
}

#media-upload #filter .subsubsub {
	margin: 8px 0;
}

#filter .tablenav select {
	border-style:solid;
	border-width:1px;
	padding:2px;
	vertical-align:top;
}

#media-upload a.delete,
#media-upload a.del-link {
	padding: 0 3px 1px;
}

#media-upload .del-attachment {
	display: none;
	margin: 5px 0;
}

.menu_order {
	float: right;
	font-size: 11px;
	margin: 10px 10px 0;
}

.menu_order_input {
	border: 1px solid #DDDDDD;
	font-size: 10px;
	padding: 1px;
	width: 23px;
}

.ui-sortable-helper {
	background-color: #fff;
	border: 1px solid #aaa;
	opacity: 0.6;
	filter: alpha(opacity=60);
}

#media-upload th.order-head {
	 width: 25%;
	 text-align: center;
}

#media-upload .widefat {
	width: 626px;
	border-style: solid solid none;
}

.sorthelper {
	z-index: -1;
}
                                                                                                                                                                                                                                                                                                  blog/wp-admin/css/press-this-ie-rtl.css                                                             0000755 0023433 0004734 00000000044 11060470617 017665  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 .ui-tabs-nav {
 	margin-right: 0;
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            blog/wp-admin/css/press-this-ie.css                                                                 0000755 0023433 0004734 00000000151 11060470620 017057  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 
#posting {
 	position: static !important;
}
 .ui-tabs-nav {
 	margin-left: 0;
 	border: 0 !important;
}
                                                                                                                                                                                                                                                                                                                                                                                                                       blog/wp-admin/css/press-this-rtl.css                                                                0000755 0023433 0004734 00000002501 11060470621 017265  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 body {
	font-family: Tahoma;
}
.ui-tabs-nav {
	padding-left:0;
	padding-right:8px;
}
.ui-tabs-nav li {
	float: right;
}
.button {
	font-family: Tahoma;
	margin-left:0;
	margin-right: 5px;
}
#wphead #viewsite {
	margin-left:0;
	margin-right: 10px;
}
#viewsite {
	right:auto;
	left: 8px;
}
#wphead #viewsite a {
	font-family: Tahoma;
}
h1 {
	right:auto;
	left:0;
}
div#posting {
	padding-left:0;
	padding-right: 16px;
}
#photo_directions span {
	right:auto;
	left:3px;
}
#img_container a {
	float:right;
}
#img_container a, #img_container a:link, #img_container a:visited {
	margin:0 0 4px 4px;
}
div#categories {
	right:auto;
	left:16px;
}
div#categories h2 {
	margin: .5em 1em .5em 0;
}
#tagsdiv #newtag {
	margin-right:0;	
	margin-left: 5px;	
}
#jaxtag {
	padding-left:0;
	padding-right: 1em;
}
#tagchecklist {
	padding-left:0;
	padding-right: 1em;
}
#tagchecklist span {
	margin-right: 10px;
	margin-left: .5em;
	float: right;
}
#tagchecklist span a {
	margin: 6px -9px 0pt 0;
	float: right;
}
.submitbox {
	float: left;
}
.submitbox .submit input {
	text-align:right;
}
.video_split #extra_fields {
	float:right;
}
.video_split .editor_area {
	float: left;
}
.ac_results li {
	text-align:right;
}
#TB_ajaxContent #options {
	right:auto;
	left:25px;
}
#post_status {
	margin-left:0;
	margin-right: 10px;
}
#footer {
	padding: 10px 60px 0 0;
}
                                                                                                                                                                                               blog/wp-admin/css/press-this.css                                                                    0000755 0023433 0004734 00000020151 11060470622 016470  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 body {
	font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
	color: #333;
	margin: 0px;
	padding: 0px;
}

img { border: 0; }
/* Tabs */
@media projection , screen {
	.ui-tabs-hide {
		display: none;
	}
}

@media print {
	.ui-tabs-nav {
		display: none;
	}
}

.ui-tabs-nav {
	list-style: none;
	border-bottom: 1px solid #C6D9E9;
	padding-left: 8px;
	margin-bottom: .5em;
	margin-top: -2em;
}

/* Additional IE specific bug fixes... */
* html .ui-tabs-nav { /* auto clear, @ IE 6 & IE 7 Quirks Mode */
	display: inline-block;
}

* :first-child+html .ui-tabs-nav {
	/* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
	display: inline-block;
}

.ui-tabs-nav:after {
	/* clearing without presentational markup, IE gets extra treatment */
	display: block;
	clear: both;
	content: " ";
}

.ui-tabs-nav li {
	float: left;
	margin: 0;
	height: 2em;
	line-height: 2em;
}

.ui-tabs-nav a,.ui-tabs-nav a span {
	display: block;
}

.ui-tabs-nav a {
	margin: 1px 0 0;
	/* position: relative makes opacity fail for disabled tab in IE */
	padding-left: 0;
	color: #27537a;
	font-weight: bold;
	line-height: 2em;
	text-align: center;
	text-decoration: none;
	white-space: nowrap; /* required in IE 6 */
	outline: 0; /* prevent dotted border in Firefox */
	padding: 0 1em;
}

.ui-tabs-nav .ui-tabs-selected a {
	position: relative;
	top: 1px;
	z-index: 2;
	margin-top: 0;
	-moz-border-radius-topleft: 4px;
	-moz-border-radius-topright: 4px;
	-webkit-border-top-left-radius: 4px;
	-webkit-border-top-right-radius: 4px;
	border-style: solid;
	border-width: 1px;
	background: white;
	border-bottom-width: 2px;
	margin-top: -2px;
}

.ui-tabs-nav a:hover,.ui-tabs-nav a:focus,.ui-tabs-nav a:active,
.ui-tabs-nav .ui-tabs-selected a:link,.ui-tabs-nav .ui-tabs-selected a:visited { 
	cursor: pointer;
}

/* Header */
#wphead {
	border-top: none;
	height: 2em;
	padding-top: 8px;
}

.button {
	font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
	padding: 3px 5px;
	font-size: 12px;
	line-height: 1.5em;
	border-width: 1px;
	border-style: solid;
	-moz-border-radius: 3px;
	-khtml-border-radius: 3px;
	-webkit-border-radius: 3px;
	border-radius: 3px;
	cursor: pointer;
	margin-left: 5px;
	text-decoration: none;
}

.howto {
	font-size: 11px;
	font-style: italic;
	display: block;
}

#wphead #viewsite {
	position: absolute;
	margin-top: 12px;
	margin-left: 10px;
}

#viewsite {
	position: relative;
	right: 8px;
	top: 6px;
	margin: 0 !important;
}

#wphead #viewsite a {
	font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
	padding: 3px 4px;
	display: block;
	letter-spacing: normal;
	border-width: 1px;
	border-style: solid;
	-moz-border-radius: 3px;
	-khtml-border-radius: 3px;
	-webkit-border-radius: 3px;
	border-radius: 3px;
	text-decoration: none;
}

#previewview {
	padding-top: 8px !important;
	padding-bottom: 8px !important;
}

h1 {
	font-size: .75em;
	line-height: 2.666em;
	top: .5em;
	right: 0;
	margin: 0 !important;
	padding: 0 !important;
	width: 236px;
	background: none;
}

input.text {
	border: 0pt none;
	outline-color: -moz-use-text-color;
	outline-style: none;
	outline-width: medium;
	padding: 0pt;
	width: 100%;
	border-style: solid;
	color: #333333;
}

/* Editor/Main Column */

div#container {
	margin: 0;
	min-width: 500px;
}

div#container form {
	margin: 0px;
	padding: 0px;
}

div#posting {
	padding-left: 16px;
	position: absolute;
	z-index: 1;
	width: 66%;
}

#post_title {
	width: 99%;
}

.titlewrap {
	border-style: solid;
	border-width: 1px;
	padding: 2px 3px;
	border-color: #CCCCCC;
}

div#posting h2 {
	margin: .5em 0 .25em 0;
	font-size: 12px;
	padding: 3px;
	background: ;
}

.editor-container {
	border-width: 1px;
	border-color: #ccc;
	border-style: solid;
	margin-bottom: 1em;
}

/* Photo Styles */

#photo_directions {
	margin-top: .25em;
	display: block;
	position: relative;
}

#photo_directions span {
	display: block;
	position: absolute;
	top: 0;
	right: 3px;
}

#photo_saving {
	margin: 0 8px 8px;
	vertical-align: middle;
}

#img_container {
	background-color: #fff;
	overflow: auto;
	height: 100px;
}

#img_container a {
	display: block;
	width: 79px;
	height: 79px;
	float: left;
}

#img_container img {
	width: 75px;
	height: 75px;
	border: 0px;
	padding: 2px;
	background-color: #f4f4f4;
	cursor: pointer;
}
#img_container a, #img_container a:link, #img_container a:visited {
	border: 2px solid #ccc;
	margin: 0 4px 4px 0;
} 
#img_container a:hover, #img_container a:active {
	border: 2px solid #000;
}

/* Submit Column */

div#categories {
	font-size: 85%;
	position: absolute;
	top: 50px;
	right: 16px;
	width: 27%;
	z-index: 2;
}

div#categories h2 {
	color: #333;
	font-size: 12px;
	margin: .5em 0 .5em 1em;
	padding: 0;
}

#categories-all {
	overflow: auto;
	padding: 0 1em 1em 1em;
	height: 15em;
}

#categories ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

#tagsdiv #newtag {
	padding: 3px;
	margin-right: 5px;
	width: 16em;	
}

#jaxtag {
	clear: both;
	padding-left: 1em;
	margin: 0;
}

#tagchecklist {
	padding-left: 1em;
	margin-bottom: 1em;
	font-size: 12px;
	overflow: auto;
}

#tagchecklist strong {
	position: absolute;
	font-size: .75em;
}

#tagchecklist span {
	margin-right: .5em;
	margin-left: 10px;
	display: block;
	float: left;
	font-size: 11px;
	line-height: 1.8em;
	white-space: nowrap;
	cursor: default;
}

#tagchecklist span a {
	margin: 6px 0pt 0pt -9px;
	cursor: pointer;
	width: 10px;
	height: 10px;
	display: block;
	float: left;
	text-indent: -9999px;
	overflow: hidden;
	position: absolute;
}
.submit {
	-moz-border-radius-bottomleft: 3px;
	-khtml-border-bottom-left-radius: 3px;
	-webkit-border-bottom-left-radius: 3px;
	border-bottom-left-radius: 3px;
	-moz-border-radius-bottomright: 3px;
	-khtml-border-bottom-right-radius: 3px;
	-webkit-border-bottom-right-radius: 3px;
	border-bottom-right-radius: 3px;
	margin: 0;
	padding: 10px;
}
.submitbox {
	width: 100%;
	float: right;
}

.submitbox .submit a:hover {
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

.submitbox .submit input {
	border: none;
	text-align: left;
	padding: 6px 4px;
	font-size: 12px;
	margin: 2px;
	-moz-border-radius: 3px;
	-khtml-border-radius: 3px;
	-webkit-border-radius: 3px;
	border-radius: 3px;
	cursor: pointer;
}

.submitbox #previewview {
	padding: 15px 10px;
	-moz-border-radius-topleft: 3px;
	-khtml-border-top-left-radius: 3px;
	-webkit-border-top-left-radius: 3px;
	border-top-left-radius: 3px;
	-moz-border-radius-topright: 3px;
	-khtml-border-top-right-radius: 3px;
	-webkit-border-top-right-radius: 3px;
	border-top-right-radius: 3px;
}

/* Video Styles */
.video_split #extra_fields {
	width: 27%;
	height: 300px;
	float: left;
}

#embed_code {
	border: 0;
	width: 99%;
	height: 200px;
}
.video_split .editor_area {
	width: 70%;
	float: right;
}

.ac_results {
	padding: 0;
	margin: 0;
	list-style: none;
	position: absolute;
	z-index: 10000;
	display: none;
	border-width: 1px;
	border-style: solid;
}

.ac_results li {
	padding: 2px 5px;
	white-space: nowrap;
	text-align: left;
}

.ac_over {
	cursor: pointer;
}

.ac_match {
	text-decoration: underline;
}

.photolist {
	display: none;
}

#extra_fields small {
	display: block;
	margin-top: .5em;
	padding-bottom: .25em;
}

#TB_ajaxContent #options {
	position: absolute;
	top: 20px;
	right: 25px;
	padding: 5px;
}
#TB_ajaxContent h3 {
	margin-bottom: .25em;
}

.updated {
	margin: 0;
	margin-left: 15px;
	margin-right: 15px;
	padding: 0;
	max-width: 980px;
	border-width: 1px;
	border-style: solid;
	padding: 0 0.6em;
	max-width: 950px;
	margin-top: 1em;
	margin-bottom: 1em;
}

.updated p, .error p {
	margin: 0.6em 0;
}

.updated a, .error a {
	text-decoration: underline;
}

.updated a {
	text-decoration: none;
	padding-bottom: 2px;
}

#post_status {
	margin-left: 10px;
	margin-bottom: 1em;
	display: block;
}

/* Footer */

#footer {
	height: 65px;
	display: block;
	width: 640px;
	padding: 10px 0 0 60px;
	margin: 0;
	position: absolute;
	bottom: 0;
	font-size: 12px;
}

#footer p {
	margin: 0;
	padding: 7px 0;
}

#footer p a {
	text-decoration: none;
}

#footer p a:hover {
	text-decoration: underline;
}


/* Utility Classes */
.centered {
	text-align: center;
}

.hidden {
	display: none;
}                                                                                                                                                                                                                                                                                                                                                                                                                       blog/wp-admin/css/theme-editor-rtl.css                                                              0000755 0023433 0004734 00000000314 11060470622 017553  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 #template textarea {
	font-family:monospace;
}
#templateside {
	float:left;
}
#themeselector {
	padding-right:0;
	padding-left: 5px;
	float: left;
}
div.tablenav {
	margin-right:0;
	margin-left: 210px;
}
                                                                                                                                                                                                                                                                                                                    blog/wp-admin/css/theme-editor.css                                                                  0000755 0023433 0004734 00000001455 11060470623 016764  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 #template textarea {
	font-family: 'Courier New', Courier, monospace;
	font-size: 12px;
	width: 97%;
}

#template p {
	width: 97%;
}

#templateside {
	float: right;
	width: 190px;
	margin-top:-3.4em;
}

#templateside h3, #postcustomstuff p.submit {
	margin: 0;
}

h3#bordertitle {
	margin-bottom: 10px;
}

#templateside h4 {
	margin-bottom: 0px;
}

#templateside ol, #templateside ul {
	list-style: none;
	margin: .5em;
	padding: 0;
}

#templateside ol li, #templateside ul li {
	margin: 1px 0px;
}

#themeselector {
	padding-right: 5px;
	float: right;
	position: relative;
	bottom: 25px;
}

#themeselector select {
	margin: 0;
	padding: 0;
}

.nonessential {
	font-size: small;
}

.highlight {
	padding: 1px;
}

div.bordertitle h2 {
	border: none;
	padding-bottom: 0px;
}

div.tablenav {
	margin-right: 210px;
}
                                                                                                                                                                                                                   blog/wp-admin/css/upload-rtl.css                                                                    0000755 0023433 0004734 00000000203 11060470624 016450  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 html {
	direction: ltr;
	}
#uploadoptions, table {
	direction: rtl;
	}
td {
	padding: 1px 6px 0;
	}
.submit {
	text-align: left;
	}                                                                                                                                                                                                                                                                                                                                                                                             blog/wp-admin/css/widgets-rtl.css                                                                   0000755 0023433 0004734 00000001562 11060470624 016643  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 /* 2 column liquid layout */
div.widget-liquid-left-holder {
	float: right;
	clear: right;
	margin-right:0;
	margin-left: -310px;
}
div.widget-liquid-left {
	margin-right:0;
	margin-left: 320px;
}
div.widget-liquid-right {
	float: left;
	clear: left;
}
p#widget-search {
	right:auto;
	left:0;
}
h4.widget-title span {
	float: right;
}
h4.widget-title a {
	float: left;
	margin-left:0;
	margin-right: 1em;
}
ul#widget-list li.widget-list-item h4.widget-title {
	float:right;
}
ul#widget-list li.widget-list-item div.widget-description {
	margin: 0 200px 0 0;
	padding: 0 4em 0 0;
}
.widget-control-save, .widget-control-remove {
	margin-right:0;
	margin-left: 8px;
	float: right;
}
li.widget-list-control-item h4.widget-title a,
#dragHelper li.widget-list-control-item h4.widget-title a,
#draghelper li.widget-list-control-item h4.widget-title a:visited {
	right:auto;
	left: 1em;
}
                                                                                                                                              blog/wp-admin/css/widgets.css                                                                       0000755 0023433 0004734 00000006213 11060470625 016043  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 /* 2 column liquid layout */
div.widget-liquid-left-holder {
	float: left;
	clear: left;
	width: 100%;
	margin-right: -310px;
}

div.widget-liquid-left {
	margin-right: 320px;
}

div.widget-liquid-right {
	float: right;
	clear: right;
	width: 300px;
	position: relative;
}

/* pasitioning etc. */
form#widgets-filter {
	position: relative;
}

div#available-widgets-filter {
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

p#widget-search {
	position: absolute;
	right: 0;
	top: 0;
	margin: 0;
}

ul#widget-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

ul#widget-list li.widget-list-item {
	padding: .7em 0.9em;
	margin: 0;
	border-bottom-width: 1px;
	border-bottom-style: solid;
	line-height: 1;
}

h4.widget-title span {
	float: left;
}

h4.widget-title a {
	float: right;
	text-decoration: underline;
	border-bottom: none;
	margin-left: 1em;
}

ul#widget-list li.widget-list-item h4.widget-title {
	position: relative;
	margin: 0;
	padding: .5em 1em;
	width: 200px;
	float: left;
	font-size: 13px;
	-moz-border-radius: 3px;
	-khtml-border-radius: 3px;
	-webkit-border-radius: 3px;
	border-radius: 3px;
}

#dragHelper h4.widget-title {
	padding: .5em 1em;
	margin: 0;
}

ul#widget-list li.widget-list-item div.widget-description {
	display: block;
	margin: 0 0 0 200px;
	padding: 0 0 0 4em;
	font-size: 11px;
}

ul#widget-list li.widget-list-item ul.widget-control-info {
	display: none;
}

div#sidebar-info {
	padding: 0 1em;
	margin-bottom: 1em;
	font-size: 11px;
}

ul.widget-control-list {
	list-style: none;
	margin: 0;
	padding: 0 1em;
}

div#current-widgets p.submit {
	padding: 1em;
}

li.widget-list-control-item {
	margin: 1em 0;
	-moz-border-radius: 3px;
	-khtml-border-radius: 3px;
	-webkit-border-radius: 3px;
	border-radius: 3px;
}

li.widget-list-control-item h4, 
#dragHelper li.widget-list-control-item h4, 
li.widget-sortable h4 {
	margin: 0;
	cursor: move;
	font-size: 13px;
	padding: 0.4em 0.8em;
	position: relative;
	-moz-border-radius: 3px;
	-khtml-border-radius: 3px;
	-webkit-border-radius: 3px;
	border-radius: 3px;
}

.widget-control-save, .widget-control-remove {
	padding: 3px 5px;
	-moz-border-radius: 3px;
	-khtml-border-radius: 3px;
	-webkit-border-radius: 3px;
	border-radius: 3px;
	margin-right: 8px;
	float: left;
	text-decoration: none;
}

li.widget-list-control-item h4.widget-title a,
#dragHelper li.widget-list-control-item h4.widget-title a,
#draghelper li.widget-list-control-item h4.widget-title a:visited {
	right: 1em;
}

li.widget-list-control-item h4.widget-title a:hover {
	text-decoration: none;
	border-bottom: none;
}

li.widget-list-control-item div.widget-control {
	display: none;
	padding: 15px;
	font-size: 11px;
	position: relative;
}

li.widget-list-control-item div.widget-control p {
	margin: 0 0 1em;
	padding: 0;
}

ul.widget-control-list div.widget-control-actions {
	border-top-width: 1px;
	border-top-style: solid;
	padding: 0.5em 0 0;
}

.widget-control-edit {
	font-size: 10px;
	font-weight: normal;
}

div#current-widgets {
	padding-top: 1em;
	border-width: 1px;
	border-style: solid none none;
}

#widget-controls .widefat {
	width: 92%;
	padding: 3px;
}

#widget-controls select.widefat {
	width: auto;
	display: block;
}
                                                                                                                                                                                                                                                                                                                                                                                     blog/wp-admin/import/                                                                               0000755 0023433 0004734 00000000000 11060470713 014376  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 blog/wp-admin/import/blogger.php                                                                    0000755 0023433 0004734 00000110143 11060470701 016530  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

define( 'MAX_RESULTS',        50 ); // How many records per GData query
define( 'MAX_EXECUTION_TIME', 20 ); // How many seconds to let the script run
define( 'STATUS_INTERVAL',     3 ); // How many seconds between status bar updates

class Blogger_Import {

	// Shows the welcome screen and the magic auth link.
	function greet() {
		$next_url = get_option('siteurl') . '/wp-admin/index.php?import=blogger&noheader=true';
		$auth_url = "https://www.google.com/accounts/AuthSubRequest";
		$title = __('Import Blogger');
		$welcome = __('Howdy! This importer allows you to import posts and comments from your Blogger account into your WordPress blog.');
		$prereqs = __('To use this importer, you must have a Google account and an upgraded (New, was Beta) blog hosted on blogspot.com or a custom domain (not FTP).');
		$stepone = __('The first thing you need to do is tell Blogger to let WordPress access your account. You will be sent back here after providing authorization.');
		$auth = __('Authorize');

		echo "
		<div class='wrap'><h2>$title</h2><p>$welcome</p><p>$prereqs</p><p>$stepone</p>
			<form action='$auth_url' method='get'>
				<p class='submit' style='text-align:left;'>
					<input type='submit' class='button' value='$auth' />
					<input type='hidden' name='scope' value='http://www.blogger.com/feeds/' />
					<input type='hidden' name='session' value='1' />
					<input type='hidden' name='secure' value='0' />
					<input type='hidden' name='next' value='$next_url' />
				</p>
			</form>
		</div>\n";
	}

	function uh_oh($title, $message, $info) {
		echo "<div class='wrap'><h2>$title</h2><p>$message</p><pre>$info</pre></div>";
	}

	function auth() {
		// We have a single-use token that must be upgraded to a session token.
		$token = preg_replace( '/[^-_0-9a-zA-Z]/', '', $_GET['token'] );
		$headers = array(
			"GET /accounts/AuthSubSessionToken HTTP/1.0",
			"Authorization: AuthSub token=\"$token\""
		);
		$request = join( "\r\n", $headers ) . "\r\n\r\n";
		$sock = $this->_get_auth_sock( );
		if ( ! $sock ) return false;
		$response = $this->_txrx( $sock, $request );
		preg_match( '/token=([-_0-9a-z]+)/i', $response, $matches );
		if ( empty( $matches[1] ) ) {
			$this->uh_oh(
				__( 'Authorization failed' ),
				__( 'Something went wrong. If the problem persists, send this info to support:' ),
				htmlspecialchars($response)
			);
			return false;
		}
		$this->token = $matches[1];

		wp_redirect( remove_query_arg( array( 'token', 'noheader' ) ) );
	}

	function get_token_info() {
		$headers = array(
			"GET /accounts/AuthSubTokenInfo  HTTP/1.0",
			"Authorization: AuthSub token=\"$this->token\""
		);
		$request = join( "\r\n", $headers ) . "\r\n\r\n";
		$sock = $this->_get_auth_sock( );
		if ( ! $sock ) return;
		$response = $this->_txrx( $sock, $request );
		return $this->parse_response($response);
	}

	function token_is_valid() {
		$info = $this->get_token_info();

		if ( $info['code'] == 200 )
			return true;

		return false;
	}

	function show_blogs($iter = 0) {
		if ( empty($this->blogs) ) {
			$headers = array(
				"GET /feeds/default/blogs HTTP/1.0",
				"Host: www.blogger.com",
				"Authorization: AuthSub token=\"$this->token\""
			);
			$request = join( "\r\n", $headers ) . "\r\n\r\n";
			$sock = $this->_get_blogger_sock( );
			if ( ! $sock ) return;
			$response = $this->_txrx( $sock, $request );

			// Quick and dirty XML mining.
			list( $headers, $xml ) = explode( "\r\n\r\n", $response );
			$p = xml_parser_create();
			xml_parse_into_struct($p, $xml, $vals, $index);
			xml_parser_free($p);

			$this->title = $vals[$index['TITLE'][0]]['value'];

			// Give it a few retries... this step often flakes out the first time.
			if ( empty( $index['ENTRY'] ) ) {
				if ( $iter < 3 ) {
					return $this->show_blogs($iter + 1);
				} else {
					$this->uh_oh(
						__('Trouble signing in'),
						__('We were not able to gain access to your account. Try starting over.'),
						''
					);
					return false;
				}
			}

			foreach ( $index['ENTRY'] as $i ) {
				$blog = array();
				while ( ( $tag = $vals[$i] ) && ! ( $tag['tag'] == 'ENTRY' && $tag['type'] == 'close' ) ) {
					if ( $tag['tag'] == 'TITLE' ) {
						$blog['title'] = $tag['value'];
					} elseif ( $tag['tag'] == 'SUMMARY' ) {
						$blog['summary'] == $tag['value'];
					} elseif ( $tag['tag'] == 'LINK' ) {
						if ( $tag['attributes']['REL'] == 'alternate' && $tag['attributes']['TYPE'] == 'text/html' ) {
							$parts = parse_url( $tag['attributes']['HREF'] );
							$blog['host'] = $parts['host'];
						} elseif ( $tag['attributes']['REL'] == 'edit' )
							$blog['gateway'] = $tag['attributes']['HREF'];
					}
					++$i;
				}
				if ( ! empty ( $blog ) ) {
					$blog['total_posts'] = $this->get_total_results('posts', $blog['host']);
					$blog['total_comments'] = $this->get_total_results('comments', $blog['host']);
					$blog['mode'] = 'init';
					$this->blogs[] = $blog;
				}
			}

			if ( empty( $this->blogs ) ) {
				$this->uh_oh(
					__('No blogs found'),
					__('We were able to log in but there were no blogs. Try a different account next time.'),
					''
				);
				return false;
			}
		}
//echo '<pre>'.print_r($this,1).'</pre>';
		$start    = js_escape( __('Import') );
		$continue = js_escape( __('Continue') );
		$stop     = js_escape( __('Importing...') );
		$authors  = js_escape( __('Set Authors') );
		$loadauth = js_escape( __('Preparing author mapping form...') );
		$authhead = js_escape( __('Final Step: Author Mapping') );
		$nothing  = js_escape( __('Nothing was imported. Had you already imported this blog?') );
		$title    = __('Blogger Blogs');
		$name     = __('Blog Name');
		$url      = __('Blog URL');
		$action   = __('The Magic Button');
		$posts    = __('Posts');
		$comments = __('Comments');
		$noscript = __('This feature requires Javascript but it seems to be disabled. Please enable Javascript and then reload this page. Don\'t worry, you can turn it back off when you\'re done.');

		$interval = STATUS_INTERVAL * 1000;

		foreach ( $this->blogs as $i => $blog ) {
			if ( $blog['mode'] == 'init' )
				$value = $start;
			elseif ( $blog['mode'] == 'posts' || $blog['mode'] == 'comments' )
				$value = $continue;
			else
				$value = $authors;
			$blogtitle = js_escape( $blog['title'] );
			$pdone = isset($blog['posts_done']) ? (int) $blog['posts_done'] : 0;
			$cdone = isset($blog['comments_done']) ? (int) $blog['comments_done'] : 0;
			$init .= "blogs[$i]=new blog($i,'$blogtitle','{$blog['mode']}'," . $this->get_js_status($i) . ');';
			$pstat = "<div class='ind' id='pind$i'>&nbsp;</div><div id='pstat$i' class='stat'>$pdone/{$blog['total_posts']}</div>";
			$cstat = "<div class='ind' id='cind$i'>&nbsp;</div><div id='cstat$i' class='stat'>$cdone/{$blog['total_comments']}</div>";
			$rows .= "<tr id='blog$i'><td class='blogtitle'>$blogtitle</td><td class='bloghost'>{$blog['host']}</td><td class='bar'>$pstat</td><td class='bar'>$cstat</td><td class='submit'><input type='submit' class='button' id='submit$i' value='$value' /><input type='hidden' name='blog' value='$i' /></td></tr>\n";
		}

		echo "<div class='wrap'><h2>$title</h2><noscript>$noscript</noscript><table cellpadding='5px'><thead><td>$name</td><td>$url</td><td>$posts</td><td>$comments</td><td>$action</td></thead>\n$rows</table></form></div>";
		echo "
		<script type='text/javascript'>
			var strings = {cont:'$continue',stop:'$stop',stopping:'$stopping',authors:'$authors',nothing:'$nothing'};
			var blogs = {};
			function blog(i, title, mode, status){
				this.blog   = i;
				this.mode   = mode;
				this.title  = title;
				this.status = status;
				this.button = document.getElementById('submit'+this.blog);
			};
			blog.prototype = {
				start: function() {
					this.cont = true;
					this.kick();
					this.check();
				},
				kick: function() {
					++this.kicks;
					var i = this.blog;
					jQuery.post('admin.php?import=blogger&noheader=true',{blog:this.blog},function(text,result){blogs[i].kickd(text,result)});
				},
				check: function() {
					++this.checks;
					var i = this.blog;
					jQuery.post('admin.php?import=blogger&noheader=true&status=true',{blog:this.blog},function(text,result){blogs[i].checkd(text,result)});
				},
				kickd: function(text, result) {
					if ( result == 'error' ) {
						// TODO: exception handling
						if ( this.cont )
							setTimeout('blogs['+this.blog+'].kick()', 1000);
					} else {
						if ( text == 'done' ) {
							this.stop();
							this.done();
						} else if ( text == 'nothing' ) {
							this.stop();
							this.nothing();
						} else if ( text == 'continue' ) {
							this.kick();
						} else if ( this.mode = 'stopped' )
							jQuery(this.button).attr('value', strings.cont);
					}
					--this.kicks;
				},
				checkd: function(text, result) {
					if ( result == 'error' ) {
						// TODO: exception handling
					} else {
						eval('this.status='+text);
						jQuery('#pstat'+this.blog).empty().append(this.status.p1+'/'+this.status.p2);
						jQuery('#cstat'+this.blog).empty().append(this.status.c1+'/'+this.status.c2);
						this.update();
						if ( this.cont || this.kicks > 0 )
							setTimeout('blogs['+this.blog+'].check()', $interval);
					}
					--this.checks;
				},
				update: function() {
					jQuery('#pind'+this.blog).width(((this.status.p1>0&&this.status.p2>0)?(this.status.p1/this.status.p2*jQuery('#pind'+this.blog).parent().width()):1)+'px');
					jQuery('#cind'+this.blog).width(((this.status.c1>0&&this.status.c2>0)?(this.status.c1/this.status.c2*jQuery('#cind'+this.blog).parent().width()):1)+'px');
				},
				stop: function() {
					this.cont = false;
				},
				done: function() {
					this.mode = 'authors';
					jQuery(this.button).attr('value', strings.authors);
				},
				nothing: function() {
					this.mode = 'nothing';
					jQuery(this.button).remove();
					alert(strings.nothing);
				},
				getauthors: function() {
					if ( jQuery('div.wrap').length > 1 )
						jQuery('div.wrap').gt(0).remove();
					jQuery('div.wrap').empty().append('<h2>$authhead</h2><h3>' + this.title + '</h3>');
					jQuery('div.wrap').append('<p id=\"auth\">$loadauth</p>');
					jQuery('p#auth').load('index.php?import=blogger&noheader=true&authors=1',{blog:this.blog});
				},
				init: function() {
					this.update();
					var i = this.blog;
					jQuery(this.button).bind('click', function(){return blogs[i].click();});
					this.kicks = 0;
					this.checks = 0;
				},
				click: function() {
					if ( this.mode == 'init' || this.mode == 'stopped' || this.mode == 'posts' || this.mode == 'comments' ) {
						this.mode = 'started';
						this.start();
						jQuery(this.button).attr('value', strings.stop);
					} else if ( this.mode == 'started' ) {
						return false; // let it run...
						this.mode = 'stopped';
						this.stop();
						if ( this.checks > 0 || this.kicks > 0 ) {
							this.mode = 'stopping';
							jQuery(this.button).attr('value', strings.stopping);
						} else {
							jQuery(this.button).attr('value', strings.cont);
						}
					} else if ( this.mode == 'authors' ) {
						document.location = 'index.php?import=blogger&authors=1&blog='+this.blog;
						//this.mode = 'authors2';
						//this.getauthors();
					}
					return false;
				}
			};
			$init
			jQuery.each(blogs, function(i, me){me.init();});
		</script>\n";
	}

	// Handy function for stopping the script after a number of seconds.
	function have_time() {
		global $importer_started;
		if ( time() - $importer_started > MAX_EXECUTION_TIME )
			die('continue');
		return true;
	}

	function get_total_results($type, $host) {
		$headers = array(
			"GET /feeds/$type/default?max-results=1&start-index=2 HTTP/1.0",
			"Host: $host",
			"Authorization: AuthSub token=\"$this->token\""
		);
		$request = join( "\r\n", $headers ) . "\r\n\r\n";
		$sock = $this->_get_blogger_sock( $host );
		if ( ! $sock ) return;
		$response = $this->_txrx( $sock, $request );
		$response = $this->parse_response( $response );
		$parser = xml_parser_create();
		xml_parse_into_struct($parser, $response['body'], $struct, $index);
		xml_parser_free($parser);
		$total_results = $struct[$index['OPENSEARCH:TOTALRESULTS'][0]]['value'];
		return (int) $total_results;
	}

	function import_blog($blogID) {
		global $importing_blog;
		$importing_blog = $blogID;

		if ( isset($_GET['authors']) )
			return print($this->get_author_form());

		header('Content-Type: text/plain');

		if ( isset($_GET['status']) )
			die($this->get_js_status());

		if ( isset($_GET['saveauthors']) )
			die($this->save_authors());

		$blog = $this->blogs[$blogID];
		$total_results = $this->get_total_results('posts', $blog['host']);
		$this->blogs[$importing_blog]['total_posts'] = $total_results;

		$start_index = $total_results - MAX_RESULTS + 1;

		if ( isset( $this->blogs[$importing_blog]['posts_start_index'] ) )
			$start_index = (int) $this->blogs[$importing_blog]['posts_start_index'];
		elseif ( $total_results > MAX_RESULTS )
			$start_index = $total_results - MAX_RESULTS + 1;
		else
			$start_index = 1;

		// This will be positive until we have finished importing posts
		if ( $start_index > 0 ) {
			// Grab all the posts
			$this->blogs[$importing_blog]['mode'] = 'posts';
			$query = "start-index=$start_index&max-results=" . MAX_RESULTS;
			do {
				$index = $struct = $entries = array();
				$headers = array(
					"GET /feeds/posts/default?$query HTTP/1.0",
					"Host: {$blog['host']}",
					"Authorization: AuthSub token=\"$this->token\""
				);
				$request = join( "\r\n", $headers ) . "\r\n\r\n";
				$sock = $this->_get_blogger_sock( $blog['host'] );
				if ( ! $sock ) return; // TODO: Error handling
				$response = $this->_txrx( $sock, $request );

				$response = $this->parse_response( $response );

				// Extract the entries and send for insertion
				preg_match_all( '/<entry[^>]*>.*?<\/entry>/s', $response['body'], $matches );
				if ( count( $matches[0] ) ) {
					$entries = array_reverse($matches[0]);
					foreach ( $entries as $entry ) {
						$entry = "<feed>$entry</feed>";
						$AtomParser = new AtomParser();
						$AtomParser->parse( $entry );
						$result = $this->import_post($AtomParser->entry);
						if ( is_wp_error( $result ) )
							return $result;
						unset($AtomParser);
					}
				} else break;

				// Get the 'previous' query string which we'll use on the next iteration
				$query = '';
				$links = preg_match_all('/<link([^>]*)>/', $response['body'], $matches);
				if ( count( $matches[1] ) )
					foreach ( $matches[1] as $match )
						if ( preg_match('/rel=.previous./', $match) )
							$query = html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match) );

				if ( $query ) {
					parse_str($query, $q);
					$this->blogs[$importing_blog]['posts_start_index'] = (int) $q['start-index'];
				} else
					$this->blogs[$importing_blog]['posts_start_index'] = 0;
				$this->save_vars();
			} while ( !empty( $query ) && $this->have_time() );
		}

		$total_results = $this->get_total_results( 'comments', $blog['host'] );
		$this->blogs[$importing_blog]['total_comments'] = $total_results;

		if ( isset( $this->blogs[$importing_blog]['comments_start_index'] ) )
			$start_index = (int) $this->blogs[$importing_blog]['comments_start_index'];
		elseif ( $total_results > MAX_RESULTS )
			$start_index = $total_results - MAX_RESULTS + 1;
		else
			$start_index = 1;

		if ( $start_index > 0 ) {
			// Grab all the comments
			$this->blogs[$importing_blog]['mode'] = 'comments';
			$query = "start-index=$start_index&max-results=" . MAX_RESULTS;
			do {
				$index = $struct = $entries = array();
				$headers = array(
					"GET /feeds/comments/default?$query HTTP/1.0",
					"Host: {$blog['host']}",
					"Authorization: AuthSub token=\"$this->token\""
				);
				$request = join( "\r\n", $headers ) . "\r\n\r\n";
				$sock = $this->_get_blogger_sock( $blog['host'] );
				if ( ! $sock ) return; // TODO: Error handling
				$response = $this->_txrx( $sock, $request );

				$response = $this->parse_response( $response );

				// Extract the comments and send for insertion
				preg_match_all( '/<entry[^>]*>.*?<\/entry>/s', $response['body'], $matches );
				if ( count( $matches[0] ) ) {
					$entries = array_reverse( $matches[0] );
					foreach ( $entries as $entry ) {
						$entry = "<feed>$entry</feed>";
						$AtomParser = new AtomParser();
						$AtomParser->parse( $entry );
						$this->import_comment($AtomParser->entry);
						unset($AtomParser);
					}
				}

				// Get the 'previous' query string which we'll use on the next iteration
				$query = '';
				$links = preg_match_all('/<link([^>]*)>/', $response['body'], $matches);
				if ( count( $matches[1] ) )
					foreach ( $matches[1] as $match )
						if ( preg_match('/rel=.previous./', $match) )
							$query = html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match) );

				parse_str($query, $q);

				$this->blogs[$importing_blog]['comments_start_index'] = (int) $q['start-index'];
				$this->save_vars();
			} while ( !empty( $query ) && $this->have_time() );
		}
		$this->blogs[$importing_blog]['mode'] = 'authors';
		$this->save_vars();
		if ( !$this->blogs[$importing_blog]['posts_done'] && !$this->blogs[$importing_blog]['comments_done'] )
			die('nothing');
		do_action('import_done', 'blogger');
		die('done');
	}

	function convert_date( $date ) {
	    preg_match('#([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.[0-9]+)?(Z|[\+|\-][0-9]{2,4}){0,1}#', $date, $date_bits);
	    $offset = iso8601_timezone_to_offset( $date_bits[7] );
		$timestamp = gmmktime($date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1]);
		$timestamp -= $offset; // Convert from Blogger local time to GMT
		$timestamp += get_option('gmt_offset') * 3600; // Convert from GMT to WP local time
		return gmdate('Y-m-d H:i:s', $timestamp);
	}

	function no_apos( $string ) {
		return str_replace( '&apos;', "'", $string);
	}

	function min_whitespace( $string ) {
		return preg_replace( '|\s+|', ' ', $string );
	}

	function import_post( $entry ) {
		global $wpdb, $importing_blog;

		// The old permalink is all Blogger gives us to link comments to their posts.
		if ( isset( $entry->draft ) )
			$rel = 'self';
		else
			$rel = 'alternate';
		foreach ( $entry->links as $link ) {
			if ( $link['rel'] == $rel ) {
				$parts = parse_url( $link['href'] );
				$entry->old_permalink = $parts['path'];
				break;
			}
		}

		$post_date    = $this->convert_date( $entry->published );
		$post_content = trim( addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) ) );
		$post_title   = trim( addslashes( $this->no_apos( $this->min_whitespace( $entry->title ) ) ) );
		$post_status  = isset( $entry->draft ) ? 'draft' : 'publish';

		// Clean up content
		$post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
		$post_content = str_replace('<br>', '<br />', $post_content);
		$post_content = str_replace('<hr>', '<hr />', $post_content);

		// Checks for duplicates
		if ( isset( $this->blogs[$importing_blog]['posts'][$entry->old_permalink] ) ) {
			++$this->blogs[$importing_blog]['posts_skipped'];
		} elseif ( $post_id = post_exists( $post_title, $post_content, $post_date ) ) {
			$this->blogs[$importing_blog]['posts'][$entry->old_permalink] = $post_id;
			++$this->blogs[$importing_blog]['posts_skipped'];
		} else {
			$post = compact('post_date', 'post_content', 'post_title', 'post_status');

			$post_id = wp_insert_post($post);
			if ( is_wp_error( $post_id ) )
				return $post_id;

			wp_create_categories( array_map( 'addslashes', $entry->categories ), $post_id );

			$author = $this->no_apos( strip_tags( $entry->author ) );

			add_post_meta( $post_id, 'blogger_blog', $this->blogs[$importing_blog]['host'], true );
			add_post_meta( $post_id, 'blogger_author', $author, true );
			add_post_meta( $post_id, 'blogger_permalink', $entry->old_permalink, true );

			$this->blogs[$importing_blog]['posts'][$entry->old_permalink] = $post_id;
			++$this->blogs[$importing_blog]['posts_done'];
		}
		$this->save_vars();
		return;
	}

	function import_comment( $entry ) {
		global $importing_blog;

		// Drop the #fragment and we have the comment's old post permalink.
		foreach ( $entry->links as $link ) {
			if ( $link['rel'] == 'alternate' ) {
				$parts = parse_url( $link['href'] );
				$entry->old_permalink = $parts['fragment'];
				$entry->old_post_permalink = $parts['path'];
				break;
			}
		}

		$comment_post_ID = (int) $this->blogs[$importing_blog]['posts'][$entry->old_post_permalink];
		preg_match('#<name>(.+?)</name>.*(?:\<uri>(.+?)</uri>)?#', $entry->author, $matches);
		$comment_author  = addslashes( $this->no_apos( strip_tags( (string) $matches[1] ) ) );
		$comment_author_url = addslashes( $this->no_apos( strip_tags( (string) $matches[2] ) ) );
		$comment_date    = $this->convert_date( $entry->updated );
		$comment_content = addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) );

		// Clean up content
		$comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);
		$comment_content = str_replace('<br>', '<br />', $comment_content);
		$comment_content = str_replace('<hr>', '<hr />', $comment_content);

		// Checks for duplicates
		if (
			isset( $this->blogs[$importing_blog]['comments'][$entry->old_permalink] ) ||
			comment_exists( $comment_author, $comment_date )
		) {
			++$this->blogs[$importing_blog]['comments_skipped'];
		} else {
			$comment = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_date', 'comment_content');

			$comment_id = wp_insert_comment($comment);

			$this->blogs[$importing_blog]['comments'][$entry->old_permalink] = $comment_id;

			++$this->blogs[$importing_blog]['comments_done'];
		}
		$this->save_vars();
	}

	function get_js_status($blog = false) {
		global $importing_blog;
		if ( $blog === false )
			$blog = $this->blogs[$importing_blog];
		else
			$blog = $this->blogs[$blog];
		$p1 = isset( $blog['posts_done'] ) ? (int) $blog['posts_done'] : 0;
		$p2 = isset( $blog['total_posts'] ) ? (int) $blog['total_posts'] : 0;
		$c1 = isset( $blog['comments_done'] ) ? (int) $blog['comments_done'] : 0;
		$c2 = isset( $blog['total_comments'] ) ? (int) $blog['total_comments'] : 0;
		return "{p1:$p1,p2:$p2,c1:$c1,c2:$c2}";
	}

	function get_author_form($blog = false) {
		global $importing_blog, $wpdb, $current_user;
		if ( $blog === false )
			$blog = & $this->blogs[$importing_blog];
		else
			$blog = & $this->blogs[$blog];

		if ( !isset( $blog['authors'] ) ) {
			$post_ids = array_values($blog['posts']);
			$authors = (array) $wpdb->get_col("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_author' AND post_id IN (" . join( ',', $post_ids ) . ")");
			$blog['authors'] = array_map(null, $authors, array_fill(0, count($authors), $current_user->ID));
			$this->save_vars();
		}

		$directions = __('All posts were imported with the current user as author. Use this form to move each Blogger user\'s posts to a different WordPress user. You may <a href="users.php">add users</a> and then return to this page and complete the user mapping. This form may be used as many times as you like until you activate the "Restart" function below.');
		$heading = __('Author mapping');
		$blogtitle = "{$blog['title']} ({$blog['host']})";
		$mapthis = __('Blogger username');
		$tothis = __('WordPress login');
		$submit = js_escape( __('Save Changes') );

		foreach ( $blog['authors'] as $i => $author )
			$rows .= "<tr><td><label for='authors[$i]'>{$author[0]}</label></td><td><select name='authors[$i]' id='authors[$i]'>" . $this->get_user_options($author[1]) . "</select></td></tr>";

		return "<div class='wrap'><h2>$heading</h2><h3>$blogtitle</h3><p>$directions</p><form action='index.php?import=blogger&noheader=true&saveauthors=1' method='post'><input type='hidden' name='blog' value='$importing_blog' /><table cellpadding='5'><thead><td>$mapthis</td><td>$tothis</td></thead>$rows<tr><td></td><td class='submit'><input type='submit' class='button authorsubmit' value='$submit' /></td></tr></table></form></div>";
	}

	function get_user_options($current) {
		global $wpdb, $importer_users;
		if ( ! isset( $importer_users ) )
			$importer_users = (array) get_users_of_blog();

		foreach ( $importer_users as $user ) {
			$sel = ( $user->user_id == $current ) ? " selected='selected'" : '';
			$options .= "<option value='$user->user_id'$sel>$user->display_name</option>";
		}

		return $options;
	}

	function save_authors() {
		global $importing_blog, $wpdb;
		$authors = (array) $_POST['authors'];

		$host = $this->blogs[$importing_blog]['host'];

		// Get an array of posts => authors
		$post_ids = (array) $wpdb->get_col( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = %s", $host) );
		$post_ids = join( ',', $post_ids );
		$results = (array) $wpdb->get_results("SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_author' AND post_id IN ($post_ids)");
		foreach ( $results as $row )
			$authors_posts[$row->post_id] = $row->meta_value;

		foreach ( $authors as $author => $user_id ) {
			$user_id = (int) $user_id;

			// Skip authors that haven't been changed
			if ( $user_id == $this->blogs[$importing_blog]['authors'][$author][1] )
				continue;

			// Get a list of the selected author's posts
			$post_ids = (array) array_keys( $authors_posts, $this->blogs[$importing_blog]['authors'][$author][0] );
			$post_ids = join( ',', $post_ids);

			$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE id IN ($post_ids)", $user_id) );
			$this->blogs[$importing_blog]['authors'][$author][1] = $user_id;
		}
		$this->save_vars();

		wp_redirect('edit.php');
	}

	function _get_auth_sock() {
		// Connect to https://www.google.com
		if ( !$sock = @ fsockopen('ssl://www.google.com', 443, $errno, $errstr) ) {
			$this->uh_oh(
				__('Could not connect to https://www.google.com'),
				__('There was a problem opening a secure connection to Google. This is what went wrong:'),
				"$errstr ($errno)"
			);
			return false;
		}
		return $sock;
	}

	function _get_blogger_sock($host = 'www2.blogger.com') {
		if ( !$sock = @ fsockopen($host, 80, $errno, $errstr) ) {
			$this->uh_oh(
				sprintf( __('Could not connect to %s'), $host ),
				__('There was a problem opening a connection to Blogger. This is what went wrong:'),
				"$errstr ($errno)"
			);
			return false;
		}
		return $sock;
	}

	function _txrx( $sock, $request ) {
		fwrite( $sock, $request );
		while ( ! feof( $sock ) )
			$response .= @ fread ( $sock, 8192 );
		fclose( $sock );
		return $response;
	}

	function revoke($token) {
		$headers = array(
			"GET /accounts/AuthSubRevokeToken HTTP/1.0",
			"Authorization: AuthSub token=\"$token\""
		);
		$request = join( "\r\n", $headers ) . "\r\n\r\n";
		$sock = $this->_get_auth_sock( );
		if ( ! $sock ) return false;
		$this->_txrx( $sock, $request );
	}

	function restart() {
		global $wpdb;
		$options = get_option( 'blogger_importer' );

		if ( isset( $options['token'] ) )
			$this->revoke( $options['token'] );

		delete_option('blogger_importer');
		$wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_key = 'blogger_author'");
		wp_redirect('?import=blogger');
	}

	// Returns associative array of code, header, cookies, body. Based on code from php.net.
	function parse_response($this_response) {
		// Split response into header and body sections
		list($response_headers, $response_body) = explode("\r\n\r\n", $this_response, 2);
		$response_header_lines = explode("\r\n", $response_headers);

		// First line of headers is the HTTP response code
		$http_response_line = array_shift($response_header_lines);
		if(preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; }

		// put the rest of the headers in an array
		$response_header_array = array();
		foreach($response_header_lines as $header_line) {
			list($header,$value) = explode(': ', $header_line, 2);
			$response_header_array[$header] .= $value."\n";
		}

		$cookie_array = array();
		$cookies = explode("\n", $response_header_array["Set-Cookie"]);
		foreach($cookies as $this_cookie) { array_push($cookie_array, "Cookie: ".$this_cookie); }

		return array("code" => $response_code, "header" => $response_header_array, "cookies" => $cookie_array, "body" => $response_body);
	}

	// Step 9: Congratulate the user
	function congrats() {
		$blog = (int) $_GET['blog'];
		echo '<h1>'.__('Congratulations!').'</h1><p>'.__('Now that you have imported your Blogger blog into WordPress, what are you going to do? Here are some suggestions:').'</p><ul><li>'.__('That was hard work! Take a break.').'</li>';
		if ( count($this->import['blogs']) > 1 )
			echo '<li>'.__('In case you haven\'t done it already, you can import the posts from your other blogs:'). $this->show_blogs() . '</li>';
		if ( $n = count($this->import['blogs'][$blog]['newusers']) )
			echo '<li>'.sprintf(__('Go to <a href="%s" target="%s">Authors &amp; Users</a>, where you can modify the new user(s) or delete them. If you want to make all of the imported posts yours, you will be given that option when you delete the new authors.'), 'users.php', '_parent').'</li>';
		echo '<li>'.__('For security, click the link below to reset this importer.').'</li>';
		echo '</ul>';
	}

	// Figures out what to do, then does it.
	function start() {
		if ( isset($_POST['restart']) )
			$this->restart();

		$options = get_option('blogger_importer');

		if ( is_array($options) )
			foreach ( $options as $key => $value )
				$this->$key = $value;

		if ( isset( $_REQUEST['blog'] ) ) {
			$blog = is_array($_REQUEST['blog']) ? array_shift( $keys = array_keys( $_REQUEST['blog'] ) ) : $_REQUEST['blog'];
			$blog = (int) $blog;
			$result = $this->import_blog( $blog );
			if ( is_wp_error( $result ) )
				echo $result->get_error_message();
		} elseif ( isset($_GET['token']) )
			$this->auth();
		elseif ( $this->token && $this->token_is_valid() )
			$this->show_blogs();
		else
			$this->greet();

		$saved = $this->save_vars();

		if ( $saved && !isset($_GET['noheader']) ) {
			$restart = __('Restart');
			$message = __('We have saved some information about your Blogger account in your WordPress database. Clearing this information will allow you to start over. Restarting will not affect any posts you have already imported. If you attempt to re-import a blog, duplicate posts and comments will be skipped.');
			$submit = __('Clear account information');
			echo "<div class='wrap'><h2>$restart</h2><p>$message</p><form method='post' action='?import=blogger&noheader=true'><p class='submit' style='text-align:left;'><input type='submit' class='button' value='$submit' name='restart' /></p></form></div>";
		}
	}

	function save_vars() {
		$vars = get_object_vars($this);
		update_option( 'blogger_importer', $vars );

		return !empty($vars);
	}

	function admin_head() {
?>
<style type="text/css">
td { text-align: center; line-height: 2em;}
thead td { font-weight: bold; }
.bar {
	width: 200px;
	text-align: left;
	line-height: 2em;
	padding: 0px;
}
.ind {
	position: absolute;
	background-color: #83B4D8;
	width: 1px;
	z-index: 9;
}
.stat {
	z-index: 10;
	position: relative;
	text-align: center;
}
</style>
<?php
	}

	function Blogger_Import() {
		global $importer_started;
		$importer_started = time();
		if ( isset( $_GET['import'] ) && $_GET['import'] == 'blogger' ) {
			wp_enqueue_script('jquery');
			add_action('admin_head', array(&$this, 'admin_head'));
		}
	}
}

$blogger_import = new Blogger_Import();

register_importer('blogger', __('Blogger'), __('Import posts, comments, and users from a Blogger blog.'), array ($blogger_import, 'start'));

class AtomEntry {
	var $links = array();
	var $categories = array();
}

class AtomParser {

	var $ATOM_CONTENT_ELEMENTS = array('content','summary','title','subtitle','rights');
	var $ATOM_SIMPLE_ELEMENTS = array('id','updated','published','draft','author');

	var $depth = 0;
	var $indent = 2;
	var $in_content;
	var $ns_contexts = array();
	var $ns_decls = array();
	var $is_xhtml = false;
	var $skipped_div = false;

	var $entry;

	function AtomParser() {

		$this->entry = new AtomEntry();
		$this->map_attrs_func = create_function('$k,$v', 'return "$k=\"$v\"";');
		$this->map_xmlns_func = create_function('$p,$n', '$xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";');
	}

	function parse($xml) {

		global $app_logging;
		array_unshift($this->ns_contexts, array());

		$parser = xml_parser_create_ns();
		xml_set_object($parser, $this);
		xml_set_element_handler($parser, "start_element", "end_element");
		xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
		xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,0);
		xml_set_character_data_handler($parser, "cdata");
		xml_set_default_handler($parser, "_default");
		xml_set_start_namespace_decl_handler($parser, "start_ns");
		xml_set_end_namespace_decl_handler($parser, "end_ns");

		$contents = "";

		xml_parse($parser, $xml);

		xml_parser_free($parser);

		return true;
	}

	function start_element($parser, $name, $attrs) {

		$tag = array_pop(split(":", $name));

		array_unshift($this->ns_contexts, $this->ns_decls);

		$this->depth++;

		if(!empty($this->in_content)) {
			$attrs_prefix = array();

			// resolve prefixes for attributes
			foreach($attrs as $key => $value) {
				$attrs_prefix[$this->ns_to_prefix($key)] = $this->xml_escape($value);
			}
			$attrs_str = join(' ', array_map($this->map_attrs_func, array_keys($attrs_prefix), array_values($attrs_prefix)));
			if(strlen($attrs_str) > 0) {
				$attrs_str = " " . $attrs_str;
			}

			$xmlns_str = join(' ', array_map($this->map_xmlns_func, array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0])));
			if(strlen($xmlns_str) > 0) {
				$xmlns_str = " " . $xmlns_str;
			}

			// handle self-closing tags (case: a new child found right-away, no text node)
			if(count($this->in_content) == 2) {
				array_push($this->in_content, ">");
			}

			array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}");
		} else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) {
			$this->in_content = array();
			$this->is_xhtml = $attrs['type'] == 'xhtml';
			array_push($this->in_content, array($tag,$this->depth));
		} else if($tag == 'link') {
			array_push($this->entry->links, $attrs);
		} else if($tag == 'category') {
			array_push($this->entry->categories, $attrs['term']);
		}

		$this->ns_decls = array();
	}

	function end_element($parser, $name) {

		$tag = array_pop(split(":", $name));

		if(!empty($this->in_content)) {
			if($this->in_content[0][0] == $tag &&
			$this->in_content[0][1] == $this->depth) {
				array_shift($this->in_content);
				if($this->is_xhtml) {
					$this->in_content = array_slice($this->in_content, 2, count($this->in_content)-3);
				}
				$this->entry->$tag = join('',$this->in_content);
				$this->in_content = array();
			} else {
				$endtag = $this->ns_to_prefix($name);
				if (strpos($this->in_content[count($this->in_content)-1], '<' . $endtag) !== false) {
					array_push($this->in_content, "/>");
				} else {
					array_push($this->in_content, "</$endtag>");
				}
			}
		}

		array_shift($this->ns_contexts);

		#print str_repeat(" ", $this->depth * $this->indent) . "end_element('$name')" ."\n";

		$this->depth--;
	}

	function start_ns($parser, $prefix, $uri) {
		#print str_repeat(" ", $this->depth * $this->indent) . "starting: " . $prefix . ":" . $uri . "\n";
		array_push($this->ns_decls, array($prefix,$uri));
	}

	function end_ns($parser, $prefix) {
		#print str_repeat(" ", $this->depth * $this->indent) . "ending: #" . $prefix . "#\n";
	}

	function cdata($parser, $data) {
		#print str_repeat(" ", $this->depth * $this->indent) . "data: #" . $data . "#\n";
		if(!empty($this->in_content)) {
			// handle self-closing tags (case: text node found, need to close element started)
			if (strpos($this->in_content[count($this->in_content)-1], '<') !== false) {
				array_push($this->in_content, ">");
			}
			array_push($this->in_content, $this->xml_escape($data));
		}
	}

	function _default($parser, $data) {
		# when does this gets called?
	}


	function ns_to_prefix($qname) {
		$components = split(":", $qname);
		$name = array_pop($components);

		if(!empty($components)) {
			$ns = join(":",$components);
			foreach($this->ns_contexts as $context) {
				foreach($context as $mapping) {
					if($mapping[1] == $ns && strlen($mapping[0]) > 0) {
						return "$mapping[0]:$name";
					}
				}
			}
		}
		return $name;
	}

	function xml_escape($string)
	{
			 return str_replace(array('&','"',"'",'<','>'),
				array('&amp;','&quot;','&apos;','&lt;','&gt;'),
				$string );
	}
}

?>
                                                                                                                                                                                                                                                                                                                                                                                                                             blog/wp-admin/import/blogware.php                                                                   0000755 0023433 0004734 00000014170 11060470701 016714  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

/* By Shayne Sweeney - http://www.theshayne.com/ */

class BW_Import {

	var $file;

	function header() {
		echo '<div class="wrap">';
		echo '<h2>'.__('Import Blogware').'</h2>';
	}

	function footer() {
		echo '</div>';
	}

	function unhtmlentities($string) { // From php.net for < 4.3 compat
		$trans_tbl = get_html_translation_table(HTML_ENTITIES);
		$trans_tbl = array_flip($trans_tbl);
		return strtr($string, $trans_tbl);
	}

	function greet() {
		echo '<div class="narrow">';
		echo '<p>'.__('Howdy! This importer allows you to extract posts from Blogware XML export file into your blog.  Pick a Blogware file to upload and click Import.').'</p>';
		wp_import_upload_form("admin.php?import=blogware&amp;step=1");
		echo '</div>';
	}

	function import_posts() {
		global $wpdb, $current_user;

		set_magic_quotes_runtime(0);
		$importdata = file($this->file); // Read the file into an array
		$importdata = implode('', $importdata); // squish it
		$importdata = str_replace(array ("\r\n", "\r"), "\n", $importdata);

		preg_match_all('|(<item[^>]+>(.*?)</item>)|is', $importdata, $posts);
		$posts = $posts[1];
		unset($importdata);
		echo '<ol>';
		foreach ($posts as $post) {
			flush();
			preg_match('|<item type=\"(.*?)\">|is', $post, $post_type);
			$post_type = $post_type[1];
			if($post_type == "photo") {
				preg_match('|<photoFilename>(.*?)</photoFilename>|is', $post, $post_title);
			} else {
				preg_match('|<title>(.*?)</title>|is', $post, $post_title);
			}
			$post_title = $wpdb->escape(trim($post_title[1]));

			preg_match('|<pubDate>(.*?)</pubDate>|is', $post, $post_date);
			$post_date = strtotime($post_date[1]);
			$post_date = gmdate('Y-m-d H:i:s', $post_date);

			preg_match_all('|<category>(.*?)</category>|is', $post, $categories);
			$categories = $categories[1];

			$cat_index = 0;
			foreach ($categories as $category) {
				$categories[$cat_index] = $wpdb->escape($this->unhtmlentities($category));
				$cat_index++;
			}

			if(strcasecmp($post_type, "photo") === 0) {
				preg_match('|<sizedPhotoUrl>(.*?)</sizedPhotoUrl>|is', $post, $post_content);
				$post_content = '<img src="'.trim($post_content[1]).'" />';
				$post_content = $this->unhtmlentities($post_content);
			} else {
				preg_match('|<body>(.*?)</body>|is', $post, $post_content);
				$post_content = str_replace(array ('<![CDATA[', ']]>'), '', trim($post_content[1]));
				$post_content = $this->unhtmlentities($post_content);
			}

			// Clean up content
			$post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
			$post_content = str_replace('<br>', '<br />', $post_content);
			$post_content = str_replace('<hr>', '<hr />', $post_content);
			$post_content = $wpdb->escape($post_content);

			$post_author = $current_user->ID;
			preg_match('|<postStatus>(.*?)</postStatus>|is', $post, $post_status);
			$post_status = trim($post_status[1]);

			echo '<li>';
			if ($post_id = post_exists($post_title, $post_content, $post_date)) {
				printf(__('Post <em>%s</em> already exists.'), stripslashes($post_title));
			} else {
				printf(__('Importing post <em>%s</em>...'), stripslashes($post_title));
				$postdata = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status');
				$post_id = wp_insert_post($postdata);
				if ( is_wp_error( $post_id ) ) {
					return $post_id;
				}
				if (!$post_id) {
					_e("Couldn't get post ID");
					echo '</li>';
					break;
				}
				if(0 != count($categories))
					wp_create_categories($categories, $post_id);
			}

			preg_match_all('|<comment>(.*?)</comment>|is', $post, $comments);
			$comments = $comments[1];

			if ( $comments ) {
				$comment_post_ID = (int) $post_id;
				$num_comments = 0;
				foreach ($comments as $comment) {
					preg_match('|<body>(.*?)</body>|is', $comment, $comment_content);
					$comment_content = str_replace(array ('<![CDATA[', ']]>'), '', trim($comment_content[1]));
					$comment_content = $this->unhtmlentities($comment_content);

					// Clean up content
					$comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);
					$comment_content = str_replace('<br>', '<br />', $comment_content);
					$comment_content = str_replace('<hr>', '<hr />', $comment_content);
					$comment_content = $wpdb->escape($comment_content);

					preg_match('|<pubDate>(.*?)</pubDate>|is', $comment, $comment_date);
					$comment_date = trim($comment_date[1]);
					$comment_date = date('Y-m-d H:i:s', strtotime($comment_date));

					preg_match('|<author>(.*?)</author>|is', $comment, $comment_author);
					$comment_author = $wpdb->escape(trim($comment_author[1]));

					$comment_author_email = NULL;

					$comment_approved = 1;
					// Check if it's already there
					if (!comment_exists($comment_author, $comment_date)) {
						$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_date', 'comment_content', 'comment_approved');
						$commentdata = wp_filter_comment($commentdata);
						wp_insert_comment($commentdata);
						$num_comments++;
					}
				}
			}
			if ( $num_comments ) {
				echo ' ';
				printf( __ngettext('%s comment', '%s comments', $num_comments), $num_comments );
			}
			echo '</li>';
			flush();
			ob_flush();
		}
		echo '</ol>';
	}

	function import() {
		$file = wp_import_handle_upload();
		if ( isset($file['error']) ) {
			echo $file['error'];
			return;
		}

		$this->file = $file['file'];
		$result = $this->import_posts();
		if ( is_wp_error( $result ) )
			return $result;
		wp_import_cleanup($file['id']);
		do_action('import_done', 'blogware');
		echo '<h3>';
		printf(__('All done. <a href="%s">Have fun!</a>'), get_option('home'));
		echo '</h3>';
	}

	function dispatch() {
		if (empty ($_GET['step']))
			$step = 0;
		else
			$step = (int) $_GET['step'];

		$this->header();

		switch ($step) {
			case 0 :
				$this->greet();
				break;
			case 1 :
				$result = $this->import();
				if ( is_wp_error( $result ) )
					$result->get_error_message();
				break;
		}

		$this->footer();
	}

	function BW_Import() {
		// Nothing.
	}
}

$blogware_import = new BW_Import();

register_importer('blogware', __('Blogware'), __('Import posts from Blogware.'), array ($blogware_import, 'dispatch'));
?>
                                                                                                                                                                                                                                                                                                                                                                                                        blog/wp-admin/import/btt.php                                                                        0000755 0023433 0004734 00000006621 11060470702 015706  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

class BunnyTags_Import {

	function header() {
		echo '<div class="wrap">';
		echo '<h2>'.__('Import Bunny&#8217;s Technorati Tags').'</h2>';
		echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'<br /><br /></p>';
	}

	function footer() {
		echo '</div>';
	}

	function greet() {
		echo '<div class="narrow">';
		echo '<p>'.__('Howdy! This imports tags from Bunny&#8217;s Technorati Tags into WordPress tags.').'</p>';
		echo '<p>'.__('This is suitable for Bunny&#8217;s Technorati Tags version 0.6.').'</p>';
		echo '<p><strong>'.__('All existing Bunny&#8217;s Technorati Tags will be removed after import.').'</strong></p>';
		echo '<p><strong>'.__('Don&#8217;t be stupid - backup your database before proceeding!').'</strong></p>';
		echo '<form action="admin.php?import=btt&amp;step=1" method="post">';
		wp_nonce_field('import-btt');
		echo '<p class="submit"><input type="submit" name="submit" value="'.__('Import Tags').'" /></p>';
		echo '</form>';
		echo '</div>';
	}

	function dispatch() {
		if ( empty($_GET['step']) )
			$step = 0;
		else
			$step = absint($_GET['step']);

		// load the header
		$this->header();

		switch ( $step ) {
			case 0 :
				$this->greet();
				break;
			case 1 :
				check_admin_referer('import-btt');
				$this->check_post_keyword( true );
				break;
			case 2 :
				check_admin_referer('import-btt');
				$this->check_post_keyword( false );
				break;
			case 3:
				$this->done();
				break;
		}

		// load the footer
		$this->footer();
	}

	function check_post_keyword($precheck = true) {
		global $wpdb;

		echo '<div class="narrow">';
		echo '<p><h3>'.__('Reading Bunny&#8217;s Technorati Tags&#8230;').'</h3></p>';

		// import Bunny's Keywords tags
		$metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'tags'");
		if ( !is_array($metakeys)) {
			echo '<p>' . __('No Tags Found!') . '</p>';
			return false;
		} else {
			$count = count($metakeys);
			echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> post with tags were read.', 'Done! <strong>%s</strong> posts with tags were read.', $count), $count ) . '<br /></p>';
			echo '<ul>';
			foreach ( $metakeys as $post_meta ) {
				if ( $post_meta->meta_value != '' ) {
					$post_keys = explode(' ', $post_meta->meta_value);
					foreach ( $post_keys as $keyword ) {
						$keyword = addslashes(trim(str_replace('+',' ',$keyword)));
						if ( '' != $keyword ) {
							echo '<li>' . $post_meta->post_id . '&nbsp;-&nbsp;' . $keyword . '</li>';
							if ( !$precheck )
								wp_add_post_tags($post_meta->post_id, $keyword);
						}
					}
				}
				if ( !$precheck )
					delete_post_meta($post_meta->post_id, 'tags');
			}
			echo '</ul>';
		}

		echo '<form action="admin.php?import=btt&amp;step='.($precheck? 2:3).'" method="post">';
		wp_nonce_field('import-btt');
		echo '<p class="submit"><input type="submit" name="submit" value="'.__('Next').'" /></p>';
		echo '</form>';
		echo '</div>';
	}

	function done() {
		echo '<div class="narrow">';
		echo '<p><h3>'.__('Import Complete!').'</h3></p>';
		echo '</div>';
	}

	function BunnyTags_Import() {
	}

}

// create the import object
$btt_import = new BunnyTags_Import();

// add it to the import page!
register_importer('btt', 'Bunny&#8217;s Technorati Tags', __('Import Bunny&#8217;s Technorati Tags into WordPress tags.'), array($btt_import, 'dispatch'));

?>
                                                                                                               blog/wp-admin/import/dotclear.php                                                                   0000755 0023433 0004734 00000055253 11060470703 016720  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/*
 * DotClear import plugin
 * by Thomas Quinot - http://thomas.quinot.org/
 */

/**
	Add These Functions to make our lives easier
**/

if(!function_exists('get_comment_count'))
{
	function get_comment_count($post_ID)
	{
		global $wpdb;
		return $wpdb->get_var( $wpdb->prepare("SELECT count(*) FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) );
	}
}

if(!function_exists('link_exists'))
{
	function link_exists($linkname)
	{
		global $wpdb;
		return $wpdb->get_var( $wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_name = %s", $linkname) );
	}
}

/*
 Identify UTF-8 text
 Taken from http://www.php.net/manual/fr/function.mb-detect-encoding.php#50087
*/
//
//    utf8 encoding validation developed based on Wikipedia entry at:
//    http://en.wikipedia.org/wiki/UTF-8
//
//    Implemented as a recursive descent parser based on a simple state machine
//    copyright 2005 Maarten Meijer
//
//    This cries out for a C-implementation to be included in PHP core
//

function valid_1byte($char) {
	if(!is_int($char)) return false;
		return ($char & 0x80) == 0x00;
}

function valid_2byte($char) {
	if(!is_int($char)) return false;
		return ($char & 0xE0) == 0xC0;
}

function valid_3byte($char) {
	if(!is_int($char)) return false;
		return ($char & 0xF0) == 0xE0;
}

function valid_4byte($char) {
	if(!is_int($char)) return false;
		return ($char & 0xF8) == 0xF0;
}

function valid_nextbyte($char) {
	if(!is_int($char)) return false;
		return ($char & 0xC0) == 0x80;
}

function valid_utf8($string) {
	$len = strlen($string);
	$i = 0;
	while( $i < $len ) {
		$char = ord(substr($string, $i++, 1));
		if(valid_1byte($char)) {    // continue
			continue;
		} else if(valid_2byte($char)) { // check 1 byte
			if(!valid_nextbyte(ord(substr($string, $i++, 1))))
				return false;
		} else if(valid_3byte($char)) { // check 2 bytes
			if(!valid_nextbyte(ord(substr($string, $i++, 1))))
				return false;
			if(!valid_nextbyte(ord(substr($string, $i++, 1))))
				return false;
		} else if(valid_4byte($char)) { // check 3 bytes
			if(!valid_nextbyte(ord(substr($string, $i++, 1))))
				return false;
			if(!valid_nextbyte(ord(substr($string, $i++, 1))))
				return false;
			if(!valid_nextbyte(ord(substr($string, $i++, 1))))
				return false;
		} // goto next char
	}
	return true; // done
}

function csc ($s) {
	if (valid_utf8 ($s)) {
		return $s;
	} else {
		return iconv(get_option ("dccharset"),"UTF-8",$s);
	}
}

function textconv ($s) {
	return csc (preg_replace ('|(?<!<br />)\s*\n|', ' ', $s));
}

/**
	The Main Importer Class
**/
class Dotclear_Import {

	function header()
	{
		echo '<div class="wrap">';
		echo '<h2>'.__('Import DotClear').'</h2>';
		echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'</p>';
	}

	function footer()
	{
		echo '</div>';
	}

	function greet()
	{
		echo '<div class="narrow"><p>'.__('Howdy! This importer allows you to extract posts from a DotClear database into your blog.  Mileage may vary.').'</p>';
		echo '<p>'.__('Your DotClear Configuration settings are as follows:').'</p>';
		echo '<form action="admin.php?import=dotclear&amp;step=1" method="post">';
		wp_nonce_field('import-dotclear');
		$this->db_form();
		echo '<p class="submit"><input type="submit" name="submit" value="'.attribute_escape(__('Import Categories')).'" /></p>';
		echo '</form></div>';
	}

	function get_dc_cats()
	{
		global $wpdb;
		// General Housekeeping
		$dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost'));
		set_magic_quotes_runtime(0);
		$dbprefix = get_option('dcdbprefix');

		// Get Categories
		return $dcdb->get_results('SELECT * FROM '.$dbprefix.'categorie', ARRAY_A);
	}

	function get_dc_users()
	{
		global $wpdb;
		// General Housekeeping
		$dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost'));
		set_magic_quotes_runtime(0);
		$dbprefix = get_option('dcdbprefix');

		// Get Users

		return $dcdb->get_results('SELECT * FROM '.$dbprefix.'user', ARRAY_A);
	}

	function get_dc_posts()
	{
		// General Housekeeping
		$dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost'));
		set_magic_quotes_runtime(0);
		$dbprefix = get_option('dcdbprefix');

		// Get Posts
		return $dcdb->get_results('SELECT '.$dbprefix.'post.*, '.$dbprefix.'categorie.cat_libelle_url AS post_cat_name
						FROM '.$dbprefix.'post INNER JOIN '.$dbprefix.'categorie
						ON '.$dbprefix.'post.cat_id = '.$dbprefix.'categorie.cat_id', ARRAY_A);
	}

	function get_dc_comments()
	{
		global $wpdb;
		// General Housekeeping
		$dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost'));
		set_magic_quotes_runtime(0);
		$dbprefix = get_option('dcdbprefix');

		// Get Comments
		return $dcdb->get_results('SELECT * FROM '.$dbprefix.'comment', ARRAY_A);
	}

	function get_dc_links()
	{
		//General Housekeeping
		$dcdb = new wpdb(get_option('dcuser'), get_option('dcpass'), get_option('dcname'), get_option('dchost'));
		set_magic_quotes_runtime(0);
		$dbprefix = get_option('dcdbprefix');

		return $dcdb->get_results('SELECT * FROM '.$dbprefix.'link ORDER BY position', ARRAY_A);
	}

	function cat2wp($categories='')
	{
		// General Housekeeping
		global $wpdb;
		$count = 0;
		$dccat2wpcat = array();
		// Do the Magic
		if(is_array($categories))
		{
			echo '<p>'.__('Importing Categories...').'<br /><br /></p>';
			foreach ($categories as $category)
			{
				$count++;
				extract($category);

				// Make Nice Variables
				$name = $wpdb->escape($cat_libelle_url);
				$title = $wpdb->escape(csc ($cat_libelle));
				$desc = $wpdb->escape(csc ($cat_desc));

				if($cinfo = category_exists($name))
				{
					$ret_id = wp_insert_category(array('cat_ID' => $cinfo, 'category_nicename' => $name, 'cat_name' => $title, 'category_description' => $desc));
				}
				else
				{
					$ret_id = wp_insert_category(array('category_nicename' => $name, 'cat_name' => $title, 'category_description' => $desc));
				}
				$dccat2wpcat[$id] = $ret_id;
			}

			// Store category translation for future use
			add_option('dccat2wpcat',$dccat2wpcat);
			echo '<p>'.sprintf(__ngettext('Done! <strong>%1$s</strong> category imported.', 'Done! <strong>%1$s</strong> categories imported.', $count), $count).'<br /><br /></p>';
			return true;
		}
		echo __('No Categories to Import!');
		return false;
	}

	function users2wp($users='')
	{
		// General Housekeeping
		global $wpdb;
		$count = 0;
		$dcid2wpid = array();

		// Midnight Mojo
		if(is_array($users))
		{
			echo '<p>'.__('Importing Users...').'<br /><br /></p>';
			foreach($users as $user)
			{
				$count++;
				extract($user);

				// Make Nice Variables
				$name = $wpdb->escape(csc ($name));
				$RealName = $wpdb->escape(csc ($user_pseudo));

				if($uinfo = get_userdatabylogin($name))
				{

					$ret_id = wp_insert_user(array(
								'ID'		=> $uinfo->ID,
								'user_login'	=> $user_id,
								'user_nicename'	=> $Realname,
								'user_email'	=> $user_email,
								'user_url'	=> 'http://',
								'display_name'	=> $Realname)
								);
				}
				else
				{
					$ret_id = wp_insert_user(array(
								'user_login'	=> $user_id,
								'user_nicename'	=> csc ($user_pseudo),
								'user_email'	=> $user_email,
								'user_url'	=> 'http://',
								'display_name'	=> $Realname)
								);
				}
				$dcid2wpid[$user_id] = $ret_id;

				// Set DotClear-to-WordPress permissions translation

				// Update Usermeta Data
				$user = new WP_User($ret_id);
				$wp_perms = $user_level + 1;
				if(10 == $wp_perms) { $user->set_role('administrator'); }
				else if(9  == $wp_perms) { $user->set_role('editor'); }
				else if(5  <= $wp_perms) { $user->set_role('editor'); }
				else if(4  <= $wp_perms) { $user->set_role('author'); }
				else if(3  <= $wp_perms) { $user->set_role('contributor'); }
				else if(2  <= $wp_perms) { $user->set_role('contributor'); }
				else                     { $user->set_role('subscriber'); }

				update_usermeta( $ret_id, 'wp_user_level', $wp_perms);
				update_usermeta( $ret_id, 'rich_editing', 'false');
				update_usermeta( $ret_id, 'first_name', csc ($user_prenom));
				update_usermeta( $ret_id, 'last_name', csc ($user_nom));
			}// End foreach($users as $user)

			// Store id translation array for future use
			add_option('dcid2wpid',$dcid2wpid);


			echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> users imported.'), $count).'<br /><br /></p>';
			return true;
		}// End if(is_array($users)

		echo __('No Users to Import!');
		return false;

	}// End function user2wp()

	function posts2wp($posts='')
	{
		// General Housekeeping
		global $wpdb;
		$count = 0;
		$dcposts2wpposts = array();
		$cats = array();

		// Do the Magic
		if(is_array($posts))
		{
			echo '<p>'.__('Importing Posts...').'<br /><br /></p>';
			foreach($posts as $post)
			{
				$count++;
				extract($post);

				// Set DotClear-to-WordPress status translation
				$stattrans = array(0 => 'draft', 1 => 'publish');
				$comment_status_map = array (0 => 'closed', 1 => 'open');

				//Can we do this more efficiently?
				$uinfo = ( get_userdatabylogin( $user_id ) ) ? get_userdatabylogin( $user_id ) : 1;
				$authorid = ( is_object( $uinfo ) ) ? $uinfo->ID : $uinfo ;

				$Title = $wpdb->escape(csc ($post_titre));
				$post_content = textconv ($post_content);
				$post_excerpt = "";
				if ($post_chapo != "") {
					$post_excerpt = textconv ($post_chapo);
					$post_content = $post_excerpt ."\n<!--more-->\n".$post_content;
				}
				$post_excerpt = $wpdb->escape ($post_excerpt);
				$post_content = $wpdb->escape ($post_content);
				$post_status = $stattrans[$post_pub];

				// Import Post data into WordPress

				if($pinfo = post_exists($Title,$post_content))
				{
					$ret_id = wp_insert_post(array(
							'ID'			=> $pinfo,
							'post_author'		=> $authorid,
							'post_date'		=> $post_dt,
							'post_date_gmt'		=> $post_dt,
							'post_modified'		=> $post_upddt,
							'post_modified_gmt'	=> $post_upddt,
							'post_title'		=> $Title,
							'post_content'		=> $post_content,
							'post_excerpt'		=> $post_excerpt,
							'post_status'		=> $post_status,
							'post_name'		=> $post_titre_url,
							'comment_status'	=> $comment_status_map[$post_open_comment],
							'ping_status'		=> $comment_status_map[$post_open_tb],
							'comment_count'		=> $post_nb_comment + $post_nb_trackback)
							);
					if ( is_wp_error( $ret_id ) )
						return $ret_id;
				}
				else
				{
					$ret_id = wp_insert_post(array(
							'post_author'		=> $authorid,
							'post_date'		=> $post_dt,
							'post_date_gmt'		=> $post_dt,
							'post_modified'		=> $post_modified_gmt,
							'post_modified_gmt'	=> $post_modified_gmt,
							'post_title'		=> $Title,
							'post_content'		=> $post_content,
							'post_excerpt'		=> $post_excerpt,
							'post_status'		=> $post_status,
							'post_name'		=> $post_titre_url,
							'comment_status'	=> $comment_status_map[$post_open_comment],
							'ping_status'		=> $comment_status_map[$post_open_tb],
							'comment_count'		=> $post_nb_comment + $post_nb_trackback)
							);
					if ( is_wp_error( $ret_id ) )
						return $ret_id;
				}
				$dcposts2wpposts[$post_id] = $ret_id;

				// Make Post-to-Category associations
				$cats = array();
				$category1 = get_category_by_slug($post_cat_name);
				$category1 = $category1->term_id;

				if($cat1 = $category1) { $cats[1] = $cat1; }

				if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); }
			}
		}
		// Store ID translation for later use
		add_option('dcposts2wpposts',$dcposts2wpposts);

		echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> posts imported.'), $count).'<br /><br /></p>';
		return true;
	}

	function comments2wp($comments='')
	{
		// General Housekeeping
		global $wpdb;
		$count = 0;
		$dccm2wpcm = array();
		$postarr = get_option('dcposts2wpposts');

		// Magic Mojo
		if(is_array($comments))
		{
			echo '<p>'.__('Importing Comments...').'<br /><br /></p>';
			foreach($comments as $comment)
			{
				$count++;
				extract($comment);

				// WordPressify Data
				$comment_ID = (int) ltrim($comment_id, '0');
				$comment_post_ID = (int) $postarr[$post_id];
				$comment_approved = "$comment_pub";
				$name = $wpdb->escape(csc ($comment_auteur));
				$email = $wpdb->escape($comment_email);
				$web = "http://".$wpdb->escape($comment_site);
				$message = $wpdb->escape(textconv ($comment_content));

				if($cinfo = comment_exists($name, $comment_dt))
				{
					// Update comments
					$ret_id = wp_update_comment(array(
							'comment_ID'		=> $cinfo,
							'comment_post_ID'	=> $comment_post_ID,
							'comment_author'	=> $name,
							'comment_author_email'	=> $email,
							'comment_author_url'	=> $web,
							'comment_author_IP'	=> $comment_ip,
							'comment_date'		=> $comment_dt,
							'comment_date_gmt'	=> $comment_dt,
							'comment_content'	=> $message,
							'comment_approved'	=> $comment_approved)
							);
				}
				else
				{
					// Insert comments
					$ret_id = wp_insert_comment(array(
							'comment_post_ID'	=> $comment_post_ID,
							'comment_author'	=> $name,
							'comment_author_email'	=> $email,
							'comment_author_url'	=> $web,
							'comment_author_IP'	=> $comment_ip,
							'comment_date'		=> $comment_dt,
							'comment_date_gmt'	=> $comment_dt,
							'comment_content'	=> $message,
							'comment_approved'	=> $comment_approved)
							);
				}
				$dccm2wpcm[$comment_ID] = $ret_id;
			}
			// Store Comment ID translation for future use
			add_option('dccm2wpcm', $dccm2wpcm);

			// Associate newly formed categories with posts
			get_comment_count($ret_id);


			echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> comments imported.'), $count).'<br /><br /></p>';
			return true;
		}
		echo __('No Comments to Import!');
		return false;
	}

	function links2wp($links='')
	{
		// General Housekeeping
		global $wpdb;
		$count = 0;

		// Deal with the links
		if(is_array($links))
		{
			echo '<p>'.__('Importing Links...').'<br /><br /></p>';
			foreach($links as $link)
			{
				$count++;
				extract($link);

				if ($title != "") {
					if ($cinfo = is_term(csc ($title), 'link_category')) {
						$category = $cinfo['term_id'];
					} else {
						$category = wp_insert_term($wpdb->escape (csc ($title)), 'link_category');
						$category = $category['term_id'];
					}
				} else {
					$linkname = $wpdb->escape(csc ($label));
					$description = $wpdb->escape(csc ($title));

					if($linfo = link_exists($linkname)) {
						$ret_id = wp_insert_link(array(
									'link_id'		=> $linfo,
									'link_url'		=> $href,
									'link_name'		=> $linkname,
									'link_category'		=> $category,
									'link_description'	=> $description)
									);
					} else {
						$ret_id = wp_insert_link(array(
									'link_url'		=> $url,
									'link_name'		=> $linkname,
									'link_category'		=> $category,
									'link_description'	=> $description)
									);
					}
					$dclinks2wplinks[$link_id] = $ret_id;
				}
			}
			add_option('dclinks2wplinks',$dclinks2wplinks);
			echo '<p>';
			printf(__ngettext('Done! <strong>%s</strong> link or link category imported.', 'Done! <strong>%s</strong> links or link categories imported.', $count), $count);
			echo '<br /><br /></p>';
			return true;
		}
		echo __('No Links to Import!');
		return false;
	}

	function import_categories()
	{
		// Category Import
		$cats = $this->get_dc_cats();
		$this->cat2wp($cats);
		add_option('dc_cats', $cats);



		echo '<form action="admin.php?import=dotclear&amp;step=2" method="post">';
		wp_nonce_field('import-dotclear');
		printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Import Users')));
		echo '</form>';

	}

	function import_users()
	{
		// User Import
		$users = $this->get_dc_users();
		$this->users2wp($users);

		echo '<form action="admin.php?import=dotclear&amp;step=3" method="post">';
		wp_nonce_field('import-dotclear');
		printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Import Posts')));
		echo '</form>';
	}

	function import_posts()
	{
		// Post Import
		$posts = $this->get_dc_posts();
		$result = $this->posts2wp($posts);
		if ( is_wp_error( $result ) )
			return $result;

		echo '<form action="admin.php?import=dotclear&amp;step=4" method="post">';
		wp_nonce_field('import-dotclear');
		printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Import Comments')));
		echo '</form>';
	}

	function import_comments()
	{
		// Comment Import
		$comments = $this->get_dc_comments();
		$this->comments2wp($comments);

		echo '<form action="admin.php?import=dotclear&amp;step=5" method="post">';
		wp_nonce_field('import-dotclear');
		printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Import Links')));
		echo '</form>';
	}

	function import_links()
	{
		//Link Import
		$links = $this->get_dc_links();
		$this->links2wp($links);
		add_option('dc_links', $links);

		echo '<form action="admin.php?import=dotclear&amp;step=6" method="post">';
		wp_nonce_field('import-dotclear');
		printf('<input type="submit" name="submit" value="%s" />', attribute_escape(__('Finish')));
		echo '</form>';
	}

	function cleanup_dcimport()
	{
		delete_option('dcdbprefix');
		delete_option('dc_cats');
		delete_option('dcid2wpid');
		delete_option('dccat2wpcat');
		delete_option('dcposts2wpposts');
		delete_option('dccm2wpcm');
		delete_option('dclinks2wplinks');
		delete_option('dcuser');
		delete_option('dcpass');
		delete_option('dcname');
		delete_option('dchost');
		delete_option('dccharset');
		do_action('import_done', 'dotclear');
		$this->tips();
	}

	function tips()
	{
		echo '<p>'.__('Welcome to WordPress.  We hope (and expect!) that you will find this platform incredibly rewarding!  As a new WordPress user coming from DotClear, there are some things that we would like to point out.  Hopefully, they will help your transition go as smoothly as possible.').'</p>';
		echo '<h3>'.__('Users').'</h3>';
		echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password.  Forget it.  You didn\'t have that login in DotClear, why should you have it here?  Instead we have taken care to import all of your users into our system.  Unfortunately there is one downside.  Because both WordPress and DotClear uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users.  <strong>Every user has the same username, but their passwords are reset to password123.</strong>  So <a href="%1$s">Login</a> and change it.'), '/wp-login.php').'</p>';
		echo '<h3>'.__('Preserving Authors').'</h3>';
		echo '<p>'.__('Secondly, we have attempted to preserve post authors.  If you are the only author or contributor to your blog, then you are safe.  In most cases, we are successful in this preservation endeavor.  However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>';
		echo '<h3>'.__('Textile').'</h3>';
		echo '<p>'.__('Also, since you\'re coming from DotClear, you probably have been using Textile to format your comments and posts.  If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>.  Trust me... You\'ll want it.').'</p>';
		echo '<h3>'.__('WordPress Resources').'</h3>';
		echo '<p>'.__('Finally, there are numerous WordPress resources around the internet.  Some of them are:').'</p>';
		echo '<ul>';
		echo '<li>'.__('<a href="http://www.wordpress.org">The official WordPress site</a>').'</li>';
		echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums</a>').'</li>';
		echo '<li>'.__('<a href="http://codex.wordpress.org">The Codex (In other words, the WordPress Bible)</a>').'</li>';
		echo '</ul>';
		echo '<p>'.sprintf(__('That\'s it! What are you waiting for? Go <a href="%1$s">login</a>!'), '../wp-login.php').'</p>';
	}

	function db_form()
	{
		echo '<table class="form-table">';
		printf('<tr><th><label for="dbuser">%s</label></th><td><input type="text" name="dbuser" id="dbuser" /></td></tr>', __('DotClear Database User:'));
		printf('<tr><th><label for="dbpass">%s</label></th><td><input type="password" name="dbpass" id="dbpass" /></td></tr>', __('DotClear Database Password:'));
		printf('<tr><th><label for="dbname">%s</label></th><td><input type="text" name="dbname" id="dbname" /></td></tr>', __('DotClear Database Name:'));
		printf('<tr><th><label for="dbhost">%s</label></th><td><input type="text" name="dbhost" nameid="dbhost" value="localhost" /></td></tr>', __('DotClear Database Host:'));
		printf('<tr><th><label for="dbprefix">%s</label></th><td><input type="text" name="dbprefix" id="dbprefix" value="dc_"/></td></tr>', __('DotClear Table prefix:'));
		printf('<tr><th><label for="dccharset">%s</label></th><td><input type="text" name="dccharset" id="dccharset" value="ISO-8859-15"/></td></tr>', __('Originating character set:'));
		echo '</table>';
	}

	function dispatch()
	{

		if (empty ($_GET['step']))
			$step = 0;
		else
			$step = (int) $_GET['step'];
		$this->header();

		if ( $step > 0 )
		{
			check_admin_referer('import-dotclear');

			if($_POST['dbuser'])
			{
				if(get_option('dcuser'))
					delete_option('dcuser');
				add_option('dcuser', sanitize_user($_POST['dbuser'], true));
			}
			if($_POST['dbpass'])
			{
				if(get_option('dcpass'))
					delete_option('dcpass');
				add_option('dcpass', sanitize_user($_POST['dbpass'], true));
			}

			if($_POST['dbname'])
			{
				if(get_option('dcname'))
					delete_option('dcname');
				add_option('dcname', sanitize_user($_POST['dbname'], true));
			}
			if($_POST['dbhost'])
			{
				if(get_option('dchost'))
					delete_option('dchost');
				add_option('dchost', sanitize_user($_POST['dbhost'], true));
			}
			if($_POST['dccharset'])
			{
				if(get_option('dccharset'))
					delete_option('dccharset');
				add_option('dccharset', sanitize_user($_POST['dccharset'], true));
			}
			if($_POST['dbprefix'])
			{
				if(get_option('dcdbprefix'))
					delete_option('dcdbprefix');
				add_option('dcdbprefix', sanitize_user($_POST['dbprefix'], true));
			}


		}

		switch ($step)
		{
			default:
			case 0 :
				$this->greet();
				break;
			case 1 :
				$this->import_categories();
				break;
			case 2 :
				$this->import_users();
				break;
			case 3 :
				$result = $this->import_posts();
				if ( is_wp_error( $result ) )
					echo $result->get_error_message();
				break;
			case 4 :
				$this->import_comments();
				break;
			case 5 :
				$this->import_links();
				break;
			case 6 :
				$this->cleanup_dcimport();
				break;
		}

		$this->footer();
	}

	function Dotclear_Import()
	{
		// Nothing.
	}
}

$dc_import = new Dotclear_Import();
register_importer('dotclear', __('DotClear'), __('Import categories, users, posts, comments, and links from a DotClear blog.'), array ($dc_import, 'dispatch'));
?>
                                                                                                                                                                                                                                                                                                                                                     blog/wp-admin/import/greymatter.php                                                                 0000755 0023433 0004734 00000025221 11060470704 017277  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

class GM_Import {

	var $gmnames = array ();

	function header() {
		echo '<div class="wrap">';
		echo '<h2>'.__('Import GreyMatter').'</h2>';
	}

	function footer() {
		echo '</div>';
	}

	function greet() {
		$this->header();
?>
<p><?php _e('This is a basic GreyMatter to WordPress import script.') ?></p>
<p><?php _e('What it does:') ?></p>
<ul>
<li><?php _e('Parses gm-authors.cgi to import (new) authors. Everyone is imported at level 1.') ?></li>
<li><?php _e('Parses the entries cgi files to import posts, comments, and karma on posts (although karma is not used on WordPress yet).<br />If authors are found not to be in gm-authors.cgi, imports them at level 0.') ?></li>
<li><?php _e("Detects duplicate entries or comments. If you don't import everything the first time, or this import should fail in the middle, duplicate entries will not be made when you try again.") ?></li>
</ul>
<p><?php _e('What it does not:') ?></p>
<ul>
<li><?php _e('Parse gm-counter.cgi, gm-banlist.cgi, gm-cplog.cgi (you can make a CP log hack if you really feel like it, but I question the need of a CP log).') ?></li>
<li><?php _e('Import gm-templates.') ?></li>
<li><?php _e("Doesn't keep entries on top.")?></li>
</ul>
<p>&nbsp;</p>

<form name="stepOne" method="get">
<input type="hidden" name="import" value="greymatter" />
<input type="hidden" name="step" value="1" />
<?php wp_nonce_field('import-greymatter'); ?>
<h3><?php _e('Second step: GreyMatter details:') ?></h3>
<table class="form-table">
<tr>
<td><label for="gmpath"><?php _e('Path to GM files:') ?></label></td>
<td><input type="text" style="width:300px" name="gmpath" id="gmpath" value="/home/my/site/cgi-bin/greymatter/" /></td>
</tr>
<tr>
<td><label for="archivespath"><?php _e('Path to GM entries:') ?></label></td>
<td><input type="text" style="width:300px" name="archivespath" id="archivespath" value="/home/my/site/cgi-bin/greymatter/archives/" /></td>
</tr>
<tr>
<td><label for="lastentry"><?php _e("Last entry's number:") ?></label></td>
<td><input type="text" name="lastentry" id="lastentry" value="00000001" /><br />
	<?php _e("This importer will search for files 00000001.cgi to 000-whatever.cgi,<br />so you need to enter the number of the last GM post here.<br />(if you don't know that number, just log into your FTP and look it out<br />in the entries' folder)") ?></td>
</tr>
</table>
</p>
<p><input type="submit" name="submit" value="<?php _e('Start Importing') ?>" class="button" /></p>
</form>
<?php
		$this->footer();
	}



	function gm2autobr($string) { // transforms GM's |*| into b2's <br />\n
		$string = str_replace("|*|","<br />\n",$string);
		return($string);
	}

	function import() {
		global $wpdb;

		$wpvarstoreset = array('gmpath', 'archivespath', 'lastentry');
		for ($i=0; $i<count($wpvarstoreset); $i += 1) {
			$wpvar = $wpvarstoreset[$i];
			if (!isset($$wpvar)) {
				if (empty($_POST["$wpvar"])) {
					if (empty($_GET["$wpvar"])) {
						$$wpvar = '';
					} else {
						$$wpvar = $_GET["$wpvar"];
					}
				} else {
					$$wpvar = $_POST["$wpvar"];
				}
			}
		}

		if (!chdir($archivespath))
			wp_die(__("Wrong path, the path to the GM entries does not exist on the server"));

		if (!chdir($gmpath))
			wp_die(__("Wrong path, the path to the GM files does not exist on the server"));

		$lastentry = (int) $lastentry;

		$this->header();
?>
<p><?php _e('The importer is running...') ?></p>
<ul>
<li><?php _e('importing users...') ?><ul><?php

	chdir($gmpath);
	$userbase = file("gm-authors.cgi");

	foreach($userbase as $user) {
		$userdata=explode("|", $user);

		$user_ip="127.0.0.1";
		$user_domain="localhost";
		$user_browser="server";

		$s=$userdata[4];
		$user_joindate=substr($s,6,4)."-".substr($s,0,2)."-".substr($s,3,2)." 00:00:00";

		$user_login=$wpdb->escape($userdata[0]);
		$pass1=$wpdb->escape($userdata[1]);
		$user_nickname=$wpdb->escape($userdata[0]);
		$user_email=$wpdb->escape($userdata[2]);
		$user_url=$wpdb->escape($userdata[3]);
		$user_joindate=$wpdb->escape($user_joindate);

		$user_id = username_exists($user_login);
		if ($user_id) {
			printf('<li>'.__('user %s').'<strong>'.__('Already exists').'</strong></li>', "<em>$user_login</em>");
			$this->gmnames[$userdata[0]] = $user_id;
			continue;
		}

		$user_info = array("user_login"=>"$user_login", "user_pass"=>"$pass1", "user_nickname"=>"$user_nickname", "user_email"=>"$user_email", "user_url"=>"$user_url", "user_ip"=>"$user_ip", "user_domain"=>"$user_domain", "user_browser"=>"$user_browser", "dateYMDhour"=>"$user_joindate", "user_level"=>"1", "user_idmode"=>"nickname");
		$user_id = wp_insert_user($user_info);
		$this->gmnames[$userdata[0]] = $user_id;

		printf('<li>'.__('user %s...').' <strong>'.__('Done').'</strong></li>', "<em>$user_login</em>");
	}

?></ul><strong><?php _e('Done') ?></strong></li>
<li><?php _e('importing posts, comments, and karma...') ?><br /><ul><?php

	chdir($archivespath);

	for($i = 0; $i <= $lastentry; $i = $i + 1) {

		$entryfile = "";

		if ($i<10000000) {
			$entryfile .= "0";
			if ($i<1000000) {
				$entryfile .= "0";
				if ($i<100000) {
					$entryfile .= "0";
					if ($i<10000) {
						$entryfile .= "0";
						if ($i<1000) {
							$entryfile .= "0";
							if ($i<100) {
								$entryfile .= "0";
								if ($i<10) {
									$entryfile .= "0";
		}}}}}}}

		$entryfile .= "$i";

		if (is_file($entryfile.".cgi")) {

			$entry=file($entryfile.".cgi");
			$postinfo=explode("|",$entry[0]);
			$postmaincontent=$this->gm2autobr($entry[2]);
			$postmorecontent=$this->gm2autobr($entry[3]);

			$post_author=trim($wpdb->escape($postinfo[1]));

			$post_title=$this->gm2autobr($postinfo[2]);
			printf('<li>'.__('entry # %s : %s : by %s'), $entryfile, $post_title, $postinfo[1]);
			$post_title=$wpdb->escape($post_title);

			$postyear=$postinfo[6];
			$postmonth=zeroise($postinfo[4],2);
			$postday=zeroise($postinfo[5],2);
			$posthour=zeroise($postinfo[7],2);
			$postminute=zeroise($postinfo[8],2);
			$postsecond=zeroise($postinfo[9],2);

			if (($postinfo[10]=="PM") && ($posthour!="12"))
				$posthour=$posthour+12;

			$post_date="$postyear-$postmonth-$postday $posthour:$postminute:$postsecond";

			$post_content=$postmaincontent;
			if (strlen($postmorecontent)>3)
				$post_content .= "<!--more--><br /><br />".$postmorecontent;
			$post_content=$wpdb->escape($post_content);

			$post_karma=$postinfo[12];

			$post_status = 'publish'; //in greymatter, there are no drafts
			$comment_status = 'open';
			$ping_status = 'closed';

			if ($post_ID = post_exists($post_title, '', $post_date)) {
				echo ' ';
				_e('(already exists)');
			} else {
				//just so that if a post already exists, new users are not created by checkauthor
				// we'll check the author is registered, or if it's a deleted author
				$user_id = username_exists($post_author);
				if (!$user_id) {	// if deleted from GM, we register the author as a level 0 user
					$user_ip="127.0.0.1";
					$user_domain="localhost";
					$user_browser="server";
					$user_joindate="1979-06-06 00:41:00";
					$user_login=$wpdb->escape($post_author);
					$pass1=$wpdb->escape("password");
					$user_nickname=$wpdb->escape($post_author);
					$user_email=$wpdb->escape("user@deleted.com");
					$user_url=$wpdb->escape("");
					$user_joindate=$wpdb->escape($user_joindate);

					$user_info = array("user_login"=>$user_login, "user_pass"=>$pass1, "user_nickname"=>$user_nickname, "user_email"=>$user_email, "user_url"=>$user_url, "user_ip"=>$user_ip, "user_domain"=>$user_domain, "user_browser"=>$user_browser, "dateYMDhour"=>$user_joindate, "user_level"=>0, "user_idmode"=>"nickname");
					$user_id = wp_insert_user($user_info);
					$this->gmnames[$postinfo[1]] = $user_id;

					echo ': ';
					printf(__('registered deleted user %s at level 0 '), "<em>$user_login</em>");
				}

				if (array_key_exists($postinfo[1], $this->gmnames)) {
					$post_author = $this->gmnames[$postinfo[1]];
				} else {
					$post_author = $user_id;
				}

				$postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt');
				$post_ID = wp_insert_post($postdata);
				if ( is_wp_error( $post_ID ) )
					return $post_ID;
			}

			$c=count($entry);
			if ($c>4) {
				$numAddedComments = 0;
				$numComments = 0;
				for ($j=4;$j<$c;$j++) {
					$entry[$j]=$this->gm2autobr($entry[$j]);
					$commentinfo=explode("|",$entry[$j]);
					$comment_post_ID=$post_ID;
					$comment_author=$wpdb->escape($commentinfo[0]);
					$comment_author_email=$wpdb->escape($commentinfo[2]);
					$comment_author_url=$wpdb->escape($commentinfo[3]);
					$comment_author_IP=$wpdb->escape($commentinfo[1]);

					$commentyear=$commentinfo[7];
					$commentmonth=zeroise($commentinfo[5],2);
					$commentday=zeroise($commentinfo[6],2);
					$commenthour=zeroise($commentinfo[8],2);
					$commentminute=zeroise($commentinfo[9],2);
					$commentsecond=zeroise($commentinfo[10],2);
					if (($commentinfo[11]=="PM") && ($commenthour!="12"))
						$commenthour=$commenthour+12;
					$comment_date="$commentyear-$commentmonth-$commentday $commenthour:$commentminute:$commentsecond";

					$comment_content=$wpdb->escape($commentinfo[12]);

					if (!comment_exists($comment_author, $comment_date)) {
						$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_content', 'comment_approved');
						$commentdata = wp_filter_comment($commentdata);
						wp_insert_comment($commentdata);
						$numAddedComments++;
					}
					$numComments++;
				}
				if ($numAddedComments > 0) {
					echo ': ';
				printf( __ngettext('imported %s comment', 'imported %s comments', $numAddedComments) , $numAddedComments);
				}
				$preExisting = $numComments - numAddedComments;
				if ($preExisting > 0) {
					echo ' ';
					printf( __ngettext( 'ignored %s pre-existing comment', 'ignored %s pre-existing comments', $preExisting ) , $preExisting);
				}
			}
			echo '... <strong>'.__('Done').'</strong></li>';
		}
	}
	do_action('import_done', 'greymatter');
	?>
</ul><strong><?php _e('Done') ?></strong></li></ul>
<p>&nbsp;</p>
<p><?php _e('Completed GreyMatter import!') ?></p>
<?php
	$this->footer();
	return;
	}

	function dispatch() {
		if (empty ($_GET['step']))
			$step = 0;
		else
			$step = (int) $_GET['step'];

		switch ($step) {
			case 0 :
				$this->greet();
				break;
			case 1:
				check_admin_referer('import-greymatter');
				$result = $this->import();
				if ( is_wp_error( $result ) )
					echo $result->get_error_message();
				break;
		}
	}

	function GM_Import() {
		// Nothing.
	}
}

$gm_import = new GM_Import();

register_importer('greymatter', __('GreyMatter'), __('Import users, posts, and comments from a Greymatter blog.'), array ($gm_import, 'dispatch'));
?>
                                                                                                                                                                                                                                                                                                                                                                               blog/wp-admin/import/jkw.php                                                                        0000755 0023433 0004734 00000013556 11060470704 015717  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

class JeromesKeyword_Import {

	function header() {
		echo '<div class="wrap">';
		echo '<h2>'.__('Import Jerome&#8217;s Keywords').'</h2>';
		echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'<br /><br /></p>';
	}

	function footer() {
		echo '</div>';
	}

	function greet() {
		echo '<div class="narrow">';
		echo '<p>'.__('Howdy! This imports tags from Jerome&#8217;s Keywords into WordPress tags.').'</p>';
		echo '<p>'.__('This is suitable for Jerome&#8217;s Keywords version 1.x and 2.0a.').'</p>';
		echo '<p><strong>'.__('All existing Jerome&#8217;s Keywords will be removed after import.').'</strong></p>';
		echo '<p><strong>'.__('Don&#8217;t be stupid - backup your database before proceeding!').'</strong></p>';
		echo '<form action="admin.php?import=jkw&amp;step=1" method="post">';
		wp_nonce_field('import-jkw');
		echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Import Version 1.x').'" /></p>';
		echo '</form>';
		echo '<form action="admin.php?import=jkw&amp;step=3" method="post">';
		wp_nonce_field('import-jkw');
		echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Import Version 2.0a').'" /></p>';
		echo '</form>';
		echo '</div>';
	}

	function dispatch() {
		if ( empty($_GET['step']) )
			$step = 0;
		else
			$step = absint($_GET['step']);

		// load the header
		$this->header();

		switch ( $step ) {
			case 0 :
				$this->greet();
				break;
			case 1 :
				check_admin_referer('import-jkw');
				$this->check_V1_post_keyword( true );
				break;
			case 2 :
				check_admin_referer('import-jkw');
				$this->check_V1_post_keyword( false );
				break;
			case 3 :
				check_admin_referer('import-jkw');
				$this->check_V2_post_keyword( true );
				break;
			case 4 :
				check_admin_referer('import-jkw');
				$this->check_V2_post_keyword( false );
				break;
			case 5:
				check_admin_referer('import-jkw');
				$this->cleanup_V2_import();
				break;
			case 6:
				$this->done();
				break;
		}

		// load the footer
		$this->footer();
	}

	function check_V1_post_keyword($precheck = true) {
		global $wpdb;

		echo '<div class="narrow">';
		echo '<p><h3>'.__('Reading Jerome&#8217;s Keywords Tags&#8230;').'</h3></p>';

		// import Jerome's Keywords tags
		$metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'keywords'");
		if ( !is_array($metakeys)) {
			echo '<p>' . __('No Tags Found!') . '</p>';
			return false;
		} else {
			$count = count($metakeys);
			echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> post with tags were read.', 'Done! <strong>%s</strong> posts with tags were read.', $count), $count ) . '<br /></p>';
			echo '<ul>';
			foreach ( $metakeys as $post_meta ) {
				if ( $post_meta->meta_value != '' ) {
					$post_keys = explode(',', $post_meta->meta_value);
					foreach ( $post_keys as $keyword ) {
						$keyword = addslashes(trim($keyword));
						if ( '' != $keyword ) {
							echo '<li>' . $post_meta->post_id . '&nbsp;-&nbsp;' . $keyword . '</li>';
							if ( !$precheck )
								wp_add_post_tags($post_meta->post_id, $keyword);
						}
					}
				}
				if ( !$precheck )
					delete_post_meta($post_meta->post_id, 'keywords');
			}
			echo '</ul>';
		}

		echo '<form action="admin.php?import=jkw&amp;step='.($precheck? 2:6).'" method="post">';
		wp_nonce_field('import-jkw');
		echo '<p class="submit"><input type="submit" name="submit" value="'.__('Next').'" /></p>';
		echo '</form>';
		echo '</div>';
	}

	function check_V2_post_keyword($precheck = true) {
		global $wpdb;

		echo '<div class="narrow">';
		echo '<p><h3>'.__('Reading Jerome&#8217;s Keywords Tags&#8230;').'</h3></p>';

		// import Jerome's Keywords tags
		$tablename = $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1);
		$metakeys = $wpdb->get_results("SELECT post_id, tag_name FROM $tablename");
		if ( !is_array($metakeys) ) {
			echo '<p>' . __('No Tags Found!') . '</p>';
			return false;
		} else {
			$count = count($metakeys);
			echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag were read.', 'Done! <strong>%s</strong> tags were read.', $count), $count ) . '<br /></p>';
			echo '<ul>';
			foreach ( $metakeys as $post_meta ) {
				$keyword = addslashes(trim($post_meta->tag_name));
				if ( $keyword != '' ) {
					echo '<li>' . $post_meta->post_id . '&nbsp;-&nbsp;' . $keyword . '</li>';
					if ( !$precheck )
						wp_add_post_tags($post_meta->post_id, $keyword);
				}
			}
		echo '</ul>';
		}
		echo '<form action="admin.php?import=jkw&amp;step='.($precheck? 4:5).'" method="post">';
		wp_nonce_field('import-jkw');
		echo '<p class="submit"><input type="submit" name="submit" value="'.__('Next').'" /></p>';
		echo '</form>';
		echo '</div>';
	}

	function cleanup_V2_import() {
		global $wpdb;

		/* options from V2.0a (jeromes-keywords.php) */
		$options = array('version', 'keywords_table', 'query_varname', 'template', 'meta_always_include', 'meta_includecats', 'meta_autoheader', 'search_strict', 'use_feed_cats', 'post_linkformat', 'post_tagseparator', 'post_includecats', 'post_notagstext', 'cloud_linkformat', 'cloud_tagseparator', 'cloud_includecats', 'cloud_sortorder', 'cloud_displaymax', 'cloud_displaymin', 'cloud_scalemax', 'cloud_scalemin');

		$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1));

		foreach ( $options as $o )
			delete_option('jkeywords_' . $o);

		$this->done();
	}

	function done() {
		echo '<div class="narrow">';
		echo '<p><h3>'.__('Import Complete!').'</h3></p>';
		echo '</div>';
	}

	function JeromesKeyword_Import() {
	}

}

// create the import object
$jkw_import = new JeromesKeyword_Import();

// add it to the import page!
register_importer('jkw', 'Jerome&#8217;s Keywords', __('Import Jerome&#8217;s Keywords into WordPress tags.'), array($jkw_import, 'dispatch'));

?>
                                                                                                                                                  blog/wp-admin/import/livejournal.php                                                                0000755 0023433 0004734 00000013034 11060470705 017446  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

class LJ_Import {

	var $file;

	function header() {
		echo '<div class="wrap">';
		echo '<h2>'.__('Import LiveJournal').'</h2>';
	}

	function footer() {
		echo '</div>';
	}

	function unhtmlentities($string) { // From php.net for < 4.3 compat
		$trans_tbl = get_html_translation_table(HTML_ENTITIES);
		$trans_tbl = array_flip($trans_tbl);
		return strtr($string, $trans_tbl);
	}

	function greet() {
		echo '<div class="narrow">';
		echo '<p>'.__('Howdy! Upload your LiveJournal XML export file and we&#8217;ll import the posts into this blog.').'</p>';
		echo '<p>'.__('Choose a LiveJournal XML file to upload, then click Upload file and import.').'</p>';
		wp_import_upload_form("admin.php?import=livejournal&amp;step=1");
		echo '</div>';
	}

	function import_posts() {
		global $wpdb, $current_user;

		set_magic_quotes_runtime(0);
		$importdata = file($this->file); // Read the file into an array
		$importdata = implode('', $importdata); // squish it
		$importdata = str_replace(array ("\r\n", "\r"), "\n", $importdata);

		preg_match_all('|<entry>(.*?)</entry>|is', $importdata, $posts);
		$posts = $posts[1];
		unset($importdata);
		echo '<ol>';
		foreach ($posts as $post) {
			preg_match('|<subject>(.*?)</subject>|is', $post, $post_title);
			$post_title = $wpdb->escape(trim($post_title[1]));
			if ( empty($post_title) ) {
				preg_match('|<itemid>(.*?)</itemid>|is', $post, $post_title);
				$post_title = $wpdb->escape(trim($post_title[1]));
			}

			preg_match('|<eventtime>(.*?)</eventtime>|is', $post, $post_date);
			$post_date = strtotime($post_date[1]);
			$post_date = date('Y-m-d H:i:s', $post_date);

			preg_match('|<event>(.*?)</event>|is', $post, $post_content);
			$post_content = str_replace(array ('<![CDATA[', ']]>'), '', trim($post_content[1]));
			$post_content = $this->unhtmlentities($post_content);

			// Clean up content
			$post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
			$post_content = str_replace('<br>', '<br />', $post_content);
			$post_content = str_replace('<hr>', '<hr />', $post_content);
			$post_content = $wpdb->escape($post_content);

			$post_author = $current_user->ID;
			$post_status = 'publish';

			echo '<li>';
			if ($post_id = post_exists($post_title, $post_content, $post_date)) {
				printf(__('Post <em>%s</em> already exists.'), stripslashes($post_title));
			} else {
				printf(__('Importing post <em>%s</em>...'), stripslashes($post_title));
				$postdata = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status');
				$post_id = wp_insert_post($postdata);
				if ( is_wp_error( $post_id ) )
					return $post_id;
				if (!$post_id) {
					_e("Couldn't get post ID");
					echo '</li>';
					break;
				}
			}

			preg_match_all('|<comment>(.*?)</comment>|is', $post, $comments);
			$comments = $comments[1];

			if ( $comments ) {
				$comment_post_ID = (int) $post_id;
				$num_comments = 0;
				foreach ($comments as $comment) {
					preg_match('|<event>(.*?)</event>|is', $comment, $comment_content);
					$comment_content = str_replace(array ('<![CDATA[', ']]>'), '', trim($comment_content[1]));
					$comment_content = $this->unhtmlentities($comment_content);

					// Clean up content
					$comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content);
					$comment_content = str_replace('<br>', '<br />', $comment_content);
					$comment_content = str_replace('<hr>', '<hr />', $comment_content);
					$comment_content = $wpdb->escape($comment_content);

					preg_match('|<eventtime>(.*?)</eventtime>|is', $comment, $comment_date);
					$comment_date = trim($comment_date[1]);
					$comment_date = date('Y-m-d H:i:s', strtotime($comment_date));

					preg_match('|<name>(.*?)</name>|is', $comment, $comment_author);
					$comment_author = $wpdb->escape(trim($comment_author[1]));

					preg_match('|<email>(.*?)</email>|is', $comment, $comment_author_email);
					$comment_author_email = $wpdb->escape(trim($comment_author_email[1]));

					$comment_approved = 1;
					// Check if it's already there
					if (!comment_exists($comment_author, $comment_date)) {
						$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_date', 'comment_content', 'comment_approved');
						$commentdata = wp_filter_comment($commentdata);
						wp_insert_comment($commentdata);
						$num_comments++;
					}
				}
			}
			if ( $num_comments ) {
				echo ' ';
				printf(__ngettext('(%s comment)', '(%s comments)', $num_comments), $num_comments);
			}
			echo '</li>';
		}
		echo '</ol>';
	}

	function import() {
		$file = wp_import_handle_upload();
		if ( isset($file['error']) ) {
			echo $file['error'];
			return;
		}

		$this->file = $file['file'];
		$result = $this->import_posts();
		if ( is_wp_error( $result ) )
			return $result;
		wp_import_cleanup($file['id']);
		do_action('import_done', 'livejournal');

		echo '<h3>';
		printf(__('All done. <a href="%s">Have fun!</a>'), get_option('home'));
		echo '</h3>';
	}

	function dispatch() {
		if (empty ($_GET['step']))
			$step = 0;
		else
			$step = (int) $_GET['step'];

		$this->header();

		switch ($step) {
			case 0 :
				$this->greet();
				break;
			case 1 :
				check_admin_referer('import-upload');
				$result = $this->import();
				if ( is_wp_error( $result ) )
					echo $result->get_error_message();
				break;
		}

		$this->footer();
	}

	function LJ_Import() {
		// Nothing.
	}
}

$livejournal_import = new LJ_Import();

register_importer('livejournal', __('LiveJournal'), __('Import posts from a LiveJournal XML export file.'), array ($livejournal_import, 'dispatch'));
?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    blog/wp-admin/import/mt.php                                                                         0000755 0023433 0004734 00000035444 11060470706 015546  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

class MT_Import {

	var $posts = array ();
	var $file;
	var $id;
	var $mtnames = array ();
	var $newauthornames = array ();
	var $j = -1;

	function header() {
		echo '<div class="wrap">';
		echo '<h2>'.__('Import Movable Type or TypePad').'</h2>';
	}

	function footer() {
		echo '</div>';
	}

	function greet() {
		$this->header();
?>
<div class="narrow">
<p><?php _e('Howdy! We&#8217;re about to begin importing all of your Movable Type or Typepad entries into WordPress. To begin, either choose a file to upload and click "Upload file and import," or use FTP to upload your MT export file as <code>mt-export.txt</code> in your <code>/wp-content/</code> directory and then click "Import mt-export.txt"'); ?></p>

<?php wp_import_upload_form( add_query_arg('step', 1) ); ?>
<form method="post" action="<?php echo add_query_arg('step', 1); ?>" class="import-upload-form">

<?php wp_nonce_field('import-upload'); ?>
<p>
	<input type="hidden" name="upload_type" value="ftp" />
<?php _e('Or use <code>mt-export.txt</code> in your <code>/wp-content/</code> directory'); ?></p>
<p class="submit">
<input type="submit" value="<?php echo attribute_escape(__('Import mt-export.txt')); ?>" />
</p>
</form>
<p><?php _e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if&#8212;for whatever reason&#8212;it doesn\'t finish. If you get an <strong>out of memory</strong> error try splitting up the import file into pieces.'); ?> </p>
</div>
<?php
		$this->footer();
	}

	function users_form($n) {
		global $wpdb, $testing;
		$users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY ID");
?><select name="userselect[<?php echo $n; ?>]">
	<option value="#NONE#"><?php _e('- Select -') ?></option>
	<?php


		foreach ($users as $user) {
			echo '<option value="'.$user->user_login.'">'.$user->user_login.'</option>';
		}
?>
	</select>
	<?php


	}

	//function to check the authorname and do the mapping
	function checkauthor($author) {
		global $wpdb;
		//mtnames is an array with the names in the mt import file
		$pass = wp_generate_password();
		if (!(in_array($author, $this->mtnames))) { //a new mt author name is found
			++ $this->j;
			$this->mtnames[$this->j] = $author; //add that new mt author name to an array
			$user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user
			if (!$user_id) { //banging my head against the desk now.
				if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname
					$user_id = wp_create_user($author, $pass);
					$this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank.
				} else {
					$user_id = wp_create_user($this->newauthornames[$this->j], $pass);
				}
			} else {
				return $user_id; // return pre-existing wp username if it exists
			}
		} else {
			$key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array
			$user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames
		}

		return $user_id;
	}

	function get_mt_authors() {
		$temp = array();
		$authors = array();

		$handle = fopen($this->file, 'r');
		if ( $handle == null )
			return false;

		$in_comment = false;
		while ( $line = fgets($handle) ) {
			$line = trim($line);

			if ( 'COMMENT:' == $line )
				$in_comment = true;
			else if ( '-----' == $line )
				$in_comment = false;

			if ( $in_comment || 0 !== strpos($line,"AUTHOR:") )
				continue;

			$temp[] = trim( substr($line, strlen("AUTHOR:")) );
		}

		//we need to find unique values of author names, while preserving the order, so this function emulates the unique_value(); php function, without the sorting.
		$authors[0] = array_shift($temp);
		$y = count($temp) + 1;
		for ($x = 1; $x < $y; $x ++) {
			$next = array_shift($temp);
			if (!(in_array($next, $authors)))
				array_push($authors, "$next");
		}

		fclose($handle);

		return $authors;
	}

	function get_authors_from_post() {
		$formnames = array ();
		$selectnames = array ();

		foreach ($_POST['user'] as $key => $line) {
			$newname = trim(stripslashes($line));
			if ($newname == '')
				$newname = 'left_blank'; //passing author names from step 1 to step 2 is accomplished by using POST. left_blank denotes an empty entry in the form.
			array_push($formnames, "$newname");
		} // $formnames is the array with the form entered names

		foreach ($_POST['userselect'] as $user => $key) {
			$selected = trim(stripslashes($key));
			array_push($selectnames, "$selected");
		}

		$count = count($formnames);
		for ($i = 0; $i < $count; $i ++) {
			if ($selectnames[$i] != '#NONE#') { //if no name was selected from the select menu, use the name entered in the form
				array_push($this->newauthornames, "$selectnames[$i]");
			} else {
				array_push($this->newauthornames, "$formnames[$i]");
			}
		}
	}

	function mt_authors_form() {
?>
<div class="wrap">
<h2><?php _e('Assign Authors'); ?></h2>
<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as admin\'s entries.'); ?></p>
<p><?php _e('Below, you can see the names of the authors of the MovableType posts in <em>italics</em>. For each of these names, you can either pick an author in your WordPress installation from the menu, or enter a name for the author in the textbox.'); ?></p>
<p><?php _e('If a new user is created by WordPress, a password will be randomly generated. Manually change the user\'s details if necessary.'); ?></p>
	<?php


		$authors = $this->get_mt_authors();
		echo '<ol id="authors">';
		echo '<form action="?import=mt&amp;step=2&amp;id=' . $this->id . '" method="post">';
		wp_nonce_field('import-mt');
		$j = -1;
		foreach ($authors as $author) {
			++ $j;
			echo '<li><label>'.__('Current author:').' <strong>'.$author.'</strong><br />'.sprintf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30"> <br />');
			$this->users_form($j);
			echo '</label></li>';
		}

		echo '<input type="submit" value="'.__('Submit').'">'.'<br />';
		echo '</form>';
		echo '</ol></div>';

	}

	function select_authors() {
		if ( $_POST['upload_type'] === 'ftp' ) {
			$file['file'] = WP_CONTENT_DIR . '/mt-export.txt';
			if ( !file_exists($file['file']) )
				$file['error'] = __('<code>mt-export.txt</code> does not exist');
		} else {
			$file = wp_import_handle_upload();
		}
		if ( isset($file['error']) ) {
			$this->header();
			echo '<p>'.__('Sorry, there has been an error').'.</p>';
			echo '<p><strong>' . $file['error'] . '</strong></p>';
			$this->footer();
			return;
		}
		$this->file = $file['file'];
		$this->id = (int) $file['id'];

		$this->mt_authors_form();
	}

	function save_post(&$post, &$comments, &$pings) {
		// Reset the counter
		set_time_limit(30);
		$post = get_object_vars($post);
		$post = add_magic_quotes($post);
		$post = (object) $post;

		if ( $post_id = post_exists($post->post_title, '', $post->post_date) ) {
			echo '<li>';
			printf(__('Post <em>%s</em> already exists.'), stripslashes($post->post_title));
		} else {
			echo '<li>';
			printf(__('Importing post <em>%s</em>...'), stripslashes($post->post_title));

			if ( '' != trim( $post->extended ) )
					$post->post_content .= "\n<!--more-->\n$post->extended";

			$post->post_author = $this->checkauthor($post->post_author); //just so that if a post already exists, new users are not created by checkauthor
			$post_id = wp_insert_post($post);
			if ( is_wp_error( $post_id ) )
				return $post_id;

			// Add categories.
			if ( 0 != count($post->categories) ) {
				wp_create_categories($post->categories, $post_id);
			}
			
			 // Add tags or keywords
			if ( 1 < strlen($post->post_keywords) ) {
			 	// Keywords exist. 
				printf(__('<br />Adding tags <i>%s</i>...'), stripslashes($post->post_keywords));
				wp_add_post_tags($post_id, $post->post_keywords);
			}
		}

		$num_comments = 0;
		foreach ( $comments as $comment ) {
			$comment = get_object_vars($comment);
			$comment = add_magic_quotes($comment);

			if ( !comment_exists($comment['comment_author'], $comment['comment_date'])) {
				$comment['comment_post_ID'] = $post_id;
				$comment = wp_filter_comment($comment);
				wp_insert_comment($comment);
				$num_comments++;
			}
		}

		if ( $num_comments )
			printf(' '.__ngettext('(%s comment)', '(%s comments)', $num_comments), $num_comments);

		$num_pings = 0;
		foreach ( $pings as $ping ) {
			$ping = get_object_vars($ping);
			$ping = add_magic_quotes($ping);

			if ( !comment_exists($ping['comment_author'], $ping['comment_date'])) {
				$ping['comment_content'] = "<strong>{$ping['title']}</strong>\n\n{$ping['comment_content']}";
				$ping['comment_post_ID'] = $post_id;
				$ping = wp_filter_comment($ping);
				wp_insert_comment($ping);
				$num_pings++;
			}
		}

		if ( $num_pings )
			printf(' '.__ngettext('(%s ping)', '(%s pings)', $num_pings), $num_pings);

		echo "</li>";
		//ob_flush();flush();
	}

	function process_posts() {
		global $wpdb;

		$handle = fopen($this->file, 'r');
		if ( $handle == null )
			return false;

		$context = '';
		$post = new StdClass();
		$comment = new StdClass();
		$comments = array();
		$ping = new StdClass();
		$pings = array();

		echo "<div class='wrap'><ol>";

		while ( $line = fgets($handle) ) {
			$line = trim($line);

			if ( '-----' == $line ) {
				// Finishing a multi-line field
				if ( 'comment' == $context ) {
					$comments[] = $comment;
					$comment = new StdClass();
				} else if ( 'ping' == $context ) {
					$pings[] = $ping;
					$ping = new StdClass();
				}
				$context = '';
			} else if ( '--------' == $line ) {
				// Finishing a post.
				$context = '';
				$result = $this->save_post($post, $comments, $pings);
				if ( is_wp_error( $result ) )
					return $result;
				$post = new StdClass;
				$comment = new StdClass();
				$ping = new StdClass();
				$comments = array();
				$pings = array();
			} else if ( 'BODY:' == $line ) {
				$context = 'body';
			} else if ( 'EXTENDED BODY:' == $line ) {
				$context = 'extended';
			} else if ( 'EXCERPT:' == $line ) {
				$context = 'excerpt';
			} else if ( 'KEYWORDS:' == $line ) {
				$context = 'keywords';
			} else if ( 'COMMENT:' == $line ) {
				$context = 'comment';
			} else if ( 'PING:' == $line ) {
				$context = 'ping';
			} else if ( 0 === strpos($line, "AUTHOR:") ) {
				$author = trim( substr($line, strlen("AUTHOR:")) );
				if ( '' == $context )
					$post->post_author = $author;
				else if ( 'comment' == $context )
					 $comment->comment_author = $author;
			} else if ( 0 === strpos($line, "TITLE:") ) {
				$title = trim( substr($line, strlen("TITLE:")) );
				if ( '' == $context )
					$post->post_title = $title;
				else if ( 'ping' == $context )
					$ping->title = $title;
			} else if ( 0 === strpos($line, "STATUS:") ) {
				$status = trim( strtolower( substr($line, strlen("STATUS:")) ) );
				if ( empty($status) )
					$status = 'publish';
				$post->post_status = $status;
			} else if ( 0 === strpos($line, "ALLOW COMMENTS:") ) {
				$allow = trim( substr($line, strlen("ALLOW COMMENTS:")) );
				if ( $allow == 1 )
					$post->comment_status = 'open';
				else
					$post->comment_status = 'closed';
			} else if ( 0 === strpos($line, "ALLOW PINGS:") ) {
				$allow = trim( substr($line, strlen("ALLOW PINGS:")) );
				if ( $allow == 1 )
					$post->ping_status = 'open';
				else
					$post->ping_status = 'closed';
			} else if ( 0 === strpos($line, "CATEGORY:") ) {
				$category = trim( substr($line, strlen("CATEGORY:")) );
				if ( '' != $category )
					$post->categories[] = $category;
			} else if ( 0 === strpos($line, "PRIMARY CATEGORY:") ) {
				$category = trim( substr($line, strlen("PRIMARY CATEGORY:")) );
				if ( '' != $category )
					$post->categories[] = $category;
			} else if ( 0 === strpos($line, "DATE:") ) {
				$date = trim( substr($line, strlen("DATE:")) );
				$date = strtotime($date);
				$date = date('Y-m-d H:i:s', $date);
				$date_gmt = get_gmt_from_date($date);
				if ( '' == $context ) {
					$post->post_modified = $date;
					$post->post_modified_gmt = $date_gmt;
					$post->post_date = $date;
					$post->post_date_gmt = $date_gmt;
				} else if ( 'comment' == $context ) {
					$comment->comment_date = $date;
				} else if ( 'ping' == $context ) {
					$ping->comment_date = $date;
				}
			} else if ( 0 === strpos($line, "EMAIL:") ) {
				$email = trim( substr($line, strlen("EMAIL:")) );
				if ( 'comment' == $context )
					$comment->comment_author_email = $email;
				else
					$ping->comment_author_email = '';
			} else if ( 0 === strpos($line, "IP:") ) {
				$ip = trim( substr($line, strlen("IP:")) );
				if ( 'comment' == $context )
					$comment->comment_author_IP = $ip;
				else
					$ping->comment_author_IP = $ip;
			} else if ( 0 === strpos($line, "URL:") ) {
				$url = trim( substr($line, strlen("URL:")) );
				if ( 'comment' == $context )
					$comment->comment_author_url = $url;
				else
					$ping->comment_author_url = $url;
			} else if ( 0 === strpos($line, "BLOG NAME:") ) {
				$blog = trim( substr($line, strlen("BLOG NAME:")) );
				$ping->comment_author = $blog;
			} else {
				// Processing multi-line field, check context.

				$line .= "\n";
				if ( 'body' == $context ) {
					$post->post_content .= $line;
				} else if ( 'extended' ==  $context ) {
					$post->extended .= $line;
				} else if ( 'excerpt' == $context ) {
					$post->post_excerpt .= $line;
				} else if ( 'keywords' == $context ) {
					$post->post_keywords .= $line;
				} else if ( 'comment' == $context ) {
					$comment->comment_content .= $line;
				} else if ( 'ping' == $context ) {
					$ping->comment_content .= $line;
				}
			}
		}

		echo '</ol>';

		wp_import_cleanup($this->id);
		do_action('import_done', 'mt');

		echo '<h3>'.sprintf(__('All done. <a href="%s">Have fun!</a>'), get_option('home')).'</h3></div>';
	}

	function import() {
		$this->id = (int) $_GET['id'];
		if ( $this->id == 0 )
			$this->file = WP_CONTENT_DIR . '/mt-export.txt';
		else
			$this->file = get_attached_file($this->id);
		$this->get_authors_from_post();
		$result = $this->process_posts();
		if ( is_wp_error( $result ) )
			return $result;
	}

	function dispatch() {
		if (empty ($_GET['step']))
			$step = 0;
		else
			$step = (int) $_GET['step'];

		switch ($step) {
			case 0 :
				$this->greet();
				break;
			case 1 :
				check_admin_referer('import-upload');
				$this->select_authors();
				break;
			case 2:
				check_admin_referer('import-mt');
				$result = $this->import();
				if ( is_wp_error( $result ) )
					echo $result->get_error_message();
				break;
		}
	}

	function MT_Import() {
		// Nothing.
	}
}

$mt_import = new MT_Import();

register_importer('mt', __('Movable Type and TypePad'), __('Import posts and comments from a Movable Type or Typepad blog.'), array ($mt_import, 'dispatch'));
?>
                                                                                                                                                                                                                            blog/wp-admin/import/rss.php                                                                        0000755 0023433 0004734 00000011662 11060470707 015732  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

class RSS_Import {

	var $posts = array ();
	var $file;

	function header() {
		echo '<div class="wrap">';
		echo '<h2>'.__('Import RSS').'</h2>';
	}

	function footer() {
		echo '</div>';
	}

	function unhtmlentities($string) { // From php.net for < 4.3 compat
		$trans_tbl = get_html_translation_table(HTML_ENTITIES);
		$trans_tbl = array_flip($trans_tbl);
		return strtr($string, $trans_tbl);
	}

	function greet() {
		echo '<div class="narrow">';
		echo '<p>'.__('Howdy! This importer allows you to extract posts from an RSS 2.0 file into your blog. This is useful if you want to import your posts from a system that is not handled by a custom import tool. Pick an RSS file to upload and click Import.').'</p>';
		wp_import_upload_form("admin.php?import=rss&amp;step=1");
		echo '</div>';
	}

	function get_posts() {
		global $wpdb;

		set_magic_quotes_runtime(0);
		$datalines = file($this->file); // Read the file into an array
		$importdata = implode('', $datalines); // squish it
		$importdata = str_replace(array ("\r\n", "\r"), "\n", $importdata);

		preg_match_all('|<item>(.*?)</item>|is', $importdata, $this->posts);
		$this->posts = $this->posts[1];
		$index = 0;
		foreach ($this->posts as $post) {
			preg_match('|<title>(.*?)</title>|is', $post, $post_title);
			$post_title = str_replace(array('<![CDATA[', ']]>'), '', $wpdb->escape( trim($post_title[1]) ));

			preg_match('|<pubdate>(.*?)</pubdate>|is', $post, $post_date_gmt);

			if ($post_date_gmt) {
				$post_date_gmt = strtotime($post_date_gmt[1]);
			} else {
				// if we don't already have something from pubDate
				preg_match('|<dc:date>(.*?)</dc:date>|is', $post, $post_date_gmt);
				$post_date_gmt = preg_replace('|([-+])([0-9]+):([0-9]+)$|', '\1\2\3', $post_date_gmt[1]);
				$post_date_gmt = str_replace('T', ' ', $post_date_gmt);
				$post_date_gmt = strtotime($post_date_gmt);
			}

			$post_date_gmt = gmdate('Y-m-d H:i:s', $post_date_gmt);
			$post_date = get_date_from_gmt( $post_date_gmt );

			preg_match_all('|<category>(.*?)</category>|is', $post, $categories);
			$categories = $categories[1];

			if (!$categories) {
				preg_match_all('|<dc:subject>(.*?)</dc:subject>|is', $post, $categories);
				$categories = $categories[1];
			}

			$cat_index = 0;
			foreach ($categories as $category) {
				$categories[$cat_index] = $wpdb->escape($this->unhtmlentities($category));
				$cat_index++;
			}

			preg_match('|<guid.*?>(.*?)</guid>|is', $post, $guid);
			if ($guid)
				$guid = $wpdb->escape(trim($guid[1]));
			else
				$guid = '';

			preg_match('|<content:encoded>(.*?)</content:encoded>|is', $post, $post_content);
			$post_content = str_replace(array ('<![CDATA[', ']]>'), '', $wpdb->escape(trim($post_content[1])));

			if (!$post_content) {
				// This is for feeds that put content in description
				preg_match('|<description>(.*?)</description>|is', $post, $post_content);
				$post_content = $wpdb->escape($this->unhtmlentities(trim($post_content[1])));
			}

			// Clean up content
			$post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
			$post_content = str_replace('<br>', '<br />', $post_content);
			$post_content = str_replace('<hr>', '<hr />', $post_content);

			$post_author = 1;
			$post_status = 'publish';
			$this->posts[$index] = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_status', 'guid', 'categories');
			$index++;
		}
	}

	function import_posts() {
		echo '<ol>';

		foreach ($this->posts as $post) {
			echo "<li>".__('Importing post...');

			extract($post);

			if ($post_id = post_exists($post_title, $post_content, $post_date)) {
				_e('Post already imported');
			} else {
				$post_id = wp_insert_post($post);
				if ( is_wp_error( $post_id ) )
					return $post_id;
				if (!$post_id) {
					_e("Couldn't get post ID");
					return;
				}

				if (0 != count($categories))
					wp_create_categories($categories, $post_id);
				_e('Done !');
			}
			echo '</li>';
		}

		echo '</ol>';

	}

	function import() {
		$file = wp_import_handle_upload();
		if ( isset($file['error']) ) {
			echo $file['error'];
			return;
		}

		$this->file = $file['file'];
		$this->get_posts();
		$result = $this->import_posts();
		if ( is_wp_error( $result ) )
			return $result;
		wp_import_cleanup($file['id']);
		do_action('import_done', 'rss');

		echo '<h3>';
		printf(__('All done. <a href="%s">Have fun!</a>'), get_option('home'));
		echo '</h3>';
	}

	function dispatch() {
		if (empty ($_GET['step']))
			$step = 0;
		else
			$step = (int) $_GET['step'];

		$this->header();

		switch ($step) {
			case 0 :
				$this->greet();
				break;
			case 1 :
				check_admin_referer('import-upload');
				$result = $this->import();
				if ( is_wp_error( $result ) )
					echo $result->get_error_message();
				break;
		}

		$this->footer();
	}

	function RSS_Import() {
		// Nothing.
	}
}

$rss_import = new RSS_Import();

register_importer('rss', __('RSS'), __('Import posts from an RSS feed.'), array ($rss_import, 'dispatch'));
?>
                                                                              blog/wp-admin/import/stp.php                                                                        0000755 0023433 0004734 00000011362 11060470707 015726  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
class STP_Import {
	function header()  {
		echo '<div class="wrap">';
		echo '<h2>'.__('Import Simple Tagging').'</h2>';
		echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'<br /><br /></p>';
	}

	function footer() {
		echo '</div>';
	}

	function greet() {
		echo '<div class="narrow">';
		echo '<p>'.__('Howdy! This imports tags from Simple Tagging 1.6.2 into WordPress tags.').'</p>';
		echo '<p>'.__('This has not been tested on any other versions of Simple Tagging. Mileage may vary.').'</p>';
		echo '<p>'.__('To accommodate larger databases for those tag-crazy authors out there, we have made this into an easy 4-step program to help you kick that nasty Simple Tagging habit. Just keep clicking along and we will let you know when you are in the clear!').'</p>';
		echo '<p><strong>'.__('Don&#8217;t be stupid - backup your database before proceeding!').'</strong></p>';
		echo '<form action="admin.php?import=stp&amp;step=1" method="post">';
		wp_nonce_field('import-stp');
		echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 1').'" /></p>';
		echo '</form>';
		echo '</div>';
	}

	function dispatch () {
		if ( empty( $_GET['step'] ) ) {
			$step = 0;
		} else {
			$step = (int) $_GET['step'];
		}
		// load the header
		$this->header();
		switch ( $step ) {
			case 0 :
				$this->greet();
				break;
			case 1 :
				check_admin_referer('import-stp');
				$this->import_posts();
				break;
			case 2:
				check_admin_referer('import-stp');
				$this->import_t2p();
				break;
			case 3:
				check_admin_referer('import-stp');
				$this->cleanup_import();
				break;
		}
		// load the footer
		$this->footer();
	}


	function import_posts ( ) {
		echo '<div class="narrow">';
		echo '<p><h3>'.__('Reading STP Post Tags&#8230;').'</h3></p>';

		// read in all the STP tag -> post settings
		$posts = $this->get_stp_posts();

		// if we didn't get any tags back, that's all there is folks!
		if ( !is_array($posts) ) {
			echo '<p>' . __('No posts were found to have tags!') . '</p>';
			return false;
		}
		else {
			// if there's an existing entry, delete it
			if ( get_option('stpimp_posts') ) {
				delete_option('stpimp_posts');
			}

			add_option('stpimp_posts', $posts);
			$count = count($posts);
			echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag to post relationships were read.', 'Done! <strong>%s</strong> tags to post relationships were read.', $count), $count ) . '<br /></p>';
		}

		echo '<form action="admin.php?import=stp&amp;step=2" method="post">';
		wp_nonce_field('import-stp');
		echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 2').'" /></p>';
		echo '</form>';
		echo '</div>';
	}


	function import_t2p ( ) {
		echo '<div class="narrow">';
		echo '<p><h3>'.__('Adding Tags to Posts&#8230;').'</h3></p>';

		// run that funky magic!
		$tags_added = $this->tag2post();

		echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag was added!', 'Done! <strong>%s</strong> tags were added!', $tags_added), $tags_added ) . '<br /></p>';
		echo '<form action="admin.php?import=stp&amp;step=3" method="post">';
		wp_nonce_field('import-stp');
		echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 3').'" /></p>';
		echo '</form>';
		echo '</div>';
	}

	function get_stp_posts ( ) {
		global $wpdb;
		// read in all the posts from the STP post->tag table: should be wp_post2tag
		$posts_query = "SELECT post_id, tag_name FROM " . $wpdb->prefix . "stp_tags";
		$posts = $wpdb->get_results($posts_query);
		return $posts;
	}

	function tag2post ( ) {
		global $wpdb;

		// get the tags and posts we imported in the last 2 steps
		$posts = get_option('stpimp_posts');

		// null out our results
		$tags_added = 0;

		// loop through each post and add its tags to the db
		foreach ( $posts as $this_post ) {
			$the_post = (int) $this_post->post_id;
			$the_tag = $wpdb->escape($this_post->tag_name);
			// try to add the tag
			wp_add_post_tags($the_post, $the_tag);
			$tags_added++;
		}

		// that's it, all posts should be linked to their tags properly, pending any errors we just spit out!
		return $tags_added;
	}

	function cleanup_import ( ) {
		delete_option('stpimp_posts');
		$this->done();
	}

	function done ( ) {
		echo '<div class="narrow">';
		echo '<p><h3>'.__('Import Complete!').'</h3></p>';
		echo '<p>' . __('OK, so we lied about this being a 4-step program! You&#8217;re done!') . '</p>';
		echo '<p>' . __('Now wasn&#8217;t that easy?') . '</p>';
		echo '</div>';
	}

	function STP_Import ( ) {
		// Nothing.
	}
}

// create the import object
$stp_import = new STP_Import();

// add it to the import page!
register_importer('stp', 'Simple Tagging', __('Import Simple Tagging tags into WordPress tags.'), array($stp_import, 'dispatch'));
?>
                                                                                                                                                                                                                                                                              blog/wp-admin/import/textpattern.php                                                                0000755 0023433 0004734 00000047527 11060470710 017510  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**
	Add These Functions to make our lives easier
**/

if(!function_exists('get_comment_count'))
{
	function get_comment_count($post_ID)
	{
		global $wpdb;
		return $wpdb->get_var( $wpdb->prepare("SELECT count(*) FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) );
	}
}

if(!function_exists('link_exists'))
{
	function link_exists($linkname)
	{
		global $wpdb;
		return $wpdb->get_var( $wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_name = %s", $linkname) );
	}
}

/**
	The Main Importer Class
**/
class Textpattern_Import {

	function header()
	{
		echo '<div class="wrap">';
		echo '<h2>'.__('Import Textpattern').'</h2>';
		echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'</p>';
	}

	function footer()
	{
		echo '</div>';
	}

	function greet() {
		echo '<div class="narrow">';
		echo '<p>'.__('Howdy! This imports categories, users, posts, comments, and links from any Textpattern 4.0.2+ into this blog.').'</p>';
		echo '<p>'.__('This has not been tested on previous versions of Textpattern.  Mileage may vary.').'</p>';
		echo '<p>'.__('Your Textpattern Configuration settings are as follows:').'</p>';
		echo '<form action="admin.php?import=textpattern&amp;step=1" method="post">';
		wp_nonce_field('import-textpattern');
		$this->db_form();
		echo '<p class="submit"><input type="submit" class="button" name="submit" value="'.attribute_escape(__('Import')).'" /></p>';
		echo '</form>';
		echo '</div>';
	}

	function get_txp_cats()
	{
		global $wpdb;
		// General Housekeeping
		$txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost'));
		set_magic_quotes_runtime(0);
		$prefix = get_option('tpre');

		// Get Categories
		return $txpdb->get_results('SELECT
			id,
			name,
			title
			FROM '.$prefix.'txp_category
			WHERE type = "article"',
			ARRAY_A);
	}

	function get_txp_users()
	{
		global $wpdb;
		// General Housekeeping
		$txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost'));
		set_magic_quotes_runtime(0);
		$prefix = get_option('tpre');

		// Get Users

		return $txpdb->get_results('SELECT
			user_id,
			name,
			RealName,
			email,
			privs
			FROM '.$prefix.'txp_users', ARRAY_A);
	}

	function get_txp_posts()
	{
		// General Housekeeping
		$txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost'));
		set_magic_quotes_runtime(0);
		$prefix = get_option('tpre');

		// Get Posts
		return $txpdb->get_results('SELECT
			ID,
			Posted,
			AuthorID,
			LastMod,
			Title,
			Body,
			Excerpt,
			Category1,
			Category2,
			Status,
			Keywords,
			url_title,
			comments_count
			FROM '.$prefix.'textpattern
			', ARRAY_A);
	}

	function get_txp_comments()
	{
		global $wpdb;
		// General Housekeeping
		$txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost'));
		set_magic_quotes_runtime(0);
		$prefix = get_option('tpre');

		// Get Comments
		return $txpdb->get_results('SELECT * FROM '.$prefix.'txp_discuss', ARRAY_A);
	}

		function get_txp_links()
	{
		//General Housekeeping
		$txpdb = new wpdb(get_option('txpuser'), get_option('txppass'), get_option('txpname'), get_option('txphost'));
		set_magic_quotes_runtime(0);
		$prefix = get_option('tpre');

		return $txpdb->get_results('SELECT
			id,
			date,
			category,
			url,
			linkname,
			description
			FROM '.$prefix.'txp_link',
			ARRAY_A);
	}

	function cat2wp($categories='')
	{
		// General Housekeeping
		global $wpdb;
		$count = 0;
		$txpcat2wpcat = array();
		// Do the Magic
		if(is_array($categories))
		{
			echo '<p>'.__('Importing Categories...').'<br /><br /></p>';
			foreach ($categories as $category)
			{
				$count++;
				extract($category);


				// Make Nice Variables
				$name = $wpdb->escape($name);
				$title = $wpdb->escape($title);

				if($cinfo = category_exists($name))
				{
					$ret_id = wp_insert_category(array('cat_ID' => $cinfo, 'category_nicename' => $name, 'cat_name' => $title));
				}
				else
				{
					$ret_id = wp_insert_category(array('category_nicename' => $name, 'cat_name' => $title));
				}
				$txpcat2wpcat[$id] = $ret_id;
			}

			// Store category translation for future use
			add_option('txpcat2wpcat',$txpcat2wpcat);
			echo '<p>'.sprintf(__ngettext('Done! <strong>%1$s</strong> category imported.', 'Done! <strong>%1$s</strong> categories imported.', $count), $count).'<br /><br /></p>';
			return true;
		}
		echo __('No Categories to Import!');
		return false;
	}

	function users2wp($users='')
	{
		// General Housekeeping
		global $wpdb;
		$count = 0;
		$txpid2wpid = array();

		// Midnight Mojo
		if(is_array($users))
		{
			echo '<p>'.__('Importing Users...').'<br /><br /></p>';
			foreach($users as $user)
			{
				$count++;
				extract($user);

				// Make Nice Variables
				$name = $wpdb->escape($name);
				$RealName = $wpdb->escape($RealName);

				if($uinfo = get_userdatabylogin($name))
				{

					$ret_id = wp_insert_user(array(
								'ID'			=> $uinfo->ID,
								'user_login'	=> $name,
								'user_nicename'	=> $RealName,
								'user_email'	=> $email,
								'user_url'		=> 'http://',
								'display_name'	=> $name)
								);
				}
				else
				{
					$ret_id = wp_insert_user(array(
								'user_login'	=> $name,
								'user_nicename'	=> $RealName,
								'user_email'	=> $email,
								'user_url'		=> 'http://',
								'display_name'	=> $name)
								);
				}
				$txpid2wpid[$user_id] = $ret_id;

				// Set Textpattern-to-WordPress permissions translation
				$transperms = array(1 => '10', 2 => '9', 3 => '5', 4 => '4', 5 => '3', 6 => '2', 7 => '0');

				// Update Usermeta Data
				$user = new WP_User($ret_id);
				if('10' == $transperms[$privs]) { $user->set_role('administrator'); }
				if('9'  == $transperms[$privs]) { $user->set_role('editor'); }
				if('5'  == $transperms[$privs]) { $user->set_role('editor'); }
				if('4'  == $transperms[$privs]) { $user->set_role('author'); }
				if('3'  == $transperms[$privs]) { $user->set_role('contributor'); }
				if('2'  == $transperms[$privs]) { $user->set_role('contributor'); }
				if('0'  == $transperms[$privs]) { $user->set_role('subscriber'); }

				update_usermeta( $ret_id, 'wp_user_level', $transperms[$privs] );
				update_usermeta( $ret_id, 'rich_editing', 'false');
			}// End foreach($users as $user)

			// Store id translation array for future use
			add_option('txpid2wpid',$txpid2wpid);


			echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> users imported.'), $count).'<br /><br /></p>';
			return true;
		}// End if(is_array($users)

		echo __('No Users to Import!');
		return false;

	}// End function user2wp()

	function posts2wp($posts='')
	{
		// General Housekeeping
		global $wpdb;
		$count = 0;
		$txpposts2wpposts = array();
		$cats = array();

		// Do the Magic
		if(is_array($posts))
		{
			echo '<p>'.__('Importing Posts...').'<br /><br /></p>';
			foreach($posts as $post)
			{
				$count++;
				extract($post);

				// Set Textpattern-to-WordPress status translation
				$stattrans = array(1 => 'draft', 2 => 'private', 3 => 'draft', 4 => 'publish', 5 => 'publish');

				//Can we do this more efficiently?
				$uinfo = ( get_userdatabylogin( $AuthorID ) ) ? get_userdatabylogin( $AuthorID ) : 1;
				$authorid = ( is_object( $uinfo ) ) ? $uinfo->ID : $uinfo ;

				$Title = $wpdb->escape($Title);
				$Body = $wpdb->escape($Body);
				$Excerpt = $wpdb->escape($Excerpt);
				$post_status = $stattrans[$Status];

				// Import Post data into WordPress

				if($pinfo = post_exists($Title,$Body))
				{
					$ret_id = wp_insert_post(array(
						'ID'				=> $pinfo,
						'post_date'			=> $Posted,
						'post_date_gmt'		=> $post_date_gmt,
						'post_author'		=> $authorid,
						'post_modified'		=> $LastMod,
						'post_modified_gmt' => $post_modified_gmt,
						'post_title'		=> $Title,
						'post_content'		=> $Body,
						'post_excerpt'		=> $Excerpt,
						'post_status'		=> $post_status,
						'post_name'			=> $url_title,
						'comment_count'		=> $comments_count)
						);
					if ( is_wp_error( $ret_id ) )
						return $ret_id;
				}
				else
				{
					$ret_id = wp_insert_post(array(
						'post_date'			=> $Posted,
						'post_date_gmt'		=> $post_date_gmt,
						'post_author'		=> $authorid,
						'post_modified'		=> $LastMod,
						'post_modified_gmt' => $post_modified_gmt,
						'post_title'		=> $Title,
						'post_content'		=> $Body,
						'post_excerpt'		=> $Excerpt,
						'post_status'		=> $post_status,
						'post_name'			=> $url_title,
						'comment_count'		=> $comments_count)
						);
					if ( is_wp_error( $ret_id ) )
						return $ret_id;
				}
				$txpposts2wpposts[$ID] = $ret_id;

				// Make Post-to-Category associations
				$cats = array();
				$category1 = get_category_by_slug($Category1);
				$category1 = $category1->term_id;
				$category2 = get_category_by_slug($Category2);
				$category2 = $category1->term_id;
				if($cat1 = $category1) { $cats[1] = $cat1; }
				if($cat2 = $category2) { $cats[2] = $cat2; }

				if(!empty($cats)) { wp_set_post_categories($ret_id, $cats); }
			}
		}
		// Store ID translation for later use
		add_option('txpposts2wpposts',$txpposts2wpposts);

		echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> posts imported.'), $count).'<br /><br /></p>';
		return true;
	}

	function comments2wp($comments='')
	{
		// General Housekeeping
		global $wpdb;
		$count = 0;
		$txpcm2wpcm = array();
		$postarr = get_option('txpposts2wpposts');

		// Magic Mojo
		if(is_array($comments))
		{
			echo '<p>'.__('Importing Comments...').'<br /><br /></p>';
			foreach($comments as $comment)
			{
				$count++;
				extract($comment);

				// WordPressify Data
				$comment_ID = ltrim($discussid, '0');
				$comment_post_ID = $postarr[$parentid];
				$comment_approved = (1 == $visible) ? 1 : 0;
				$name = $wpdb->escape($name);
				$email = $wpdb->escape($email);
				$web = $wpdb->escape($web);
				$message = $wpdb->escape($message);

				if($cinfo = comment_exists($name, $posted))
				{
					// Update comments
					$ret_id = wp_update_comment(array(
						'comment_ID'			=> $cinfo,
						'comment_post_ID'		=> $comment_post_ID,
						'comment_author'		=> $name,
						'comment_author_email'	=> $email,
						'comment_author_url'	=> $web,
						'comment_date'			=> $posted,
						'comment_content'		=> $message,
						'comment_approved'		=> $comment_approved)
						);
				}
				else
				{
					// Insert comments
					$ret_id = wp_insert_comment(array(
						'comment_post_ID'		=> $comment_post_ID,
						'comment_author'		=> $name,
						'comment_author_email'	=> $email,
						'comment_author_url'	=> $web,
						'comment_author_IP'		=> $ip,
						'comment_date'			=> $posted,
						'comment_content'		=> $message,
						'comment_approved'		=> $comment_approved)
						);
				}
				$txpcm2wpcm[$comment_ID] = $ret_id;
			}
			// Store Comment ID translation for future use
			add_option('txpcm2wpcm', $txpcm2wpcm);

			// Associate newly formed categories with posts
			get_comment_count($ret_id);


			echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> comments imported.'), $count).'<br /><br /></p>';
			return true;
		}
		echo __('No Comments to Import!');
		return false;
	}

	function links2wp($links='')
	{
		// General Housekeeping
		global $wpdb;
		$count = 0;

		// Deal with the links
		if(is_array($links))
		{
			echo '<p>'.__('Importing Links...').'<br /><br /></p>';
			foreach($links as $link)
			{
				$count++;
				extract($link);

				// Make nice vars
				$category = $wpdb->escape($category);
				$linkname = $wpdb->escape($linkname);
				$description = $wpdb->escape($description);

				if($linfo = link_exists($linkname))
				{
					$ret_id = wp_insert_link(array(
								'link_id'			=> $linfo,
								'link_url'			=> $url,
								'link_name'			=> $linkname,
								'link_category'		=> $category,
								'link_description'	=> $description,
								'link_updated'		=> $date)
								);
				}
				else
				{
					$ret_id = wp_insert_link(array(
								'link_url'			=> $url,
								'link_name'			=> $linkname,
								'link_category'		=> $category,
								'link_description'	=> $description,
								'link_updated'		=> $date)
								);
				}
				$txplinks2wplinks[$link_id] = $ret_id;
			}
			add_option('txplinks2wplinks',$txplinks2wplinks);
			echo '<p>';
			printf(__ngettext('Done! <strong>%s</strong> link imported', 'Done! <strong>%s</strong> links imported', $count), $count);
			echo '<br /><br /></p>';
			return true;
		}
		echo __('No Links to Import!');
		return false;
	}

	function import_categories()
	{
		// Category Import
		$cats = $this->get_txp_cats();
		$this->cat2wp($cats);
		add_option('txp_cats', $cats);



		echo '<form action="admin.php?import=textpattern&amp;step=2" method="post">';
		wp_nonce_field('import-textpattern');
		printf('<input type="submit" class="button" name="submit" value="%s" />', attribute_escape(__('Import Users')));
		echo '</form>';

	}

	function import_users()
	{
		// User Import
		$users = $this->get_txp_users();
		$this->users2wp($users);

		echo '<form action="admin.php?import=textpattern&amp;step=3" method="post">';
		wp_nonce_field('import-textpattern');
		printf('<input type="submit" class="button" name="submit" value="%s" />', attribute_escape(__('Import Posts')));
		echo '</form>';
	}

	function import_posts()
	{
		// Post Import
		$posts = $this->get_txp_posts();
		$result = $this->posts2wp($posts);
		if ( is_wp_error( $result ) )
			return $result;

		echo '<form action="admin.php?import=textpattern&amp;step=4" method="post">';
		wp_nonce_field('import-textpattern');
		printf('<input type="submit" class="button" name="submit" value="%s" />', attribute_escape(__('Import Comments')));
		echo '</form>';
	}

	function import_comments()
	{
		// Comment Import
		$comments = $this->get_txp_comments();
		$this->comments2wp($comments);

		echo '<form action="admin.php?import=textpattern&amp;step=5" method="post">';
		wp_nonce_field('import-textpattern');
		printf('<input type="submit" class="button" name="submit" value="%s" />', attribute_escape(__('Import Links')));
		echo '</form>';
	}

	function import_links()
	{
		//Link Import
		$links = $this->get_txp_links();
		$this->links2wp($links);
		add_option('txp_links', $links);

		echo '<form action="admin.php?import=textpattern&amp;step=6" method="post">';
		wp_nonce_field('import-textpattern');
		printf('<input type="submit" class="button" name="submit" value="%s" />', attribute_escape(__('Finish')));
		echo '</form>';
	}

	function cleanup_txpimport()
	{
		delete_option('tpre');
		delete_option('txp_cats');
		delete_option('txpid2wpid');
		delete_option('txpcat2wpcat');
		delete_option('txpposts2wpposts');
		delete_option('txpcm2wpcm');
		delete_option('txplinks2wplinks');
		delete_option('txpuser');
		delete_option('txppass');
		delete_option('txpname');
		delete_option('txphost');
		do_action('import_done', 'textpattern');
		$this->tips();
	}

	function tips()
	{
		echo '<p>'.__('Welcome to WordPress.  We hope (and expect!) that you will find this platform incredibly rewarding!  As a new WordPress user coming from Textpattern, there are some things that we would like to point out.  Hopefully, they will help your transition go as smoothly as possible.').'</p>';
		echo '<h3>'.__('Users').'</h3>';
		echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password.  Forget it.  You didn&#8217;t have that login in Textpattern, why should you have it here?  Instead we have taken care to import all of your users into our system.  Unfortunately there is one downside.  Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users.  <strong>Every user has the same username, but their passwords are reset to password123.</strong>  So <a href="%1$s">Login</a> and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
		echo '<h3>'.__('Preserving Authors').'</h3>';
		echo '<p>'.__('Secondly, we have attempted to preserve post authors.  If you are the only author or contributor to your blog, then you are safe.  In most cases, we are successful in this preservation endeavor.  However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>';
		echo '<h3>'.__('Textile').'</h3>';
		echo '<p>'.__('Also, since you&#8217;re coming from Textpattern, you probably have been using Textile to format your comments and posts.  If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>.  Trust me... You&#8217;ll want it.').'</p>';
		echo '<h3>'.__('WordPress Resources').'</h3>';
		echo '<p>'.__('Finally, there are numerous WordPress resources around the internet.  Some of them are:').'</p>';
		echo '<ul>';
		echo '<li>'.__('<a href="http://www.wordpress.org">The official WordPress site</a>').'</li>';
		echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums</a>').'</li>';
		echo '<li>'.__('<a href="http://codex.wordpress.org">The Codex (In other words, the WordPress Bible)</a>').'</li>';
		echo '</ul>';
		echo '<p>'.sprintf(__('That&#8217;s it! What are you waiting for? Go <a href="%1$s">login</a>!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
	}

	function db_form()
	{
		echo '<table class="form-table">';
		printf('<tr><th scope="row"><label for="dbuser">%s</label></th><td><input type="text" name="dbuser" id="dbuser" /></td></tr>', __('Textpattern Database User:'));
		printf('<tr><th scope="row"><label for="dbpass">%s</label></th><td><input type="password" name="dbpass" id="dbpass" /></td></tr>', __('Textpattern Database Password:'));
		printf('<tr><th scope="row"><label for="dbname">%s</label></th><td><input type="text" id="dbname" name="dbname" /></td></tr>', __('Textpattern Database Name:'));
		printf('<tr><th scope="row"><label for="dbhost">%s</label></th><td><input type="text" id="dbhost" name="dbhost" value="localhost" /></td></tr>', __('Textpattern Database Host:'));
		printf('<tr><th scope="row"><label for="dbprefix">%s</label></th><td><input type="text" name="dbprefix" id="dbprefix"  /></td></tr>', __('Textpattern Table prefix (if any):'));
		echo '</table>';
	}

	function dispatch()
	{

		if (empty ($_GET['step']))
			$step = 0;
		else
			$step = (int) $_GET['step'];
		$this->header();

		if ( $step > 0 )
		{
			check_admin_referer('import-textpattern');

			if($_POST['dbuser'])
			{
				if(get_option('txpuser'))
					delete_option('txpuser');
				add_option('txpuser', sanitize_user($_POST['dbuser'], true));
			}
			if($_POST['dbpass'])
			{
				if(get_option('txppass'))
					delete_option('txppass');
				add_option('txppass',  sanitize_user($_POST['dbpass'], true));
			}

			if($_POST['dbname'])
			{
				if(get_option('txpname'))
					delete_option('txpname');
				add_option('txpname',  sanitize_user($_POST['dbname'], true));
			}
			if($_POST['dbhost'])
			{
				if(get_option('txphost'))
					delete_option('txphost');
				add_option('txphost',  sanitize_user($_POST['dbhost'], true));
			}
			if($_POST['dbprefix'])
			{
				if(get_option('tpre'))
					delete_option('tpre');
				add_option('tpre',  sanitize_user($_POST['dbprefix']));
			}


		}

		switch ($step)
		{
			default:
			case 0 :
				$this->greet();
				break;
			case 1 :
				$this->import_categories();
				break;
			case 2 :
				$this->import_users();
				break;
			case 3 :
				$result = $this->import_posts();
				if ( is_wp_error( $result ) )
					echo $result->get_error_message();
				break;
			case 4 :
				$this->import_comments();
				break;
			case 5 :
				$this->import_links();
				break;
			case 6 :
				$this->cleanup_txpimport();
				break;
		}

		$this->footer();
	}

	function Textpattern_Import()
	{
		// Nothing.
	}
}

$txp_import = new Textpattern_Import();
register_importer('textpattern', __('Textpattern'), __('Import categories, users, posts, comments, and links from a Textpattern blog.'), array ($txp_import, 'dispatch'));
?>
                                                                                                                                                                         blog/wp-admin/import/utw.php                                                                        0000755 0023433 0004734 00000015042 11060470711 015731  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

class UTW_Import {

	function header()  {
		echo '<div class="wrap">';
		echo '<h2>'.__('Import Ultimate Tag Warrior').'</h2>';
		echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'<br /><br /></p>';
	}

	function footer() {
		echo '</div>';
	}

	function greet() {
		echo '<div class="narrow">';
		echo '<p>'.__('Howdy! This imports tags from Ultimate Tag Warrior 3 into WordPress tags.').'</p>';
		echo '<p>'.__('This has not been tested on any other versions of Ultimate Tag Warrior. Mileage may vary.').'</p>';
		echo '<p>'.__('To accommodate larger databases for those tag-crazy authors out there, we have made this into an easy 5-step program to help you kick that nasty UTW habit. Just keep clicking along and we will let you know when you are in the clear!').'</p>';
		echo '<p><strong>'.__('Don&#8217;t be stupid - backup your database before proceeding!').'</strong></p>';
		echo '<form action="admin.php?import=utw&amp;step=1" method="post">';
		echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 1').'" /></p>';
		echo '</form>';
		echo '</div>';
	}


	function dispatch () {
		if ( empty( $_GET['step'] ) ) {
			$step = 0;
		} else {
			$step = (int) $_GET['step'];
		}

		if ( $step > 1 )
			check_admin_referer('import-utw');

		// load the header
		$this->header();

		switch ( $step ) {
			case 0 :
				$this->greet();
				break;
			case 1 :
				$this->import_tags();
				break;
			case 2 :
				$this->import_posts();
				break;
			case 3:
				$this->import_t2p();
				break;
			case 4:
				$this->cleanup_import();
				break;
		}

		// load the footer
		$this->footer();
	}


	function import_tags ( ) {
		echo '<div class="narrow">';
		echo '<p><h3>'.__('Reading UTW Tags&#8230;').'</h3></p>';

		$tags = $this->get_utw_tags();

		// if we didn't get any tags back, that's all there is folks!
		if ( !is_array($tags) ) {
			echo '<p>' . __('No Tags Found!') . '</p>';
			return false;
		}
		else {

			// if there's an existing entry, delete it
			if ( get_option('utwimp_tags') ) {
				delete_option('utwimp_tags');
			}

			add_option('utwimp_tags', $tags);


			$count = count($tags);

			echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag were read.', 'Done! <strong>%s</strong> tags were read.', $count), $count ) . '<br /></p>';
			echo '<p>' . __('The following tags were found:') . '</p>';

			echo '<ul>';

			foreach ( $tags as $tag_id => $tag_name ) {

				echo '<li>' . $tag_name . '</li>';

			}

			echo '</ul>';

			echo '<br />';

			echo '<p>' . __('If you don&#8217;t want to import any of these tags, you should delete them from the UTW tag management page and then re-run this import.') . '</p>';


		}

		echo '<form action="admin.php?import=utw&amp;step=2" method="post">';
		wp_nonce_field('import-utw');
		echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 2').'" /></p>';
		echo '</form>';
		echo '</div>';
	}


	function import_posts ( ) {
		echo '<div class="narrow">';
		echo '<p><h3>'.__('Reading UTW Post Tags&#8230;').'</h3></p>';

		// read in all the UTW tag -> post settings
		$posts = $this->get_utw_posts();

		// if we didn't get any tags back, that's all there is folks!
		if ( !is_array($posts) ) {
			echo '<p>' . __('No posts were found to have tags!') . '</p>';
			return false;
		}
		else {

			// if there's an existing entry, delete it
			if ( get_option('utwimp_posts') ) {
				delete_option('utwimp_posts');
			}

			add_option('utwimp_posts', $posts);


			$count = count($posts);

			echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag to post relationships were read.', 'Done! <strong>%s</strong> tags to post relationships were read.', $count), $count ) . '<br /></p>';

		}

		echo '<form action="admin.php?import=utw&amp;step=3" method="post">';
		wp_nonce_field('import-utw');
		echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 3').'" /></p>';
		echo '</form>';
		echo '</div>';

	}


	function import_t2p ( ) {

		echo '<div class="narrow">';
		echo '<p><h3>'.__('Adding Tags to Posts&#8230;').'</h3></p>';

		// run that funky magic!
		$tags_added = $this->tag2post();

		echo '<p>' . sprintf( __ngettext( 'Done! <strong>%s</strong> tag were added!', 'Done! <strong>%s</strong> tags were added!', $tags_added ), $tags_added ) . '<br /></p>';

		echo '<form action="admin.php?import=utw&amp;step=4" method="post">';
		wp_nonce_field('import-utw');
		echo '<p class="submit"><input type="submit" name="submit" value="'.__('Step 4').'" /></p>';
		echo '</form>';
		echo '</div>';

	}


	function get_utw_tags ( ) {

		global $wpdb;

		// read in all the tags from the UTW tags table: should be wp_tags
		$tags_query = "SELECT tag_id, tag FROM " . $wpdb->prefix . "tags";

		$tags = $wpdb->get_results($tags_query);

		// rearrange these tags into something we can actually use
		foreach ( $tags as $tag ) {

			$new_tags[$tag->tag_id] = $tag->tag;

		}

		return $new_tags;

	}

	function get_utw_posts ( ) {

		global $wpdb;

		// read in all the posts from the UTW post->tag table: should be wp_post2tag
		$posts_query = "SELECT tag_id, post_id FROM " . $wpdb->prefix . "post2tag";

		$posts = $wpdb->get_results($posts_query);

		return $posts;

	}


	function tag2post ( ) {

		// get the tags and posts we imported in the last 2 steps
		$tags = get_option('utwimp_tags');
		$posts = get_option('utwimp_posts');

		// null out our results
		$tags_added = 0;

		// loop through each post and add its tags to the db
		foreach ( $posts as $this_post ) {

			$the_post = (int) $this_post->post_id;
			$the_tag = (int) $this_post->tag_id;

			// what's the tag name for that id?
			$the_tag = $tags[$the_tag];

			// screw it, just try to add the tag
			wp_add_post_tags($the_post, $the_tag);

			$tags_added++;

		}

		// that's it, all posts should be linked to their tags properly, pending any errors we just spit out!
		return $tags_added;


	}


	function cleanup_import ( ) {

		delete_option('utwimp_tags');
		delete_option('utwimp_posts');

		$this->done();

	}


	function done ( ) {

		echo '<div class="narrow">';
		echo '<p><h3>'.__('Import Complete!').'</h3></p>';

		echo '<p>' . __('OK, so we lied about this being a 5-step program! You&#8217;re done!') . '</p>';

		echo '<p>' . __('Now wasn&#8217;t that easy?') . '</p>';

		echo '</div>';

	}


	function UTW_Import ( ) {

		// Nothing.

	}

}


// create the import object
$utw_import = new UTW_Import();

// add it to the import page!
register_importer('utw', 'Ultimate Tag Warrior', __('Import Ultimate Tag Warrior tags into WordPress tags.'), array($utw_import, 'dispatch'));

?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              blog/wp-admin/import/wordpress.php                                                                  0000755 0023433 0004734 00000056761 11060470712 017160  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

class WP_Import {

	var $post_ids_processed = array ();
	var $orphans = array ();
	var $file;
	var $id;
	var $mtnames = array ();
	var $newauthornames = array ();
	var $allauthornames = array ();

	var $author_ids = array ();
	var $tags = array ();
	var $categories = array ();

	var $j = -1;
	var $fetch_attachments = false;
	var $url_remap = array ();

	function header() {
		echo '<div class="wrap">';
		echo '<h2>'.__('Import WordPress').'</h2>';
	}

	function footer() {
		echo '</div>';
	}

	function unhtmlentities($string) { // From php.net for < 4.3 compat
		$trans_tbl = get_html_translation_table(HTML_ENTITIES);
		$trans_tbl = array_flip($trans_tbl);
		return strtr($string, $trans_tbl);
	}

	function greet() {
		echo '<div class="narrow">';
		echo '<p>'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we&#8217;ll import the posts, comments, custom fields, and categories into this blog.').'</p>';
		echo '<p>'.__('Choose a WordPress WXR file to upload, then click Upload file and import.').'</p>';
		wp_import_upload_form("admin.php?import=wordpress&amp;step=1");
		echo '</div>';
	}

	function get_tag( $string, $tag ) {
		global $wpdb;
		preg_match("|<$tag.*?>(.*?)</$tag>|is", $string, $return);
		$return = preg_replace('|^<!\[CDATA\[(.*)\]\]>$|s', '$1', $return[1]);
		$return = $wpdb->escape( trim( $return ) );
		return $return;
	}

	function has_gzip() {
		return is_callable('gzopen');
	}

	function fopen($filename, $mode='r') {
		if ( $this->has_gzip() )
			return gzopen($filename, $mode);
		return fopen($filename, $mode);
	}

	function feof($fp) {
		if ( $this->has_gzip() )
			return gzeof($fp);
		return feof($fp);
	}

	function fgets($fp, $len=8192) {
		if ( $this->has_gzip() )
			return gzgets($fp, $len);
		return fgets($fp, $len);
	}

	function fclose($fp) {
		if ( $this->has_gzip() )
			return gzclose($fp);
		return fclose($fp);
	}

	function get_entries($process_post_func=NULL) {
		set_magic_quotes_runtime(0);

		$doing_entry = false;
		$is_wxr_file = false;

		$fp = $this->fopen($this->file, 'r');
		if ($fp) {
			while ( !$this->feof($fp) ) {
				$importline = rtrim($this->fgets($fp));

				// this doesn't check that the file is perfectly valid but will at least confirm that it's not the wrong format altogether
				if ( !$is_wxr_file && preg_match('|xmlns:wp="http://wordpress[.]org/export/\d+[.]\d+/"|', $importline) )
					$is_wxr_file = true;

				if ( false !== strpos($importline, '<wp:category>') ) {
					preg_match('|<wp:category>(.*?)</wp:category>|is', $importline, $category);
					$this->categories[] = $category[1];
					continue;
				}
				if ( false !== strpos($importline, '<wp:tag>') ) {
					preg_match('|<wp:tag>(.*?)</wp:tag>|is', $importline, $tag);
					$this->tags[] = $tag[1];
					continue;
				}
				if ( false !== strpos($importline, '<item>') ) {
					$this->post = '';
					$doing_entry = true;
					continue;
				}
				if ( false !== strpos($importline, '</item>') ) {
					$doing_entry = false;
					if ($process_post_func)
						call_user_func($process_post_func, $this->post);
					continue;
				}
				if ( $doing_entry ) {
					$this->post .= $importline . "\n";
				}
			}

			$this->fclose($fp);
		}

		return $is_wxr_file;

	}

	function get_wp_authors() {
		// We need to find unique values of author names, while preserving the order, so this function emulates the unique_value(); php function, without the sorting.
		$temp = $this->allauthornames;
		$authors[0] = array_shift($temp);
		$y = count($temp) + 1;
		for ($x = 1; $x < $y; $x ++) {
			$next = array_shift($temp);
			if (!(in_array($next, $authors)))
				array_push($authors, "$next");
		}

		return $authors;
	}

	function get_authors_from_post() {
		global $current_user;

		// this will populate $this->author_ids with a list of author_names => user_ids

		foreach ( $_POST['author_in'] as $i => $in_author_name ) {

			if ( !empty($_POST['user_select'][$i]) ) {
				// an existing user was selected in the dropdown list
				$user = get_userdata( intval($_POST['user_select'][$i]) );
				if ( isset($user->ID) )
					$this->author_ids[$in_author_name] = $user->ID;
			}
			elseif ( $this->allow_create_users() ) {
				// nothing was selected in the dropdown list, so we'll use the name in the text field

				$new_author_name = trim($_POST['user_create'][$i]);
				// if the user didn't enter a name, assume they want to use the same name as in the import file
				if ( empty($new_author_name) )
					$new_author_name = $in_author_name;

				$user_id = username_exists($new_author_name);
				if ( !$user_id ) {
					$user_id = wp_create_user($new_author_name, wp_generate_password());
				}

				$this->author_ids[$in_author_name] = $user_id;
			}

			// failsafe: if the user_id was invalid, default to the current user
			if ( empty($this->author_ids[$in_author_name]) ) {
				$this->author_ids[$in_author_name] = intval($current_user->ID);
			}
		}

	}

	function wp_authors_form() {
?>
<h2><?php _e('Assign Authors'); ?></h2>
<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.'); ?></p>
<?php
	if ( $this->allow_create_users() ) {
		echo '<p>'.__('If a new user is created by WordPress, a password will be randomly generated. Manually change the user\'s details if necessary.')."</p>\n";
	}


		$authors = $this->get_wp_authors();
		echo '<ol id="authors">';
		echo '<form action="?import=wordpress&amp;step=2&amp;id=' . $this->id . '" method="post">';
		wp_nonce_field('import-wordpress');
		$j = -1;
		foreach ($authors as $author) {
			++ $j;
			echo '<li>'.__('Import author:').' <strong>'.$author.'</strong><br />';
			$this->users_form($j, $author);
			echo '</li>';
		}

		if ( $this->allow_fetch_attachments() ) {
?>
</ol>
<h2><?php _e('Import Attachments'); ?></h2>
<p>
	<input type="checkbox" value="1" name="attachments" id="import-attachments" />
	<label for="import-attachments"><?php _e('Download and import file attachments') ?></label>
</p>

<?php
		}

		echo '<input type="submit" value="'.attribute_escape( __('Submit') ).'">'.'<br />';
		echo '</form>';

	}

	function users_form($n, $author) {

		if ( $this->allow_create_users() ) {
			printf('<label>'.__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user_create['.intval($n).']'.'" maxlength="30"></label> <br />');
		}
		else {
			echo __('Map to existing').'<br />';
		}

		// keep track of $n => $author name
		echo '<input type="hidden" name="author_in['.intval($n).']" value="'.htmlspecialchars($author).'" />';

		$users = get_users_of_blog();
?><select name="user_select[<?php echo $n; ?>]">
	<option value="0"><?php _e('- Select -'); ?></option>
	<?php
		foreach ($users as $user) {
			echo '<option value="'.$user->user_id.'">'.$user->user_login.'</option>';
		}
?>
	</select>
	<?php
	}

	function select_authors() {
		$is_wxr_file = $this->get_entries(array(&$this, 'process_author'));
		if ( $is_wxr_file ) {
			$this->wp_authors_form();
		}
		else {
			echo '<h2>'.__('Invalid file').'</h2>';
			echo '<p>'.__('Please upload a valid WXR (WordPress eXtended RSS) export file.').'</p>';
		}
	}

	// fetch the user ID for a given author name, respecting the mapping preferences
	function checkauthor($author) {
		global $current_user;

		if ( !empty($this->author_ids[$author]) )
			return $this->author_ids[$author];

		// failsafe: map to the current user
		return $current_user->ID;
	}



	function process_categories() {
		global $wpdb;

		$cat_names = (array) get_terms('category', 'fields=names');

		while ( $c = array_shift($this->categories) ) {
			$cat_name = trim($this->get_tag( $c, 'wp:cat_name' ));

			// If the category exists we leave it alone
			if ( in_array($cat_name, $cat_names) )
				continue;

			$category_nicename	= $this->get_tag( $c, 'wp:category_nicename' );
			$posts_private		= (int) $this->get_tag( $c, 'wp:posts_private' );
			$links_private		= (int) $this->get_tag( $c, 'wp:links_private' );

			$parent = $this->get_tag( $c, 'wp:category_parent' );

			if ( empty($parent) )
				$category_parent = '0';
			else
				$category_parent = category_exists($parent);

			$catarr = compact('category_nicename', 'category_parent', 'posts_private', 'links_private', 'posts_private', 'cat_name');

			$cat_ID = wp_insert_category($catarr);
		}
	}

	function process_tags() {
		global $wpdb;

		$tag_names = (array) get_terms('post_tag', 'fields=names');

		while ( $c = array_shift($this->tags) ) {
			$tag_name = trim($this->get_tag( $c, 'wp:tag_name' ));

			// If the category exists we leave it alone
			if ( in_array($tag_name, $tag_names) )
				continue;

			$slug = $this->get_tag( $c, 'wp:tag_slug' );
			$description = $this->get_tag( $c, 'wp:tag_description' );

			$tagarr = compact('slug', 'description');

			$tag_ID = wp_insert_term($tag_name, 'post_tag', $tagarr);
		}
	}

	function process_author($post) {
		$author = $this->get_tag( $post, 'dc:creator' );
		if ($author)
			$this->allauthornames[] = $author;
	}

	function process_posts() {
		$i = -1;
		echo '<ol>';

		$this->get_entries(array(&$this, 'process_post'));

		echo '</ol>';

		wp_import_cleanup($this->id);
		do_action('import_done', 'wordpress');

		echo '<h3>'.sprintf(__('All done.').' <a href="%s">'.__('Have fun!').'</a>', get_option('home')).'</h3>';
	}

	function process_post($post) {
		global $wpdb;

		$post_ID = (int) $this->get_tag( $post, 'wp:post_id' );
  		if ( $post_ID && !empty($this->post_ids_processed[$post_ID]) ) // Processed already
			return 0;
		
		set_time_limit( 60 );

		// There are only ever one of these
		$post_title     = $this->get_tag( $post, 'title' );
		$post_date      = $this->get_tag( $post, 'wp:post_date' );
		$post_date_gmt  = $this->get_tag( $post, 'wp:post_date_gmt' );
		$comment_status = $this->get_tag( $post, 'wp:comment_status' );
		$ping_status    = $this->get_tag( $post, 'wp:ping_status' );
		$post_status    = $this->get_tag( $post, 'wp:status' );
		$post_name      = $this->get_tag( $post, 'wp:post_name' );
		$post_parent    = $this->get_tag( $post, 'wp:post_parent' );
		$menu_order     = $this->get_tag( $post, 'wp:menu_order' );
		$post_type      = $this->get_tag( $post, 'wp:post_type' );
		$post_password  = $this->get_tag( $post, 'wp:post_password' );
		$guid           = $this->get_tag( $post, 'guid' );
		$post_author    = $this->get_tag( $post, 'dc:creator' );

		$post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
		$post_excerpt = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_excerpt);
		$post_excerpt = str_replace('<br>', '<br />', $post_excerpt);
		$post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt);

		$post_content = $this->get_tag( $post, 'content:encoded' );
		$post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
		$post_content = str_replace('<br>', '<br />', $post_content);
		$post_content = str_replace('<hr>', '<hr />', $post_content);

		preg_match_all('|<category domain="tag">(.*?)</category>|is', $post, $tags);
		$tags = $tags[1];

		$tag_index = 0;
		foreach ($tags as $tag) {
			$tags[$tag_index] = $wpdb->escape($this->unhtmlentities(str_replace(array ('<![CDATA[', ']]>'), '', $tag)));
			$tag_index++;
		}

		preg_match_all('|<category>(.*?)</category>|is', $post, $categories);
		$categories = $categories[1];

		$cat_index = 0;
		foreach ($categories as $category) {
			$categories[$cat_index] = $wpdb->escape($this->unhtmlentities(str_replace(array ('<![CDATA[', ']]>'), '', $category)));
			$cat_index++;
		}

		$post_exists = post_exists($post_title, '', $post_date);

		if ( $post_exists ) {
			echo '<li>';
			printf(__('Post <em>%s</em> already exists.'), stripslashes($post_title));
		} else {

			// If it has parent, process parent first.
			$post_parent = (int) $post_parent;
			if ($post_parent) {
				// if we already know the parent, map it to the local ID
				if ( $parent = $this->post_ids_processed[$post_parent] ) {
					$post_parent = $parent;  // new ID of the parent
				}
				else {
					// record the parent for later
					$this->orphans[intval($post_ID)] = $post_parent;
				}
			}

			echo '<li>';

			$post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor

			$postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_excerpt', 'post_title', 'post_status', 'post_name', 'comment_status', 'ping_status', 'guid', 'post_parent', 'menu_order', 'post_type', 'post_password');
			if ($post_type == 'attachment') {
				$remote_url = $this->get_tag( $post, 'wp:attachment_url' );
				if ( !$remote_url )
					$remote_url = $guid;

				$comment_post_ID = $post_id = $this->process_attachment($postdata, $remote_url);
				if ( !$post_id or is_wp_error($post_id) )
					return $post_id;
			}
			else {
				printf(__('Importing post <em>%s</em>...'), stripslashes($post_title));
				$comment_post_ID = $post_id = wp_insert_post($postdata);
			}

			if ( is_wp_error( $post_id ) )
				return $post_id;

			// Memorize old and new ID.
			if ( $post_id && $post_ID ) {
				$this->post_ids_processed[intval($post_ID)] = intval($post_id);
			}

			// Add categories.
			if (count($categories) > 0) {
				$post_cats = array();
				foreach ($categories as $category) {
					$slug = sanitize_term_field('slug', $category, 0, 'category', 'db');
					$cat = get_term_by('slug', $slug, 'category');
					$cat_ID = 0;
					if ( ! empty($cat) )
						$cat_ID = $cat->term_id;
					if ($cat_ID == 0) {
						$category = $wpdb->escape($category);
						$cat_ID = wp_insert_category(array('cat_name' => $category));
					}
					$post_cats[] = $cat_ID;
				}
				wp_set_post_categories($post_id, $post_cats);
			}

			// Add tags.
			if (count($tags) > 0) {
				$post_tags = array();
				foreach ($tags as $tag) {
					$slug = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
					$tag_obj = get_term_by('slug', $slug, 'post_tag');
					$tag_id = 0;
					if ( ! empty($tag_obj) )
						$tag_id = $tag_obj->term_id;
					if ( $tag_id == 0 ) {
						$tag = $wpdb->escape($tag);
						$tag_id = wp_insert_term($tag, 'post_tag');
						$tag_id = $tag_id['term_id'];
					}
					$post_tags[] = intval($tag_id);
				}
				wp_set_post_tags($post_id, $post_tags);
			}
		}

		// Now for comments
		preg_match_all('|<wp:comment>(.*?)</wp:comment>|is', $post, $comments);
		$comments = $comments[1];
		$num_comments = 0;
		if ( $comments) { foreach ($comments as $comment) {
			$comment_author       = $this->get_tag( $comment, 'wp:comment_author');
			$comment_author_email = $this->get_tag( $comment, 'wp:comment_author_email');
			$comment_author_IP    = $this->get_tag( $comment, 'wp:comment_author_IP');
			$comment_author_url   = $this->get_tag( $comment, 'wp:comment_author_url');
			$comment_date         = $this->get_tag( $comment, 'wp:comment_date');
			$comment_date_gmt     = $this->get_tag( $comment, 'wp:comment_date_gmt');
			$comment_content      = $this->get_tag( $comment, 'wp:comment_content');
			$comment_approved     = $this->get_tag( $comment, 'wp:comment_approved');
			$comment_type         = $this->get_tag( $comment, 'wp:comment_type');
			$comment_parent       = $this->get_tag( $comment, 'wp:comment_parent');

			// if this is a new post we can skip the comment_exists() check
			if ( !$post_exists || !comment_exists($comment_author, $comment_date) ) {
				$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_approved', 'comment_type', 'comment_parent');
				wp_insert_comment($commentdata);
				$num_comments++;
			}
		} }

		if ( $num_comments )
			printf(' '.__ngettext('(%s comment)', '(%s comments)', $num_comments), $num_comments);

		// Now for post meta
		preg_match_all('|<wp:postmeta>(.*?)</wp:postmeta>|is', $post, $postmeta);
		$postmeta = $postmeta[1];
		if ( $postmeta) { foreach ($postmeta as $p) {
			$key   = $this->get_tag( $p, 'wp:meta_key' );
			$value = $this->get_tag( $p, 'wp:meta_value' );
			$value = stripslashes($value); // add_post_meta() will escape.

			$this->process_post_meta($post_id, $key, $value);

		} }

		do_action('import_post_added', $post_id);
		print "</li>\n";
	}

	function process_post_meta($post_id, $key, $value) {
		// the filter can return false to skip a particular metadata key
		$_key = apply_filters('import_post_meta_key', $key);
		if ( $_key ) {
			add_post_meta( $post_id, $_key, $value );
			do_action('import_post_meta', $post_id, $_key, $value);
		}
	}

	function process_attachment($postdata, $remote_url) {
		if ($this->fetch_attachments and $remote_url) {
			printf( __('Importing attachment <em>%s</em>... '), htmlspecialchars($remote_url) );
			$upload = $this->fetch_remote_file($postdata, $remote_url);
			if ( is_wp_error($upload) ) {
				printf( __('Remote file error: %s'), htmlspecialchars($upload->get_error_message()) );
				return $upload;
			}
			else {
				print '('.size_format(filesize($upload['file'])).')';
			}

			if ( $info = wp_check_filetype($upload['file']) ) {
				$postdata['post_mime_type'] = $info['type'];
			}
			else {
				print __('Invalid file type');
				return;
			}

			$postdata['guid'] = $upload['url'];

			// as per wp-admin/includes/upload.php
			$post_id = wp_insert_attachment($postdata, $upload['file']);
			wp_update_attachment_metadata( $post_id, wp_generate_attachment_metadata( $post_id, $upload['file'] ) );

			// remap the thumbnail url.  this isn't perfect because we're just guessing the original url.
			if ( preg_match('@^image/@', $info['type']) && $thumb_url = wp_get_attachment_thumb_url($post_id) ) {
				$parts = pathinfo($remote_url);
				$ext = $parts['extension'];
				$name = basename($parts['basename'], ".{$ext}");
				$this->url_remap[$parts['dirname'] . '/' . $name . '.thumbnail.' . $ext] = $thumb_url;
			}

			return $post_id;
		}
		else {
			printf( __('Skipping attachment <em>%s</em>'), htmlspecialchars($remote_url) );
		}
	}

	function fetch_remote_file($post, $url) {
		$upload = wp_upload_dir($post['post_date']);

		// extract the file name and extension from the url
		$file_name = basename($url);

		// get placeholder file in the upload dir with a unique sanitized filename
		$upload = wp_upload_bits( $file_name, 0, '', $post['post_date']);
		if ( $upload['error'] ) {
			echo $upload['error'];
			return new WP_Error( 'upload_dir_error', $upload['error'] );
		}

		// fetch the remote url and write it to the placeholder file
		$headers = wp_get_http($url, $upload['file']);

		// make sure the fetch was successful
		if ( $headers['response'] != '200' ) {
			@unlink($upload['file']);
			return new WP_Error( 'import_file_error', sprintf(__('Remote file returned error response %d'), intval($headers['response'])) );
		}
		elseif ( isset($headers['content-length']) && filesize($upload['file']) != $headers['content-length'] ) {
			@unlink($upload['file']);
			return new WP_Error( 'import_file_error', __('Remote file is incorrect size') );
		}

		$max_size = $this->max_attachment_size();
		if ( !empty($max_size) and filesize($upload['file']) > $max_size ) {
			@unlink($upload['file']);
			return new WP_Error( 'import_file_error', sprintf(__('Remote file is too large, limit is %s', size_format($max_size))) );
		}

		// keep track of the old and new urls so we can substitute them later
		$this->url_remap[$url] = $upload['url'];
		// if the remote url is redirected somewhere else, keep track of the destination too
		if ( $headers['x-final-location'] != $url )
			$this->url_remap[$headers['x-final-location']] = $upload['url'];

		return $upload;

	}

	// sort by strlen, longest string first
	function cmpr_strlen($a, $b) {
		return strlen($b) - strlen($a);
	}

	// update url references in post bodies to point to the new local files
	function backfill_attachment_urls() {

		// make sure we do the longest urls first, in case one is a substring of another
		uksort($this->url_remap, array(&$this, 'cmpr_strlen'));

		global $wpdb;
		foreach ($this->url_remap as $from_url => $to_url) {
			// remap urls in post_content
			$wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, '%s', '%s')", $from_url, $to_url) );
			// remap enclosure urls
			$result = $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->postmeta} SET meta_value = REPLACE(meta_value, '%s', '%s') WHERE meta_key='enclosure'", $from_url, $to_url) );
		}
	}

	// update the post_parent of orphans now that we know the local id's of all parents
	function backfill_parents() {
		global $wpdb;

		foreach ($this->orphans as $child_id => $parent_id) {
			$local_child_id = $this->post_ids_processed[$child_id];
			$local_parent_id = $this->post_ids_processed[$parent_id];
			if ($local_child_id and $local_parent_id) {
				$wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_parent = %d WHERE ID = %d", $local_parent_id, $local_child_id));
			}
		}
	}

	function is_valid_meta_key($key) {
		// skip _wp_attached_file metadata since we'll regenerate it from scratch
		if ( $key == '_wp_attached_file' )
			return false;
		return $key;
	}

	// give the user the option of creating new users to represent authors in the import file?
	function allow_create_users() {
		return apply_filters('import_allow_create_users', true);
	}

	// give the user the option of downloading and importing attached files
	function allow_fetch_attachments() {
		return apply_filters('import_allow_fetch_attachments', true);
	}

	function max_attachment_size() {
		// can be overridden with a filter - 0 means no limit
		return apply_filters('import_attachment_size_limit', 0);
	}

	function import_start() {
		wp_defer_term_counting(true);
		wp_defer_comment_counting(true);
		do_action('import_start');
	}

	function import_end() {
		do_action('import_end');

		// clear the caches after backfilling
		foreach ($this->post_ids_processed as $post_id)
			clean_post_cache($post_id);

		wp_defer_term_counting(false);
		wp_defer_comment_counting(false);
	}

	function import($id, $fetch_attachments = false) {
		$this->id = (int) $id;
		$this->fetch_attachments = ($this->allow_fetch_attachments() && (bool) $fetch_attachments);

		add_filter('import_post_meta_key', array($this, 'is_valid_meta_key'));
		$file = get_attached_file($this->id);
		$this->import_file($file);
	}

	function import_file($file) {
		$this->file = $file;

		$this->import_start();
		$this->get_authors_from_post();
		$this->get_entries();
		$this->process_categories();
		$this->process_tags();
		$result = $this->process_posts();
		$this->backfill_parents();
		$this->backfill_attachment_urls();
		$this->import_end();

		if ( is_wp_error( $result ) )
			return $result;
	}

	function handle_upload() {
		$file = wp_import_handle_upload();
		if ( isset($file['error']) ) {
			echo '<p>'.__('Sorry, there has been an error.').'</p>';
			echo '<p><strong>' . $file['error'] . '</strong></p>';
			return false;
		}
		$this->file = $file['file'];
		$this->id = (int) $file['id'];
		return true;
	}

	function dispatch() {
		if (empty ($_GET['step']))
			$step = 0;
		else
			$step = (int) $_GET['step'];

		$this->header();
		switch ($step) {
			case 0 :
				$this->greet();
				break;
			case 1 :
				check_admin_referer('import-upload');
				if ( $this->handle_upload() )
					$this->select_authors();
				break;
			case 2:
				check_admin_referer('import-wordpress');
				$result = $this->import( $_GET['id'], $_POST['attachments'] );
				if ( is_wp_error( $result ) )
					echo $result->get_error_message();
				break;
		}
		$this->footer();
	}

	function WP_Import() {
		// Nothing.
	}
}

$wp_import = new WP_Import();

register_importer('wordpress', 'WordPress', __('Import <strong>posts, comments, custom fields, pages, and categories</strong> from a WordPress export file.'), array ($wp_import, 'dispatch'));

?>
               blog/wp-admin/import/wp-cat2tag.php                                                                 0000755 0023433 0004734 00000041101 11060470713 017060  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

class WP_Categories_to_Tags {
	var $categories_to_convert = array();
	var $all_categories = array();
	var $tags_to_convert = array();
	var $all_tags = array();
	var $hybrids_ids = array();

	function header() {
		echo '<div class="wrap">';
		if ( ! current_user_can('manage_categories') ) {
			echo '<div class="narrow">';
			echo '<p>' . __('Cheatin&#8217; uh?') . '</p>';
			echo '</div>';
		} else { ?>
			<div class="tablenav"><p style="margin:4px"><a style="display:inline;" class="button-secondary" href="admin.php?import=wp-cat2tag"><?php _e( "Categories to Tags" ); ?></a>
			<a style="display:inline;" class="button-secondary" href="admin.php?import=wp-cat2tag&amp;step=3"><?php _e( "Tags to Categories" ); ?></a></p></div>
<?php	}
	}

	function footer() {
		echo '</div>';
	}

	function populate_cats() {

		$categories = get_categories('get=all');
		foreach ( $categories as $category ) {
			$this->all_categories[] = $category;
			if ( is_term( $category->slug, 'post_tag' ) )
				$this->hybrids_ids[] = $category->term_id;
		}
	}

	function populate_tags() {

		$tags = get_terms( array('post_tag'), 'get=all' );
		foreach ( $tags as $tag ) {
			$this->all_tags[] = $tag;
			if ( is_term( $tag->slug, 'category' ) )
				$this->hybrids_ids[] = $tag->term_id;
		}
	}

	function categories_tab() {
		$this->populate_cats();
		$cat_num = count($this->all_categories);

		echo '<br class="clear" />';

		if ( $cat_num > 0 ) {
			echo '<h2>' . sprintf( __ngettext( 'Convert Category to Tag.', 'Convert Categories (%d) to Tags.', $cat_num ), $cat_num ) . '</h2>';
			echo '<div class="narrow">';
			echo '<p>' . __('Hey there. Here you can selectively convert existing categories to tags. To get started, check the categories you wish to be converted, then click the Convert button.') . '</p>';
			echo '<p>' . __('Keep in mind that if you convert a category with child categories, the children become top-level orphans.') . '</p></div>';

			$this->categories_form();
		} else {
			echo '<p>'.__('You have no categories to convert!').'</p>';
		}
	}

	function categories_form() { ?>

<script type="text/javascript">
/* <![CDATA[ */
var checkflag = "false";
function check_all_rows() {
	field = document.catlist;
	if ( 'false' == checkflag ) {
		for ( i = 0; i < field.length; i++ ) {
			if ( 'cats_to_convert[]' == field[i].name )
				field[i].checked = true;
		}
		checkflag = 'true';
		return '<?php _e('Uncheck All') ?>';
	} else {
		for ( i = 0; i < field.length; i++ ) {
			if ( 'cats_to_convert[]' == field[i].name )
				field[i].checked = false;
		}
		checkflag = 'false';
		return '<?php _e('Check All') ?>';
	}
}
/* ]]> */
</script>

<form name="catlist" id="catlist" action="admin.php?import=wp-cat2tag&amp;step=2" method="post">
<p><input type="button" class="button-secondary" value="<?php _e('Check All'); ?>" onclick="this.value=check_all_rows()" />
<?php wp_nonce_field('import-cat2tag'); ?></p>
<ul style="list-style:none">

<?php	$hier = _get_term_hierarchy('category');

		foreach ($this->all_categories as $category) {
			$category = sanitize_term( $category, 'category', 'display' );

			if ( (int) $category->parent == 0 ) { ?>

	<li><label><input type="checkbox" name="cats_to_convert[]" value="<?php echo intval($category->term_id); ?>" /> <?php echo $category->name . ' (' . $category->count . ')'; ?></label><?php

				 if ( in_array( intval($category->term_id),  $this->hybrids_ids ) )
				 	echo ' <a href="#note"> * </a>';
				
				if ( isset($hier[$category->term_id]) )
					$this->_category_children($category, $hier); ?></li>
<?php		}
		} ?>
</ul>

<?php	if ( ! empty($this->hybrids_ids) )
			echo '<p><a name="note"></a>' . __('* This category is also a tag. Converting it will add that tag to all posts that are currently in the category.') . '</p>'; ?>

<p class="submit"><input type="submit" name="submit" class="button" value="<?php _e('Convert Categories to Tags'); ?>" /></p>
</form>

<?php }

	function tags_tab() {
		$this->populate_tags();
		$tags_num = count($this->all_tags);

		echo '<br class="clear" />';

		if ( $tags_num > 0 ) {
			echo '<h2>' . sprintf( __ngettext( 'Convert Tag to Category.', 'Convert Tags (%d) to Categories.', $tags_num ), $tags_num ) . '</h2>';
			echo '<div class="narrow">';
			echo '<p>' . __('Here you can selectively converts existing tags to categories. To get started, check the tags you wish to be converted, then click the Convert button.') . '</p>';
			echo '<p>' . __('The newly created categories will still be associated with the same posts.') . '</p></div>';

			$this->tags_form();
		} else {
			echo '<p>'.__('You have no tags to convert!').'</p>';
		}
	}

	function tags_form() { ?>

<script type="text/javascript">
/* <![CDATA[ */
var checktags = "false";
function check_all_tagrows() {
	field = document.taglist;
	if ( 'false' == checktags ) {
		for ( i = 0; i < field.length; i++ ) {
			if ( 'tags_to_convert[]' == field[i].name )
				field[i].checked = true;
		}
		checktags = 'true';
		return '<?php _e('Uncheck All') ?>';
	} else {
		for ( i = 0; i < field.length; i++ ) {
			if ( 'tags_to_convert[]' == field[i].name )
				field[i].checked = false;
		}
		checktags = 'false';
		return '<?php _e('Check All') ?>';
	}
}
/* ]]> */
</script>

<form name="taglist" id="taglist" action="admin.php?import=wp-cat2tag&amp;step=4" method="post">
<p><input type="button" class="button-secondary" value="<?php _e('Check All'); ?>" onclick="this.value=check_all_tagrows()" />
<?php wp_nonce_field('import-cat2tag'); ?></p>
<ul style="list-style:none">

<?php	foreach ( $this->all_tags as $tag ) { ?>
	<li><label><input type="checkbox" name="tags_to_convert[]" value="<?php echo intval($tag->term_id); ?>" /> <?php echo attribute_escape($tag->name) . ' (' . $tag->count . ')'; ?></label><?php if ( in_array( intval($tag->term_id),  $this->hybrids_ids ) ) echo ' <a href="#note"> * </a>'; ?></li>

<?php	} ?>
</ul>

<?php	if ( ! empty($this->hybrids_ids) )
			echo '<p><a name="note"></a>' . __('* This tag is also a category. When converted, all posts associated with the tag will also be in the category.') . '</p>'; ?>

<p class="submit"><input type="submit" name="submit_tags" class="button" value="<?php _e('Convert Tags to Categories'); ?>" /></p>
</form>

<?php }

	function _category_children($parent, $hier) { ?>

		<ul style="list-style:none">
<?php	foreach ($hier[$parent->term_id] as $child_id) {
			$child =& get_category($child_id); ?>
		<li><label><input type="checkbox" name="cats_to_convert[]" value="<?php echo intval($child->term_id); ?>" /> <?php echo $child->name . ' (' . $child->count . ')'; ?></label><?php

			if ( in_array( intval($child->term_id), $this->hybrids_ids ) )
				echo ' <a href="#note"> * </a>';

			if ( isset($hier[$child->term_id]) )
				$this->_category_children($child, $hier); ?></li>
<?php	} ?>
		</ul><?php
	}

	function _category_exists($cat_id) {
		$cat_id = (int) $cat_id;

		$maybe_exists = category_exists($cat_id);

		if ( $maybe_exists ) {
			return true;
		} else {
			return false;
		}
	}

	function convert_categories() {
		global $wpdb;

		if ( (!isset($_POST['cats_to_convert']) || !is_array($_POST['cats_to_convert'])) && empty($this->categories_to_convert)) { ?>
			<div class="narrow">
			<p><?php printf(__('Uh, oh. Something didn&#8217;t work. Please <a href="%s">try again</a>.'), 'admin.php?import=wp-cat2tag'); ?></p>
			</div>
<?php		return;
		}

		if ( empty($this->categories_to_convert) )
			$this->categories_to_convert = $_POST['cats_to_convert'];

		$hier = _get_term_hierarchy('category');
		$hybrid_cats = $clear_parents = $parents = false;
		$clean_term_cache = $clean_cat_cache = array();
		$default_cat = get_option('default_category');

		echo '<ul>';

		foreach ( (array) $this->categories_to_convert as $cat_id) {
			$cat_id = (int) $cat_id;

			if ( ! $this->_category_exists($cat_id) ) {
				echo '<li>' . sprintf( __('Category %s doesn\'t exist!'),  $cat_id ) . "</li>\n";
			} else {
				$category =& get_category($cat_id);
				echo '<li>' . sprintf(__('Converting category <strong>%s</strong> ... '),  $category->name);

				// If the category is the default, leave category in place and create tag.
				if ( $default_cat == $category->term_id ) {

					if ( ! ($id = is_term( $category->slug, 'post_tag' ) ) )
						$id = wp_insert_term($category->name, 'post_tag', array('slug' => $category->slug));
					
					$id = $id['term_taxonomy_id'];
					$posts = get_objects_in_term($category->term_id, 'category');
					$term_order = 0;

					foreach ( $posts as $post ) {
						$values[] = $wpdb->prepare( "(%d, %d, %d)", $post, $id, $term_order);
						clean_post_cache($post);
					}
					
					if ( $values ) {
						$wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)");

						$wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'post_tag'", $category->count, $category->term_id) );
					}

					echo __('Converted successfully.') . "</li>\n";
					continue;
				}
				
				// if tag already exists, add it to all posts in the category
				if ( $tag_ttid = $wpdb->get_var( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'", $category->term_id) ) ) {
					$objects_ids = get_objects_in_term($category->term_id, 'category');
					$tag_ttid = (int) $tag_ttid;
					$term_order = 0;

					foreach ( $objects_ids as $object_id )
						$values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $tag_ttid, $term_order);

					if ( $values ) {
						$wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)");

						$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tag_ttid) );
						$wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'post_tag'", $count, $category->term_id) );
					}
					echo __('Tag added to all posts in this category.') . " *</li>\n";

					$hybrid_cats = true;
					$clean_term_cache[] = $category->term_id;
					$clean_cat_cache[] = $category->term_id;

					continue;
				}

				$tt_ids = $wpdb->get_col( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'category'", $category->term_id) );
				if ( $tt_ids ) {
					$posts = $wpdb->get_col("SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id IN (" . join(',', $tt_ids) . ") GROUP BY object_id");
					foreach ( (array) $posts as $post )
						clean_post_cache($post);
				}

				// Change the category to a tag.
				$wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag' WHERE term_id = %d AND taxonomy = 'category'", $category->term_id) );

				// Set all parents to 0 (root-level) if their parent was the converted tag
				$parents = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET parent = 0 WHERE parent = %d AND taxonomy = 'category'", $category->term_id) );

				if ( $parents ) $clear_parents = true;
				$clean_cat_cache[] = $category->term_id;
				echo __('Converted successfully.') . "</li>\n";
			}
		}
		echo '</ul>';

		if ( ! empty($clean_term_cache) ) {
			$clean_term_cache = array_unique(array_values($clean_term_cache));
			foreach ( $clean_term_cache as $id )
				wp_cache_delete($id, 'post_tag');
		}

		if ( ! empty($clean_cat_cache) ) {
			$clean_cat_cache = array_unique(array_values($clean_cat_cache));
			foreach ( $clean_cat_cache as $id )
				wp_cache_delete($id, 'category');
		}

		if ( $clear_parents ) delete_option('category_children');

		if ( $hybrid_cats )
			echo '<p>' . sprintf( __('* This category is also a tag. The converter has added that tag to all posts currently in the category. If you want to remove it, please confirm that all tags were added successfully, then delete it from the <a href="%s">Manage Categories</a> page.'), 'categories.php') . '</p>';
		echo '<p>' . sprintf( __('We&#8217;re all done here, but you can always <a href="%s">convert more</a>.'), 'admin.php?import=wp-cat2tag' ) . '</p>';
	}

	function convert_tags() {
		global $wpdb;

		if ( (!isset($_POST['tags_to_convert']) || !is_array($_POST['tags_to_convert'])) && empty($this->tags_to_convert)) {
			echo '<div class="narrow">';
			echo '<p>' . sprintf(__('Uh, oh. Something didn&#8217;t work. Please <a href="%s">try again</a>.'), 'admin.php?import=wp-cat2tag&amp;step=3') . '</p>';
			echo '</div>';
			return;
		}

		if ( empty($this->tags_to_convert) )
			$this->tags_to_convert = $_POST['tags_to_convert'];

		$hybrid_tags = $clear_parents = false;
		$clean_cat_cache = $clean_term_cache = array();
		$default_cat = get_option('default_category');
		echo '<ul>';

		foreach ( (array) $this->tags_to_convert as $tag_id) {
			$tag_id = (int) $tag_id;

			if ( $tag = get_term( $tag_id, 'post_tag' ) ) {
				printf('<li>' . __('Converting tag <strong>%s</strong> ... '),  $tag->name);

				if ( $cat_ttid = $wpdb->get_var( $wpdb->prepare("SELECT term_taxonomy_id FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'category'", $tag->term_id) ) ) {
					$objects_ids = get_objects_in_term($tag->term_id, 'post_tag');
					$cat_ttid = (int) $cat_ttid;
					$term_order = 0;

					foreach ( $objects_ids as $object_id ) {
						$values[] = $wpdb->prepare( "(%d, %d, %d)", $object_id, $cat_ttid, $term_order);
						clean_post_cache($object_id);
					}

					if ( $values ) {
						$wpdb->query("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join(',', $values) . " ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)");

						if ( $default_cat != $tag->term_id ) {
							$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tag->term_id) );
							$wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_id = %d AND taxonomy = 'category'", $count, $tag->term_id) );
						}
					}

					$hybrid_tags = true;
					$clean_term_cache[] = $tag->term_id;
					$clean_cat_cache[] = $tag->term_id;
					echo __('All posts were added to the category with the same name.') . " *</li>\n";

					continue;
				}

				// Change the tag to a category.
				$parent = $wpdb->get_var( $wpdb->prepare("SELECT parent FROM $wpdb->term_taxonomy WHERE term_id = %d AND taxonomy = 'post_tag'", $tag->term_id) );
				if ( 0 == $parent || (0 < (int) $parent && $this->_category_exists($parent)) ) {
					$reset_parent = '';
					$clear_parents = true;
				} else
					$reset_parent = ", parent = '0'";

				$wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET taxonomy = 'category' $reset_parent WHERE term_id = %d AND taxonomy = 'post_tag'", $tag->term_id) );

				$clean_term_cache[] = $tag->term_id;
				$clean_cat_cache[] = $cat['term_id'];
				echo __('Converted successfully.') . "</li>\n";

			} else {
				printf( '<li>' . __('Tag #%s doesn\'t exist!') . "</li>\n",  $tag_id );
			}
		}

		if ( ! empty($clean_term_cache) ) {
			$clean_term_cache = array_unique(array_values($clean_term_cache));
			foreach ( $clean_term_cache as $id )
				wp_cache_delete($id, 'post_tag');
		}

		if ( ! empty($clean_cat_cache) ) {
			$clean_cat_cache = array_unique(array_values($clean_cat_cache));
			foreach ( $clean_cat_cache as $id )
				wp_cache_delete($id, 'category');
		}

		if ( $clear_parents ) delete_option('category_children');

		echo '</ul>';
		if ( $hybrid_tags )
			echo '<p>' . sprintf( __('* This tag is also a category. The converter has added all posts from it to the category. If you want to remove it, please confirm that all posts were added successfully, then delete it from the <a href="%s">Manage Tags</a> page.'), 'edit-tags.php') . '</p>';
		echo '<p>' . sprintf( __('We&#8217;re all done here, but you can always <a href="%s">convert more</a>.'), 'admin.php?import=wp-cat2tag&amp;step=3' ) . '</p>';
	}

	function init() {

		$step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1;

		$this->header();

		if ( current_user_can('manage_categories') ) {

			switch ($step) {
				case 1 :
					$this->categories_tab();
				break;

				case 2 :
					check_admin_referer('import-cat2tag');
					$this->convert_categories();
				break;

				case 3 :
					$this->tags_tab();
				break;

				case 4 :
					check_admin_referer('import-cat2tag');
					$this->convert_tags();
				break;
			}
		}

		$this->footer();
	}

	function WP_Categories_to_Tags() {
		// Do nothing.
	}
}

$wp_cat2tag_importer = new WP_Categories_to_Tags();

register_importer('wp-cat2tag', __('Categories and Tags Converter'), __('Convert existing categories to tags or tags to categories, selectively.'), array(&$wp_cat2tag_importer, 'init'));

?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                               blog/wp-admin/images/                                                                               0000755 0023433 0004734 00000000000 11060470675 014340  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 blog/wp-admin/images/align-center.png                                                               0000755 0023433 0004734 00000001073 11060470646 017420  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         8<   	pHYs       IDAT(OkAūkgc"݋~®1$Az$%$tUк?+T{	ȗ $%@d($C`f9rQEN,qSڂc雏DU{_VOnp9J~	RsMvEϋp}a8g">=fp'SSe"Oft@9WtvMD9s"]B׮z_xK@2զS7݋1yc@D \TP;^|M& g`}noX"-P j׊tm۶ms s>99Suc AJxQFя:tvvvW?ڇ#t*"MӔ+Ο32pttt7?f @d.%_U= SSz|B9u's;ǫb    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                                     blog/wp-admin/images/align-left.png                                                                 0000755 0023433 0004734 00000001113 11060470646 017065  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         o?   	pHYs       IDAT(}R=oAMBdj:*"_HAd	:~ -=R9}bHٝٙAKdɞdӨ2LL$U$I3ph+hdo4';@ I	j:Vj4N!o?V7Oj75 "{UUf&v6TU֍OJţ]/4_Ll6 dk>i8D:u]79єc1Oa2IDr"̜s@AoZGmMOk$ql+H  HJ}M֛g{W!D׏_Z_E$EB9l6C	nTfH.*c{3[,Spb$UuZBA5PJH$c$`f!U󜳪P.jrhTu\.I+lJ{#H:ίs뺇YiQdfRl!eHyY    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                     blog/wp-admin/images/align-none.png                                                                 0000755 0023433 0004734 00000000705 11060470647 017101  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         8<   	pHYs       wIDAT(=nA_!"R+Cp2KDtW=Y&mɥJZWB23I 4*.TyfNӴm.Q%T3]ONxtu]8I=|Ƞjf/47#`.tY1}ڟn|΀(m^_ о37m/ETUO`(PP<37q .?QP T=!xςk[
w"Pv5
r fp7 ="V@xzpo\{^5eEvD~/&Jl9"wX!vK    IENDB`                                                           blog/wp-admin/images/align-right.png                                                                0000755 0023433 0004734 00000001054 11060470650 017247  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         o?   	pHYs       IDAT(AnAE=I)RV,8ΐ, Q|
ؒ,tW}EFB`[GSfwgfz 1y&ڥJɸ媞HKQ@wogs/;C
鉈D̦Ry<py+>{'ul-]( 5U`fJD,m.Km8+9b3#eZJ!qTUff曛>OjH3?%dxtr~ODfREȿt1+Ca7nejf93)#!	%#j`f Zkx!l68*-K:BD[kM)3ފȯ?mmZkqԔRDW<cݧ죛dfǙ,R8; cN]Zk8Pl6^Cbޢ(Ow?baO`y    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    blog/wp-admin/images/browse-happy.gif                                                               0000755 0023433 0004734 00000010456 11060470651 017452  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a (  MMy3Ȫjjj44mmRRrS		9Ұq$$qqqYY҉݉{kffxzcLLHHJJvv<  yy!!((aamuznnn}}<<\\8섄Ɯvvv99EEAxyyyaaɥ8811~~~ĽAAVV--v__qƺN䆆3뮟kkkccvqi}~}zGGqq///??|Ɵ[T񰳷<iheߓd  ff߷ǤTzccchdhᔗZNN44Ѕplf픘Amm<<͇Ctr!   ,     (   	ׯ*\ȰÇ#JpwIG?Iɑ'K\eʗ,aIsfu
^F:T(ѣ0؈SѧH*jԫTZuW1bF?6:*_>FnᾍK7ߪP@a*թܿ~+68q|:9lX,o_Ο=o},cIаI~-6۳s֍{oϖJF8Ms͟K_IJ$ߣOˣ_}ID1R0EPҧIU>H#Q
?,A8  N)+C?#蜉BJ$B)#x$	'3䏳0#BxdF8Eϓ"?E.I%
>OAψ8?kf'%I&Pj:J&J$'I衆:i@	3LEꏥm2饕J*馆>?xg8✪jP	$̺&&h(X+첗Rr*: b;%ZO>ُ>?>
#,&BɞARS. )2o
7, PXO)qOybdJ\(TBJ&|-?l#dH&R	t$"J$HwDG}Q-uX_\g^WM cs|2*B
?hڎtB+J#T6͙h$Ȳ(j?kCSLGg枇l&%q8s#,ȩ)%r,;;B<o}go}#K`&X)"ʬ%PЍB#) 	T~@2='
6Ġ3zUŏHg'4aHDBH3#F	`"/&<a	S`
I,GLs%hHE'NъUq5ufhMD&ƊV`=
[ )Q:珀 AL"	qOad[qO(ijt8A ܋
Pp&B򕰌 	J	y'N5>bw`*QN|D?`VFpb ]\␰ xr\؁
LIKS2U s*Gq,E**AV4@E(7щW4B,h (	* ~aX `8@A8`H ؼGsT#0?Z+Mp *1щN#<?GO+e#!Vn&pB	ADЁ- 	 `@8p܀DAx! ȅsrq  "A"U >2`h?D#J
`,D2āV셫X[%2	{0|bVQuD(E`Ѐ" t d"Ѓ+8t( Y7X 8x69txD(^
`] ڑ# X8B0mH0@YDB!$6QVlt`G(&%ax@z ;08i A@x?^p
2 5  3xW_6& qx"D @ HJU+hl.@
d!ȼ!%怀ABhFA
UJLwAذCA8@9,(~@ 6aN6daه)g@ U' '0\B##8%pJ  P@	iG(9"c2
e8Ρ&`
 p` ܐ Br=]G`"D, 8 &FQl;v&'
Mԁ:KXsw+la
\"YsP s2:0K`&-OA9_ ZT!P|Ѓ<x!&J8B3	KP`G( 
P`7h+4!PX "Gt<]9P09	><HE#pg<6@_@
_(-6m?, O6C c6T>Ч?!9 H=H45xQuC"pp?Pdf	P0	p
i
@]@P
0_`Rg|P`
Up
r0b  UmDw'H@7Ht@ k  7 zX td=&vM0	{p0q@ 	g@ F

@

` l	- #b AHCp^\]NH 0  0e0o =dF@u	@  pvK<@^`p0 &u
g@'5F,g)pXt df &dujR0y P0W6k\0p j@6@^@Aa6ZG	pƒ! 
m 	

X1spKpBYPCy|
G@Kp E5PPA p p5 P`Q]ptey aM/PD ;`jI!"
˅
	0		qG  
0h4@ 
CD}2K
`
` Od/ !N XX[`z O`" HPv&``_aB	
A	D
	0
	 P
pZT
 FԠԜgHI  Xd-{L%#a	SyH	x/
	C 
G3>GeP:HH;E v :ji


r	UA
	7`B\ZvzxU2 z0z0lP ~ʥAD9A+Kz@}U)

	@ gJ3@  r::%@P%zP0`B
gA<
?!

 @! G!޺)
C,`79
 	)p?:Zz*PJ!@iZp4P4  !C0)@;&{(*,۲.{:aJ6{8: ;                                                                                                                                                                                                                  blog/wp-admin/images/bubble_bg.gif                                                                  0000755 0023433 0004734 00000000613 11060470651 016727  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a d   &GaiN!%꧐𿿿d=3̡jgΠ4SkȺY/@A^uuｬwN                                                                  ! ) ,     d  pH,Ȥrl:ШtJ.X쁙ł]k)f6Ӓ~D L
' MNO PPQ&L#MNOPP!{L$(M	OPIA ;                                                                                                                     blog/wp-admin/images/comment-grey-bubble.png                                                        0000755 0023433 0004734 00000000236 11060470652 020704  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a   tEXtSoftware Adobe ImageReadyqe<   PLTEFFFrrrM   tRNS @f   !IDATxb``$6G]=``9H` ( oÚ~    IENDB`                                                                                                                                                                                                                                                                                                                                                                  blog/wp-admin/images/comment-pill.gif                                                               0000755 0023433 0004734 00000000110 11060470653 017416  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a    N!!    ,       Dkڋ޼צHIʎGj ;                                                                                                                                                                                                                                                                                                                                                                                                                                                        blog/wp-admin/images/comment-stalk-classic.gif                                                      0000755 0023433 0004734 00000002114 11060470653 021221  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a@P  '>N!%&Ga&Ga&Ga&Ga!   ,    @P  0I8ͻ`x	dihlC,tmxq  *l:&oJZgv%p-ޫzr+=~ߚ:sqstww|[Ifk?!MT,9'4Яߝꥺ/dg@L0!KE|X(ĉF<Z|1#%xȑ{V2囕,[Y	SΙpԄSgKzA
СA4R(R^
ԩ Kٳg^uUk]}|ݻs2vܸҽK0 z]C0`^K\Wp*,3N˃)96@{v :hɭKhFCZ]eّhז߮yW1G\YͩCzuc>j_}mѧ.˟{?~F`b2Fa_va]օn]ՅU jP HXJT6]2JL2$hӎ8Ў<^EDDD:"H&YCeQЕSRiN.;WJ!O蔉zWYh2&s9j9geBsbg:~ei&@ڣa)E"#*餎lʨlxЦʧ$ꩨBj:
*j+VjkG++ł+>*=e$Vk-}mt{Ӹʍm>;nꆖﺦkZ;T<Uz1e[AUVD 2[ 5\ Բ/2--r/{͊,rρ\"ݘr M#-Ґ9#Ҷbr6XG7_5_C3ggvavvjm7sv+wmw}7YyG8}/x"_7q~X_9y;7%[~yd.	  ;                                                                                                                                                                                                                                                                                                                                                                                                                                                    blog/wp-admin/images/comment-stalk-fresh.gif                                                        0000755 0023433 0004734 00000002053 11060470654 020712  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a@P  %&GaN!         !   ,    @P  80I8ͻ`xdihlA,tmxq  *l:&oJZgv%p-ޫzr+=~ߚ:sqstww| [Ifk?!MT,9'4Яߝꥺ/dg@L0!KE|X(ĉF<Z|1#%xȑ{V2囕,[Y	SΙpԄSgKzA
СA4R(R^
ԩT|*_
([L؞V-m[xޤ|U,Xb6"?vY2ΕQt\!8tѤe>g`];mڶo:xৃq7+_hzУN]_1s]5g.}.DdxVP(`H*V
"L@MhӄaOf!Gv#8S$S鍣bF0>hэ4Xύ8V#?@2@Nd,ϒ,XK#<Rr#e>R2)JdNuIMRdF&<h=hvX܉̝t։۝My˝YD/j衮$(6h&闒)D2EjiGveZɪZݪ$z*$檫w+ Ev$k1"MѶՎ)|RSj!Ի+Ļ/VnoTN0l^|3k18LK\!r< WD#1#5K52`)j#OZǙ,ܬύ8=4=.9ѾPͤQK݌9R-X5Bz8!jmvhcjK%=޵}I߀Qkz[x ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     blog/wp-admin/images/comment-stalk-rtl.gif                                                          0000755 0023433 0004734 00000002050 11060470655 020402  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a@P   %&GaN!         !   ,    @P  0I8ͻ`x	dihlC,tmx1QAdj:PGZ3ovʰxh-vnk޸<7zoۀ:opssx }CbglGNU,9'4ͬݚٻEW9<BQz1"qJ;zl2䝔$<)(ʕtRc34ټӗ͝z434(EEd(P:bh ]"I׭Vz-VeEKEڕv݆ׅ];ލ(X0}WL
9ȌoDn-؜f<pZҥeFk]fK,\ioJ:䱓+?$sKKس3=OéW.\K% ZDT[%"%%,1H1mlm!m8I*rHR,W1ʨP+ģFϏ;Џ@DHLLyϔT"de5\fe7\vI`IOdŔ#.rXg0u)g2urgyg@}眖,&9fᨢnr)Fz)ufZUhX+J"oȮJx+/*k:KB);zmںT&ƺWeJn[\+D. :|0 H7\Wara|1Ɛi,*1$^$Er`)O3 3K0;3sc9=_3;@f2m60Ԕ9=QKdҠI}5Hmaڲ]qݸ-	ޗE7	  ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        blog/wp-admin/images/date-button.gif                                                                0000755 0023433 0004734 00000000157 11060470655 017261  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a   ǘddd͖!   ,       4x*ۧH!+;'yZ؝ᾰL;_ᆫt\e,$  ;                                                                                                                                                                                                                                                                                                                                                                                                                 blog/wp-admin/images/fade-butt.png                                                                  0000755 0023433 0004734 00000001421 11060470656 016721  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR      (   *   gAMA  7   tEXtSoftware Adobe ImageReadyqe<   PLTE2  IDATxbpP``"uf Rg $`CM888 eueeeuA]_J]JL]_L DE#e@<<@GBGH )f@|||||V| Ġjh(*i*)
 dĤjĤdd288CI bT6UV䔖VV0V4 'AAM{A-AM-A%%M-A% bbbaab KE[ |  *@X @ a  U 
VA *@X @ a  U 
VA *@X @ a  U 
VA  Kv%FU    IENDB`                                                                                                                                                                                                                                               blog/wp-admin/images/gear.png                                                                       0000755 0023433 0004734 00000040546 11060470657 016000  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         >a    IDATx}yU餳vH` Y@EM|p8(.83n<EEGa㠠|qIBB Iwz]k?}ߓs+tg{[ԩ.[c;w^ `AUUHY!I @UU aPUeee%	u]L2dcգ`QJȑ#P1MDfC  y ǂjk	ݦ:^`8b{n i6 '<yg+m	XN'NQ{(Vb> 	\k <7L$@v@&IZZZPYYyJuWY/+O7iq˶O>峟\=8$	0  p\JUUP9==7#VV]U*dY(9}! `'-% Ǒى*=$ƛnsOه#Gpeb3!ķ- V a}p@,> #SEO Χ%#c! \ׅ"L^$[tT\$IhkkC:.:7\\+D=%y`ك" i?7xuĶzRc]Ai?FT*//svQJ k[ L[ǝ1ƞR|iUUk.?'8_N<t	^lT
D$Dr]ӦM7>|x>t&LpJ(% ɓ W^Aѣy<sHѲ,CQ#N`8Oz+8~s==rLlll<"z%Smwcc ~-1mڴ'<۰HJB*$Is \}<A]QWWqʴiOW^,f͚uT5.v̙G Lc?þvZkj h3f<8It]ia   ]׹dI&mL$@mm-^z)6m܈{,O={y%sރ s=`ϟz
$>|41cƌﯠoD_̰U@޽>6lXqFfø>L"oL$hiiAww79sdٻ/OPeڬYƹ Q

MJn\	4,`՘>cF(f͚q׮]gY|4~޽}}}e-&!/2G,ܬ#il߾'Oa5k֗5M(  8qj LBQxl6S@V<p ,ꫯ6w#wn4	*LHP1\r%G L78n444\. m޼<̚5W]u.-bHVTҨoؿ?v܉~K/ܹs?V]]}HQUUU8z(z{{WPF)
zI`̙yѷz8EIiqtCk,[o48,x%O<$bݎ׾,_Vĉeuqs$F5M(Hؿ?mۆ#G`ƌ;ppn#""QO⸿G1k,_mݹsg*R$?)L, pO}ݸ[O"nף xd)DP;A]#n(
,XYfaH8|0|߇y<.y  Q^IS`o<i,8oN> RD&n,H}Ghkk?A̙3Y@$5M0"Dǎ9 D%0L8tqB.^))@?݋K.Ļn<3(++Ç?aqN"Itvvv(_|Co?%Eli~ўqymevIԫ5gx< U<r<WT`jClقx<϶HUU[d
pX0qUPH~5mڴOW#(Ņ"w5āUA ahhHp{Dn:apab}H*;h4%_4^gF2	G3aX8E0& 3h$(%r@WVWlX,3dLrϖ {zzՅ!I}N⟤ X,	&`ɈF,eM"(B=O$zVUUqqqLJh :ԜRH
$IOX`%"&yԮ:]]]hooG*aO044.޽9s&LD>?-K"?!eeeྑ.;0 vqk e]V:mp饗>1nܸͶJ4r9:t}}} D}+nDH'EA>k={`Ř2e
|Q?OFԖy(//G,[WXЦ(
dYX/++Þ={ǡiٝNW޽aEsn8po&ϟDMMfQzGG>۶Cs8m?3HǁeYHB:溄a J᷿-.@mS(u1ƾB#"(
^yH]G%af0i{Lf>{kc<qsIN98_755w]]4O+GEss3@BeYp`ܸq͏"H*ܭiGmHR>}:VZݮ#Yeee(//=4.PZ[[ˑFO"$)eH$b
$	D"""8/z8<'~uԩr$=MӰ~=zs=I6(2e
Wɢؾm8|0v؁n` &O`q%)?/ %`/2GؿzIɉir"8o@H'*@dYF2ܶuEz+f̘9@u9r{N |>z̝;Xk$mahh||,0!#pPUe^֭[3\ fΜիWsA,`+=^&I/XIcrxF"$	\{4^Le HFekoo_*"HQ$I0ؽ{wG"޼y9s&WEAww7qrړFcc#NʉnٲeÆ%aرc(zkfׇQ
NkӦMXb  \pp,aOO-Z'bhhiy7|q\ve:u*lۆioN>d|!8z(݋J,Yd2hhh5k~z$Ib1A 0/MMM}eDtA<+z)S9A>/+W䉧T
hT<?ca?>|={c۶h"n7[nEOO(|߇(,Lc̙hjjB:o~̟?\srjkkxꩧf
fY&M.X1144˟Ks"R)l޼~/ L&H$BgЀ
dY.u]GOO:<"yaʔ)fPU;vCaX.Xcc'L𨪪?Ohhh@cc#ZZZvtt;v|lÆhjj9sk.n뺨{0UTT[lU QVV6cp~Di..lJX)p__A<<XC&T}}=f̘˲(
vލV^o~,^wu7x˲oYV8q]VZvc===xאH$L&?#Ncԩ+>TUiݻyRg sn:eYSUP>&{#m3Dt H$044Xuuu,AJc&a|R3f6;vx?<}h%˲#琨 V ~VWWc݈FH&Fd2Xp!&Mĝ5ݻg"L!sPc@c̐$AD|߷ `awyeY_~[[jkk!2zzz8Ӡ?H,477#HW_Eoo/֬YzUU۶rOx
zrˊ^ziSkk+q1?Ǐ,Xp!6o\kommży .t0yq^z/ү 0H11f $I3Ni ϩi H ?5{NN	/"H wa sS&0u7 `ժU*++g.y+q֭f8t.P[[!:ۋqIB`(5-FTncEaedl H 555P 8F:.,Q$	L˄D"]׹@
ԄiLO:]r%??xmau]tww,cgƀ#٧~%cDsE]]EqKs)Ȳ c"y8STQ,SGMDG 2 IL&aLy{E_AKE
YÄ́	nsX$IH$(++mhƕWzrdyR^z}'F-  OۿęR!B@uB/C`6t]G*B}}=t]\hફL&ti ykƍ~``oL&IE	E]|oIBevl xq?Fbٓ%"LrBHqsq	~$ :$ AZL0? lڵky =4˲y۶2UVV|>2},#WpmӘHF:ujc"S)ᚦq(`F&4\I:y M,z&L+WrtX"C,J;zsFõ<[xH4$Ĕ;1:.aOS{v"TU=XJĊu.Ν;aYfϞ]TwJăS xA²gk4p	y@㤪*_3!~(FEqMIDiODB?N"xl'8硩	k֬N>tnr3R&ia8K^j r^lZ.IRqdYfappl'NDKKKQ,~$D1Bit Q9-T*UsJ qF#i%EKT$%)΍$Àip] *l|z֤IpСg9Ey\.z I4*':k i.p|YWXDbnae04GA0Ԛj[+(NOcH&%q ax@4o@@)bZ?qBDpQ߇0J? c,JH1HJt]h ^Dbi/&tq9>(H$}/"4M4y*{,oT?x?dyqT2`p&mGywq?>$L`ؤ	6}G4-4M4CGL&AMRCyy9SE!\|k4"	@Ki`5mx$d /='QYaL`ю>!3@|v|ACpyD"=
DQͶ')!H4iF @YY"H"**kb5"3٨]M$ ç?R0z[ZZ.8:B[i`V%I	)Fee%\ŤIpȑA[3ѢDyA
;:88ȥQ]]Q iG
`\.`321m\>X_|/*[Cp>VQ vHUUU}hHs]555<KZUU*)zIЀC=UЦןA q4R4M۷mC$TVVh%QHR' <q&i0GZ=%o|.%(T1xD7"  Iٵijjj0k,r xt\1ݲd]]ݢ)S@UUchhD1ct]V@,'{뺏N&Glb;4'ԼhY6m.(@ee%͛ד'Oe]UU?>003>N!
"}?<k֬F躎JضݻwCe8)S,H$x<]MBgEBM'䷵rUUu=)Q44UW]ŵy1ca`۶mPӦMeY%=,˯x^NXcu1MS8q"GlmD"9(J~9.\Gjܲip"M܌7b1,ZLr={6@ף\۶}m<RŠi/D"ttt^+2
Eqo߾?Q cq- @/UEGP*Nyyg4a7x+W!tRl޼}}}u۷oGgg',Xj2M'N,%i,Ν;q!+x#PT9t1.@R,/bBqƟid2j!]c쳱X/&]`x;˲x']ױ|r/cǠiL&1a.9d)N<ݶmT
\[2aѣ8p t]?y<AUU-Q9} '&طzm{_P?1cI3d3s{);Dee%fΜɝ.|a+āk.~oKK
Yx%r9#J]ԩSpBIh4l߾(5\~`~С|PG|uq-$sA'xl4w\7OC֭[(
R,ӛ5kjjjo>tttRyPN$0|<^4ROؼy3<ϣPtQ{4mL4	!IR(Eïk[opkb@@.nZʘ.ő_3Җ|ߏ,Ydꫯwڅt:]TX`ZtR444@|Ckk+:;;yRz,4Q[[ɓ'$8.eXd_ƤIe$eI9UM1sog4 J믿j,pi|MT8;~/.]tkնoߎ~	,#"({?>8ёD+xG*B&)
D54M_#ICXǏiӦgu+ h* 	%J"$Y,{1^HloLS@8dPʻE,$D/_>x7j/2$ϸI@J׶mӃŋK .IzH<Gyy	f }G&)_oݺ{5ږe/    IDAT,Xv~
 R ))4#yZ:qn}?jժ}ڦM˃Ab֑؎J$cǎMMM5k/H\Dҁ ̵!PoKKvڅ!vt~,*y*o}
X.0af$8/fH׮]@WW pSUmW_Ů]0{l444 '&'4ڿ?_m7 KsȲ̿?twh=СC*t]Ϟ-Ʀ;4-TZUlٲիWCOO"HN	RIa;wD}}=Ə^&	bZr\/0/paسg|g>̴Ȳ<[ W90&%GݱgŤI)bHFlzdQF'r*Om)M>,ö<A__n8O|E~d#`ppmc y_áCk.#eHd1?FV
:4w	a`5tM(sHSx[ٶ]x?яf78  _j_Q4t+>_oΝΒ-K:~$V}?B6h15Jt@&
H׎r]CCC\lR}~.4:뮻/~?0?F16#f3pE$2vmPţ>q̙7}{`jC/%D"8vvqqƌ<QT\M>Plr5b"K!7`OGGǾ+bɓy&)<ܶv-nf<C~SUUYQ wJ_OiL@&*tnWK_gh4/ٜH$fnٲ?<8nr˿4WN,N!mGww7\mb饗niiKS"w^p7}oe"$͏
<zҘmL $<ϣ@̊pbߞ=6}:7u]G{{;?iڒB/N<~qF1e#)4 ^\.˲qppvŋjĉ9Äs!|ի;MT->HǱmt?l""\/@
oWys=`Z[[y"9|/nSe	bkfF"~+ؼy3Z[[H$8!F5sd9^ ѣؽ{7y^W_cl͟g)MT
G>^ַp},//$fD7tz	 8-[<}ݸKuDֆM6mc-}_&^UUap۶mDM,'.ݍd21F+h}_iӦgx閖qx{ߋu{]YQQwOJ?̑OmӱdM/^o?~---¦MXLs&-  >Z)TX+xgLT$ L&y /Fd46\ulܸK4gw_ױnݺuuug^/rQSEC ",Zh;6y{<_,Qql2ľ}x08<T tBBH:F?|rP^ rGټy3/y{}ݷrܸq_~9><_
.: IPٿiٲe}횦]&g.Bիqu^C8x ^z%[T-L ""H$UVK.̙3~TUQ)(ϯYn݋D⚟'WVVr䟫qd2x PL>я~T.œ	'&U<̞=]w oǾ}xpG }
 B>Gcc#z!lٲB(
:^?4aÆ$'mΧw"L3g%<Sdm+kRF`i.,L&2>GS!Z46狁I\/詤vh*}
EG118RҔ
D/ȱb=!"DFK$Ȋ2\=y?qL>nf-x6A$VrV XEČũ1".2m4b GD	++ Et2/B$Q>V$)L`LӟbPtlN
e'K`!e,"W,S|z!YԂ2+ Oa
C W_=ԧxSi"?Bٲe[ux۶q7cn# c0WkIHM%K  ,Dh]+q"15$5ESy\BGsc {兜F"Qds,x嗋>JeSÉ4@dykkk Ǳj*	<ǝ:GܹW5L+$-=OB	kcH2i'?(qr8f qzİtRDQ"dBϱ7r6oތeURW^'v	m<N!?ᓟ$oAQu]EQShQog0-)t 읣ʝwZ$nl62LQ_~yѠ+ICCCeI!3㮻c(*W]O66kHpQ:8<pǏGwwwQI ̑dNh^1t%2wtGHH$M3w%  'Hj𩪊l6SH͵aΉ}ش9\Q&Mi<r7SE;β5HREZ2eXŏ)KJͰVs/Gh8KB~dْٿ#ۆ Dd%	[B̶m!3K.&\X
+_aAχ8C3~OJJ=>-rFHE$$Irx3eaڴi:?D"xy`N8T?]
/`ݺuEQғ976qȭaBQyu``n(͋>W8S;d!36`!E\ttj[$<"_n: 8iF0p	&8{)q;L`=y^i|~. p<S5Me¤R)-*PXCnZP[J~i.  $
:i`6G T/-N+TVI	.)+t''Ep)`uݍƍ[O~i$D)C%Zoc꫹T3ɤ$"v؁-[`͚5Xz5`&J61zH5ydY'$I'G2IǠr7N#udF$sKOG"#G<sL+q8' K,AF#i"<G*͛3gRR*>!M{{;ETjlN_YSIs.Fx{Jj3,$KI&aٲeȿ/$QsEq2f\
API,lp`$Ip`$B P4]xlF>ǜ9sdy~o8P<x,c^1{"N#jeAT(_>/B)"@ 8.Ei-++,f.\s^: Es󩸟"ӽbrh))!2ZZZ@tD*</nB ^0\4@@ 嘢(eee(|I٥^ɓ'c$%$%LGGl柢&+>6/E# x L+0uu],//G<hjjfxjox,oOO @yy9\E[[}},ow;]/8E "h	__aY_z]Pt]UWWEo>ǌ3H$ZBDo)~~ @ee%c8|0
^iFLD{眏h`ݺu?DRӴ&Mjr9dYL2HR!|a~``B$<xVUUi@$6>|˵]i1c***/a}db<܄	*ۇ#G@UտU)4F/~hmG wsAee%R$빍.N`lp%41m4{0㛚}0}d,o[ ַkjjjjjB<G2Dww7jjj /*#	$"`وF8p ك\.nĉ_>wa^,۞  ~5cƌ5-B$Agg'PYYYH A 4M,\eeehnnƎ;̤Iկ~ك ǥΕ n-Zd(Gرc(///BXWuK.Eee%ZZZ+`߾}/<
C{ꛌ3X/v!B$#t6	(f | ?Dht;̙37JB~*&Ii555ī~zB	@Ai#W3'ܑ~8P
Iq`0˅Ľx	Kq |&Y_~Xh	D{>waĉH&ؼy3<xPTׇ9gH~E8F0#RÉ.L uݖzꝪe]
eDB!o&466"JaƍعsgSO=W  h8Q:&r5!cńΉ{~˨lB&	MUx~(B] ,j~XQɗw]o~~q |F.>455m<sx7'|ry>%E워bą9M(˅Ή}'~yL`J !OD{	Ä10z  D">SO._txi=W^ _=
˲hPq\28r""ÈKKoT (gg
 W
*N$E8/G(&"Q' ip 9 {m'<q1?<<㦛nµw_ׯeY/a8/Rs0&auq]yS{)lĹb"0h:0Q"QR@ @ IR @}}?|Sꗾ%Ȳ#Ga+W> -[裏駟H&y	LIƘ"˲HSͮ9{^x"RzEA Ta/+">FEQTYUY5EQ4YuƘ3 Fc&A1TƘ&I*Ip% $I}ZD)cV:>O ]v?!lƊ+~ w^<ذaw:;;l$IE A
	ba8$$F-IR.1f}߷$Ir]uc ϶mBzPmaLJH</4M	 FPJ]fmR6l088JJAȖe)*1}}-1A3ƔeI ³ dƘBb/>啇~xruuvϟرcG~ww7aÆO%ɖk4MS
$I
F$_e[` X<+(A$I,ˁ(LQOQM$W44MIu-7bP=abn݊gcA1J ĹYԐue J*{{{~9CCCdt:mr9=˙뚶mAAH r뺴wGsG<O++$Qɲ,+ɤ͛w+Vg?~WDaJaa(a뎦ii뾢(i(c8_*'˲(imŬX,f%	'ەN<w+***u=(pa jyQԂ P P8b۶d˲L&r9ݲ,-meA(﫞穮*mmei|^rj6ǖei\NsGm[<O}_<eYY~}ռyK|+_c=sk,u])f{yaHčF^,#H$b1Ou/x$:vh4jGQ7Hči~\Y=YE@!p 4INIM4EQT0H$9WUU0۶%qqTq4˲deihLFd2F&QUU%eQgA Hg$IR |ga |^x!f&x_XoooOuuMӌ磀8^$qMt"SVVF"';DbnYY|00|EQl6i끪aivGuWQWUU0,aa4f8[`pܭ)aXʆaH TTUUU50L";mU-beɲ,+究mk㘎mAg+4VI?`j[?яκk'x"_WWנ
 ,3EQY}EQ<]}UU  }qKUU˶mu]<$:)iXL2Maa8iڊUUͩju]KHI)BbƓZtf,ZTmv|߷t] |719Uu]Ӳ,3tHRF:6t$NG|,Fmf11ɲ,*3TYuYuEQTƘ\VVMӼ_|wޡM,_^竪ꫪ(ji&`1<׶$I9 Y۶sǱ<ϳ=s 1Ke[u[eK$Ku[41fiļ11Crr*0uu۶!0Td2˲b bieY.7#8nyRXa	8\Xi$<tuuYLQ\Piu<YeeYNiQU5zJ!Xu\&1,xvy8i^UU'y`ZTp Jr9y``@*hﲪj$E1u]7***A<-Jyy뺆mێde1۶m۾eYj(
e<m4McHL5M
s5׎vAeYdY*VU5zp4f^.󪪪h4PY伅ϖ8j%S d2)*1<-}Cc,Au2 1{</y^q۶cǉ`۶a۶꺮y aغ[iTU4-jZU+$)%rNYEQ, 9I\ nnYY3MӋFvp	+|>\e)lVfa
Y1u݈QXqD\׍}@@ r,˾,ˎ(+ 9(JVUլi)IdYΫjɲl˲gyi՞idǓh(\D8NQ]8d&|Vu  IDAT>*(XUUu˲ƘQ@|$3]$uT
/8n\Y]I,EQ,EQ,}wc$I^$cnP[[Ӈc؈ꢋ.A@Âgz{$mܹlImˌ11&.
K( /,
"H=EQiA2Dmm-Od2J$ɢ29K!\Lp`M)E	Vm}((EņRp۝%(s<    IENDB`                                                                                                                                                          blog/wp-admin/images/loading-publish.gif                                                            0000755 0023433 0004734 00000003471 11060470660 020112  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a    FFFPNN[WW˷㾬ˁxxtmm֌                                             !Created with ajaxload.info ! 
   !NETSCAPE2.0   ,       w  	!DBAH¬aD@ ^AXP@"UQ#	B\;1o:2$v@
$|,3
_# d53"s5e! ! 
  ,       v  i@e9DAA/`ph$Ca%@ pHxFuSx#.݄YfL_"
p
3BW]|L\6{|z87[7! ! 
  ,       x  e9DE"2r,qP j`8@8bH, *0-mFW9LPE3+
(B"f{*BW_/@_$~Kr7Ar7! ! 
  ,       v  4e9!H"*Q/@-4ép4R+-pȧ`P(6᠝U/ 	*,)(+/]"lO/*AkK]A~666! ! 
  ,       l  ie9"* -80H=N;TEqeUoK2_WZ݌V1jgWe@tuH//w`?f~#6#! ! 
  ,       ~  ,e9"*
;pR%#0` 'c(J@@/1i4`VBVu}"caNi/]))- Lel	mi} me[+! ! 
  ,       y  Ie9"M6*¨"7E͖@G((L&pqj@Z %@wZ) pl(
ԭqu*R&c	`))(s_J>_\'Gm7$+! ! 
  ,       w  Ie9*, (*(B5[1 ZIah!GexzJ0e6@V|U4Dm%$͛p
	\G x		} @+|=+
1-	Ea5l)+! ! 
  ,       y  )䨞'AKڍ,E\(l&;5 5D03a0--ÃpH4V	%i
p[R"|	#
	6iZwcw*! ! 
 	 ,       y  )䨞,K*0a;׋аY8b`4n¨Bb bx,(	Ƚ %
>
2*i*	/:+$v*! ! 
 
 ,       u  )䨞l[$
Jq[q3`Q[5:IX!0rAD8CvHPfii QAP@pC%D PQ46iciNj0w)#! ! 
  ,       y  ).q
,GJ r(J8C*B,&<
hW~-`,	,>;
8RN<,<1T]
c'qk$
@)#! ;                                                                                                                                                                                                                blog/wp-admin/images/loading.gif                                                                    0000755 0023433 0004734 00000004742 11060470660 016450  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a     !NETSCAPE2.0 !  ,      ///vvvd	uBz4q@ 2,,F@(;cKJ0(&$`fj0PhQ(B+Q\%Sr=0(FS	
A	GKv	E	Z$T0#]#Z !  ,      ===sssu귂z4=L# 0	6D#0@ Ƣ0hp.`0M$c{j3@XJI1 L'G4LB	U
	}NxO	X`	]c54Y#`#F] !  ,      999$uzA0=
<H	6DC`P  F.2
  pm:チ@(|6B`0z[@RNe@Bw	RzAnA(	Zrf1T	'TbZ !  ,      :::}}}uzC4=Q<ʐ8a8,   48B#3
48,@P}6&`m֚b@xj.3@	u	|O
66	Ye#	'#bS !  ,      AAAooo$2u
{4C=aS|ʠ8[À`("hpB#3 cx,L]ubJ
M1 8'r@		grN
n%+	Z!,e2n!#&#aS !  ,      <<<$2u
{4=aă|ʠ̀X( FfD2Dfr8L.gXZB!Yށ	CƋМ8 &?:	   M
1	 	[$!l21!'#[ !  ,      @@@kkk$2u
{4=aă|ʠ̀X(1
0 &DfrYg #Jq 1?:T
	JL
1U r7[$ 	'1   +#Q !  ,      555ggg$2u
{4=aă|ʠ̀X(1
M$\Ϧq0BaUFBkN s?O
07L
1 -XZ  & &'#Q !  ,      %%%ddd$2u
{4=aă|ʠ̀X(1
M$\Ϧq0 TށVJ q)z		H%  		Zxv[ +;#Q !  ,      >>>ooo$2u
{4=aă|ʠ̀X(1
M$ n8؀pTۂVJ0S<|_		H l	 o5]ZjNb]#NQ !  ,      ???sss$2u
{4=aăv2. FX(Eax,  Ii L @o=:D( ND?A*t	H.:
CYa	^]-WOa#f#u^ !  ,      ...ooo$2u z4= ă@5F X( H &qb 3I$&ش!((A,	
	H._	W(	\$! 1!#_#\ ;                              blog/wp-admin/images/logo-ghost.png                                                                 0000755 0023433 0004734 00000001560 11060470661 017130  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         ǲ5   tEXtSoftware Adobe ImageReadyqe<   PLTEOOOGGGhhh{{{TTTHHHqqqQQQSSSyyy[[[lllnnnIIILLLMMMbbbiii]]]KKKgggVVVzzzaaaJJJ}}}ddduuukkk```xxxsssNNNfff^^^PPPXXXjjj|||___WWWeeepppRRRrrr~~~UUU\\\vvvtttZZZcccwwwmmmoooFFFg"\  IDATxڄSgs@]p{BBH#i~S}zbxz9(J.'3IDCҩlUBXLm,ҷZ<KM=o>e]e>jhwVpMŬ$_Pxpq8^7Pĩ)N|I#dcPh{'2J,:D;9Dʍ1k63D4Y>7*QWme$Ko`1$g6"&@qjVP`{tð9e%$$:kc_ 7jY!ub٫ /h)s25
PDj4k=K"@7*oJAks8ӧIs7qjj!v!̀0@bK?3JAmG(l Т֘ˉb io6#<Dw'VnM7;P;ŶX/ݗYk}=+T5T+:Gp#)\\\I-ĴWׅ` ΞrN    IENDB`                                                                                                                                                blog/wp-admin/images/logo-login.gif                                                                 0000755 0023433 0004734 00000006160 11060470662 017077  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a"B   FFF%ѢtttRRR]]]󹹹iii藗֌Ůw3iN@兹\$FGGIGF%i2[                                                   !     ,    "B  @pH,D)8ZجvzxLN("zf"yN^;TELk{V
Z
CjHU}jZ	D
mjB	Р۱r_
im 	D
jC7 8ǰ3IHC HǏ hu9\2H!	4{-sssHrsΣH$@/&PH.U:}j1B]^9;?\-<Bط6f/,&O
8 @`ךa,|*2^)KR}_T$$GLT3H/2
9߾+YA&^ΜIAUa4wH0!?  4FB"ױqta,xp|tgTy8RUR>7v@wBLwAw#R D&E!EM3	ab25] qeP{wYeZ^'?X"7 e,l&;Ex~J=Tk	 5U4z"A8Д'f9zpPXA|GI-f &Sc0N80v[/ԙ'<R	Q 3ѣyz^Et_yW㢗T@flKT Ln36l4klD ^	͹͖P 
!|߂Z^CkT@eyKDo|/V/.澍 i%MFO*tD<PgʗE6
pDh$A
A\6}^r ,An]DUs-s.TDk@jhE9|p  U$lP(<k7Pw296jl6U^7 gmddplAD8yg~>TnaFνj*0[ϓK~,2 *,LW&
xBP`y#P@1^d+eB2|E,"xJHQf:" }iFos27
+gs5cJDBK29ғ-j|Cp >P,q;PP2<Rlaf;Q VP<P	3A 8B tWW PE#t`Z!J
( 2XI S  M
6<qq F##*<c3w9
@
@IpD%7פQ0ra<Y?zGǍ4}$B A <^ i%-\KPCf#BQ KyT0NnEEz4K(-N5N,E@Xp]
beV4s{FHjiyLlРM{C#JP`Ymc{H04t"{C,]4?ϢB\ft~(RS"<S  է* h!P(3*
C$TXQGv*j
^A  ZB4Jn,d* Z 4^kН2<EQ%.YAFgyUZuA$ F6"qbVH 4jۨ,^ 	h۠;6dd 
!;P0E&tgx@3 \w[E.yZ6~
p@IjuwuUڥo@kG}ͳ+%BV `/trMI2i( z^^YV򞐏ӮYmT"@-1\6Nm޲T"؏>q5*6FApSGU/[Y֗b\]CK	gOY{eV@!&E̬}lP) `inL}B"d#O؟icmdIYp@q[W[5MC]pzӴ3뉓-T?OZ]LH'##`eUeh5<(	Gv!iLNq>}/BX `_8]"frhwG5,B &L"[jmVаe4EpP5Ӂ&_QuQyfx!;cV EDJoԺ6]EMys#K :
, }[4Jh=s< \-J0n)h"ϩ<,&V )
~<ܝъ!or0Y~U|FEXУEjtf(J,> bI HI]5u{,`ށ+XF'-?$¹La_+LZ es.mfwWQ$X y`H
؀xSwCRE%Y`&vKz][7*'ҡCPð{i C#9۱~/x0Ђ\D׷fV8
~ 9^J5߀?vdAPgRf&Eje8pRO]F@wF0	nPW(p78Ј1lH?hY0AX +mDЉ؊d0 :Mb- 0 *ኼxp U1Q&BՋH7!G`m AL8	p@ aXH{!7h`T8  y[J\d F 90%YFF9vF3Yr ;                                                                                                                                                                                                                                                                                                                                                                                                                blog/wp-admin/images/logo.gif                                                                       0000755 0023433 0004734 00000002326 11060470663 015772  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89aA B   Źtttiii]]]RRRFFF                                             !   ,    A B    di,L.1tmb`,@caHa"ҀrdB(rp:[-cdiShmsҷ@}'	
lA>
b"
x'ouF#V=
A} h >#A
=	=>"=
iQ>Zӗͱc=1#5V&5{ pSL "u"%PO*	 _LX*'0A> P ,B1l"P$ l$UB*&y8+f?GLTűV 3bj,\J+bm'Z'4R  CԕV!pz@,PqԀdRjF> `Uի+fL|kj/ZXUAx&a" tv@`&BIr 'dyV]ػxS(լϳn?\*%b @v1(B>@v*@ at85JgwƢ|a3'"&o8f`l >ŔI#;<Ub(dL>D)FR\q h7Hf7BoUL}lG!A	T2,&;\ÜE&AaՍ3y(iDaaVN<'t剤Nt΅ɥ@<S~ F(`2Y`wAP$9\#Yj+b5&JწHgp!T v-_t,Y<%Y yB XT`n&mGW%[="o*|ol9#(hBp2'*8piˠ#%djdf㼫3ײ.TXʬ)$b L	Hgb`Gp͕ ,7.*
 2kػt[B|Z1'	D2,%3 JbSM@{-V'^Ә!M< n	0 L%M&_ DJ #AE-x@
<!  ;                                                                                                                                                                                                                                                                                                          blog/wp-admin/images/media-button-gallery.gif                                                       0000755 0023433 0004734 00000000110 11060470663 021044  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a    !     ,       mRp3FB{vUeeR@ ;                                                                                                                                                                                                                                                                                                                                                                                                                                                        blog/wp-admin/images/media-button-image.gif                                                         0000755 0023433 0004734 00000000105 11060470664 020474  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a    !     ,       	˽"3kU"v$%1hjfH ;                                                                                                                                                                                                                                                                                                                                                                                                                                                           blog/wp-admin/images/media-button-music.gif                                                         0000755 0023433 0004734 00000000274 11060470665 020542  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a   穫󟟠ɸ߰                                             !   ,       9 $BJ`<#L	\K$]3ñp<`#6d: ;                                                                                                                                                                                                                                                                                                                                    blog/wp-admin/images/media-button-other.gif                                                         0000755 0023433 0004734 00000000215 11060470665 020536  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a  
 ܷʣ螟            !  
 ,       :PI@،C9K!"	kw"<OA	s-6B9Ua(k ;                                                                                                                                                                                                                                                                                                                                                                                   blog/wp-admin/images/media-button-video.gif                                                         0000755 0023433 0004734 00000000104 11060470666 020521  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a    !     ,       `SVGmr%HnЉT ;                                                                                                                                                                                                                                                                                                                                                                                                                                                            blog/wp-admin/images/media-buttons.gif                                                              0000755 0023433 0004734 00000001323 11060470667 017605  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89av   贷߰粵Ը                                                                                                                                                                                                                                                                                                                  !   ,    v   

		ȫ  όˮ֓֒L@;P$|!Kle.Z
zǱEUh㤏b=iV3t'4FJaBk>sƌf%;Y*@Tx'1Ss6)ފ5Af(O7o0Z6#}$ɞ7K-[S0bhAE;.h*
<Xe%Q ;                                                                                                                                                                                                                                                                                                             blog/wp-admin/images/no.png                                                                         0000755 0023433 0004734 00000001430 11060470667 015464  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a  IDAT8o?߷?nkiv3K)M71QC? O:cQF4`DD?Fu]}۾=xIsx<GT#1ćq`&Jqy'~;;_o hj~ſx\o 8w87'jpс-?'_!OM5,ٶLL9<s2'lF7]]ױ\/\w_c:yƃ{xiP-|ň ýT2f|b=QJoM=#97GRIa-&b	 )#Q<B2@oVAA`~ZvvuNw \mT.ŇpF|VM׹+g0}V=]b	s{nK.{b7f(&pr|2(5Ug:nsuǡ.S+Ί! ־Uޏ'ͼ X(FnQT0F!Ǟa:061R@nY,1i-G1FO?kv&%U?a=]_t7(ZB;||]Nwμǭnz%ӬϽC(pU+^m>]^pPTDijĆ!AEal_* \1qPϹSʀq9
C|>"8"fb>xY    IENDB`                                                                                                                                                                                                                                        blog/wp-admin/images/required.gif                                                                   0000755 0023433 0004734 00000000076 11060470670 016650  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a      !  ,       Jgg~{H& ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                  blog/wp-admin/images/tab.png                                                                        0000755 0023433 0004734 00000001756 11060470671 015624  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR  ,      e,g   sBITO   ~PLTE׾ԼεЮѮƢ~rhzcz\rOh|QfyH_qE^rD_t<Wl?Uj<Ukvc   	pHYs  
  
B4   tEXtSoftware Macromedia Fireworks 8hx   tEXtCreation Time 17.03.2007+E^  IDATxRAFVF i/hͬ\=;]oI*ХtbJplk(<e/hHb,Է2`,E(c)X@U{Eԃn6#1RLl_`?϶Cex9V(c0`,X c0`,X c0`,X/5fxů/W;e/hS|ВmX c0`,O'd,XmZb,X c0`,X c0`,X c0`,Xp!óV!v_bg\Xs4Xؽ5{*0drsjUzɚ4,닱&X5{*nd5,vUfbkU0~t0`,X c0`,X c0`,X cu!go*{ACv^$g,X c08O<Y ߆߆q߆q0`,X c0`,X c0`,X cB~p4P    IENDB`                  blog/wp-admin/images/tail.gif                                                                       0000755 0023433 0004734 00000000142 11060470672 015755  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a       !  ,       3fsmn}#Y
番gkqfaS<"B D* ;                                                                                                                                                                                                                                                                                                                                                                                                                              blog/wp-admin/images/toggle-arrow-rtl.gif                                                           0000755 0023433 0004734 00000000110 11060470673 020230  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a    %   !   ,       a{lE6)9޷#DA ;                                                                                                                                                                                                                                                                                                                                                                                                                                                        blog/wp-admin/images/toggle-arrow.gif                                                               0000755 0023433 0004734 00000000107 11060470673 017437  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a   %   !   ,       D	:bt1vKh* ;                                                                                                                                                                                                                                                                                                                                                                                                                                                         blog/wp-admin/images/wordpress-logo.png                                                             0000755 0023433 0004734 00000004436 11060470674 020045  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR      D   
   tEXtSoftware Adobe ImageReadyqe<   cPLTE\\\$fff{{{ppp[̷2Mv˭儺i?L4   !tRNS !  $IDATxٖ:EfL ɲCWU]Oq;$Ŷ%Y8-EEEE@tJ$UL?]&n M+OV^&;=Mqt5$X,e= av[[J [EWE5*	[:Ed6UNJjO"z%~Y{ɵa*seņ]Y6Kj{\͆"B/:yVOTI!6?_ӛ,SAWzg#ݠKЫp'F+=kLc2őDl]2#igXR^]
h>1Y{}ﶔUFT^\j]w{}߾?땮s7SDY>{.`VO$0w3PI 6G2=#3>QFj4V|:Xw0e3wX3&@7^=S|+n@gbݠ;fW#y:߼CË>5YԻm;=V"~sxgooPjwg;);<njݼ5@.|2J+(7O@"2GW)>V0k!w"_0"^v2N'뼆n=L{~e\4N^nv% b@I#7oEX_}]gƽlx'҃O&NW	@'@KBHHi͞/@s^ݓw0{9o஼1Ũi$ tWIA9ob#nӻ5䝤;zN?</=1}suST7po+YbtT~z W>{^ngi
]r)Z3볧2@o>^@=#@Gߌ@JяЧutgvBRJ1	Do	d{蘭q߻AGoN{]Nn>g%w
b VT+G/"WK)^:b+T~GWgzzC=}}dbxWyN
v֢[iHV`qG-}*>]4z]g//qp+ayF{J)0 >Aŗ
R~דݘtp]2W{*P
]}pu
WҶes>Q9%˕fO=@t\Bѻ;(ks֠Is"F%Nk)F5Q7t♼9usl@lAHx2uwX۩Vy.Mf~JzjUɰuԸW|L.r{E͊ycttW'-blN#OJxTi>m,_\_a6	d#x1\a%۴/xx-#q)=Ӓ6O沠 g4V\@{3S9Lw~O6O}q{YwAbɍV,Wg#WepwRP(4n*EPrLD^_̓ρWsϏ#z|pӁwIL)zI^l8]ᨑ]|"#`sLh*7P`ޢ:\rrEv)ccY7A<~`?}+h^6+O-i]eսO{Ί5LFv)sx486hE q@?sd&@rK܂'XqW½֓V|_X3(Sm=_NU<pWC֩
~{Nokgi	*a2l?7WFuYp}VͱӒCwBӒl\VѱodOB}߾X/c///g ~f    IENDB`                                                                                                                                                                                                                                  blog/wp-admin/images/xit.gif                                                                        0000755 0023433 0004734 00000000265 11060470675 015641  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 GIF89a 
            !     ,     
  bb0EJ",d	H00KA(L&BB0DR!$ఓgJVsPH4"sKAn೏1*NJՒP,  ;                                                                                                                                                                                                                                                                                                                                           blog/wp-admin/images/yes.png                                                                        0000755 0023433 0004734 00000001144 11060470675 015651  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 PNG

   IHDR         a  +IDAT8]HSa98[jDb4JֈĺK$(ҺꪏnBȆ6-Ksu,)6t45u;{Dl\'ZHtPn_2gVvv!c$kD2d߭Í:%!'p?x< _Fr'*a}=2>WU忉Op1Y/&f* ԒLG{`C!Փ?%:~4ހ^-!G#hlD}Q.KեզŤ'YqWS=tHYs䲭=:B#$&8 pL8
?,QOѪsg/=poL;A.K J4Ovj/1btMIK[ؑ bx	Wj"o!M`2t\}̩\?P<OJqv=vYobf$RWqjyxQ2{K§Y_+5K	RwH9]doi:R6dI?    IENDB`                                                                                                                                                                                                                                                                                                                                                                                                                            blog/wp-admin/admin-ajax.php                                                                        0000755 0023433 0004734 00000043316 11060470574 015625  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
define('DOING_AJAX', true);

require_once('../wp-load.php');
require_once('includes/admin.php');

if ( !is_user_logged_in() )
	die('-1');

if ( isset($_GET['action']) && 'ajax-tag-search' == $_GET['action'] ) {
	if ( !current_user_can( 'manage_categories' ) )
		die('-1');

	$s = $_GET['q']; // is this slashed already?

	if ( strstr( $s, ',' ) ) { 
		$s = explode( ',', $s ); 
		$s = $s[count( $s ) - 1]; 
	}
	$s = trim( $s );
	if ( strlen( $s ) < 2 )
	 die; // require 2 chars for matching
	$results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%". $s . "%')" );
	echo join( $results, "\n" );
	die;
}

$id = isset($_POST['id'])? (int) $_POST['id'] : 0;
switch ( $action = $_POST['action'] ) :
case 'delete-comment' :
	check_ajax_referer( "delete-comment_$id" );
	if ( !$comment = get_comment( $id ) )
		die('1');
	if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
		die('-1');

	if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
		if ( 'spam' == wp_get_comment_status( $comment->comment_ID ) )
			die('1');
		$r = wp_set_comment_status( $comment->comment_ID, 'spam' );
	} else {
		$r = wp_delete_comment( $comment->comment_ID );
	}

	die( $r ? '1' : '0' );
	break;
case 'delete-cat' :
	check_ajax_referer( "delete-category_$id" );
	if ( !current_user_can( 'manage_categories' ) )
		die('-1');

	$cat = get_category( $id );
	if ( !$cat || is_wp_error( $cat ) )
		die('1');

	if ( wp_delete_category( $id ) )
		die('1');
	else
		die('0');
	break;
case 'delete-tag' :
	check_ajax_referer( "delete-tag_$id" );
	if ( !current_user_can( 'manage_categories' ) )
		die('-1');

	$tag = get_term( $id, 'post_tag' );
	if ( !$tag || is_wp_error( $tag ) )
		die('1');

	if ( wp_delete_term($id, 'post_tag'))
		die('1');
	else
		die('0');
	break;
case 'delete-link-cat' :
	check_ajax_referer( "delete-link-category_$id" );
	if ( !current_user_can( 'manage_categories' ) )
		die('-1');

	$cat = get_term( $id, 'link_category' );
	if ( !$cat || is_wp_error( $cat ) )
		die('1');

	$cat_name = get_term_field('name', $id, 'link_category');

	// Don't delete the default cats.
	if ( $id == get_option('default_link_category') ) {
		$x = new WP_AJAX_Response( array(
			'what' => 'link-cat',
			'id' => $id,
			'data' => new WP_Error( 'default-link-cat', sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name) )
		) );
		$x->send();
	}

	$r = wp_delete_term($id, 'link_category');
	if ( !$r )
		die('0');
	if ( is_wp_error($r) ) {
		$x = new WP_AJAX_Response( array(
			'what' => 'link-cat',
			'id' => $id,
			'data' => $r
		) );
		$x->send();
	}
	die('1');
	break;
case 'delete-link' :
	check_ajax_referer( "delete-bookmark_$id" );
	if ( !current_user_can( 'manage_links' ) )
		die('-1');

	$link = get_bookmark( $id );
	if ( !$link || is_wp_error( $link ) )
		die('1');

	if ( wp_delete_link( $id ) )
		die('1');
	else
		die('0');
	break;
case 'delete-meta' :
	check_ajax_referer( "delete-meta_$id" );
	if ( !$meta = get_post_meta_by_id( $id ) )
		die('1');

	if ( !current_user_can( 'edit_post', $meta->post_id ) )
		die('-1');
	if ( delete_meta( $meta->meta_id ) )
		die('1');
	die('0');
	break;
case 'delete-post' :
	check_ajax_referer( "{$action}_$id" );
	if ( !current_user_can( 'delete_post', $id ) )
		die('-1');

	if ( !get_post( $id ) )
		die('1');

	if ( wp_delete_post( $id ) )
		die('1');
	else
		die('0');
	break;
case 'delete-page' :
	check_ajax_referer( "{$action}_$id" );
	if ( !current_user_can( 'delete_page', $id ) )
		die('-1');

	if ( !get_page( $id ) )
		die('1');

	if ( wp_delete_post( $id ) )
		die('1');
	else
		die('0');
	break;
case 'dim-comment' :
	if ( !$comment = get_comment( $id ) )
		die('0');

	if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
		die('-1');
	if ( !current_user_can( 'moderate_comments' ) )
		die('-1');

	$current = wp_get_comment_status( $comment->comment_ID );
	if ( $_POST['new'] == $current )
		die('1');

	if ( 'unapproved' == $current ) {
		check_ajax_referer( "approve-comment_$id" );
		if ( wp_set_comment_status( $comment->comment_ID, 'approve' ) )
			die('1');
	} else {
		check_ajax_referer( "unapprove-comment_$id" );
		if ( wp_set_comment_status( $comment->comment_ID, 'hold' ) )
			die('1');
	}
	die('0');
	break;
case 'add-category' : // On the Fly
	check_ajax_referer( $action );
	if ( !current_user_can( 'manage_categories' ) )
		die('-1');
	$names = explode(',', $_POST['newcat']);
	if ( 0 > $parent = (int) $_POST['newcat_parent'] )
		$parent = 0;
	$post_category = isset($_POST['post_category'])? (array) $_POST['post_category'] : array();
	$checked_categories = array_map( 'absint', (array) $post_category );
	$popular_ids = isset( $_POST['popular_ids'] ) ?
			array_map( 'absint', explode( ',', $_POST['popular_ids'] ) ) :
			false;

	$x = new WP_Ajax_Response();
	foreach ( $names as $cat_name ) {
		$cat_name = trim($cat_name);
		$category_nicename = sanitize_title($cat_name);
		if ( '' === $category_nicename )
			continue;
		$cat_id = wp_create_category( $cat_name, $parent );
		$checked_categories[] = $cat_id;
		if ( $parent ) // Do these all at once in a second
			continue;
		$category = get_category( $cat_id );
		ob_start();
			wp_category_checklist( 0, $cat_id, $checked_categories, $popular_ids );
		$data = ob_get_contents();
		ob_end_clean();
		$x->add( array(
			'what' => 'category',
			'id' => $cat_id,
			'data' => $data,
			'position' => -1
		) );
	}
	if ( $parent ) { // Foncy - replace the parent and all its children
		$parent = get_category( $parent );
		ob_start();
			dropdown_categories( 0, $parent );
		$data = ob_get_contents();
		ob_end_clean();
		$x->add( array(
			'what' => 'category',
			'id' => $parent->term_id,
			'old_id' => $parent->term_id,
			'data' => $data,
			'position' => -1
		) );

	}
	$x->send();
	break;
case 'add-link-category' : // On the Fly
	check_ajax_referer( $action );
	if ( !current_user_can( 'manage_categories' ) )
		die('-1');
	$names = explode(',', $_POST['newcat']);
	$x = new WP_Ajax_Response();
	foreach ( $names as $cat_name ) {
		$cat_name = trim($cat_name);
		$slug = sanitize_title($cat_name);
		if ( '' === $slug )
			continue;
		if ( !$cat_id = is_term( $cat_name, 'link_category' ) ) {
			$cat_id = wp_insert_term( $cat_name, 'link_category' );
		}
		$cat_id = $cat_id['term_id'];
		$cat_name = wp_specialchars(stripslashes($cat_name));
		$x->add( array(
			'what' => 'link-category',
			'id' => $cat_id,
			'data' => "<li id='link-category-$cat_id'><label for='in-link-category-$cat_id' class='selectit'><input value='$cat_id' type='checkbox' checked='checked' name='link_category[]' id='in-link-category-$cat_id'/> $cat_name</label></li>",
			'position' => -1
		) );
	}
	$x->send();
	break;
case 'add-cat' : // From Manage->Categories
	check_ajax_referer( 'add-category' );
	if ( !current_user_can( 'manage_categories' ) )
		die('-1');

	if ( '' === trim($_POST['cat_name']) ) {
		$x = new WP_Ajax_Response( array(
			'what' => 'cat',
			'id' => new WP_Error( 'cat_name', __('You did not enter a category name.') )
		) );
		$x->send();
	}

	if ( category_exists( trim( $_POST['cat_name'] ) ) ) {
		$x = new WP_Ajax_Response( array(
			'what' => 'cat',
			'id' => new WP_Error( 'cat_exists', __('The category you are trying to create already exists.'), array( 'form-field' => 'cat_name' ) ),
		) );
		$x->send();
	}
	
	$cat = wp_insert_category( $_POST, true );

	if ( is_wp_error($cat) ) {
		$x = new WP_Ajax_Response( array(
			'what' => 'cat',
			'id' => $cat
		) );
		$x->send();
	}

	if ( !$cat || (!$cat = get_category( $cat )) )
		die('0');

	$level = 0;
	$cat_full_name = $cat->name;
	$_cat = $cat;
	while ( $_cat->parent ) {
		$_cat = get_category( $_cat->parent );
		$cat_full_name = $_cat->name . ' &#8212; ' . $cat_full_name;
		$level++;
	}
	$cat_full_name = attribute_escape($cat_full_name);

	$x = new WP_Ajax_Response( array(
		'what' => 'cat',
		'id' => $cat->term_id,
		'data' => _cat_row( $cat, $level, $cat_full_name ),
		'supplemental' => array('name' => $cat_full_name, 'show-link' => sprintf(__( 'Category <a href="#%s">%s</a> added' ), "cat-$cat->term_id", $cat_full_name))
	) );
	$x->send();
	break;
case 'add-link-cat' : // From Blogroll -> Categories
	check_ajax_referer( 'add-link-category' );
	if ( !current_user_can( 'manage_categories' ) )
		die('-1');

	if ( '' === trim($_POST['name']) ) {
		$x = new WP_Ajax_Response( array(
			'what' => 'link-cat',
			'id' => new WP_Error( 'name', __('You did not enter a category name.') )
		) );
		$x->send();
	}

	$r = wp_insert_term($_POST['name'], 'link_category', $_POST );
	if ( is_wp_error( $r ) ) {
		$x = new WP_AJAX_Response( array(
			'what' => 'link-cat',
			'id' => $r
		) );
		$x->send();
	}

	extract($r, EXTR_SKIP);

	if ( !$link_cat = link_cat_row( $term_id ) )
		die('0');

	$x = new WP_Ajax_Response( array(
		'what' => 'link-cat',
		'id' => $term_id,
		'data' => $link_cat
	) );
	$x->send();
	break;
case 'add-tag' : // From Manage->Tags
	check_ajax_referer( 'add-tag' );
	if ( !current_user_can( 'manage_categories' ) )
		die('-1');

	if ( '' === trim($_POST['name']) ) {
		$x = new WP_Ajax_Response( array(
			'what' => 'tag',
			'id' => new WP_Error( 'name', __('You did not enter a tag name.') )
		) );
		$x->send();
	}

	$tag = wp_insert_term($_POST['name'], 'post_tag', $_POST );

	if ( is_wp_error($tag) ) {
		$x = new WP_Ajax_Response( array(
			'what' => 'tag',
			'id' => $tag
		) );
		$x->send();
	}

	if ( !$tag || (!$tag = get_term( $tag['term_id'], 'post_tag' )) )
		die('0');

	$tag_full_name = $tag->name;
	$tag_full_name = attribute_escape($tag_full_name);

	$x = new WP_Ajax_Response( array(
		'what' => 'tag',
		'id' => $tag->term_id,
		'data' => _tag_row( $tag ),
		'supplemental' => array('name' => $tag_full_name, 'show-link' => sprintf(__( 'Tag <a href="#%s">%s</a> added' ), "tag-$tag->term_id", $tag_full_name))
	) );
	$x->send();
	break;
case 'add-comment' :
	check_ajax_referer( $action );
	if ( !current_user_can( 'edit_post', $id ) )
		die('-1');
	$search = isset($_POST['s']) ? $_POST['s'] : false;
	$start = isset($_POST['page']) ? intval($_POST['page']) * 25 - 1: 24;
	$status = isset($_POST['comment_status']) ? $_POST['comment_status'] : false;
	$mode = isset($_POST['mode']) ? $_POST['mode'] : 'detail';

	list($comments, $total) = _wp_get_comment_list( $status, $search, $start, 1 );

	if ( get_option('show_avatars') )
		add_filter( 'comment_author', 'floated_admin_avatar' );

	if ( !$comments )
		die('1');
	$x = new WP_Ajax_Response();
	foreach ( (array) $comments as $comment ) {
		get_comment( $comment );
		ob_start();
			_wp_comment_row( $comment->comment_ID, $mode, $status );
			$comment_list_item = ob_get_contents();
		ob_end_clean();
		$x->add( array(
			'what' => 'comment',
			'id' => $comment->comment_ID,
			'data' => $comment_list_item
		) );
	}
	$x->send();
	break;
case 'add-meta' :
	check_ajax_referer( 'add-meta' );
	$c = 0;
	$pid = (int) $_POST['post_id'];
	if ( isset($_POST['metakeyselect']) || isset($_POST['metakeyinput']) ) {
		if ( !current_user_can( 'edit_post', $pid ) )
			die('-1');
		if ( '#NONE#' == $_POST['metakeyselect'] && empty($_POST['metakeyinput']) )
			die('1');
		if ( $pid < 0 ) {
			$now = current_time('timestamp', 1);
			if ( $pid = wp_insert_post( array(
				'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now))
			) ) ) {
				if ( is_wp_error( $pid ) ) {
					$x = new WP_Ajax_Response( array(
						'what' => 'meta',
						'data' => $pid
					) );
					$x->send();
				}
				$mid = add_meta( $pid );
			} else {
				die('0');
			}
		} else if ( !$mid = add_meta( $pid ) ) {
			die('0');
		}

		$meta = get_post_meta_by_id( $mid );
		$pid = (int) $meta->post_id;
		$meta = get_object_vars( $meta );
		$x = new WP_Ajax_Response( array(
			'what' => 'meta',
			'id' => $mid,
			'data' => _list_meta_row( $meta, $c ),
			'position' => 1,
			'supplemental' => array('postid' => $pid)
		) );
	} else {
		$mid = (int) array_pop(array_keys($_POST['meta']));
		$key = $_POST['meta'][$mid]['key'];
		$value = $_POST['meta'][$mid]['value'];
		if ( !$meta = get_post_meta_by_id( $mid ) )
			die('0'); // if meta doesn't exist
		if ( !current_user_can( 'edit_post', $meta->post_id ) )
			die('-1');
		if ( !$u = update_meta( $mid, $key, $value ) )
			die('1'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
		$key = stripslashes($key);
		$value = stripslashes($value);
		$x = new WP_Ajax_Response( array(
			'what' => 'meta',
			'id' => $mid, 'old_id' => $mid,
			'data' => _list_meta_row( array(
				'meta_key' => $key,
				'meta_value' => $value,
				'meta_id' => $mid
			), $c ),
			'position' => 0,
			'supplemental' => array('postid' => $meta->post_id)
		) );
	}
	$x->send();
	break;
case 'add-user' :
	check_ajax_referer( $action );
	if ( !current_user_can('create_users') )
		die('-1');
	require_once(ABSPATH . WPINC . '/registration.php');
	if ( !$user_id = add_user() )
		die('0');
	elseif ( is_wp_error( $user_id ) ) {
		$x = new WP_Ajax_Response( array(
			'what' => 'user',
			'id' => $user_id
		) );
		$x->send();
	}
	$user_object = new WP_User( $user_id );

	$x = new WP_Ajax_Response( array(
		'what' => 'user',
		'id' => $user_id,
		'data' => user_row( $user_object, '', $user_object->roles[0] ),
		'supplemental' => array(
			'show-link' => sprintf(__( 'User <a href="#%s">%s</a> added' ), "user-$user_id", $user_object->user_login),
			'role' => $user_object->roles[0]
		)
	) );
	$x->send();
	break;
case 'autosave' : // The name of this action is hardcoded in edit_post()
	define( 'DOING_AUTOSAVE', true );

	$nonce_age = check_ajax_referer( 'autosave', 'autosavenonce' );
	global $current_user;

	$_POST['post_category'] = explode(",", $_POST['catslist']);
	$_POST['tags_input'] = explode(",", $_POST['tags_input']);
	if($_POST['post_type'] == 'page' || empty($_POST['post_category']))
		unset($_POST['post_category']);

	$do_autosave = (bool) $_POST['autosave'];
	$do_lock = true;

	$data = '';
	$message = sprintf( __('Draft Saved at %s.'), date( __('g:i:s a'), current_time( 'timestamp', true ) ) );

	$supplemental = array();

	$id = $revision_id = 0;
	if($_POST['post_ID'] < 0) {
		$_POST['post_status'] = 'draft';
		$_POST['temp_ID'] = $_POST['post_ID'];
		if ( $do_autosave ) {
			$id = wp_write_post();
			$data = $message;
		}
	} else {
		$post_ID = (int) $_POST['post_ID'];
		$_POST['ID'] = $post_ID;
		$post = get_post($post_ID);

		if ( $last = wp_check_post_lock( $post->ID ) ) {
			$do_autosave = $do_lock = false;

			$last_user = get_userdata( $last );
			$last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
			$data = new WP_Error( 'locked', sprintf(
				$_POST['post_type'] == 'page' ? __( 'Autosave disabled: %s is currently editing this page.' ) : __( 'Autosave disabled: %s is currently editing this post.' ),
				wp_specialchars( $last_user_name )
			) );

			$supplemental['disable_autosave'] = 'disable';
		}

		if ( 'page' == $post->post_type ) {
			if ( !current_user_can('edit_page', $post_ID) )
				die(__('You are not allowed to edit this page.'));
		} else {
			if ( !current_user_can('edit_post', $post_ID) )
				die(__('You are not allowed to edit this post.'));
		}

		if ( $do_autosave ) {
			// Drafts are just overwritten by autosave
			if ( 'draft' == $post->post_status ) {
				$id = edit_post();
			} else { // Non drafts are not overwritten.  The autosave is stored in a special post revision.
				$revision_id = wp_create_post_autosave( $post->ID );
				if ( is_wp_error($revision_id) )
					$id = $revision_id;
				else
					$id = $post->ID;
			}
			$data = $message;
		} else {
			$id = $post->ID;
		}
	}

	if ( $do_lock && $id && is_numeric($id) )
		wp_set_post_lock( $id );

	if ( $nonce_age == 2 ) {
		$supplemental['replace-autosavenonce'] = wp_create_nonce('autosave');
		$supplemental['replace-getpermalinknonce'] = wp_create_nonce('getpermalink');
		$supplemental['replace-samplepermalinknonce'] = wp_create_nonce('samplepermalink');
		$supplemental['replace-closedpostboxesnonce'] = wp_create_nonce('closedpostboxes');
		if ( $id ) {
			if ( $_POST['post_type'] == 'post' )
				$supplemental['replace-_wpnonce'] = wp_create_nonce('update-post_' . $id);
			elseif ( $_POST['post_type'] == 'page' )
				$supplemental['replace-_wpnonce'] = wp_create_nonce('update-page_' . $id);
		}
	}

	$x = new WP_Ajax_Response( array(
		'what' => 'autosave',
		'id' => $id,
		'data' => $id ? $data : '',
		'supplemental' => $supplemental
	) );
	$x->send();
	break;
case 'autosave-generate-nonces' :
	check_ajax_referer( 'autosave', 'autosavenonce' );
	$ID = (int) $_POST['post_ID'];
	if($_POST['post_type'] == 'post') {
		if(current_user_can('edit_post', $ID))
			die(wp_create_nonce('update-post_' . $ID));
	}
	if($_POST['post_type'] == 'page') {
		if(current_user_can('edit_page', $ID)) {
			die(wp_create_nonce('update-page_' . $ID));
		}
	}
	die('0');
break;
case 'closed-postboxes' :
	check_ajax_referer( 'closedpostboxes', 'closedpostboxesnonce' );
	$closed = isset( $_POST['closed'] )? $_POST['closed'] : '';
	$closed = explode( ',', $_POST['closed'] );
	$page = isset( $_POST['page'] )? $_POST['page'] : '';
	if ( !preg_match( '/^[a-z-]+$/', $page ) ) {
		die(-1);
	}
	if (!is_array($closed)) break;
	$current_user = wp_get_current_user();
	update_usermeta($current_user->ID, 'closedpostboxes_'.$page, $closed);
break;
case 'get-permalink':
	check_ajax_referer( 'getpermalink', 'getpermalinknonce' );
	$post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0;
	die(add_query_arg(array('preview' => 'true'), get_permalink($post_id)));
break;
case 'sample-permalink':
	check_ajax_referer( 'samplepermalink', 'samplepermalinknonce' );
	$post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0;
	$title = isset($_POST['new_title'])? $_POST['new_title'] : '';
	$slug = isset($_POST['new_slug'])? $_POST['new_slug'] : '';
	die(get_sample_permalink_html($post_id, $title, $slug));
break;
default :
	do_action( 'wp_ajax_' . $_POST['action'] );
	die('0');
	break;
endswitch;
?>
                                                                                                                                                                                                                                                                                                                  blog/wp-admin/admin-footer.php                                                                      0000755 0023433 0004734 00000001073 11060470574 016172  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 </div><!-- wpbody -->
</div><!-- wpcontent -->
</div><!-- wpwrap -->
<div id="footer">
<p><?php
do_action('in_admin_footer', '');
$upgrade = apply_filters( 'update_footer', '' );
echo __('Thank you for creating with <a href="http://wordpress.org/">WordPress</a>').' | '.__('<a href="http://codex.wordpress.org/">Documentation</a>').' | '.__('<a href="http://wordpress.org/support/forum/4">Feedback</a>').' '.$upgrade;
?></p>
</div>
<?php do_action('admin_footer', ''); ?>
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
</body>
</html>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                     blog/wp-admin/admin-functions.php                                                                   0000755 0023433 0004734 00000000266 11060470575 016710  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
// Deprecated.  Use includes/admin.php.
_deprecated_file( basename(__FILE__), '2.5', 'wp-admin/includes/admin.php' );
require_once(ABSPATH . 'wp-admin/includes/admin.php');
?>
                                                                                                                                                                                                                                                                                                                                          blog/wp-admin/admin-header.php                                                                      0000755 0023433 0004734 00000014733 11060470576 016135  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
if (!isset($_GET["page"])) require_once('admin.php');
if ( $editing ) {
	if ( user_can_richedit() )
		wp_enqueue_script( 'wp_tiny_mce' );
}
wp_enqueue_script( 'wp-gears' );

$min_width_pages = array( 'post.php', 'post-new.php', 'page.php', 'page-new.php', 'widgets.php', 'comment.php', 'link.php' );
$the_current_page = preg_replace('|^.*/wp-admin/|i', '', $_SERVER['PHP_SELF']);
$ie6_no_scrollbar = true;

function add_minwidth($c) {
	return $c . 'minwidth ';
}

if ( in_array( $the_current_page, $min_width_pages ) ) {
		$ie6_no_scrollbar = false;
		add_filter( 'admin_body_class', 'add_minwidth' );
}

get_admin_page_title();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<title><?php bloginfo('name') ?> &rsaquo; <?php echo wp_specialchars( strip_tags( $title ) ); ?> &#8212; WordPress</title>
<?php

wp_admin_css( 'css/global' );
wp_admin_css();
wp_admin_css( 'css/colors' );
wp_admin_css( 'css/ie' );

?>
<script type="text/javascript">
//<![CDATA[
addLoadEvent = function(func) {if (typeof jQuery != "undefined") jQuery(document).ready(func); else if (typeof wpOnload!='function'){wpOnload=func;} else {var oldonload=wpOnload; wpOnload=function(){oldonload();func();}}};
//]]>
</script>
<?php if ( ($parent_file != 'link-manager.php') && ($parent_file != 'options-general.php') && $ie6_no_scrollbar ) : ?>
<style type="text/css">* html { overflow-x: hidden; }</style>
<?php endif;

$hook_suffixes = array();

if ( isset($page_hook) )
	$hook_suffixes[] = "-$page_hook";
else if ( isset($plugin_page) )
	$hook_suffixes[] = "-$plugin_page";
else if ( isset($pagenow) )
	$hook_suffixes[] = "-$pagenow";

$hook_suffixes[] = '';

foreach ( $hook_suffixes as $hook_suffix )
	do_action("admin_print_styles$hook_suffix"); // do_action( 'admin_print_styles-XXX' ); do_action( 'admin_print_styles' );
foreach ( $hook_suffixes as $hook_suffix )
	do_action("admin_print_scripts$hook_suffix"); // do_action( 'admin_print_scripts-XXX' ); do_action( 'admin_print_scripts' );
foreach ( $hook_suffixes as $hook_suffix )
	do_action("admin_head$hook_suffix"); // do_action( 'admin_head-XXX' ); do_action( 'admin_head' );
unset($hook_suffixes, $hook_suffix);

?>
</head>
<body class="wp-admin <?php echo apply_filters( 'admin_body_class', '' ); ?>">
<div id="wpwrap">
<div id="wpcontent">
<div id="wphead">
<h1><?php if ( '' == get_bloginfo('name', 'display') ) echo '&nbsp;'; else echo get_bloginfo('name', 'display'); ?><span id="viewsite"><a href="<?php echo trailingslashit( get_option('home') ); ?>"><?php _e('Visit Site') ?></a></span></h1>
</div>

<?php
if ( ! $is_opera ) { 
?>
	<div id="gears-info-box" class="info-box" style="display:none;">
	<img src="images/gear.png" title="Gear" alt="" class="gears-img" />
	<div id="gears-msg1">
	<h3 class="info-box-title"><?php _e('Speed up WordPress'); ?></h3>
	<p><?php _e('WordPress now has support for Gears, which adds new features to your web browser.'); ?><br />
	<a href="http://gears.google.com/" target="_blank" style="font-weight:normal;"><?php _e('More information...'); ?></a></p>
	<p><?php _e('After you install and enable Gears most of WordPress&#8217; images, scripts, and CSS files will be stored locally on your computer. This speeds up page load time.'); ?></p>
	<p><strong><?php _e('Don&#8217;t install on a public or shared computer.'); ?></strong></p>	<div class="submit"><button onclick="window.location = 'http://gears.google.com/?action=install&amp;return=<?php echo urlencode( admin_url() ); ?>';" class="button"><?php _e('Install Now'); ?></button>
	<button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Cancel'); ?></button></div>
	</div>

	<div id="gears-msg2" style="display:none;">
	<h3 class="info-box-title"><?php _e('Gears Status'); ?></h3>
	<p><?php _e('Gears is installed on this computer but is not enabled for use with WordPress.'); ?></p> 
	<p><?php 
	
	if ( $is_safari )
		_e('To enable it, make sure this web site is not on the denied list in Gears Settings under the Safari menu, then click the button below.');
	else
		_e('To enable it, make sure this web site is not on the denied list in Gears Settings under your browser Tools menu, then click the button below.'); 
	
	?></p>
	<p><strong><?php _e('However if this is a public or shared computer, Gears should not be enabled.'); ?></strong></p>
	<div class="submit"><button class="button" onclick="wpGears.getPermission();"><?php _e('Enable Gears'); ?></button>
	<button class="button" style="margin-left:10px;" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Cancel'); ?></button></div>
	</div>

	<div id="gears-msg3" style="display:none;">
	<h3 class="info-box-title"><?php _e('Gears Status'); ?></h3>
	<p><?php
	
	if ( $is_safari )
		_e('Gears is installed and enabled on this computer. You can disable it from the Safari menu.');
	else
		_e('Gears is installed and enabled on this computer. You can disable it from your browser Tools menu.'); 
	
	?></p>
	<p><?php _e('If there are any errors, try disabling Gears, then reload the page and enable it again.'); ?></p>
	<p><?php _e('Local storage status:'); ?> <span id="gears-wait"><span style="color:#f00;"><?php _e('Please wait! Updating files:'); ?></span> <span id="gears-upd-number"></span></span></p>
	<div class="submit"><button class="button" onclick="document.getElementById('gears-info-box').style.display='none';"><?php _e('Close'); ?></button></div>
	</div>
	</div>
<?php } ?>

<div id="user_info"><p><?php printf(__('Howdy, <a href="%1$s">%2$s</a>!'), 'profile.php', $user_identity) ?> | <a href="<?php echo site_url('wp-login.php?action=logout', 'login') ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a> | <?php _e('<a href="http://codex.wordpress.org/">Help</a>') ?> | <?php _e('<a href="http://wordpress.org/support/">Forums</a>'); if ( ! $is_opera ) { ?> | <span id="gears-menu"><a href="#" onclick="wpGears.message(1);return false;"><?php _e('Turbo') ?></a></span><?php } ?></p></div>

<?php
require(ABSPATH . 'wp-admin/menu-header.php');

if ( $parent_file == 'options-general.php' ) {
	require(ABSPATH . 'wp-admin/options-head.php');
}
?>
<div id="wpbody">
                                     blog/wp-admin/admin-post.php                                                                        0000755 0023433 0004734 00000000660 11060470577 015665  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
define('WP_ADMIN', TRUE);

if ( defined('ABSPATH') )
	require_once(ABSPATH . 'wp-load.php');
else
	require_once('../wp-load.php');

require_once(ABSPATH . 'wp-admin/includes/admin.php');

if ( !wp_validate_auth_cookie() )
	wp_die(__('Cheatin&#8217; uh?'));

nocache_headers();

do_action('admin_init');

$action = 'admin_post';
if ( !empty($_REQUEST['action']) )
	$action .= '_' . $_REQUEST['action'];

do_action($action);

?>                                                                                blog/wp-admin/admin.php                                                                             0000755 0023433 0004734 00000005770 11060470600 014674  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
define('WP_ADMIN', TRUE);

if ( defined('ABSPATH') )
	require_once(ABSPATH . 'wp-load.php');
else
	require_once('../wp-load.php');

if ( get_option('db_version') != $wp_db_version ) {
	wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
	exit;
}

require_once(ABSPATH . 'wp-admin/includes/admin.php');

auth_redirect();

nocache_headers();

update_category_cache();

$posts_per_page = get_option('posts_per_page');
$what_to_show = get_option('what_to_show');
$date_format = get_option('date_format');
$time_format = get_option('time_format');

wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback'));

wp_admin_css_color('classic', __('Classic'), admin_url("css/colors-classic.css"), array('#07273E', '#14568A', '#D54E21', '#2683AE'));
wp_admin_css_color('fresh', __('Fresh'), admin_url("css/colors-fresh.css"), array('#464646', '#CEE1EF', '#D54E21', '#2683AE'));

wp_enqueue_script( 'common' );
wp_enqueue_script( 'jquery-color' );

$editing = false;

if (isset($_GET['page'])) {
	$plugin_page = stripslashes($_GET['page']);
	$plugin_page = plugin_basename($plugin_page);
}

require(ABSPATH . 'wp-admin/menu.php');

do_action('admin_init');

// Handle plugin admin pages.
if (isset($plugin_page)) {
	$page_hook = get_plugin_page_hook($plugin_page, $pagenow);

	if ( $page_hook ) {
		do_action('load-' . $page_hook);
		if (! isset($_GET['noheader']))
			require_once(ABSPATH . 'wp-admin/admin-header.php');

		do_action($page_hook);
	} else {
		if ( validate_file($plugin_page) ) {
			wp_die(__('Invalid plugin page'));
		}

		if (! ( file_exists(WP_PLUGIN_DIR . "/$plugin_page") && is_file(WP_PLUGIN_DIR . "/$plugin_page") ) )
			wp_die(sprintf(__('Cannot load %s.'), htmlentities($plugin_page)));

		do_action('load-' . $plugin_page);

		if (! isset($_GET['noheader']))
			require_once(ABSPATH . 'wp-admin/admin-header.php');

		include(WP_PLUGIN_DIR . "/$plugin_page");
	}

	include(ABSPATH . 'wp-admin/admin-footer.php');

	exit();
} else if (isset($_GET['import'])) {

	$importer = $_GET['import'];

	if ( ! current_user_can('import') )
		wp_die(__('You are not allowed to import.'));

	if ( validate_file($importer) ) {
		wp_die(__('Invalid importer.'));
	}

	// Allow plugins to define importers as well
	if (! is_callable($wp_importers[$importer][2]))
	{
		if (! file_exists(ABSPATH . "wp-admin/import/$importer.php"))
		{
			wp_die(__('Cannot load importer.'));
		}
		include(ABSPATH . "wp-admin/import/$importer.php");
	}

	$parent_file = 'edit.php';
	$submenu_file = 'import.php';
	$title = __('Import');

	if (! isset($_GET['noheader']))
		require_once(ABSPATH . 'wp-admin/admin-header.php');

	require_once(ABSPATH . 'wp-admin/includes/upgrade.php');

	define('WP_IMPORTING', true);

	call_user_func($wp_importers[$importer][2]);

	include(ABSPATH . 'wp-admin/admin-footer.php');

	exit();
} else {
	do_action("load-$pagenow");
}

if ( !empty($_REQUEST['action']) )
	do_action('admin_action_' . $_REQUEST['action']);

?>
        blog/wp-admin/async-upload.php                                                                      0000755 0023433 0004734 00000002610 11060470600 016171  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

/* This accepts file uploads from swfupload or other asynchronous upload methods.

*/

if ( defined('ABSPATH') )
	require_once(ABSPATH . 'wp-load.php');
else
	require_once('../wp-load.php');

// Flash often fails to send cookies with the POST or upload, so we need to pass it in GET or POST instead
if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
	$_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie'];
elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
	$_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
unset($current_user);
require_once('admin.php');

header('Content-Type: text/plain; charset=' . get_option('blog_charset'));

if ( !current_user_can('upload_files') )
	wp_die(__('You do not have permission to upload files.'));

// just fetch the detail form for that attachment	
if ( ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) {
	echo get_media_item($id);
	exit;
}

check_admin_referer('media-form');

$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
if (is_wp_error($id)) {
	echo '<div id="media-upload-error">'.wp_specialchars($id->get_error_message()).'</div>';
	exit;
}

if ( $_REQUEST['short'] ) {
	// short form response - attachment ID only
	echo $id;
}
else {
	// long form response - big chunk o html
	$type = $_REQUEST['type'];
	echo apply_filters("async_upload_{$type}", $id);
}

?>
                                                                                                                        blog/wp-admin/categories.php                                                                        0000755 0023433 0004734 00000012541 11060470601 015724  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
require_once('admin.php');

$title = __('Categories');
$parent_file = 'edit.php';

wp_reset_vars(array('action', 'cat'));

if ( isset($_GET['deleteit']) && isset($_GET['delete']) )
	$action = 'bulk-delete';

switch($action) {

case 'addcat':

	check_admin_referer('add-category');

	if ( !current_user_can('manage_categories') )
		wp_die(__('Cheatin&#8217; uh?'));

	if( wp_insert_category($_POST ) ) {
		wp_redirect('categories.php?message=1#addcat');
	} else {
		wp_redirect('categories.php?message=4#addcat');
	}
	exit;
break;

case 'delete':
	$cat_ID = (int) $_GET['cat_ID'];
	check_admin_referer('delete-category_' .  $cat_ID);

	if ( !current_user_can('manage_categories') )
		wp_die(__('Cheatin&#8217; uh?'));

	$cat_name = get_catname($cat_ID);

	// Don't delete the default cats.
    if ( $cat_ID == get_option('default_category') )
		wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name));

	wp_delete_category($cat_ID);

	wp_redirect('categories.php?message=2');
	exit;

break;

case 'bulk-delete':
	check_admin_referer('bulk-categories');

	if ( !current_user_can('manage_categories') )
		wp_die( __('You are not allowed to delete categories.') );

	foreach ( (array) $_GET['delete'] as $cat_ID ) {
		$cat_name = get_catname($cat_ID);

		// Don't delete the default cats.
		if ( $cat_ID == get_option('default_category') )
			wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name));

		wp_delete_category($cat_ID);
	}

	$sendback = wp_get_referer();
	$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);

	wp_redirect($sendback);
	exit();

break;
case 'edit':

	require_once ('admin-header.php');
	$cat_ID = (int) $_GET['cat_ID'];
	$category = get_category_to_edit($cat_ID);
	include('edit-category-form.php');

break;

case 'editedcat':
	$cat_ID = (int) $_POST['cat_ID'];
	check_admin_referer('update-category_' . $cat_ID);

	if ( !current_user_can('manage_categories') )
		wp_die(__('Cheatin&#8217; uh?'));

	if ( wp_update_category($_POST) )
		wp_redirect('categories.php?message=3');
	else
		wp_redirect('categories.php?message=5');

	exit;
break;

default:

if ( !empty($_GET['_wp_http_referer']) ) {
	 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
	 exit;
}

wp_enqueue_script( 'admin-categories' );
wp_enqueue_script('admin-forms');

require_once ('admin-header.php');

$messages[1] = __('Category added.');
$messages[2] = __('Category deleted.');
$messages[3] = __('Category updated.');
$messages[4] = __('Category not added.');
$messages[5] = __('Category not updated.');
?>

<?php if (isset($_GET['message'])) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
endif; ?>

<div class="wrap">
<form id="posts-filter" action="" method="get">
<?php if ( current_user_can('manage_categories') ) : ?>
	<h2><?php printf(__('Manage Categories (<a href="%s">add new</a>)'), '#addcat') ?> </h2>
<?php else : ?>
	<h2><?php _e('Manage Categories') ?> </h2>
<?php endif; ?>

<p id="post-search">
	<label class="hidden" for="post-search-input"><?php _e('Search Categories'); ?>:</label>
	<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
	<input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
</p>

<br class="clear" />

<div class="tablenav">

<?php
$pagenum = absint( $_GET['pagenum'] );
if ( empty($pagenum) )
	$pagenum = 1;
if( !$catsperpage || $catsperpage < 0 )
	$catsperpage = 20;

$page_links = paginate_links( array(
	'base' => add_query_arg( 'pagenum', '%#%' ),
	'format' => '',
	'total' => ceil(wp_count_terms('category') / $catsperpage),
	'current' => $pagenum
));

if ( $page_links )
	echo "<div class='tablenav-pages'>$page_links</div>";
?>

<div class="alignleft">
<input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" />
<?php wp_nonce_field('bulk-categories'); ?>
</div>

<br class="clear" />
</div>

<br class="clear" />

<table class="widefat">
	<thead>
	<tr>
		<th scope="col" class="check-column"><input type="checkbox" /></th>
        <th scope="col"><?php _e('Name') ?></th>
        <th scope="col"><?php _e('Description') ?></th>
        <th scope="col" class="num"><?php _e('Posts') ?></th>
	</tr>
	</thead>
	<tbody id="the-list" class="list:cat">
<?php
cat_rows(0, 0, 0, $pagenum, $catsperpage);
?>
	</tbody>
</table>
</form>

<div class="tablenav">

<?php
if ( $page_links )
	echo "<div class='tablenav-pages'>$page_links</div>";
?>
<br class="clear" />
</div>
<br class="clear" />

</div>

<?php if ( current_user_can('manage_categories') ) : ?>
<div class="wrap">
<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_catname(get_option('default_category')))) ?></p>
<p><?php printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'admin.php?import=wp-cat2tag') ?></p>
</div>

<?php include('edit-category-form.php'); ?>

<?php endif; ?>

<?php
break;
}

include('admin-footer.php');

?>
                                                                                                                                                               blog/wp-admin/comment.php                                                                           0000755 0023433 0004734 00000015512 11060470602 015243  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
require_once('admin.php');

$parent_file = 'edit-comments.php';
$submenu_file = 'edit-comments.php';

wp_reset_vars( array('action') );

if ( isset( $_POST['deletecomment'] ) )
	$action = 'deletecomment';

function comment_footer_die( $msg ) {  // $msg is assumed to contain HTML and be sanitized
	echo "<div class='wrap'><p>$msg</p></div>";
	include('admin-footer.php');
	die;
}

switch( $action ) {

case 'editcomment' :
	$title = __('Edit Comment');

	wp_enqueue_script('comment');

	require_once('admin-header.php');

	$comment_id = absint( $_GET['c'] );

	if ( !$comment = get_comment( $comment_id ) )
		comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'javascript:history.go(-1)') );

	if ( !current_user_can('edit_post', $comment->comment_post_ID) )
		comment_footer_die( __('You are not allowed to edit comments on this post.') );

	$comment = get_comment_to_edit( $comment_id );

	include('edit-form-comment.php');

	break;

case 'cdc' :
case 'mac' :

	require_once('admin-header.php');

	$comment_id = absint( $_GET['c'] );
	$formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment';
	$nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_';
	$nonce_action .= $comment_id;

	if ( !$comment = get_comment_to_edit( $comment_id ) )
		comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );

	if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
		comment_footer_die( 'cdc' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
?>
<div class='wrap'>

<div class="narrow">
<?php
if ( 'spam' == $_GET['dt'] ) {
	$caution_msg = __('You are about to mark the following comment as spam:');
	$button = __('Spam Comment');
} elseif ( 'cdc' == $action ) {
	$caution_msg = __('You are about to delete the following comment:');
	$button = __('Delete Comment');
} else {
	$caution_msg = __('You are about to approve the following comment:');
	$button = __('Approve Comment');
}
?>

<p><strong><?php _e('Caution:'); ?></strong> <?php echo $caution_msg; ?></p>

<p><?php _e('Are you sure you want to do that?'); ?></p>

<form action='comment.php' method='get'>

<table width="100%">
<tr>
<td><input type='button' class="button" value='<?php _e('No'); ?>' onclick="self.location='<?php echo admin_url('edit-comments.php'); ?>" /></td>
<td class="textright"><input type='submit' class="button" value='<?php echo $button; ?>' /></td>
</tr>
</table>

<?php wp_nonce_field( $nonce_action ); ?>
<input type='hidden' name='action' value='<?php echo $formaction; ?>' />
<?php if ( 'spam' == $_GET['dt'] ) { ?>
<input type='hidden' name='dt' value='spam' />
<?php } ?>
<input type='hidden' name='p' value='<?php echo $comment->comment_post_ID; ?>' />
<input type='hidden' name='c' value='<?php echo $comment->comment_ID; ?>' />
<input type='hidden' name='noredir' value='1' />
</form>

<table class="form-table" cellpadding="5">
<tr class="alt">
<th scope="row"><?php _e('Author'); ?></th>
<td><?php echo $comment->comment_author; ?></td>
</tr>
<?php if ( $comment->comment_author_email ) { ?>
<tr>
<th scope="row"><?php _e('E-mail'); ?></th>
<td><?php echo $comment->comment_author_email; ?></td>
</tr>
<?php } ?>
<?php if ( $comment->comment_author_url ) { ?>
<tr>
<th scope="row"><?php _e('URL'); ?></th>
<td><a href='<?php echo $comment->comment_author_url; ?>'><?php echo $comment->comment_author_url; ?></a></td>
</tr>
<?php } ?>
<tr>
<th scope="row" valign="top"><?php _e('Comment'); ?></th>
<td><?php echo $comment->comment_content; ?></td>
</tr>
</table>

</div>
</div>
<?php
	break;

case 'deletecomment' :
	$comment_id = absint( $_REQUEST['c'] );
	check_admin_referer( 'delete-comment_' . $comment_id );

	if ( isset( $_REQUEST['noredir'] ) )
		$noredir = true;
	else
		$noredir = false;

	if ( !$comment = get_comment( $comment_id ) )
		comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit-comments.php') );

	if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
		comment_footer_die( __('You are not allowed to edit comments on this post.') );

	if ( 'spam' == $_REQUEST['dt'] )
		wp_set_comment_status( $comment->comment_ID, 'spam' );
	else
		wp_delete_comment( $comment->comment_ID );

	if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php' ) )
		wp_redirect( wp_get_referer() );
	else if ( '' != wp_get_original_referer() && false == $noredir )
		wp_redirect( wp_get_original_referer() );
	else
		wp_redirect( admin_url('edit-comments.php') );

	die;
	break;

case 'unapprovecomment' :
	$comment_id = absint( $_GET['c'] );
	check_admin_referer( 'unapprove-comment_' . $comment_id );

	if ( isset( $_GET['noredir'] ) )
		$noredir = true;
	else
		$noredir = false;

	if ( !$comment = get_comment( $comment_id ) )
		comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );

	if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
		comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );

	wp_set_comment_status( $comment->comment_ID, 'hold' );

	if ( '' != wp_get_referer() && false == $noredir )
		wp_redirect( wp_get_referer() );
	else
		wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );

	exit();
	break;

case 'approvecomment' :
	$comment_id = absint( $_GET['c'] );
	check_admin_referer( 'approve-comment_' . $comment_id );

	if ( isset( $_GET['noredir'] ) )
		$noredir = true;
	else
		$noredir = false;

	if ( !$comment = get_comment( $comment_id ) )
		comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );

	if ( !current_user_can('edit_post', $comment->comment_post_ID) )
		comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );

	wp_set_comment_status( $comment->comment_ID, 'approve' );

	if ( '' != wp_get_referer() && false == $noredir )
		wp_redirect( wp_get_referer() );
	else
		wp_redirect( admin_url('edit.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );

	exit();
	break;

case 'editedcomment' :

	$comment_id = absint( $_POST['comment_ID'] );
	$comment_post_id = absint( $_POST['comment_post_id'] );

	check_admin_referer( 'update-comment_' . $comment_id );

	edit_comment();

	$location = ( empty( $_POST['referredby'] ) ? "edit.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id;
	$location = apply_filters( 'comment_edit_redirect', $location, $comment_id );
	wp_redirect( $location );

	exit();
	break;

default:
	wp_die( __('Unknown action.') );
	break;

} // end switch

include('admin-footer.php');

?>
                                                                                                                                                                                      blog/wp-admin/plugin-editor.php                                                                     0000755 0023433 0004734 00000012251 11060471022 016355  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
require_once('admin.php');

$title = __("Edit Plugins");
$parent_file = 'plugins.php';

wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file'));

wp_admin_css( 'theme-editor' );

$plugins = get_plugins();
$plugin_files = array_keys($plugins);

if (empty($file))
	$file = $plugin_files[0];

$file = validate_file_to_edit($file, $plugin_files);
$real_file = WP_PLUGIN_DIR . '/' . $file;

switch($action) {

case 'update':

	check_admin_referer('edit-plugin_' . $file);

	if ( !current_user_can('edit_plugins') )
		wp_die('<p>'.__('You do not have sufficient permissions to edit templates for this blog.').'</p>');

	$newcontent = stripslashes($_POST['newcontent']);
	if ( is_writeable($real_file) ) {
		$f = fopen($real_file, 'w+');
		fwrite($f, $newcontent);
		fclose($f);

		// Deactivate so we can test it.
		if ( is_plugin_active($file) || isset($_POST['phperror']) ) {
			if ( is_plugin_active($file) )
				deactivate_plugins($file, true);
			wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1"));
			exit;
		}
		wp_redirect("plugin-editor.php?file=$file&a=te");
	} else {
		wp_redirect("plugin-editor.php?file=$file");
	}
	exit;

break;

default:

	if ( !current_user_can('edit_plugins') )
		wp_die('<p>'.__('You do not have sufficient permissions to edit plugins for this blog.').'</p>');

	if ( isset($_GET['liveupdate']) ) {
		check_admin_referer('edit-plugin-test_' . $file);

		$error = validate_plugin($file);
		if( is_wp_error($error) )
			wp_die( $error );

		if ( ! is_plugin_active($file) )
			activate_plugin($file, "plugin-editor.php?file=$file&phperror=1");// we'll override this later if the plugin can be included without fatal error

		wp_redirect("plugin-editor.php?file=$file&a=te");
		exit;
	}

	require_once('admin-header.php');

	update_recently_edited(WP_PLUGIN_DIR . '/' . $file);

	if ( ! is_file($real_file) )
		$error = 1;

	if ( ! $error )
		$content = htmlspecialchars(file_get_contents($real_file));

	?>
<?php if (isset($_GET['a'])) : ?>
 <div id="message" class="updated fade"><p><?php _e('File edited successfully.') ?></p></div>
<?php elseif (isset($_GET['phperror'])) : ?>
 <div id="message" class="updated fade"><p><?php _e('This plugin has been deactivated because your changes resulted in a <strong>fatal error</strong>.') ?></p>
	<?php
		if ( wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $file) ) { ?>
	<iframe style="border:0" width="100%" height="70px" src="<?php bloginfo('wpurl'); ?>/wp-admin/plugins.php?action=error_scrape&amp;plugin=<?php echo attribute_escape($file); ?>&amp;_wpnonce=<?php echo attribute_escape($_GET['_error_nonce']); ?>"></iframe>
	<?php } ?>
</div>
<?php endif; ?>
 <div class="wrap">
<div class="bordertitle">
	<h2><?php _e('Plugin Editor'); ?></h2>
</div>
<div class="tablenav">
<div class="alignleft">
<big><strong><?php
	if ( is_plugin_active($file) ) {
		if ( is_writeable($real_file) )
			echo sprintf(__('Editing <strong>%s</strong> (active)'), $file);
		else
			echo sprintf(__('Browsing <strong>%s</strong> (active)'), $file);
	} else {
		if ( is_writeable($real_file) )
			echo sprintf(__('Editing <strong>%s</strong> (inactive)'), $file);
		else
			echo sprintf(__('Browsing <strong>%s</strong> (inactive)'), $file);
	}
	?></strong></big>
</div>
<br class="clear" />
</div>
<br class="clear" />
	<div id="templateside">
	<h3 id="bordertitle"><?php _e('Plugin Files'); ?></h3>

	<h4><?php _e('Plugins'); ?></h4>
	<ul>
<?php foreach($plugin_files as $plugin_file) : ?>
		<li><a href="plugin-editor.php?file=<?php echo $plugin_file; ?>"><?php echo $plugins[$plugin_file]['Name']; ?></a></li>
<?php endforeach; ?>
	</ul>
	</div>
<?php	if ( ! $error ) { ?>
	<form name="template" id="template" action="plugin-editor.php" method="post">
	<?php wp_nonce_field('edit-plugin_' . $file) ?>
		<div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea>
		<input type="hidden" name="action" value="update" />
		<input type="hidden" name="file" value="<?php echo $file ?>" />
		</div>
<?php if ( is_writeable($real_file) ) : ?>
	<?php if ( in_array($file, (array) get_option('active_plugins')) ) { ?>
		<p><?php _e('<strong>Warning:</strong> Making changes to active plugins is not recommended.  If your changes cause a fatal error, the plugin will be automatically deactivated.'); ?></p>
	<?php } ?>
	<p class="submit">
	<?php
		if ( isset($_GET['phperror']) )
			echo "<input type='hidden' name='phperror' value='1' /><input type='submit' name='submit' value='" . __('Update File and Attempt to Reactivate') . "' tabindex='2' />";
		else
			echo "<input type='submit' name='submit' value='" . __('Update File') . "' tabindex='2' />";
	?>
	</p>
<?php else : ?>
	<p><em><?php _e('You need to make this file writable before you can save your changes. See <a href="http://codex.wordpress.org/Changing_File_Permissions">the Codex</a> for more information.'); ?></em></p>
<?php endif; ?>
 </form>
<?php
	} else {
		echo '<div class="error"><p>' . __('Oops, no such file exists! Double check the name and try again, merci.') . '</p></div>';
	}
?>
<div class="clear"> &nbsp; </div>
</div>
<?php
	break;
}
include("admin-footer.php") ?>                                                                                                                                                                                                                                                                                                                                                       blog/wp-admin/custom-header.php                                                                     0000755 0023433 0004734 00000026644 11060470630 016352  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

class Custom_Image_Header {
	var $admin_header_callback;

	function Custom_Image_Header($admin_header_callback) {
		$this->admin_header_callback = $admin_header_callback;
	}

	function init() {
		$page = add_theme_page(__('Custom Image Header'), __('Custom Image Header'), 'edit_themes', 'custom-header', array(&$this, 'admin_page'));

		add_action("admin_print_scripts-$page", array(&$this, 'js_includes'));
		add_action("admin_head-$page", array(&$this, 'take_action'), 50);
		add_action("admin_head-$page", array(&$this, 'js'), 50);
		add_action("admin_head-$page", $this->admin_header_callback, 51);
	}

	function step() {
		$step = (int) @$_GET['step'];
		if ( $step < 1 || 3 < $step )
			$step = 1;
		return $step;
	}

	function js_includes() {
		$step = $this->step();
		if ( 1 == $step )
			wp_enqueue_script('colorpicker');
		elseif ( 2 == $step )	
			wp_enqueue_script('cropper');
	}

	function take_action() {
		if ( isset( $_POST['textcolor'] ) ) {
			check_admin_referer('custom-header');
			if ( 'blank' == $_POST['textcolor'] ) {
				set_theme_mod('header_textcolor', 'blank');
			} else {
				$color = preg_replace('/[^0-9a-fA-F]/', '', $_POST['textcolor']);
				if ( strlen($color) == 6 || strlen($color) == 3 )
					set_theme_mod('header_textcolor', $color);
			}
		}
		if ( isset($_POST['resetheader']) ) {
			check_admin_referer('custom-header');
			remove_theme_mods();
		}
	}

	function js() {
		$step = $this->step();
		if ( 1 == $step )
			$this->js_1();
		elseif ( 2 == $step )
			$this->js_2();
	}

	function js_1() { ?>
<script type="text/javascript">
	var cp = new ColorPicker();

	function pickColor(color) {
		$('name').style.color = color;
		$('desc').style.color = color;
		$('textcolor').value = color;
	}
	function PopupWindow_hidePopup(magicword) {
		if ( magicword != 'prettyplease' )
			return false;
		if (this.divName != null) {
			if (this.use_gebi) {
				document.getElementById(this.divName).style.visibility = "hidden";
			}
			else if (this.use_css) {
				document.all[this.divName].style.visibility = "hidden";
			}
			else if (this.use_layers) {
				document.layers[this.divName].visibility = "hidden";
			}
		}
		else {
			if (this.popupWindow && !this.popupWindow.closed) {
				this.popupWindow.close();
				this.popupWindow = null;
			}
		}
		return false;
	}
	function colorSelect(t,p) {
		if ( cp.p == p && document.getElementById(cp.divName).style.visibility != "hidden" ) {
			cp.hidePopup('prettyplease');
		} else {
			cp.p = p;
			cp.select(t,p);
		}
	}
	function colorDefault() {
		pickColor('#<?php echo HEADER_TEXTCOLOR; ?>');
	}

	function hide_text() {
		$('name').style.display = 'none';
		$('desc').style.display = 'none';
		$('pickcolor').style.display = 'none';
		$('defaultcolor').style.display = 'none';
		$('textcolor').value = 'blank';
		$('hidetext').value = '<?php _e('Show Text'); ?>';
//		$('hidetext').onclick = 'show_text()';
		Event.observe( $('hidetext'), 'click', show_text );
	}

	function show_text() {
		$('name').style.display = 'block';
		$('desc').style.display = 'block';
		$('pickcolor').style.display = 'inline';
		$('defaultcolor').style.display = 'inline';
		$('textcolor').value = '<?php echo HEADER_TEXTCOLOR; ?>';
		$('hidetext').value = '<?php _e('Hide Text'); ?>';
		Event.stopObserving( $('hidetext'), 'click', show_text );
		Event.observe( $('hidetext'), 'click', hide_text );
	}

	<?php if ( 'blank' == get_theme_mod('header_textcolor', HEADER_TEXTCOLOR) ) { ?>
Event.observe( window, 'load', hide_text );
	<?php } ?>

</script>
<?php
	}

	function js_2() { ?>
<script type="text/javascript">
	function onEndCrop( coords, dimensions ) {
		$( 'x1' ).value = coords.x1;
		$( 'y1' ).value = coords.y1;
		$( 'x2' ).value = coords.x2;
		$( 'y2' ).value = coords.y2;
		$( 'width' ).value = dimensions.width;
		$( 'height' ).value = dimensions.height;
	}

	// with a supplied ratio
	Event.observe(
		window,
		'load',
		function() {
			var xinit = <?php echo HEADER_IMAGE_WIDTH; ?>;
			var yinit = <?php echo HEADER_IMAGE_HEIGHT; ?>;
			var ratio = xinit / yinit;
			var ximg = $('upload').width;
			var yimg = $('upload').height;
			if ( yimg < yinit || ximg < xinit ) {
				if ( ximg / yimg > ratio ) {
					yinit = yimg;
					xinit = yinit * ratio;
				} else {
					xinit = ximg;
					yinit = xinit / ratio;
				}
			}
			new Cropper.Img(
				'upload',
				{
					ratioDim: { x: xinit, y: yinit },
					displayOnInit: true,
					onEndCrop: onEndCrop
				}
			)
		}
	);
</script>
<?php
	}

	function step_1() {
		if ( $_GET['updated'] ) { ?>
<div id="message" class="updated fade">
<p><?php _e('Header updated.') ?></p>
</div>
		<?php } ?>

<div class="wrap">
<h2><?php _e('Your Header Image'); ?></h2>
<p><?php _e('This is your header image. You can change the text color or upload and crop a new image.'); ?></p>

<div id="headimg" style="background-image: url(<?php clean_url(header_image()) ?>);">
<h1><a onclick="return false;" href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>" id="name"><?php bloginfo('name'); ?></a></h1>
<div id="desc"><?php bloginfo('description');?></div>
</div>
<?php if ( !defined( 'NO_HEADER_TEXT' ) ) { ?>
<form method="post" action="<?php echo admin_url('themes.php?page=custom-header&amp;updated=true') ?>">
<input type="button" value="<?php _e('Hide Text'); ?>" onclick="hide_text()" id="hidetext" />
<input type="button" value="<?php _e('Select a Text Color'); ?>" onclick="colorSelect($('textcolor'), 'pickcolor')" id="pickcolor" /><input type="button" value="<?php _e('Use Original Color'); ?>" onclick="colorDefault()" id="defaultcolor" />
<?php wp_nonce_field('custom-header') ?>
<input type="hidden" name="textcolor" id="textcolor" value="#<?php attribute_escape(header_textcolor()) ?>" /><input name="submit" type="submit" value="<?php _e('Save Changes'); ?>" /></form>
<?php } ?>

<div id="colorPickerDiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;visibility:hidden;"> </div>
</div>
<div class="wrap">
<h2><?php _e('Upload New Header Image'); ?></h2><p><?php _e('Here you can upload a custom header image to be shown at the top of your blog instead of the default one. On the next screen you will be able to crop the image.'); ?></p>
<p><?php printf(__('Images of exactly <strong>%1$d x %2$d pixels</strong> will be used as-is.'), HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT); ?></p>

<form enctype="multipart/form-data" id="uploadForm" method="POST" action="<?php echo attribute_escape(add_query_arg('step', 2)) ?>" style="margin: auto; width: 50%;">
<label for="upload"><?php _e('Choose an image from your computer:'); ?></label><br /><input type="file" id="upload" name="import" />
<input type="hidden" name="action" value="save" />
<?php wp_nonce_field('custom-header') ?>
<p class="submit">
<input type="submit" value="<?php _e('Upload'); ?>" />
</p>
</form>

</div>

		<?php if ( get_theme_mod('header_image') || get_theme_mod('header_textcolor') ) : ?>
<div class="wrap">
<h2><?php _e('Reset Header Image and Color'); ?></h2>
<p><?php _e('This will restore the original header image and color. You will not be able to retrieve any customizations.') ?></p>
<form method="post" action="<?php echo attribute_escape(add_query_arg('step', 1)) ?>">
<?php wp_nonce_field('custom-header'); ?>
<input type="submit" name="resetheader" value="<?php _e('Restore Original Header'); ?>" />
</form>
</div>
		<?php endif;

	}

	function step_2() {
		check_admin_referer('custom-header');
		$overrides = array('test_form' => false);
		$file = wp_handle_upload($_FILES['import'], $overrides);

		if ( isset($file['error']) )
		die( $file['error'] );

		$url = $file['url'];
		$type = $file['type'];
		$file = $file['file'];
		$filename = basename($file);

		// Construct the object array
		$object = array(
		'post_title' => $filename,
		'post_content' => $url,
		'post_mime_type' => $type,
		'guid' => $url);

		// Save the data
		$id = wp_insert_attachment($object, $file);

		list($width, $height, $type, $attr) = getimagesize( $file );

		if ( $width == HEADER_IMAGE_WIDTH && $height == HEADER_IMAGE_HEIGHT ) {
			// Add the meta-data
			wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );

			set_theme_mod('header_image', clean_url($url));
			do_action('wp_create_file_in_uploads', $file, $id); // For replication
			return $this->finished();
		} elseif ( $width > HEADER_IMAGE_WIDTH ) {
			$oitar = $width / HEADER_IMAGE_WIDTH;
			$image = wp_crop_image($file, 0, 0, $width, $height, HEADER_IMAGE_WIDTH, $height / $oitar, false, str_replace(basename($file), 'midsize-'.basename($file), $file));
			$image = apply_filters('wp_create_file_in_uploads', $image, $id); // For replication

			$url = str_replace(basename($url), basename($image), $url);
			$width = $width / $oitar;
			$height = $height / $oitar;
		} else {
			$oitar = 1;
		}
		?>

<div class="wrap">

<form method="POST" action="<?php echo attribute_escape(add_query_arg('step', 3)) ?>">

<p><?php _e('Choose the part of the image you want to use as your header.'); ?></p>
<div id="testWrap" style="position: relative">
<img src="<?php echo $url; ?>" id="upload" width="<?php echo $width; ?>" height="<?php echo $height; ?>" />
</div>

<p class="submit">
<input type="hidden" name="x1" id="x1" />
<input type="hidden" name="y1" id="y1" />
<input type="hidden" name="x2" id="x2" />
<input type="hidden" name="y2" id="y2" />
<input type="hidden" name="width" id="width" />
<input type="hidden" name="height" id="height" />
<input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo $id; ?>" />
<input type="hidden" name="oitar" id="oitar" value="<?php echo $oitar; ?>" />
<?php wp_nonce_field('custom-header') ?>
<input type="submit" value="<?php _e('Crop Header'); ?>" />
</p>

</form>
</div>
		<?php
	}

	function step_3() {
		check_admin_referer('custom-header');
		if ( $_POST['oitar'] > 1 ) {
			$_POST['x1'] = $_POST['x1'] * $_POST['oitar'];
			$_POST['y1'] = $_POST['y1'] * $_POST['oitar'];
			$_POST['width'] = $_POST['width'] * $_POST['oitar'];
			$_POST['height'] = $_POST['height'] * $_POST['oitar'];
		}

		$original = get_attached_file( $_POST['attachment_id'] );

		$cropped = wp_crop_image($_POST['attachment_id'], $_POST['x1'], $_POST['y1'], $_POST['width'], $_POST['height'], HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT);
		$cropped = apply_filters('wp_create_file_in_uploads', $cropped, $_POST['attachment_id']); // For replication

		$parent = get_post($_POST['attachment_id']);
		$parent_url = $parent->guid;
		$url = str_replace(basename($parent_url), basename($cropped), $parent_url);

		// Construct the object array
		$object = array(
			'ID' => $_POST['attachment_id'],
			'post_title' => basename($cropped),
			'post_content' => $url,
			'post_mime_type' => 'image/jpeg',
			'guid' => $url
		);

		// Update the attachment
		wp_insert_attachment($object, $cropped);
		wp_update_attachment_metadata( $_POST['attachment_id'], wp_generate_attachment_metadata( $_POST['attachment_id'], $cropped ) );

		set_theme_mod('header_image', $url);

		// cleanup
		$medium = str_replace(basename($original), 'midsize-'.basename($original), $original);
		@unlink( apply_filters( 'wp_delete_file', $medium ) );
		@unlink( apply_filters( 'wp_delete_file', $original ) );

		return $this->finished();
	}

	function finished() {
		?>
<div class="wrap">
<h2><?php _e('Header complete!'); ?></h2>

<p><?php _e('Visit your site and you should see the new header now.'); ?></p>

</div>
		<?php
	}

	function admin_page() {
		$step = $this->step();
		if ( 1 == $step )
			$this->step_1();
		elseif ( 2 == $step )
			$this->step_2();
		elseif ( 3 == $step )
			$this->step_3();
	}

}
?>
                                                                                            blog/wp-admin/edit-attachment-rows.php                                                              0000755 0023433 0004734 00000010224 11060470630 017640  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php if ( ! defined('ABSPATH') ) die(); ?>
<table class="widefat">
	<thead>
	<tr>

<?php $posts_columns = wp_manage_media_columns(); ?>
<?php foreach($posts_columns as $post_column_key => $column_display_name) {
	if ( 'cb' === $post_column_key )
		$class = ' class="check-column"';
	elseif ( 'comments' === $post_column_key )
		$class = ' class="num"';
	else
		$class = '';
?>
	<th scope="col"<?php echo $class; ?>><?php echo $column_display_name; ?></th>
<?php } ?>

	</tr>
	</thead>
	<tbody id="the-list" class="list:post">
<?php
if ( have_posts() ) {
$bgcolor = '';
add_filter('the_title','wp_specialchars');
while (have_posts()) : the_post();
$class = 'alternate' == $class ? '' : 'alternate';
global $current_user;
$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
$att_title = get_the_title();
if ( empty($att_title) )
	$att_title = __('(no title)');

?>
	<tr id='post-<?php echo $id; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">

<?php

foreach($posts_columns as $column_name=>$column_display_name) {

	switch($column_name) {

	case 'cb':
		?>
		<th scope="row" class="check-column"><input type="checkbox" name="delete[]" value="<?php the_ID(); ?>" /></th>
		<?php
		break;

	case 'icon':
		?>
		<td class="media-icon"><?php echo wp_get_attachment_link($post->ID, array(80, 60), false, true); ?></td>
		<?php
		// TODO
		break;

	case 'media':
		?>
		<td><strong><a href="media.php?action=edit&amp;attachment_id=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />
		<?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?>
		<?php do_action('manage_media_media_column', $post->ID); ?>
		</td>
		<?php
		break;

	case 'desc':
		?>
		<td><?php echo has_excerpt() ? $post->post_excerpt : ''; ?></td>
		<?php
		break;

	case 'date':
		if ( '0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name ) {
			$t_time = $h_time = __('Unpublished');
		} else {
			$t_time = get_the_time(__('Y/m/d g:i:s A'));
			$m_time = $post->post_date;
			$time = get_post_time( 'G', true );
			if ( ( abs($t_diff = time() - $time) ) < 86400 ) {
				if ( $t_diff < 0 )
					$h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
				else
					$h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
			} else {
				$h_time = mysql2date(__('Y/m/d'), $m_time);
			}
		}
		?>
		<td><?php echo $h_time ?></td>
		<?php
		break;

	case 'parent':
		$title = __('(no title)'); // override below
		if ( $post->post_parent > 0 ) {
			if ( get_post($post->post_parent) ) {
				$parent_title = get_the_title($post->post_parent);
				if ( !empty($parent_title) )
					$title = $parent_title;
			}
			?>
			<td><strong><a href="post.php?action=edit&amp;post=<?php echo $post->post_parent; ?>"><?php echo $title ?></a></strong></td>
			<?php
		} else {
			?>
			<td>&nbsp;</td>
			<?php
		}

		break;

	case 'comments':
		?>
		<td class="num"><div class="post-com-count-wrapper">
		<?php
		$left = get_pending_comments_num( $post->ID );
		$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
		if ( $left )
			echo '<strong>';
		comments_number("<a href='upload.php?attachment_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='upload.php?attachment_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='upload.php?attachment_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
		if ( $left )
			echo '</strong>';
		?>
		</div></td>
		<?php
		break;

	case 'location':
		?>
		<td><a href="<?php the_permalink(); ?>"><?php _e('Permalink'); ?></a></td>
		<?php
		break;

	default:
		?>
		<td><?php do_action('manage_media_custom_column', $column_name, $id); ?></td>
		<?php
		break;
	}
}
?>
	</tr>
<?php
endwhile;
} else {
?>
  <tr style='background-color: <?php echo $bgcolor; ?>'>
    <td colspan="8"><?php _e('No posts found.') ?></td>
  </tr>
<?php
} // end if ( have_posts() )
?>
	</tbody>
</table>
                                                                                                                                                                                                                                                                                                                                                                            blog/wp-admin/edit-category-form.php                                                                0000755 0023433 0004734 00000005770 11060470631 017311  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
if ( ! empty($cat_ID) ) {
	$heading = __('Edit Category');
	$submit_text = __('Edit Category');
	$form = '<form name="editcat" id="editcat" method="post" action="categories.php" class="validate">';
	$action = 'editedcat';
	$nonce_action = 'update-category_' . $cat_ID;
	do_action('edit_category_form_pre', $category);
} else {
	$heading = __('Add Category');
	$submit_text = __('Add Category');
	$form = '<form name="addcat" id="addcat" method="post" action="categories.php" class="add:the-list: validate">';
	$action = 'addcat';
	$nonce_action = 'add-category';
	do_action('add_category_form_pre', $category);
}
?>

<div class="wrap">
<h2><?php echo $heading ?></h2>
<div id="ajax-response"></div>
<?php echo $form ?>
<input type="hidden" name="action" value="<?php echo $action ?>" />
<input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" />
<?php wp_nonce_field($nonce_action); ?>
	<table class="form-table">
		<tr class="form-field form-required">
			<th scope="row" valign="top"><label for="cat_name"><?php _e('Category Name') ?></label></th>
			<td><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->name); ?>" size="40" aria-required="true" /><br />
            <?php _e('The name is used to identify the category almost everywhere, for example under the post or in the category widget.'); ?></td>
		</tr>
		<tr class="form-field">
			<th scope="row" valign="top"><label for="category_nicename"><?php _e('Category Slug') ?></label></th>
			<td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
            <?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
		</tr>
		<tr class="form-field">
			<th scope="row" valign="top"><label for="category_parent"><?php _e('Category Parent') ?></label></th>
			<td>
	  			<?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br />
                <?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?>
	  		</td>
		</tr>
		<tr class="form-field">
			<th scope="row" valign="top"><label for="category_description"><?php _e('Description') ?></label></th>
			<td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars($category->description); ?></textarea><br />
            <?php _e('The description is not prominent by default, however some themes may show it.'); ?></td>
		</tr>
	</table>
<p class="submit"><input type="submit" class="button" name="submit" value="<?php echo $submit_text ?>" /></p>
<?php do_action('edit_category_form', $category); ?>
</form>
</div>
        blog/wp-admin/edit-comments.php                                                                     0000755 0023433 0004734 00000020367 11060470632 016360  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
require_once('admin.php');

$title = __('Edit Comments');
$parent_file = 'edit-comments.php';
wp_enqueue_script( 'admin-comments' );
wp_enqueue_script('admin-forms');

if ( !empty( $_REQUEST['delete_comments'] ) ) {
	check_admin_referer('bulk-comments');

	$comments_deleted = $comments_approved = $comments_unapproved = $comments_spammed = 0;
	foreach ($_REQUEST['delete_comments'] as $comment) : // Check the permissions on each
		$comment = (int) $comment;
		$post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment) );
		if ( !current_user_can('edit_post', $post_id) )
			continue;
		if ( !empty( $_REQUEST['spamit'] ) ) {
			wp_set_comment_status($comment, 'spam');
			$comments_spammed++;
		} elseif ( !empty( $_REQUEST['deleteit'] ) ) {
			wp_set_comment_status($comment, 'delete');
			$comments_deleted++;
		} elseif ( !empty( $_REQUEST['approveit'] ) ) {
			wp_set_comment_status($comment, 'approve');
			$comments_approved++;
		} elseif ( !empty( $_REQUEST['unapproveit'] ) ) {
			wp_set_comment_status($comment, 'hold');
			$comments_unapproved++;
		}
	endforeach;
	$redirect_to = basename( __FILE__ ) . '?deleted=' . $comments_deleted . '&approved=' . $comments_approved . '&spam=' . $comments_spammed . '&unapproved=' . $comments_unapproved;
	if ( isset($_REQUEST['apage']) )
		$redirect_to = add_query_arg( 'apage', absint($_REQUEST['apage']), $redirect_to );
	if ( !empty($_REQUEST['mode']) )
		$redirect_to = add_query_arg('mode', $_REQUEST['mode'], $redirect_to);
	if ( !empty($_REQUEST['comment_status']) )
		$redirect_to = add_query_arg('comment_status', $_REQUEST['comment_status'], $redirect_to);
	if ( !empty($_REQUEST['s']) )
		$redirect_to = add_query_arg('s', $_REQUEST['s'], $redirect_to);
	wp_redirect( $redirect_to );
} elseif ( !empty($_GET['_wp_http_referer']) ) {
	 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
	 exit;
}

require_once('admin-header.php');

if ( empty($_GET['mode']) )
	$mode = 'detail';
else
	$mode = attribute_escape($_GET['mode']);

if ( isset($_GET['comment_status']) )
	$comment_status = attribute_escape($_GET['comment_status']);
else
	$comment_status = '';

if ( isset($_GET['s']) )
	$search_dirty = $_GET['s'];
else
	$search_dirty = '';
$search = attribute_escape( $search_dirty );
?>
<?php
if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['spam'] ) ) {
	$approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0;
	$deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0;
	$spam = isset( $_GET['spam'] ) ? (int) $_GET['spam'] : 0;

	if ( $approved > 0 || $deleted > 0 || $spam > 0 ) {
		echo '<div id="moderated" class="updated fade"><p>';

		if ( $approved > 0 ) {
			printf( __ngettext( '%s comment approved', '%s comments approved', $approved ), $approved );
			echo '<br />';
		}

		if ( $deleted > 0 ) {
			printf( __ngettext( '%s comment deleted', '%s comments deleted', $deleted ), $deleted );
			echo '<br />';
		}

		if ( $spam > 0 ) {
			printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam );
			echo '<br />';
		}

		echo '</p></div>';
	}
}
?>
<div class="wrap">
<form id="posts-filter" action="" method="get">
<h2><?php _e('Manage Comments'); ?></h2>

<ul class="subsubsub">
<?php
$status_links = array();
$num_comments = wp_count_comments();
$stati = array('moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"), 'approved' => _c('Approved|plural'));
$class = ( '' === $comment_status ) ? ' class="current"' : '';
$status_links[] = "<li><a href=\"edit-comments.php\"$class>".__('Show All Comments')."</a>";
foreach ( $stati as $status => $label ) {
	$class = '';

	if ( $status == $comment_status )
		$class = ' class="current"';

	$status_links[] = "<li><a href=\"edit-comments.php?comment_status=$status\"$class>" . $label . '</a>';
}

$status_links = apply_filters( 'comment_status_links', $status_links );

echo implode(' | </li>', $status_links) . '</li>';
unset($status_links);
?>
</ul>

<p id="post-search">
	<label class="hidden" for="post-search-input"><?php _e( 'Search Comments' ); ?>:</label>
	<input type="text" id="post-search-input" name="s" value="<?php echo $search; ?>" />
	<input type="submit" value="<?php _e( 'Search Comments' ); ?>" class="button" />
</p>

<input type="hidden" name="mode" value="<?php echo $mode; ?>" />
<input type="hidden" name="comment_status" value="<?php echo $comment_status; ?>" />
</form>

<ul class="view-switch">
	<li <?php if ( 'detail' == $mode ) echo "class='current'" ?>><a href="<?php echo clean_url(add_query_arg('mode', 'detail', $_SERVER['REQUEST_URI'])) ?>"><?php _e('Detail View') ?></a></li>
	<li <?php if ( 'list' == $mode ) echo "class='current'" ?>><a href="<?php echo clean_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><?php _e('List View') ?></a></li>
</ul>

<?php

$comments_per_page = apply_filters('comments_per_page', 20, $comment_status);

if ( isset( $_GET['apage'] ) )
	$page = abs( (int) $_GET['apage'] );
else
	$page = 1;

$start = $offset = ( $page - 1 ) * $comments_per_page;

list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5 ); // Grab a few extra

$comments = array_slice($_comments, 0, $comments_per_page);
$extra_comments = array_slice($_comments, $comments_per_page);

$page_links = paginate_links( array(
	'base' => add_query_arg( 'apage', '%#%' ),
	'format' => '',
	'total' => ceil($total / $comments_per_page),
	'current' => $page
));

?>

<form id="comments-form" action="" method="post">

<div class="tablenav">

<?php
if ( $page_links )
	echo "<div class='tablenav-pages'>$page_links</div>";
?>

<div class="alignleft">
<?php if ( 'approved' != $comment_status ): ?>
<input type="submit" value="<?php _e('Approve'); ?>" name="approveit" class="button-secondary" />
<?php endif; ?>
<input type="submit" value="<?php _e('Mark as Spam'); ?>" name="spamit" class="button-secondary" />
<?php if ( 'moderated' != $comment_status ): ?>
<input type="submit" value="<?php _e('Unapprove'); ?>" name="unapproveit" class="button-secondary" />
<?php endif; ?>
<input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" />
<?php do_action('manage_comments_nav', $comment_status); ?>
<?php wp_nonce_field('bulk-comments'); ?>
<?php if ( isset($_GET['apage']) ) { ?>
	<input type="hidden" name="apage" value="<?php echo absint( $_GET['apage'] ); ?>" />
<?php } ?>
</div>

<br class="clear" />

</div>

<br class="clear" />
<?php
if ($comments) {
?>
<table class="widefat">
<thead>
  <tr>
    <th scope="col" class="check-column"><input type="checkbox" /></th>
    <th scope="col"><?php _e('Comment') ?></th>
    <th scope="col"><?php _e('Date') ?></th>
    <th scope="col" class="action-links"><?php _e('Actions') ?></th>
  </tr>
</thead>
<tbody id="the-comment-list" class="list:comment">
<?php
	foreach ($comments as $comment)
		_wp_comment_row( $comment->comment_ID, $mode, $comment_status );
?>
</tbody>
<tbody id="the-extra-comment-list" class="list:comment" style="display: none;">
<?php
	foreach ($extra_comments as $comment)
		_wp_comment_row( $comment->comment_ID, $mode, $comment_status );
?>
</tbody>
</table>

</form>

<form id="get-extra-comments" method="post" action="" class="add:the-extra-comment-list:" style="display: none;">
	<input type="hidden" name="s" value="<?php echo $search; ?>" />
	<input type="hidden" name="mode" value="<?php echo $mode; ?>" />
	<input type="hidden" name="comment_status" value="<?php echo $comment_status; ?>" />
	<input type="hidden" name="page" value="<?php echo isset($_REQUEST['page']) ? absint( $_REQUEST['page'] ) : 1; ?>" />
	<?php wp_nonce_field( 'add-comment', '_ajax_nonce', false ); ?>
</form>

<div id="ajax-response"></div>
<?php
} elseif ( 'moderated' == $_GET['comment_status'] ) {
?>
<p>
<?php _e('No comments awaiting moderation&hellip; yet.') ?>
</p>
<?php
} else  {
?>
<p>
<?php _e('No results found.') ?>
</p>
<?php
}
?>
<div class="tablenav">
<?php
if ( $page_links )
	echo "<div class='tablenav-pages'>$page_links</div>";
?>
<br class="clear" />
</div>

</div>

<?php include('admin-footer.php'); ?>
                                                                                                                                                                                                                                                                         blog/wp-admin/edit-form-advanced.php                                                                0000755 0023433 0004734 00000044257 11060470633 017246  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

$action = isset($action) ? $action : '';
if ( isset($_GET['message']) )
	$_GET['message'] = absint( $_GET['message'] );
$messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer'] ) ) );
$messages[2] = __('Custom field updated.');
$messages[3] = __('Custom field deleted.');
$messages[4] = __('Post updated.');

if ( isset($_GET['revision']) )
	$messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );

$notice = false;
$notices[1] = __( 'There is an autosave of this post that is more recent than the version below.  <a href="%s">View the autosave</a>.' );

if ( !isset($post_ID) || 0 == $post_ID ) {
	$form_action = 'post';
	$temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
	$form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
	$autosave = false;
} else {
	$post_ID = (int) $post_ID;
	$form_action = 'editpost';
	$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
	$autosave = wp_get_post_autosave( $post_id );

	// Detect if there exists an autosave newer than the post and if that autosave is different than the post
	if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) {
		foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
			if ( wp_text_diff( $autosave->$autosave_field, $post->$autosave_field ) ) {
				$notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
				break;
			}
		}
		unset($autosave_field, $_autosave_field);
	}
}

?>
<?php if ( $notice ) : ?>
<div id="notice" class="error"><p><?php echo $notice ?></p></div>
<?php endif; ?>
<?php if (isset($_GET['message'])) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
<?php endif; ?>

<form name="post" action="post.php" method="post" id="post">
<?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?>
<input type="hidden" name="mode" value="bookmarklet" />
<?php endif; ?>

<div class="wrap">
<h2><?php _e('Write Post') ?></h2>
<?php

if ( !isset($post_ID) || 0 == $post_ID)
	wp_nonce_field('add-post');
else
	wp_nonce_field('update-post_' .  $post_ID);

$form_pingback = '<input type="hidden" name="post_pingback" value="' . (int) get_option('default_pingback_flag') . '" id="post_pingback" />';

$form_prevstatus = '<input type="hidden" name="prev_status" value="' . attribute_escape( $post->post_status ) . '" />';

$saveasdraft = '<input name="save" type="submit" id="save" class="button" tabindex="3" value="' . attribute_escape( __('Save and Continue Editing') ) . '" />';

?>

<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
<input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" />
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
<input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
<?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>

<?php echo $form_extra ?>

<div id="poststuff">

<div class="submitbox" id="submitpost">

<div id="previewview">
<?php if ( 'publish' == $post->post_status ) { ?>
<a href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank" tabindex="4"><?php _e('View this Post'); ?></a>
<?php } elseif ( 'edit' == $action ) { ?>
<a href="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" target="_blank"  tabindex="4"><?php _e('Preview this Post'); ?></a>
<?php } ?>
</div>

<div class="inside">

<p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p>
<p>
<select name='post_status' id='post_status' tabindex='4'>
<?php 
// only show the publish menu item if they are allowed to publish posts or they are allowed to edit this post (accounts for 'edit_published_posts' capability) 
if ( current_user_can('publish_posts') OR ( $post->post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) :
?>
<option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
<?php if ( 'future' == $post->post_status ) : ?>
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
<?php endif; ?>
<?php endif; ?>
<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Unpublished') ?></option>
</select>
</p>

<?php if ( current_user_can( 'publish_posts' ) ) : ?>
<p id="private-checkbox"><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label></p>
<?php endif; ?>
<?php
if ($post_ID) {
	if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
		$stamp = __('Scheduled for:<br />%1$s at %2$s');
	} else if ( 'publish' == $post->post_status ) { // already published
		$stamp = __('Published on:<br />%1$s at %2$s');
	} else if ( '0000-00-00 00:00:00' == $post->post_date ) { // draft, 1 or more saves, no date specified
		$stamp = __('Publish immediately');
	} else { // draft, 1 or more saves, date specified
		$stamp = __('Publish on:<br />%1$s at %2$s');
	}
	$date = mysql2date(get_option('date_format'), $post->post_date);
	$time = mysql2date(get_option('time_format'), $post->post_date);
} else { // draft (no saves, and thus no date specified)
	$stamp = __('Publish immediately');
	$date = mysql2date(get_option('date_format'), current_time('mysql'));
	$time = mysql2date(get_option('time_format'), current_time('mysql'));
}
?>
<?php if ( current_user_can( 'publish_posts' ) ) : // Contributors don't get to choose the date of publish ?>
<p class="curtime"><?php printf($stamp, $date, $time); ?>
&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a></p>

<div id='timestampdiv' class='hide-if-js'><?php touch_time(($action == 'edit'),1,4); ?></div>
<?php endif; ?>

</div>

<p class="submit">
<input type="submit" name="save" id="save-post" value="<?php _e('Save'); ?>" tabindex="4" class="button button-highlighted" />
<?php
if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post_ID ) {
?>
<?php if ( current_user_can('publish_posts') ) : ?>
	<input name="publish" type="submit" class="button" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
<?php else : ?>
	<input name="publish" type="submit" class="button" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
<?php endif; ?>
<?php
}

if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
	echo "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&amp;post=$post_ID", 'delete-post_' . $post_ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete&nbsp;post') . "</a>";
?>
<br class="clear" />
<?php if ($post_ID): ?>
<?php if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
	$last_user = get_userdata($last_id);
	printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
} else {
	printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
}
?>
<br class="clear" />
<?php endif; ?>
<span id="autosave"></span>
<span id="wp-word-count"></span>
</p>

<div class="side-info">
<h5><?php _e('Related') ?></h5>

<ul>
<?php if ($post_ID): ?>
<li><a href="edit.php?p=<?php echo $post_ID ?>"><?php _e('See Comments on this Post') ?></a></li>
<?php endif; ?>
<li><a href="edit-comments.php"><?php _e('Manage All Comments') ?></a></li>
<li><a href="edit.php"><?php _e('Manage All Posts') ?></a></li>
<li><a href="categories.php"><?php _e('Manage All Categories') ?></a></li>
<li><a href="edit-tags.php"><?php _e('Manage All Tags') ?></a></li>
<li><a href="edit.php?post_status=draft"><?php _e('View Drafts'); ?></a></li>
<?php do_action('post_relatedlinks_list'); ?>
</ul>

<h5><?php _e('Shortcuts') ?></h5>
<p><?php _e('Drag-and-drop the following link to your bookmarks bar or right click it and add it to your favorites for a posting shortcut.') ?>  <a href="<?php echo get_shortcut_link(); ?>" title="<?php echo attribute_escape(__('Press This')) ?>"><?php _e('Press This') ?></a></p>
</div>

<?php do_action('submitpost_box'); ?>
</div>

<div id="post-body">
<div id="titlediv">
<h3><label for="title"><?php _e('Title') ?></label></h3>
<div id="titlewrap">
	<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" autocomplete="off" />
</div>
<div class="inside">
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
	<div id="edit-slug-box">
<?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
	echo $sample_permalink_html;
endif; ?>
	</div>
</div>
</div>

<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
<h3><label for="content"><?php _e('Post') ?></label></h3>
<?php the_editor($post->post_content); ?>
<?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
<?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?>
<?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?>
</div>

<?php echo $form_pingback ?>
<?php echo $form_prevstatus ?>

<?php
function post_tags_meta_box($post) {
?>
<p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>
<div id="tagchecklist"></div>
<?php
}
add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'normal', 'core');

function post_categories_meta_box($post) {
?>
<div id="category-adder" class="wp-hidden-children">
	<h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
	<p id="category-add" class="wp-hidden-child">
		<label class="hidden" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
		<label class="hidden" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
		<input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _e( 'Add' ); ?>" tabindex="3" />
		<?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
		<span id="category-ajax-response"></span>
	</p>
</div>

<ul id="category-tabs">
	<li class="ui-tabs-selected"><a href="#categories-all" tabindex="3"><?php _e( 'All Categories' ); ?></a></li>
	<li class="wp-no-js-hidden"><a href="#categories-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>
</ul>

<div id="categories-pop" class="ui-tabs-panel" style="display: none;">
	<ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
		<?php $popular_ids = wp_popular_terms_checklist('category'); ?>
	</ul>
</div>

<div id="categories-all" class="ui-tabs-panel">
	<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
		<?php wp_category_checklist($post->ID, false, false, $popular_ids) ?>
	</ul>
</div>
<?php
}
add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'normal', 'core');
?>

<?php do_meta_boxes('post', 'normal', $post); ?>

<?php do_action('edit_form_advanced'); ?>

<h2><?php _e('Advanced Options'); ?></h2>

<?php
function post_excerpt_meta_box($post) {
?>
<label class="hidden" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
<p><?php _e('Excerpts are optional hand-crafted summaries of your content. You can <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" target="_blank">use them in your template</a>'); ?></p>
<?php
}
add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'advanced', 'core');

function post_trackback_meta_box($post) {
	$form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';
	if ('' != $post->pinged) {
		$pings = '<p>'. __('Already pinged:') . '</p><ul>';
		$already_pinged = explode("\n", trim($post->pinged));
		foreach ($already_pinged as $pinged_url) {
			$pings .= "\n\t<li>" . wp_specialchars($pinged_url) . "</li>";
		}
		$pings .= '</ul>';
	}

?>
<p><label for="trackback"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
<p><?php _e('Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. If you link other WordPress blogs they&#8217;ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
<?php
if ( ! empty($pings) )
	echo $pings;
}
add_meta_box('trackbacksdiv', __('Trackbacks'), 'post_trackback_meta_box', 'post', 'advanced', 'core');

function post_custom_meta_box($post) {
?>
<div id="postcustomstuff">
<table cellpadding="3">
<?php
$metadata = has_meta($post->ID);
list_meta($metadata);
?>

</table>
<?php
	meta_form();
?>
<div id="ajax-response"></div>
</div>
<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
<?php
}
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'advanced', 'core');

do_action('dbx_post_advanced');

function post_comment_status_meta_box($post) {
?>
<input name="advanced_view" type="hidden" value="1" />
<p><label for="comment_status" class="selectit">
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
<?php _e('Allow Comments') ?></label></p>
<p><label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label></p>
<p><?php _e('These settings apply to this post only. &#8220;Pings&#8221; are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p>
<?php
}
add_meta_box('commentstatusdiv', __('Comments &amp; Pings'), 'post_comment_status_meta_box', 'post', 'advanced', 'core');

function post_password_meta_box($post) {
?>
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p>
<?php
}
add_meta_box('passworddiv', __('Password Protect This Post'), 'post_password_meta_box', 'post', 'advanced', 'core');

function post_slug_meta_box($post) {
?>
<label class="hidden" for="post_name"><?php _e('Post Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
<?php
}
add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'advanced', 'core');

$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
if ( $post->post_author && !in_array($post->post_author, $authors) )
	$authors[] = $post->post_author;
if ( $authors && count( $authors ) > 1 ) :
function post_author_meta_box($post) {
	global $current_user, $user_ID;
	$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
	if ( $post->post_author && !in_array($post->post_author, $authors) )
		$authors[] = $post->post_author;
?>
<label class="hidden" for="post_author_override"><?php _e('Post Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
<?php
}
add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'advanced', 'core');
endif;

if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
function post_revisions_meta_box($post) {
	wp_list_post_revisions();
}
add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'advanced', 'core');
endif;

do_meta_boxes('post', 'advanced', $post);

do_action('dbx_post_sidebar');
?>
</div>
</div>

</div>

</form>

<?php if ((isset($post->post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message'])) : ?>
<script type="text/javascript">
try{document.post.title.focus();}catch(e){}
</script>
<?php endif; ?>
                                                                                                                                                                                                                                                                                                                                                 blog/wp-admin/edit-form-comment.php                                                                 0000755 0023433 0004734 00000010535 11060470633 017133  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
$submitbutton_text = __('Edit Comment');
$toprow_title = sprintf(__('Editing Comment # %s'), $comment->comment_ID);
$form_action = 'editedcomment';
$form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment->comment_ID . "' />\n<input type='hidden' name='comment_post_ID' value='" . $comment->comment_post_ID;
?>

<form name="post" action="comment.php" method="post" id="post">
<?php wp_nonce_field('update-comment_' . $comment->comment_ID) ?>
<div class="wrap">
<h2><?php echo $toprow_title; ?></h2>
<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />

<div id="poststuff">

<div class="submitbox" id="submitcomment">

<div id="previewview">
<a href="<?php echo get_comment_link(); ?>" target="_blank"><?php _e('View this Comment'); ?></a>
</div>

<div class="inside">

<p><strong><label for='comment_status'><?php _e('Approval Status') ?></label></strong></p>
<p>
<select name='comment_status' id='comment_status'>
<option<?php selected( $comment->comment_approved, '1' ); ?> value='1'><?php _e('Approved') ?></option>
<option<?php selected( $comment->comment_approved, '0' ); ?> value='0'><?php _e('Moderated') ?></option>
<option<?php selected( $comment->comment_approved, 'spam' ); ?> value='spam'><?php _e('Spam') ?></option>
</select>
</p>

<?php
$stamp = __('%1$s at %2$s');
$date = mysql2date(get_option('date_format'), $comment->comment_date);
$time = mysql2date(get_option('time_format'), $comment->comment_date);
?>
<p class="curtime"><?php printf($stamp, $date, $time); ?>
&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Edit') ?></a></p>

<div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0, 5); ?></div>

</div>

<p class="submit">
<input type="submit" name="save" value="<?php _e('Save'); ?>" tabindex="4" class="button button-highlighted" />
<?php
echo "<a class='submitdelete' href='" . wp_nonce_url("comment.php?action=deletecomment&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n  'Cancel' to stop, 'OK' to delete.")) . "') ) { return true;}return false;\">" . __('Delete comment') . "</a>";
?>
</p>

<div class="side-info">
<h5><?php _e('Related') ?></h5>

<ul>
<li><a href="edit-comments.php"><?php _e('Manage All Comments') ?></a></li>
<li><a href="edit-comments.php?comment_status=moderated"><?php _e('Moderate Comments') ?></a></li>
<?php do_action('comment_relatedlinks_list'); ?>
</ul>
</div>
<?php do_action('submitcomment_box'); ?>
</div>

<div id="post-body">
<div id="namediv" class="stuffbox">
<h3><label for="name"><?php _e('Name') ?></label></h3>
<div class="inside">
<input type="text" name="newcomment_author" size="30" value="<?php echo attribute_escape( $comment->comment_author ); ?>" tabindex="1" id="name" />
</div>
</div>

<div id="emaildiv" class="stuffbox">
<h3><label for="email"><?php _e('E-mail') ?></label></h3>
<div class="inside">
<input type="text" name="newcomment_author_email" size="30" value="<?php echo attribute_escape( $comment->comment_author_email ); ?>" tabindex="2" id="email" />
</div>
</div>

<div id="uridiv" class="stuffbox">
<h3><label for="newcomment_author_url"><?php _e('URL') ?></label></h3>
<div class="inside">
<input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" value="<?php echo attribute_escape( $comment->comment_author_url ); ?>" tabindex="3" />
</div>
</div>

<div id="postdiv" class="postarea">
<h3><label for="content"><?php _e('Comment') ?></label></h3>
<?php the_editor($comment->comment_content, 'content', 'newcomment_author_url', false, 4); ?>
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
</div>

<?php do_meta_boxes('comment', 'normal', $comment); ?>

<input type="hidden" name="c" value="<?php echo $comment->comment_ID ?>" />
<input type="hidden" name="p" value="<?php echo $comment->comment_post_ID ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo wp_get_referer(); ?>" />
<?php wp_original_referer_field(true, 'previous'); ?>
<input type="hidden" name="noredir" value="1" />
</div>
</div>
</div>

</form>

<script type="text/javascript">
try{document.post.name.focus();}catch(e){}
</script>
                                                                                                                                                                   blog/wp-admin/edit-form.php                                                                         0000755 0023433 0004734 00000006053 11060470634 015474  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 
<div class="wrap">
<h2><?php _e('Write Post'); ?></h2>
<form name="post" action="post.php" method="post" id="simple">

<?php if (isset($mode) && 'bookmarklet' == $mode) : ?>
<input type="hidden" name="mode" value="bookmarklet" />
<?php endif; ?>
<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
<input type="hidden" name="action" value='post' />

<div id="poststuff">
    <fieldset id="titlediv">
      <legend><a href="http://wordpress.org/docs/reference/post/#title" title="<?php _e('Help on titles') ?>"><?php _e('Title') ?></a></legend>
	  <div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" /></div>
    </fieldset>

    <fieldset id="categorydiv">
      <legend><a href="http://wordpress.org/docs/reference/post/#category" title="<?php _e('Help on categories') ?>"><?php _e('Categories') ?></a></legend>
	  <div><?php dropdown_categories($post->post_category); ?></div>
    </fieldset>

<br />
<fieldset id="postdiv">
    <legend><a href="http://wordpress.org/docs/reference/post/#post" title="<?php _e('Help with post field') ?>"><?php _e('Post') ?></a></legend>
<?php
 $rows = get_option('default_post_edit_rows');
 if (($rows < 3) || ($rows > 100)) {
     $rows = 10;
 }
?>
<div><textarea rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="4" id="content"><?php echo $post->post_content ?></textarea></div>
<?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
</fieldset>


<script type="text/javascript">
<!--
edCanvas = document.getElementById('content');
//-->
</script>

<input type="hidden" name="post_pingback" value="<?php echo (int) get_option('default_pingback_flag') ?>" id="post_pingback" />

<p><label for="trackback"> <?php printf(__('<a href="%s" title="Help on trackbacks"><strong>TrackBack</strong> a <abbr title="Universal Resource Locator">URL</abbr></a>:</label> (Separate multiple <abbr title="Universal Resource Locator">URL</abbr>s with spaces.)'), 'http://wordpress.org/docs/reference/post/#trackback'); echo '<br />'; ?>
	<input type="text" name="trackback_url" style="width: 360px" id="trackback" tabindex="7" /></p>

<p class="submit"><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft') ?>" />
	<input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php _e('Save as Private') ?>" />

	 <?php if ( current_user_can('edit_posts') ) : ?>
	<input name="publish" type="submit" id="publish" tabindex="6" value="<?php _e('Publish') ?>" class="button button-highlighted" />
<?php endif; ?>

<?php if ('bookmarklet' != $mode) {
		echo '<input name="advanced" type="submit" id="advancededit" tabindex="7" value="' .  __('Advanced Editing') . '" />';
	} ?>
	<input name="referredby" type="hidden" id="referredby" value="<?php if ( $refby = wp_get_referer() ) echo urlencode($refby); ?>" />
</p>

<?php do_action('simple_edit_form', ''); ?>

</div>
</form>

<script type="text/javascript">
try{document.getElementById('title').focus();}catch(e){}
</script>
</div>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     blog/wp-admin/edit-link-categories.php                                                              0000755 0023433 0004734 00000011065 11060470635 017611  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
require_once('admin.php');

// Handle bulk deletes
if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
	check_admin_referer('bulk-link-categories');

	if ( !current_user_can('manage_categories') )
		wp_die(__('Cheatin&#8217; uh?'));

	foreach( (array) $_GET['delete'] as $cat_ID ) {
		$cat_name = get_term_field('name', $cat_ID, 'link_category');
		$default_cat_id = get_option('default_link_category');
		
		// Don't delete the default cats.
		if ( $cat_ID == $default_cat_id )
			wp_die(sprintf(__("Can&#8217;t delete the <strong>%s</strong> category: this is the default one"), $cat_name));

		wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
	}

	$location = 'edit-link-categories.php';
	if ( $referer = wp_get_referer() ) {
		if ( false !== strpos($referer, 'edit-link-categories.php') )
			$location = $referer;
	}

	$location = add_query_arg('message', 6, $location);
	wp_redirect($location);
	exit();
} elseif ( !empty($_GET['_wp_http_referer']) ) {
	 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
	 exit;
}

$title = __('Link Categories');
$parent_file = 'edit.php';

wp_enqueue_script( 'admin-categories' );
wp_enqueue_script('admin-forms');

require_once ('admin-header.php');

$messages[1] = __('Category added.');
$messages[2] = __('Category deleted.');
$messages[3] = __('Category updated.');
$messages[4] = __('Category not added.');
$messages[5] = __('Category not updated.');
$messages[6] = __('Categories deleted.');

if (isset($_GET['message'])) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
endif; ?>

<div class="wrap">

<form id="posts-filter" action="" method="get">
<?php if ( current_user_can('manage_categories') ) : ?>
	<h2><?php printf(__('Manage Link Categories (<a href="%s">add new</a>)'), '#addcat') ?> </h2>
<?php else : ?>
	<h2><?php _e('Manage Link Categories') ?> </h2>
<?php endif; ?>

<p id="post-search">
	<label class="hidden" for="post-search-input"><?php _e( 'Search Categories' ); ?>:</label>
	<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
	<input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
</p>

<br class="clear" />

<div class="tablenav">

<?php
$pagenum = absint( $_GET['pagenum'] );
if ( empty($pagenum) )
	$pagenum = 1;
if( !$catsperpage || $catsperpage < 0 )
	$catsperpage = 20;

$page_links = paginate_links( array(
	'base' => add_query_arg( 'pagenum', '%#%' ),
	'format' => '',
	'total' => ceil(wp_count_terms('link_category') / $catsperpage),
	'current' => $pagenum
));

if ( $page_links )
	echo "<div class='tablenav-pages'>$page_links</div>";
?>

<div class="alignleft">
<input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" />
<?php wp_nonce_field('bulk-link-categories'); ?>
</div>

<br class="clear" />
</div>

<br class="clear" />

<table class="widefat">
	<thead>
	<tr>
        <th scope="col" class="check-column"><input type="checkbox" /></th>
        <th scope="col"><?php _e('Name') ?></th>
        <th scope="col"><?php _e('Description') ?></th>
        <th scope="col" class="num" style="width: 90px;"><?php _e('Links') ?></th>
	</tr>
	</thead>
	<tbody id="the-list" class="list:link-cat">
<?php
$start = ($pagenum - 1) * $catsperpage;
$args = array('offset' => $start, 'number' => $catsperpage, 'hide_empty' => 0);
if ( !empty( $_GET['s'] ) )
	$args['search'] = $_GET['s'];

$categories = get_terms( 'link_category', $args );
if ( $categories ) {
	$output = '';
	foreach ( $categories as $category ) {
		$category = sanitize_term($category, 'link_category', 'display');
		$output .= link_cat_row($category);
	}
	$output = apply_filters('cat_rows', $output);
	echo $output;
	unset($category);
}

?>
	</tbody>
</table>
</form>

<div class="tablenav">

<?php
if ( $page_links )
	echo "<div class='tablenav-pages'>$page_links</div>";
?>
<br class="clear" />
</div>
<br class="clear" />

</div>

<?php if ( current_user_can('manage_categories') ) : ?>
<div class="wrap">
<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the links in that category. Instead, links that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), get_term_field('name', get_option('default_link_category'), 'link_category')) ?></p>
</div>

<?php include('edit-link-category-form.php'); ?>

<?php endif; ?>

<?php include('admin-footer.php'); ?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           blog/wp-admin/edit-link-category-form.php                                                           0000755 0023433 0004734 00000004240 11060470635 020237  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
if ( ! empty($cat_ID) ) {
	$heading = __('Edit Category');
	$submit_text = __('Edit Category');
	$form = '<form name="editcat" id="editcat" method="post" action="link-category.php" class="validate">';
	$action = 'editedcat';
	$nonce_action = 'update-link-category_' . $cat_ID;
	do_action('edit_link_category_form_pre', $category);
} else {
	$heading = __('Add Category');
	$submit_text = __('Add Category');
	$form = '<form name="addcat" id="addcat" class="add:the-list: validate" method="post" action="link-category.php">';
	$action = 'addcat';
	$nonce_action = 'add-link-category';
	do_action('add_link_category_form_pre', $category);
}
?>

<div class="wrap">
<h2><?php echo $heading ?></h2>
<div id="ajax-response"></div>
<?php echo $form ?>
<input type="hidden" name="action" value="<?php echo $action ?>" />
<input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" />
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field($nonce_action); ?>
	<table class="form-table">
		<tr class="form-field form-required">
			<th scope="row" valign="top"><label for="name"><?php _e('Category name') ?></label></th>
			<td><input name="name" id="name" type="text" value="<?php echo $category->name; ?>" size="40" aria-required="true" /></td>
		</tr>
		<tr class="form-field">
			<th scope="row" valign="top"><label for="slug"><?php _e('Category slug') ?></label></th>
			<td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" />
            <?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
		</tr>
		<tr class="form-field">
			<th scope="row" valign="top"><label for="description"><?php _e('Description (optional)') ?></label></th>
			<td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea></td>
		</tr>
	</table>
<p class="submit"><input type="submit" class="button" name="submit" value="<?php echo $submit_text ?>" /></p>
<?php do_action('edit_link_category_form', $category); ?>
</form>
</div>
                                                                                                                                                                                                                                                                                                                                                                blog/wp-admin/edit-link-form.php                                                                    0000755 0023433 0004734 00000035134 11060470636 016433  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
if ( ! empty($link_id) ) {
	$heading = __('Edit Link');
	$submit_text = __('Save Changes');
	$form = '<form name="editlink" id="editlink" method="post" action="link.php">';
	$nonce_action = 'update-bookmark_' . $link_id;
} else {
	$heading = __('Add Link');
	$submit_text = __('Add Link');
	$form = '<form name="addlink" id="addlink" method="post" action="link.php">';
	$nonce_action = 'add-bookmark';
}

function xfn_check($class, $value = '', $deprecated = '') {
	global $link;

	$link_rel = $link->link_rel;
	$rels = preg_split('/\s+/', $link_rel);

	if ('' != $value && in_array($value, $rels) ) {
		echo ' checked="checked"';
	}

	if ('' == $value) {
		if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"';
		if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
		if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
		if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
	}
}
?>

<?php echo $form ?>
<?php wp_nonce_field($nonce_action); ?>
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>

<div class="wrap">
<h2><?php echo $heading; ?></h2>

<div id="poststuff">

<div class="submitbox" id="submitlink">

<div id="previewview">
<?php if ( !empty($link_id) ) { ?>
<a href="<?php echo $link->link_url; ?>" target="_blank"><?php _e('Visit Link'); ?></a>
<?php } ?>
</div>

<div class="inside">
<p><label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label></p>
</div>

<p class="submit">
<input type="submit" class="button button-highlighted" name="save" value="<?php _e('Save'); ?>" tabindex="4" />
<?php
if ( ( 'edit' == $action) && current_user_can('manage_links') )
	echo "<a class='submitdelete' href='" . wp_nonce_url("link.php?action=delete&amp;link_id=$link_id", 'delete-bookmark_' . $link_id) . "' onclick=\"if ( confirm('" . js_escape( sprintf( __("You are about to delete this link '%s'\n'Cancel' to stop, 'OK' to delete."), $link->link_name )) . "') ) { return true;}return false;\">" . __('Delete&nbsp;link') . "</a>";
?>
</p>

<div class="side-info">
<h5><?php _e('Related') ?></h5>

<ul>
<li><a href="link-manager.php"><?php _e('Manage All Links') ?></a></li>
<li><a href="edit-link-categories.php"><?php _e('Manage All Link Categories') ?></a></li>
<li><a href="link-import.php"><?php _e('Import Links') ?></a></li>
<?php do_action('link_relatedlinks_list'); ?>
</ul>
</div>
<?php do_action('submitlink_box'); ?>
</div>

<div id="post-body">
<div id="namediv" class="stuffbox">
<h3><label for="link_name"><?php _e('Name') ?></label></h3>
<div class="inside">
	<input type="text" name="link_name" size="30" tabindex="1" value="<?php echo $link->link_name; ?>" id="link_name" /><br />
    <?php _e('Example: Nifty blogging software'); ?>
</div>
</div>

<div id="addressdiv" class="stuffbox">
<h3><label for="link_url"><?php _e('Web Address') ?></label></h3>
<div class="inside">
	<input type="text" name="link_url" size="30" tabindex="1" value="<?php echo $link->link_url; ?>" id="link_url" /><br />
    <?php _e('Example: <code>http://wordpress.org/</code> &#8212; don&#8217;t forget the <code>http://</code>'); ?>
</div>
</div>

<div id="descriptiondiv" class="stuffbox">
<h3><label for="link_description"><?php _e('Description') ?></label></h3>
<div class="inside">
	<input type="text" name="link_description" size="30" tabindex="1" value="<?php echo $link->link_description; ?>" id="link_description" /><br />
    <?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?>
</div>
</div>

<?php function link_categories_meta_box($link) { ?>
<div id="category-adder" class="wp-hidden-children">
	<h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
	<p id="link-category-add" class="wp-hidden-child">
		<label class="hidden" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
		<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" aria-required="true" />
		<input type="button" id="category-add-sumbit" class="add:categorychecklist:linkcategorydiv button" value="<?php _e( 'Add' ); ?>" />
		<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
		<span id="category-ajax-response"></span>
	</p>
</div>

<ul id="category-tabs">
	<li class="ui-tabs-selected"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
	<li class="wp-no-js-hidden"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
</ul>

<div id="categories-all" class="ui-tabs-panel">
	<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
		<?php wp_link_category_checklist($link->link_id); ?>
	</ul>
</div>

<div id="categories-pop" class="ui-tabs-panel" style="display: none;">
	<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
		<?php wp_popular_terms_checklist('link_category'); ?>
	</ul>
</div>
<?php
}
add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', 'link', 'normal', 'core');
?>

<?php do_meta_boxes('link', 'normal', $link); ?>

<h2><?php _e('Advanced Options'); ?></h2>

<?php function link_target_meta_box($link) { ?>
<fieldset><legend class="hidden"><?php _e('Target') ?></legend>
<label for="link_target_blank" class="selectit">
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo(($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
<code>_blank</code></label><br />
<label for="link_target_top" class="selectit">
<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo(($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
<code>_top</code></label><br />
<label for="link_target_none" class="selectit">
<input id="link_target_none" type="radio" name="link_target" value="" <?php echo(($link->link_target == '') ? 'checked="checked"' : ''); ?> />
<?php _e('none') ?></label>
</fieldset>
<p><?php _e('Choose the frame your link targets. Essentially this means if you choose <code>_blank</code> your link will open in a new window.'); ?></p>
<?php
}
add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'advanced', 'core');

function link_xfn_meta_box($link) {
?>
<table class="editform" style="width: 100%;" cellspacing="2" cellpadding="5">
	<tr>
		<th style="width: 20%;" scope="row"><label for="link_rel"><?php _e('rel:') ?></label></th>
		<td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo $link->link_rel; ?>" /></td>
	</tr>
	<tr>
		<td colspan="2">
			<table cellpadding="3" cellspacing="5" class="form-table">
				<tr>
					<th scope="row"> <?php _e('identity') ?> </th>
					<td><fieldset><legend class="hidden"> <?php _e('identity') ?> </legend>
						<label for="me">
						<input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
						<?php _e('another web address of mine') ?></label>
					</fieldset></td>
				</tr>
				<tr>
					<th scope="row"> <?php _e('friendship') ?> </th>
					<td><fieldset><legend class="hidden"> <?php _e('friendship') ?> </legend>
						<label for="contact">
						<input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php _e('contact') ?></label>
						<label for="acquaintance">
						<input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> />  <?php _e('acquaintance') ?></label>
						<label for="friend">
						<input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php _e('friend') ?></label>
						<label for="friendship">
						<input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php _e('none') ?></label>
					</fieldset></td>
				</tr>
				<tr>
					<th scope="row"> <?php _e('physical') ?> </th>
					<td><fieldset><legend class="hidden"> <?php _e('physical') ?> </legend>
						<label for="met">
						<input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
						<?php _e('met') ?></label>
					</fieldset></td>
				</tr>
				<tr>
					<th scope="row"> <?php _e('professional') ?> </th>
					<td><fieldset><legend class="hidden"> <?php _e('professional') ?> </legend>
						<label for="co-worker">
						<input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
						<?php _e('co-worker') ?></label>
						<label for="colleague">
						<input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
						<?php _e('colleague') ?></label>
					</fieldset></td>
				</tr>
				<tr>
					<th scope="row"> <?php _e('geographical') ?> </th>
					<td><fieldset><legend class="hidden"> <?php _e('geographical') ?> </legend>
						<label for="co-resident">
						<input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
						<?php _e('co-resident') ?></label>
						<label for="neighbor">
						<input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
						<?php _e('neighbor') ?></label>
						<label for="geographical">
						<input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
						<?php _e('none') ?></label>
					</fieldset></td>
				</tr>
				<tr>
					<th scope="row"> <?php _e('family') ?> </th>
					<td><fieldset><legend class="hidden"> <?php _e('family') ?> </legend>
						<label for="child">
						<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?>  />
						<?php _e('child') ?></label>
						<label for="kin">
						<input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?>  />
						<?php _e('kin') ?></label>
						<label for="parent">
						<input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
						<?php _e('parent') ?></label>
						<label for="sibling">
						<input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
						<?php _e('sibling') ?></label>
						<label for="spouse">
						<input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
						<?php _e('spouse') ?></label>
						<label for="family">
						<input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
						<?php _e('none') ?></label>
					</fieldset></td>
				</tr>
				<tr>
					<th scope="row"> <?php _e('romantic') ?> </th>
					<td><fieldset><legend class="hidden"> <?php _e('romantic') ?> </legend>
						<label for="muse">
						<input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
						<?php _e('muse') ?></label>
						<label for="crush">
						<input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
						<?php _e('crush') ?></label>
						<label for="date">
						<input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
						<?php _e('date') ?></label>
						<label for="romantic">
						<input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
						<?php _e('sweetheart') ?></label>
					</fieldset></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<p><?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p>
<?php
}
add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'advanced', 'core');

function link_advanced_meta_box($link) {
?>
<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
	<tr class="form-field">
		<th valign="top"  scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
		<td><input type="text" name="link_image" id="link_image" size="50" value="<?php echo $link->link_image; ?>" style="width: 95%" /></td>
	</tr>
	<tr class="form-field">
		<th valign="top"  scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>
		<td><input name="link_rss" type="text" id="rss_uri" value="<?php echo $link->link_rss; ?>" size="50" style="width: 95%" /></td>
	</tr>
	<tr class="form-field">
		<th valign="top"  scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
		<td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo $link->link_notes; ?></textarea></td>
	</tr>
	<tr class="form-field">
		<th valign="top"  scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>
		<td><select name="link_rating" id="link_rating" size="1">
		<?php
			for ($r = 0; $r < 10; $r++) {
				echo('            <option value="'.$r.'" ');
				if ($link->link_rating == $r)
					echo 'selected="selected"';
				echo('>'.$r.'</option>');
			}
		?></select>&nbsp;<?php _e('(Leave at 0 for no rating.)') ?>
		</td>
	</tr>
</table>
<?php
}
add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'advanced', 'core');

do_meta_boxes('link', 'advanced', $link);

if ( $link_id ) : ?>
<input type="hidden" name="action" value="save" />
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
<input type="hidden" name="order_by" value="<?php echo attribute_escape($order_by); ?>" />
<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
<?php else: ?>
<input type="hidden" name="action" value="add" />
<?php endif; ?>

</div>
</div>

</div>

</form>
                                                                                                                                                                                                                                                                                                                                                                                                                                    blog/wp-admin/edit-page-form.php                                                                    0000755 0023433 0004734 00000034667 11060470637 016425  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
if ( isset($_GET['message']) )
	$_GET['message'] = absint( $_GET['message'] );
$messages[1] = sprintf( __( 'Page updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( $_GET['_wp_original_http_referer'] ) ) );
$messages[2] = __('Custom field updated.');
$messages[3] = __('Custom field deleted.');
$messages[4] = __('Page updated.');

if ( isset($_GET['revision']) )
	$messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );

$notice = false;
$notices[1] = __( 'There is an autosave of this page that is more recent than the version below.  <a href="%s">View the autosave</a>.' );

if (!isset($post_ID) || 0 == $post_ID) {
	$form_action = 'post';
	$nonce_action = 'add-page';
	$temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
	$form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
} else {
	$post_ID = (int) $post_ID;
	$form_action = 'editpost';
	$nonce_action = 'update-page_' . $post_ID;
	$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
	$autosave = wp_get_post_autosave( $post_id );
	if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) )
		$notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
}

$temp_ID = (int) $temp_ID;
$user_ID = (int) $user_ID;

?>

<?php if ( $notice ) : ?>
<div id="notice" class="error"><p><?php echo $notice ?></p></div>
<?php endif; ?>
<?php if (isset($_GET['message'])) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
<?php endif; ?>

<form name="post" action="page.php" method="post" id="post">
<div class="wrap">
<h2><?php _e('Write Page') ?></h2>

<?php
wp_nonce_field($nonce_action);

if (isset($mode) && 'bookmarklet' == $mode)
	echo '<input type="hidden" name="mode" value="bookmarklet" />';
?>
<input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" />
<input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
<input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
<?php echo $form_extra ?>
<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
<?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>

<div id="poststuff">

<div class="submitbox" id="submitpage">

<div id="previewview">
<?php if ( 'publish' == $post->post_status ) { ?>
<a href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank"  tabindex="4"><?php _e('View this Page'); ?></a>
<?php } elseif ( 'edit' == $action ) { ?>
<a href="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" target="_blank" tabindex="4"><?php _e('Preview this Page'); ?></a>
<?php } ?>
</div>

<div class="inside">
<p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p>
<p>
<select name='post_status' tabindex='4' id='post_status'>
<?php // Show publish in dropdown if user can publish or if they can re-publish this page ('edit_published_pages')
// 'publish' option will be selected for published AND private posts (checkbox overrides dropdown)
if ( current_user_can('publish_pages') OR ( $post->post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) : 
?>
<option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option>
<?php endif; ?>
<?php if ( 'future' == $post->post_status ) : ?>
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Pending') ?></option>
<?php endif; ?>
<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Unpublished') ?></option>
</select>
</p>
<?php if ( current_user_can( 'publish_posts' ) ) : ?> 
<p id="private-checkbox"><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>
<?php endif; ?>

<?php
if ($post_ID) {
	if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
		$stamp = __('Scheduled for:<br />%1$s at %2$s');
	} else if ( 'publish' == $post->post_status ) { // already published
		$stamp = __('Published on:<br />%1$s at %2$s');
	} else if ( '0000-00-00 00:00:00' == $post->post_date ) { // draft, 1 or more saves, no date specified
		$stamp = __('Publish immediately');
	} else { // draft, 1 or more saves, date specified
		$stamp = __('Publish on:<br />%1$s at %2$s');
	}
	$date = mysql2date(get_option('date_format'), $post->post_date);
	$time = mysql2date(get_option('time_format'), $post->post_date);
} else { // draft (no saves, and thus no date specified)
	$stamp = __('Publish immediately');
	$date = mysql2date(get_option('date_format'), current_time('mysql'));
	$time = mysql2date(get_option('time_format'), current_time('mysql'));
}
?>
<p class="curtime"><?php printf($stamp, $date, $time); ?>
&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a></p>

<div id='timestampdiv' class='hide-if-js'><?php touch_time(($action == 'edit'),1,4); ?></div>

</div>

<p class="submit">
<input type="submit" name="save" class="button button-highlighted" value="<?php _e('Save'); ?>" tabindex="4" />
<?php
if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post_ID ) {
?>
<?php if ( current_user_can('publish_pages') ) : ?>
	<input name="publish" type="submit" class="button" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
<?php else : ?>
	<input name="publish" type="submit" class="button" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
<?php endif; ?>
<?php
}

if ( ('edit' == $action) && current_user_can('delete_page', $post_ID) )
	echo "<a class='submitdelete' href='" . wp_nonce_url("page.php?action=delete&amp;post=$post_ID", 'delete-page_' . $post_ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete&nbsp;page') . "</a>";
?>
<br class="clear" />
<?php if ($post_ID): ?>
<?php if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
	$last_user = get_userdata($last_id);
	printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
} else {
	printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
}
?>
<br class="clear" />
<?php endif; ?>
<span id="autosave"></span>
<span id="wp-word-count"></span>
</p>

<div class="side-info">
<h5><?php _e('Related') ?></h5>

<ul>
<?php if ($post_ID): ?>
<li><a href="edit-pages.php?page_id=<?php echo $post_ID ?>"><?php _e('See Comments on this Page') ?></a></li>
<?php endif; ?>
<li><a href="edit-comments.php"><?php _e('Manage All Comments') ?></a></li>
<li><a href="edit-pages.php"><?php _e('Manage All Pages') ?></a></li>
<?php do_action('page_relatedlinks_list'); ?>
</ul>
</div>
<?php do_action('submitpage_box'); ?>
</div>

<div id="post-body">
<div id="titlediv">
<h3><label for="title"><?php _e('Title') ?></label></h3>
<div id="titlewrap">
  <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" autocomplete="off" />
</div>
<div class="inside">
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
	<div id="edit-slug-box">
<?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
	echo $sample_permalink_html;
endif; ?>
	</div>
</div>
</div>

<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
<h3><label for="content"><?php _e('Page') ?></label></h3>
<?php the_editor($post->post_content); ?>
<?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
<?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?>
<?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?>
</div>

<?php do_meta_boxes('page', 'normal', $post); ?>

<?php do_action('edit_page_form'); ?>

<h2><?php _e('Advanced Options'); ?></h2>


<?php 
function page_custom_meta_box($post){
?>
<div id="postcustomstuff">
<table cellpadding="3">
<?php
$metadata = has_meta($post->ID);
list_meta($metadata);
?>

</table>
<?php
	meta_form();
?>
<div id="ajax-response"></div>
</div>
<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
<?php
}
add_meta_box('pagecustomdiv', __('Custom Fields'), 'page_custom_meta_box', 'page', 'advanced', 'core');

function page_comments_status_meta_box($post){
?>
<input name="advanced_view" type="hidden" value="1" />
<p><label for="comment_status" class="selectit">
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
<?php _e('Allow Comments') ?></label></p>
<p><label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label></p>
<p><?php _e('These settings apply to this page only. &#8220;Pings&#8221; are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p>
<?php 
}
add_meta_box('pagecommentstatusdiv', __('Comments &amp; Pings'), 'page_comments_status_meta_box', 'page', 'advanced', 'core');

function page_password_meta_box($post){
?>
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this page and its comments.'); ?></p>
<?php
}
add_meta_box('pagepassworddiv', __('Password Protect This Page'), 'page_password_meta_box', 'page', 'advanced', 'core');

function page_slug_meta_box($post){
?>
<label class="hidden" for="post_name"><?php _e('Page Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
<?php
}
add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', 'advanced', 'core');

function page_parent_meta_box($post){
?>
<label class="hidden" for="parent_id"><?php _e('Page Parent') ?></label>
<select name="parent_id" id="parent_id">
<option value='0'><?php _e('Main Page (no parent)'); ?></option>
<?php parent_dropdown($post->post_parent); ?>
</select>
<p><?php _e('You can arrange your pages in hierarchies, for example you could have an &#8220;About&#8221; page that has &#8220;Life Story&#8221; and &#8220;My Dog&#8221; pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
<?php
}
add_meta_box('pageparentdiv', __('Page Parent'), 'page_parent_meta_box', 'page', 'advanced', 'core');

if ( 0 != count( get_page_templates() ) ) {
	function page_template_meta_box($post){
?>
<label class="hidden" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
<option value='default'><?php _e('Default Template'); ?></option>
<?php page_template_dropdown($post->page_template); ?>
</select>
<p><?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you&#8217;ll see them above.'); ?></p>
<?php
	}
	add_meta_box('pagetemplatediv', __('Page Template'), 'page_template_meta_box', 'page', 'advanced', 'core');
}

function page_order_meta_box($post){
?>
<p><label class="hidden" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p>
<p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it&#8217;ll be better in future releases.)'); ?></p>
<?php
}
add_meta_box('pageorderdiv', __('Page Order'), 'page_order_meta_box', 'page', 'advanced', 'core');


$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
if ( $post->post_author && !in_array($post->post_author, $authors) )
	$authors[] = $post->post_author;
if ( $authors && count( $authors ) > 1 ) {
	function page_author_meta_box($post){
		global $current_user, $user_ID;
		$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
		if ( $post->post_author && !in_array($post->post_author, $authors) )
			$authors[] = $post->post_author;
?>
<label class="hidden" for="post_author_override"><?php _e('Page Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
<?php
	}
	add_meta_box('pageauthordiv', __('Page Author'), 'page_author_meta_box', 'page', 'advanced', 'core');
}


if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
function page_revisions_meta_box($post) {
	wp_list_post_revisions();
}
add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', 'advanced', 'core');
endif;

do_meta_boxes('page', 'advanced', $post);
?>

</div>
</div>

</div>

</form>

<script type="text/javascript">
try{document.post.title.focus();}catch(e){}
</script>
                                                                         blog/wp-admin/edit-pages.php                                                                        0000755 0023433 0004734 00000016224 11060470640 015626  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
require_once('admin.php');

// Handle bulk deletes
if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
	check_admin_referer('bulk-pages');
	foreach( (array) $_GET['delete'] as $post_id_del ) {
		$post_del = & get_post($post_id_del);

		if ( !current_user_can('delete_page', $post_id_del) )
			wp_die( __('You are not allowed to delete this page.') );

		if ( $post_del->post_type == 'attachment' ) {
			if ( ! wp_delete_attachment($post_id_del) )
				wp_die( __('Error in deleting...') );
		} else {
			if ( !wp_delete_post($post_id_del) )
				wp_die( __('Error in deleting...') );
		}
	}

	$sendback = wp_get_referer();
	if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php');
	elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
	$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);

	wp_redirect($sendback);
	exit();
} elseif ( !empty($_GET['_wp_http_referer']) ) {
	 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
	 exit;
}

$title = __('Pages');
$parent_file = 'edit.php';
wp_enqueue_script('admin-forms');

$post_stati  = array(	//	array( adj, noun )
		'publish' => array(__('Published'), __('Published pages'), __ngettext_noop('Published (%s)', 'Published (%s)')),
		'future' => array(__('Scheduled'), __('Scheduled pages'), __ngettext_noop('Scheduled (%s)', 'Scheduled (%s)')),
		'pending' => array(__('Pending Review'), __('Pending pages'), __ngettext_noop('Pending Review (%s)', 'Pending Review (%s)')),
		'draft' => array(__('Draft'), _c('Drafts|manage posts header'), __ngettext_noop('Draft (%s)', 'Drafts (%s)')),
		'private' => array(__('Private'), __('Private pages'), __ngettext_noop('Private (%s)', 'Private (%s)'))
	);

$post_status_label = __('Manage Pages');
$post_status_q = '';
if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) {
	$post_status_label = $post_stati[$_GET['post_status']][1];
	$post_status_q = '&post_status=' . $_GET['post_status'];
	$post_status_q .= '&perm=readable';
}

$query_str = "post_type=page&orderby=menu_order title&what_to_show=posts$post_status_q&posts_per_page=-1&posts_per_archive_page=-1&order=asc";

$query_str = apply_filters('manage_pages_query', $query_str);
wp($query_str);

if ( is_singular() )
	wp_enqueue_script( 'admin-comments' );
require_once('admin-header.php');

?>
<div class="wrap">
<form id="posts-filter" action="" method="get">
<h2><?php
// Use $_GET instead of is_ since they can override each other
$h2_search = isset($_GET['s']) && $_GET['s'] ? ' ' . sprintf(__('matching &#8220;%s&#8221;'), wp_specialchars( stripslashes( $_GET['s'] ) ) ) : '';
$h2_author = '';
if ( isset($_GET['author']) && $_GET['author'] ) {
	$author_user = get_userdata( (int) $_GET['author'] );
	$h2_author = ' ' . sprintf(__('by %s'), wp_specialchars( $author_user->display_name ));
}
printf( _c( '%1$s%2$s%3$s|You can reorder these: 1: Pages, 2: by {s}, 3: matching {s}' ), $post_status_label, $h2_author, $h2_search );
?></h2>

<ul class="subsubsub">
<?php

$avail_post_stati = get_available_post_statuses('page');

$status_links = array();
$num_posts = wp_count_posts('page', 'readable');
$class = empty($_GET['post_status']) ? ' class="current"' : '';
$status_links[] = "<li><a href=\"edit-pages.php\"$class>".__('All Pages')."</a>";
foreach ( $post_stati as $status => $label ) {
	$class = '';

	if ( !in_array($status, $avail_post_stati) )
		continue;

	if ( $status == $_GET['post_status'] )
		$class = ' class="current"';

	$status_links[] = "<li><a href=\"edit-pages.php?post_status=$status\"$class>" .
	sprintf(__ngettext($label[2][0], $label[2][1], $num_posts->$status), number_format_i18n( $num_posts->$status ) ) . '</a>';
}
echo implode(' |</li>', $status_links) . '</li>';
unset($status_links);
?>
</ul>

<?php if ( isset($_GET['post_status'] ) ) : ?>
<input type="hidden" name="post_status" value="<?php echo attribute_escape($_GET['post_status']) ?>" />
<?php
endif;
if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
<div id="message" class="updated fade"><p><strong><?php _e('Your page has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View page'); ?></a> | <a href="page.php?action=edit&amp;post=<?php echo $_GET['posted']; ?>"><?php _e('Edit page'); ?></a></p></div>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
endif;
?>

<p id="post-search">
	<label class="hidden" for="post-search-input"><?php _e( 'Search Pages' ); ?>:</label>
	<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
	<input type="submit" value="<?php _e( 'Search Pages' ); ?>" class="button" />
</p>

<div class="tablenav">

<?php
$pagenum = absint( $_GET['pagenum'] );
if ( empty($pagenum) )
	$pagenum = 1;
if( !$per_page || $per_page < 0 )
	$per_page = 20;

$num_pages = ceil(count($posts) / $per_page);
$page_links = paginate_links( array(
	'base' => add_query_arg( 'pagenum', '%#%' ),
	'format' => '',
	'total' => $num_pages,
	'current' => $pagenum
));

if ( $page_links )
	echo "<div class='tablenav-pages'>$page_links</div>";
?>

<div class="alignleft">
<input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" />
<?php wp_nonce_field('bulk-pages'); ?>
</div>

<br class="clear" />
</div>

<br class="clear" />

<?php

$all = !( $h2_search || $post_status_q );

if ($posts) {
?>
<table class="widefat">
  <thead>
  <tr>
<?php $posts_columns = wp_manage_pages_columns(); ?>
<?php foreach($posts_columns as $post_column_key => $column_display_name) {
	if ( 'cb' === $post_column_key )
		$class = ' class="check-column"';
	elseif ( 'comments' === $post_column_key )
		$class = ' class="num"';
	else
		$class = '';
?>
	<th scope="col"<?php echo $class; ?>><?php echo $column_display_name; ?></th>
<?php } ?>
  </tr>
  </thead>
  <tbody>
  <?php page_rows($posts, $pagenum, $per_page); ?>
  </tbody>
</table>

</form>

<div id="ajax-response"></div>

<?php
} else {
?>
</form>
<p><?php _e('No pages found.') ?></p>
<?php
} // end if ($posts)
?>

<div class="tablenav">
<?php
if ( $page_links )
	echo "<div class='tablenav-pages'>$page_links</div>";
?>
<br class="clear" />
</div>

<?php

if ( 1 == count($posts) && is_singular() ) :

	$comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) );
	if ( $comments ) :
		// Make sure comments, post, and post_author are cached
		update_comment_cache($comments);
		$post = get_post($id);
		$authordata = get_userdata($post->post_author);
	?>

<br class="clear" />

<table class="widefat" style="margin-top: .5em">
<thead>
  <tr>
    <th scope="col"><?php _e('Comment') ?></th>
    <th scope="col"><?php _e('Date') ?></th>
    <th scope="col"><?php _e('Actions') ?></th>
  </tr>
</thead>
<tbody id="the-comment-list" class="list:comment">
<?php
	foreach ($comments as $comment)
		_wp_comment_row( $comment->comment_ID, 'detail', false, false );
?>
</tbody>
</table>

<?php

endif; // comments
endif; // posts;

?>

</div>

<?php include('admin-footer.php'); ?>
                                                                                                                                                                                                                                                                                                                                                                            blog/wp-admin/edit-post-rows.php                                                                    0000755 0023433 0004734 00000013630 11060470640 016502  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php if ( ! defined('ABSPATH') ) die(); ?>
<table class="widefat">
	<thead>
	<tr>

<?php $posts_columns = wp_manage_posts_columns(); ?>
<?php foreach($posts_columns as $post_column_key => $column_display_name) {
	if ( 'cb' === $post_column_key )
		$class = ' class="check-column"';
	elseif ( 'comments' === $post_column_key )
		$class = ' class="num"';
	else
		$class = '';
?>
	<th scope="col"<?php echo $class; ?>><?php echo $column_display_name; ?></th>
<?php } ?>

	</tr>
	</thead>
	<tbody>
<?php
if ( have_posts() ) {
$bgcolor = '';
add_filter('the_title','wp_specialchars');

// Create array of post IDs.
$post_ids = array();
foreach ( $wp_query->posts as $a_post )
	$post_ids[] = $a_post->ID;

$comment_pending_count = get_pending_comments_num($post_ids);

while (have_posts()) : the_post();
$class = 'alternate' == $class ? '' : 'alternate';
global $current_user;
$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
$title = get_the_title();
if ( empty($title) )
	$title = __('(no title)');
?>
	<tr id='post-<?php echo $id; ?>' class='<?php echo trim( $class . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">

<?php

foreach($posts_columns as $column_name=>$column_display_name) {

	switch($column_name) {

	case 'cb':
		?>
		<th scope="row" class="check-column"><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><input type="checkbox" name="delete[]" value="<?php the_ID(); ?>" /><?php } ?></th>
		<?php
		break;
	case 'modified':
	case 'date':
		if ( '0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name ) {
			$t_time = $h_time = __('Unpublished');
		} else {
			if ( 'modified' == $column_name ) {
				$t_time = get_the_modified_time(__('Y/m/d g:i:s A'));
				$m_time = $post->post_modified;
				$time = get_post_modified_time('G', true);
			} else {
				$t_time = get_the_time(__('Y/m/d g:i:s A'));
				$m_time = $post->post_date;
				$time = get_post_time('G', true);
			}
			if ( ( abs(time() - $time) ) < 86400 ) {
				if ( ( 'future' == $post->post_status) )
					$h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
				else
					$h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
			} else {
				$h_time = mysql2date(__('Y/m/d'), $m_time);
			}
		}
		?>
		<td><abbr title="<?php echo $t_time ?>"><?php echo apply_filters('post_date_column_time', $h_time, $post, $column_name) ?></abbr></td>
		<?php
		break;
	case 'title':
		?>
		<td><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a class="row-title" href="post.php?action=edit&amp;post=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; } ?></strong>
		<?php if ( !empty($post->post_password) ) { _e(' &#8212; <strong>Protected</strong>'); } elseif ('private' == $post->post_status) { _e(' &#8212; <strong>Private</strong>'); } ?></td>
		<?php
		break;

	case 'categories':
		?>
		<td><?php
		$categories = get_the_category();
		if ( !empty( $categories ) ) {
			$out = array();
			foreach ( $categories as $c )
				$out[] = "<a href='edit.php?category_name=$c->slug'> " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>";
			echo join( ', ', $out );
		} else {
			_e('Uncategorized');
		}
		?></td>
		<?php
		break;

	case 'tags':
		?>
		<td><?php
		$tags = get_the_tags();
		if ( !empty( $tags ) ) {
			$out = array();
			foreach ( $tags as $c )
				$out[] = "<a href='edit.php?tag=$c->slug'> " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . "</a>";
			echo join( ', ', $out );
		} else {
			_e('No Tags');
		}
		?></td>
		<?php
		break;

	case 'comments':
		?>
		<td class="num"><div class="post-com-count-wrapper">
		<?php
		$left = isset($comment_pending_count) ? $comment_pending_count[$post->ID] : 0;
		$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
		if ( $left )
			echo '<strong>';
		comments_number("<a href='edit.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
		if ( $left )
			echo '</strong>';
		?>
		</div></td>
		<?php
		break;

	case 'author':
		?>
		<td><a href="edit.php?author=<?php the_author_ID(); ?>"><?php the_author() ?></a></td>
		<?php
		break;

	case 'status':
		?>
		<td>
		<a href="<?php the_permalink(); ?>" title="<?php echo attribute_escape(sprintf(__('View "%s"'), $title)); ?>" rel="permalink">
		<?php
		switch ( $post->post_status ) {
			case 'publish' :
			case 'private' :
				_e('Published');
				break;
			case 'future' :
				_e('Scheduled');
				break;
			case 'pending' :
				_e('Pending Review');
				break;
			case 'draft' :
				_e('Unpublished');
				break;
		}
		?>
		</a>
		</td>
		<?php
		break;

	case 'control_view':
		?>
		<td><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e('View'); ?></a></td>
		<?php
		break;

	case 'control_edit':
		?>
		<td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
		<?php
		break;

	case 'control_delete':
		?>
		<td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-post_' . $post->ID) . "' class='delete'>" . __('Delete') . "</a>"; } ?></td>
		<?php
		break;

	default:
		?>
		<td><?php do_action('manage_posts_custom_column', $column_name, $id); ?></td>
		<?php
		break;
	}
}
?>
	</tr>
<?php
endwhile;
} else {
?>
  <tr style='background-color: <?php echo $bgcolor; ?>'>
    <td colspan="8"><?php _e('No posts found.') ?></td>
  </tr>
<?php
} // end if ( have_posts() )
?>
	</tbody>
</table>
                                                                                                        blog/wp-admin/edit-tag-form.php                                                                     0000755 0023433 0004734 00000003564 11060470641 016247  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
if ( ! empty($tag_ID) ) {
	$heading = __('Edit Tag');
	$submit_text = __('Edit Tag');
	$form = '<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate">';
	$action = 'editedtag';
	$nonce_action = 'update-tag_' . $tag_ID;
	do_action('edit_tag_form_pre', $tag);
} else {
	$heading = __('Add Tag');
	$submit_text = __('Add Tag');
	$form = '<form name="addtag" id="addtag" method="post" action="edit-tags.php" class="add:the-list: validate">';
	$action = 'addtag';
	$nonce_action = 'add-tag';
	do_action('add_tag_form_pre', $tag);
}
?>

<div class="wrap">
<h2><?php echo $heading ?></h2>
<div id="ajax-response"></div>
<?php echo $form ?>
<input type="hidden" name="action" value="<?php echo $action ?>" />
<input type="hidden" name="tag_ID" value="<?php echo $tag->term_id ?>" />
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field($nonce_action); ?>
	<table class="form-table">
		<tr class="form-field form-required">
			<th scope="row" valign="top"><label for="name"><?php _e('Tag name') ?></label></th>
			<td><input name="name" id="name" type="text" value="<?php echo attribute_escape($tag->name); ?>" size="40" aria-required="true" />
            <p><?php _e('The name is how the tag appears on your site.'); ?></p></td>
		</tr>
		<tr class="form-field">
			<th scope="row" valign="top"><label for="slug"><?php _e('Tag slug') ?></label></th>
			<td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
            <p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td>
		</tr>
	</table>
<p class="submit"><input type="submit" class="button" name="submit" value="<?php echo $submit_text ?>" /></p>
<?php do_action('edit_tag_form', $tag); ?>
</form>
</div>
                                                                                                                                            blog/wp-admin/edit-tags.php                                                                         0000755 0023433 0004734 00000011461 11060470642 015465  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
require_once('admin.php');

$title = __('Tags');
$parent_file = 'edit.php';

wp_reset_vars(array('action', 'tag'));

if ( isset($_GET['deleteit']) && isset($_GET['delete_tags']) )
	$action = 'bulk-delete';

switch($action) {

case 'addtag':

	check_admin_referer('add-tag');

	if ( !current_user_can('manage_categories') )
		wp_die(__('Cheatin&#8217; uh?'));

	$ret = wp_insert_term($_POST['name'], 'post_tag', $_POST);
	if ( $ret && !is_wp_error( $ret ) ) {
		wp_redirect('edit-tags.php?message=1#addtag');
	} else {
		wp_redirect('edit-tags.php?message=4#addtag');
	}
	exit;
break;

case 'delete':
	$tag_ID = (int) $_GET['tag_ID'];
	check_admin_referer('delete-tag_' .  $tag_ID);

	if ( !current_user_can('manage_categories') )
		wp_die(__('Cheatin&#8217; uh?'));

	wp_delete_term( $tag_ID, 'post_tag');

	wp_redirect('edit-tags.php?message=2');
	exit;

break;

case 'bulk-delete':
	check_admin_referer('bulk-tags');

	if ( !current_user_can('manage_categories') )
		wp_die(__('Cheatin&#8217; uh?'));

	$tags = $_GET['delete_tags'];
	foreach( (array) $tags as $tag_ID ) {
		wp_delete_term( $tag_ID, 'post_tag');
	}

	$location = 'edit-tags.php';
	if ( $referer = wp_get_referer() ) {
		if ( false !== strpos($referer, 'edit-tags.php') )
			$location = $referer;
	}

	$location = add_query_arg('message', 6, $location);
	wp_redirect($location);
	exit;

break;

case 'edit':

	require_once ('admin-header.php');
	$tag_ID = (int) $_GET['tag_ID'];

	$tag = get_term($tag_ID, 'post_tag', OBJECT, 'edit');
	include('edit-tag-form.php');

break;

case 'editedtag':
	$tag_ID = (int) $_POST['tag_ID'];
	check_admin_referer('update-tag_' . $tag_ID);

	if ( !current_user_can('manage_categories') )
		wp_die(__('Cheatin&#8217; uh?'));

	$ret = wp_update_term($tag_ID, 'post_tag', $_POST);

	$location = 'edit-tags.php';
	if ( $referer = wp_get_original_referer() ) {
		if ( false !== strpos($referer, 'edit-tags.php') )
			$location = $referer;
	}

	if ( $ret && !is_wp_error( $ret ) )
		$location = add_query_arg('message', 3, $location);
	else
		$location = add_query_arg('message', 5, $location);

	wp_redirect($location);
	exit;
break;

default:

if ( !empty($_GET['_wp_http_referer']) ) {
	 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
	 exit;
}

wp_enqueue_script( 'admin-tags' );
wp_enqueue_script('admin-forms');

require_once ('admin-header.php');

$messages[1] = __('Tag added.');
$messages[2] = __('Tag deleted.');
$messages[3] = __('Tag updated.');
$messages[4] = __('Tag not added.');
$messages[5] = __('Tag not updated.');
$messages[6] = __('Tags deleted.');
?>

<?php if (isset($_GET['message'])) : ?>
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
endif; ?>

<div class="wrap">

<form id="posts-filter" action="" method="get">
<?php if ( current_user_can('manage_categories') ) : ?>
	<h2><?php printf(__('Manage Tags (<a href="%s">add new</a>)'), '#addtag') ?> </h2>
<?php else : ?>
	<h2><?php _e('Manage Tags') ?> </h2>
<?php endif; ?>

<p id="post-search">
	<label class="hidden" for="post-search-input"><?php _e( 'Search Tags' ); ?>:</label>
	<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
	<input type="submit" value="<?php _e( 'Search Tags' ); ?>" class="button" />
</p>

<br class="clear" />

<div class="tablenav">

<?php
$pagenum = absint( $_GET['pagenum'] );
if ( empty($pagenum) )
	$pagenum = 1;
if( !$tagsperpage || $tagsperpage < 0 )
	$tagsperpage = 20;

$page_links = paginate_links( array(
	'base' => add_query_arg( 'pagenum', '%#%' ),
	'format' => '',
	'total' => ceil(wp_count_terms('post_tag') / $tagsperpage),
	'current' => $pagenum
));

if ( $page_links )
	echo "<div class='tablenav-pages'>$page_links</div>";
?>

<div class="alignleft">
<input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" />
<?php wp_nonce_field('bulk-tags'); ?>
</div>

<br class="clear" />
</div>

<br class="clear" />

<table class="widefat">
	<thead>
	<tr>
	<th scope="col" class="check-column"><input type="checkbox" /></th>
        <th scope="col"><?php _e('Name') ?></th>
        <th scope="col" class="num" style="width: 90px"><?php _e('Posts') ?></th>
	</tr>
	</thead>
	<tbody id="the-list" class="list:tag">
<?php

$searchterms = trim( $_GET['s'] );

$count = tag_rows( $pagenum, $tagsperpage, $searchterms );
?>
	</tbody>
</table>
</form>

<div class="tablenav">

<?php
if ( $page_links )
	echo "<div class='tablenav-pages'>$page_links</div>";
?>
<br class="clear" />
</div>
<br class="clear" />

</div>

<?php if ( current_user_can('manage_categories') ) : ?>

<br />
<?php include('edit-tag-form.php'); ?>

<?php endif; ?>

<?php
break;
}

include('admin-footer.php');

?>
                                                                                                                                                                                                               blog/wp-admin/edit.php                                                                              0000755 0023433 0004734 00000017410 11060470643 014532  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
require_once('admin.php');

// Handle bulk deletes
if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
	check_admin_referer('bulk-posts');
	foreach( (array) $_GET['delete'] as $post_id_del ) {
		$post_del = & get_post($post_id_del);

		if ( !current_user_can('delete_post', $post_id_del) )
			wp_die( __('You are not allowed to delete this post.') );

		if ( $post_del->post_type == 'attachment' ) {
			if ( ! wp_delete_attachment($post_id_del) )
				wp_die( __('Error in deleting...') );
		} else {
			if ( !wp_delete_post($post_id_del) )
				wp_die( __('Error in deleting...') );
		}
	}

	$sendback = wp_get_referer();
	if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('post-new.php');
	elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
	$sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);

	wp_redirect($sendback);
	exit();
} elseif ( !empty($_GET['_wp_http_referer']) ) {
	 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
	 exit;
}

$title = __('Posts');
$parent_file = 'edit.php';
wp_enqueue_script('admin-forms');

list($post_stati, $avail_post_stati) = wp_edit_posts_query();

if ( 1 == count($posts) && is_singular() )
	wp_enqueue_script( 'admin-comments' );
require_once('admin-header.php');

if ( !isset( $_GET['paged'] ) )
	$_GET['paged'] = 1;

?>

<div class="wrap">

<form id="posts-filter" action="" method="get">
<h2><?php
if ( is_single() ) {
	printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title));
} else {
	$post_status_label = _c('Manage Posts|manage posts header');
	if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) )
        $post_status_label = $post_stati[$_GET['post_status']][1];
	if ( $post_listing_pageable && !is_archive() && !is_search() )
		$h2_noun = is_paged() ? sprintf(__( 'Previous %s' ), $post_status_label) : sprintf(__('Latest %s'), $post_status_label);
	else
		$h2_noun = $post_status_label;
	// Use $_GET instead of is_ since they can override each other
	$h2_author = '';
	$_GET['author'] = (int) $_GET['author'];
	if ( $_GET['author'] != 0 ) {
		if ( $_GET['author'] == '-' . $user_ID ) { // author exclusion
			$h2_author = ' ' . __('by other authors');
		} else {
			$author_user = get_userdata( get_query_var( 'author' ) );
			$h2_author = ' ' . sprintf(__('by %s'), wp_specialchars( $author_user->display_name ));
		}
	}
	$h2_search = isset($_GET['s'])   && $_GET['s']   ? ' ' . sprintf(__('matching &#8220;%s&#8221;'), wp_specialchars( get_search_query() ) ) : '';
	$h2_cat    = isset($_GET['cat']) && $_GET['cat'] ? ' ' . sprintf( __('in &#8220;%s&#8221;'), single_cat_title('', false) ) : '';
	$h2_tag    = isset($_GET['tag']) && $_GET['tag'] ? ' ' . sprintf( __('tagged with &#8220;%s&#8221;'), single_tag_title('', false) ) : '';
	$h2_month  = isset($_GET['m'])   && $_GET['m']   ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : '';
	printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s|You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: tagged with {s}, 6: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_tag, $h2_month );
}
?></h2>

<ul class="subsubsub">
<?php
$status_links = array();
$num_posts = wp_count_posts( 'post', 'readable' );
$class = empty( $_GET['post_status'] ) ? ' class="current"' : '';
$status_links[] = "<li><a href='edit.php' $class>" . __('All Posts') . '</a>';
foreach ( $post_stati as $status => $label ) {
	$class = '';

	if ( !in_array( $status, $avail_post_stati ) )
		continue;

	if ( empty( $num_posts->$status ) )
		continue;
	if ( $status == $_GET['post_status'] )
		$class = ' class="current"';

	$status_links[] = "<li><a href='edit.php?post_status=$status' $class>" .
	sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
}
echo implode( ' |</li>', $status_links ) . '</li>';
unset( $status_links );
?>
</ul>

<?php if ( isset($_GET['post_status'] ) ) : ?>
<input type="hidden" name="post_status" value="<?php echo attribute_escape($_GET['post_status']) ?>" />
<?php
endif;

if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
<div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View post'); ?></a> | <a href="post.php?action=edit&amp;post=<?php echo $_GET['posted']; ?>"><?php _e('Edit post'); ?></a></p></div>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
endif;
?>

<p id="post-search">
	<label class="hidden" for="post-search-input"><?php _e( 'Search Posts' ); ?>:</label>
	<input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />
	<input type="submit" value="<?php _e( 'Search Posts' ); ?>" class="button" />
</p>

<div class="tablenav">

<?php
$page_links = paginate_links( array(
	'base' => add_query_arg( 'paged', '%#%' ),
	'format' => '',
	'total' => $wp_query->max_num_pages,
	'current' => $_GET['paged']
));

if ( $page_links )
	echo "<div class='tablenav-pages'>$page_links</div>";
?>

<div class="alignleft">
<input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" />
<?php wp_nonce_field('bulk-posts'); ?>
<?php
if ( !is_singular() ) {
$arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'post' ORDER BY post_date DESC";

$arc_result = $wpdb->get_results( $arc_query );

$month_count = count($arc_result);

if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ?>
<select name='m'>
<option<?php selected( @$_GET['m'], 0 ); ?> value='0'><?php _e('Show all dates'); ?></option>
<?php
foreach ($arc_result as $arc_row) {
	if ( $arc_row->yyear == 0 )
		continue;
	$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );

	if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] )
		$default = ' selected="selected"';
	else
		$default = '';

	echo "<option$default value='$arc_row->yyear$arc_row->mmonth'>";
	echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";
	echo "</option>\n";
}
?>
</select>
<?php } ?>

<?php
$dropdown_options = array('show_option_all' => __('View all categories'), 'hide_empty' => 0, 'hierarchical' => 1,
	'show_count' => 0, 'orderby' => 'name', 'selected' => $cat);
wp_dropdown_categories($dropdown_options);
do_action('restrict_manage_posts');
?>
<input type="submit" id="post-query-submit" value="<?php _e('Filter'); ?>" class="button-secondary" />

<?php } ?>
</div>

<br class="clear" />
</div>

<br class="clear" />

<?php include( 'edit-post-rows.php' ); ?>

</form>

<div id="ajax-response"></div>

<div class="tablenav">

<?php
if ( $page_links )
	echo "<div class='tablenav-pages'>$page_links</div>";
?>

<br class="clear" />
</div>

<br class="clear" />

<?php

if ( 1 == count($posts) && is_singular() ) :

	$comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) );
	if ( $comments ) :
		// Make sure comments, post, and post_author are cached
		update_comment_cache($comments);
		$post = get_post($id);
		$authordata = get_userdata($post->post_author);
	?>

<br class="clear" />

<table class="widefat" style="margin-top: .5em">
<thead>
  <tr>
    <th scope="col"><?php _e('Comment') ?></th>
    <th scope="col"><?php _e('Date') ?></th>
    <th scope="col"><?php _e('Actions') ?></th>
  </tr>
</thead>
<tbody id="the-comment-list" class="list:comment">
<?php
	foreach ($comments as $comment)
		_wp_comment_row( $comment->comment_ID, 'detail', false, false );
?>
</tbody>
</table>

<?php

endif; // comments
endif; // posts;

?>

</div>

<?php include('admin-footer.php'); ?>
                                                                                                                                                                                                                                                        blog/wp-admin/export.php                                                                            0000755 0023433 0004734 00000002667 11060470643 015136  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
require_once ('admin.php');
require_once('includes/export.php');
$title = __('Export');
$parent_file = 'edit.php';

if ( isset( $_GET['download'] ) ) {
	export_wp( $_GET['author'] );
	die();
}

require_once ('admin-header.php');
?>

<div class="wrap">
<h2><?php _e('Export'); ?></h2>
<p><?php _e('When you click the button below WordPress will create an XML file for you to save to your computer.'); ?></p>
<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags.'); ?></p>
<p><?php _e('Once you&#8217;ve saved the download file, you can use the Import function on another WordPress blog to import this blog.'); ?></p>
<form action="" method="get">
<h3><?php _e('Options'); ?></h3>

<table class="form-table">
<tr>
<th><label for="author"><?php _e('Restrict Author'); ?></label></th>
<td>
<select name="author" id="author">
<option value="all" selected="selected"><?php _e('All Authors'); ?></option>
<?php
$authors = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" );
foreach ( $authors as $id ) {
	$o = get_userdata( $id );
	echo "<option value='$o->ID'>$o->display_name</option>";
}
?>
</select>
</td>
</tr>
</table>
<p class="submit"><input type="submit" name="submit" value="<?php _e('Download Export File'); ?>" />
<input type="hidden" name="download" value="true" />
</p>
</form>
</div>

<?php


include ('admin-footer.php');
?>
                                                                         blog/wp-admin/gears-manifest.php                                                                    0000755 0023433 0004734 00000025626 11060470644 016523  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

define( 'ABSPATH', dirname(dirname(__FILE__)) );
define( 'WPINC', '/wp-includes' );

function __() {}
function add_filter() {}
function attribute_escape() {}
function apply_filters() {}
function get_option() {}
function is_lighttpd_before_150() {}
function add_action() {}
function do_action_ref_array() {}
function get_bloginfo() {}
function is_admin() {return true;}
function site_url() {}
function admin_url() {}
function wp_guess_url() {}

require(ABSPATH . '/wp-includes/script-loader.php');
require(ABSPATH . '/wp-includes/version.php');

$wp_scripts = new WP_Scripts();
wp_default_scripts($wp_scripts);

$wp_styles = new WP_Styles();
wp_default_styles($wp_styles);

$defaults = $man_version = '';
foreach ( $wp_scripts->registered as $script ) {
	if ( empty($script->src) || strpos($script->src, 'tiny_mce_config.php') ) continue;
	$ver = empty($script->ver) ? $wp_version : $script->ver;
	$src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $script->src );
	$defaults .= '{ "url" : "' . $src . '?ver=' . $ver . '" },' . "\n";
	$man_version .= $ver;
}

foreach ( $wp_styles->registered as $style ) {
	if ( empty($style->src) ) continue;

	$ver = empty($style->ver) ? $wp_version : $style->ver;
	$src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->src );
	if ( 'colors' == $style->handle ) $src = 'css/colors-classic.css';
	$defaults .= '{ "url" : "' . $src . '?ver=' . $ver . '" },' . "\n";

	if ( isset($style->extra['rtl']) && $style->extra['rtl'] ) {
		if ( is_bool( $style->extra['rtl'] ) )
			$rtl_href = str_replace( '.css', '-rtl.css', $src );
		else 
			$rtl_href = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->extra['rtl'] );

		$defaults .= '{ "url" : "' . $rtl_href . '?ver=' . $ver . '" },' . "\n";
	}
	$man_version .= $ver;
}

$man_version = md5($man_version);

header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
header( 'Pragma: no-cache' );
header( 'Content-Type: application/x-javascript; charset=UTF-8' );
?>
{
"betaManifestVersion" : 1,
"version" : "<?php echo $man_version; ?>_20080810",
"entries" : [
<?php echo $defaults; ?>

{ "url" : "images/align-center.png" },
{ "url" : "images/align-left.png" },
{ "url" : "images/align-none.png" },
{ "url" : "images/align-right.png" },
{ "url" : "images/browse-happy.gif" },
{ "url" : "images/bubble_bg.gif" },
{ "url" : "images/comment-grey-bubble.png" },
{ "url" : "images/comment-pill.gif" },
{ "url" : "images/comment-stalk-classic.gif" },
{ "url" : "images/comment-stalk-fresh.gif" },
{ "url" : "images/comment-stalk-rtl.gif" },
{ "url" : "images/date-button.gif" },
{ "url" : "images/fade-butt.png" },
{ "url" : "images/gear.png" },
{ "url" : "images/logo-ghost.png" },
{ "url" : "images/logo-login.gif" },
{ "url" : "images/logo.gif" },
{ "url" : "images/media-button-gallery.gif" },
{ "url" : "images/media-button-image.gif" },
{ "url" : "images/media-button-music.gif" },
{ "url" : "images/media-button-other.gif" },
{ "url" : "images/media-button-video.gif" },
{ "url" : "images/media-buttons.gif" },
{ "url" : "images/tab.png" },
{ "url" : "images/tail.gif" },
{ "url" : "images/toggle-arrow-rtl.gif" },
{ "url" : "images/toggle-arrow.gif" },
{ "url" : "images/wordpress-logo.png" },
{ "url" : "images/xit.gif" },
{ "url" : "images/loading-publish.gif" },
{ "url" : "images/loading.gif" },
{ "url" : "images/required.gif" },
{ "url" : "images/no.png" },
{ "url" : "images/yes.png" },

<?php if ( is_file(ABSPATH.'/wp-includes/js/tinymce/tiny_mce.js') ) { ?>
{ "url" : "../wp-includes/js/tinymce/tiny_mce_popup.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/utils/mctabs.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/utils/validate.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/utils/form_utils.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/utils/editable_selects.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/js/media.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311g" },
{ "url" : "../wp-includes/js/tinymce/tiny_mce.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=311" },

{ "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/image.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/link.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/media.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311g" },
{ "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" },

{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/css/content.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311g" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" },

{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/icons.gif" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/colorpicker.jpg" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/fm.gif" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/gotmoxie.png" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/sflogo.png" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/fade-butt.png" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/tabs.gif" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/progress.gif" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_check.gif" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_arrow.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/drag.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/flash.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/flv_player.swf" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/quicktime.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/realmedia.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/shockwave.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/windowsmedia.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/trans.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/more.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/page.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/image.png" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/help.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/image.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/media.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/video.gif" },
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/audio.gif" },
<?php } ?>

{ "url" : "../wp-includes/images/crystal/archive.png" },
{ "url" : "../wp-includes/images/crystal/audio.png" },
{ "url" : "../wp-includes/images/crystal/code.png" },
{ "url" : "../wp-includes/images/crystal/default.png" },
{ "url" : "../wp-includes/images/crystal/document.png" },
{ "url" : "../wp-includes/images/crystal/interactive.png" },
{ "url" : "../wp-includes/images/crystal/text.png" },
{ "url" : "../wp-includes/images/crystal/video.png" },
{ "url" : "../wp-includes/images/crystal/spreadsheet.png" },
{ "url" : "../wp-includes/images/rss.png" },
{ "url" : "../wp-includes/js/thickbox/loadingAnimation.gif" },
{ "url" : "../wp-includes/js/thickbox/tb-close.png" },
{ "url" : "../wp-includes/js/swfupload/swfupload_f9.swf" }
]}
                                                                                                          blog/wp-admin/includes/                                                                             0000755 0023433 0004734 00000000000 11060470750 014673  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 blog/wp-admin/includes/admin.php                                                                    0000755 0023433 0004734 00000001515 11060470717 016504  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

require_once(ABSPATH . 'wp-admin/includes/bookmark.php');
require_once(ABSPATH . 'wp-admin/includes/comment.php');
require_once(ABSPATH . 'wp-admin/includes/file.php');
require_once(ABSPATH . 'wp-admin/includes/image.php');
require_once(ABSPATH . 'wp-admin/includes/media.php');
require_once(ABSPATH . 'wp-admin/includes/import.php');
require_once(ABSPATH . 'wp-admin/includes/misc.php');
require_once(ABSPATH . 'wp-admin/includes/plugin.php');
require_once(ABSPATH . 'wp-admin/includes/post.php');
require_once(ABSPATH . 'wp-admin/includes/taxonomy.php');
require_once(ABSPATH . 'wp-admin/includes/template.php');
require_once(ABSPATH . 'wp-admin/includes/theme.php');
require_once(ABSPATH . 'wp-admin/includes/user.php');
require_once(ABSPATH . 'wp-admin/includes/update.php');

require_once(ABSPATH . WPINC . '/registration.php');

?>
                                                                                                                                                                                   blog/wp-admin/includes/bookmark.php                                                                 0000755 0023433 0004734 00000011322 11060470720 017210  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

function add_link() {
	return edit_link();
}

function edit_link( $link_id = '' ) {
	if (!current_user_can( 'manage_links' ))
		wp_die( __( 'Cheatin&#8217; uh?' ));

	$_POST['link_url'] = wp_specialchars( $_POST['link_url'] );
	$_POST['link_url'] = clean_url($_POST['link_url']);
	$_POST['link_name'] = wp_specialchars( $_POST['link_name'] );
	$_POST['link_image'] = wp_specialchars( $_POST['link_image'] );
	$_POST['link_rss'] = clean_url($_POST['link_rss']);
	if ( 'N' != $_POST['link_visible'] )
		$_POST['link_visible'] = 'Y';

	if ( !empty( $link_id ) ) {
		$_POST['link_id'] = $link_id;
		return wp_update_link( $_POST);
	} else {
		return wp_insert_link( $_POST);
	}
}

function get_default_link_to_edit() {
	if ( isset( $_GET['linkurl'] ) )
		$link->link_url = clean_url( $_GET['linkurl']);
	else
		$link->link_url = '';

	if ( isset( $_GET['name'] ) )
		$link->link_name = attribute_escape( $_GET['name']);
	else
		$link->link_name = '';

	$link->link_visible = 'Y';

	return $link;
}

function wp_delete_link($link_id) {
	global $wpdb;

	do_action('delete_link', $link_id);

	wp_delete_object_term_relationships($link_id, 'link_category');

	$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->links WHERE link_id = %d", $link_id) );

	do_action('deleted_link', $link_id);

	return true;
}

function wp_get_link_cats($link_id = 0) {

	$cats = wp_get_object_terms($link_id, 'link_category', 'fields=ids');

	return array_unique($cats);
}

function get_link_to_edit( $link_id ) {
	return get_bookmark( $link_id, OBJECT, 'edit' );
}

function wp_insert_link($linkdata) {
	global $wpdb, $current_user;

	$defaults = array('link_id' => 0, 'link_name' => '', 'link_url' => '', 'link_rating' => 0 );

	$linkdata = wp_parse_args($linkdata, $defaults);
	$linkdata = sanitize_bookmark($linkdata, 'db');

	extract(stripslashes_deep($linkdata), EXTR_SKIP);

	$update = false;

	if ( !empty($link_id) )
		$update = true;

	if ( trim( $link_name ) == '' )
		return 0;

	if ( trim( $link_url ) == '' )
		return 0;

	if ( empty($link_rating) )
		$link_rating = 0;

	if ( empty($link_image) )
		$link_image = '';

	if ( empty($link_target) )
		$link_target = '';

	if ( empty($link_visible) )
		$link_visible = 'Y';

	if ( empty($link_owner) )
		$link_owner = $current_user->id;

	if ( empty($link_notes) )
		$link_notes = '';

	if ( empty($link_description) )
		$link_description = '';

	if ( empty($link_rss) )
		$link_rss = '';

	if ( empty($link_rel) )
		$link_rel = '';

	// Make sure we set a valid category
	if (0 == count($link_category) || !is_array($link_category)) {
		$link_category = array(get_option('default_link_category'));
	}

	if ( $update ) {
		$wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_url = %s,
			link_name = %s, link_image = %s, link_target = %s, 
			link_visible = %s, link_description = %s, link_rating = %s, 
			link_rel = %s, link_notes = %s, link_rss = %s
			WHERE link_id = %s", $link_url, $link_name, $link_image, $link_target, $link_visible, $link_description, $link_rating, $link_rel, $link_notes, $link_rss, $link_id) );
	} else {
		$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", 
		$link_url,$link_name, $link_image, $link_target, $link_description, $link_visible, $link_owner, $link_rating, $link_rel, $link_notes, $link_rss) );
		$link_id = (int) $wpdb->insert_id;
	}

	wp_set_link_cats($link_id, $link_category);

	if ( $update )
		do_action('edit_link', $link_id);
	else
		do_action('add_link', $link_id);

	return $link_id;
}

function wp_set_link_cats($link_id = 0, $link_categories = array()) {
	// If $link_categories isn't already an array, make it one:
	if (!is_array($link_categories) || 0 == count($link_categories))
		$link_categories = array(get_option('default_link_category'));

	$link_categories = array_map('intval', $link_categories);
	$link_categories = array_unique($link_categories);

	wp_set_object_terms($link_id, $link_categories, 'link_category');
}	// wp_set_link_cats()

function wp_update_link($linkdata) {
	$link_id = (int) $linkdata['link_id'];

	$link = get_link($link_id, ARRAY_A);

	// Escape data pulled from DB.
	$link = add_magic_quotes($link);

	// Passed link category list overwrites existing category list if not empty.
	if ( isset($linkdata['link_category']) && is_array($linkdata['link_category'])
			 && 0 != count($linkdata['link_category']) )
		$link_cats = $linkdata['link_category'];
	else
		$link_cats = $link['link_category'];

	// Merge old and new fields with new fields overwriting old ones.
	$linkdata = array_merge($link, $linkdata);
	$linkdata['link_category'] = $link_cats;

	return wp_insert_link($linkdata);
}

?>                                                                                                                                                                                                                                                                                                              blog/wp-admin/includes/class-ftp-pure.php                                                           0000755 0023433 0004734 00000012042 11060470720 020250  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**
 * PemFTP - A Ftp implementation in pure PHP
 *
 * @package PemFTP
 * @since 2.5
 *
 * @version 1.0
 * @copyright Alexey Dotsenko
 * @author Alexey Dotsenko
 * @link http://www.phpclasses.org/browse/package/1743.html Site
 * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
 */
class ftp extends ftp_base {

	function ftp($verb=FALSE, $le=FALSE) {
		$this->__construct($verb, $le);
	}

	function __construct($verb=FALSE, $le=FALSE) {
		parent::__construct(false, $verb, $le);
	}

// <!-- --------------------------------------------------------------------------------------- -->
// <!--       Private functions                                                                 -->
// <!-- --------------------------------------------------------------------------------------- -->

	function _settimeout($sock) {
		if(!@stream_set_timeout($sock, $this->_timeout)) {
			$this->PushError('_settimeout','socket set send timeout');
			$this->_quit();
			return FALSE;
		}
		return TRUE;
	}

	function _connect($host, $port) {
		$this->SendMSG("Creating socket");
		$sock = @fsockopen($host, $port, $errno, $errstr, $this->_timeout);
		if (!$sock) {
			$this->PushError('_connect','socket connect failed', $errstr." (".$errno.")");
			return FALSE;
		}
		$this->_connected=true;
		return $sock;
	}

	function _readmsg($fnction="_readmsg"){
		if(!$this->_connected) {
			$this->PushError($fnction, 'Connect first');
			return FALSE;
		}
		$result=true;
		$this->_message="";
		$this->_code=0;
		$go=true;
		do {
			$tmp=@fgets($this->_ftp_control_sock, 512);
			if($tmp===false) {
				$go=$result=false;
				$this->PushError($fnction,'Read failed');
			} else {
				$this->_message.=$tmp;
				if(preg_match("/^([0-9]{3})(-(.*[".CRLF."]{1,2})+\\1)? [^".CRLF."]+[".CRLF."]{1,2}$/", $this->_message, $regs)) $go=false;
			}
		} while($go);
		if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF;
		$this->_code=(int)$regs[1];
		return $result;
	}

	function _exec($cmd, $fnction="_exec") {
		if(!$this->_ready) {
			$this->PushError($fnction,'Connect first');
			return FALSE;
		}
		if($this->LocalEcho) echo "PUT > ",$cmd,CRLF;
		$status=@fputs($this->_ftp_control_sock, $cmd.CRLF);
		if($status===false) {
			$this->PushError($fnction,'socket write failed');
			return FALSE;
		}
		$this->_lastaction=time();
		if(!$this->_readmsg($fnction)) return FALSE;
		return TRUE;
	}

	function _data_prepare($mode=FTP_ASCII) {
		if(!$this->_settype($mode)) return FALSE;
		if($this->_passive) {
			if(!$this->_exec("PASV", "pasv")) {
				$this->_data_close();
				return FALSE;
			}
			if(!$this->_checkCode()) {
				$this->_data_close();
				return FALSE;
			}
			$ip_port = explode(",", ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message));
			$this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3];
            $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);
			$this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
			$this->_ftp_data_sock=@fsockopen($this->_datahost, $this->_dataport, $errno, $errstr, $this->_timeout);
			if(!$this->_ftp_data_sock) {
				$this->PushError("_data_prepare","fsockopen fails", $errstr." (".$errno.")");
				$this->_data_close();
				return FALSE;
			}
			else $this->_ftp_data_sock;
		} else {
			$this->SendMSG("Only passive connections available!");
			return FALSE;
		}
		return TRUE;
	}

	function _data_read($mode=FTP_ASCII, $fp=NULL) {
		if(is_resource($fp)) $out=0;
		else $out="";
		if(!$this->_passive) {
			$this->SendMSG("Only passive connections available!");
			return FALSE;
		}
		while (!feof($this->_ftp_data_sock)) {
			$block=fread($this->_ftp_data_sock, $this->_ftp_buff_size);
			if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block);
			if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block));
			else $out.=$block;
		}
		return $out;
	}

	function _data_write($mode=FTP_ASCII, $fp=NULL) {
		if(is_resource($fp)) $out=0;
		else $out="";
		if(!$this->_passive) {
			$this->SendMSG("Only passive connections available!");
			return FALSE;
		}
		if(is_resource($fp)) {
			while(!feof($fp)) {
				$block=fread($fp, $this->_ftp_buff_size);
				if(!$this->_data_write_block($mode, $block)) return false;
			}
		} elseif(!$this->_data_write_block($mode, $fp)) return false;
		return TRUE;
	}

	function _data_write_block($mode, $block) {
		if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block);
		do {
			if(($t=@fwrite($this->_ftp_data_sock, $block))===FALSE) {
				$this->PushError("_data_write","Can't write to socket");
				return FALSE;
			}
			$block=substr($block, $t);
		} while(!empty($block));
		return true;
	}

	function _data_close() {
		@fclose($this->_ftp_data_sock);
		$this->SendMSG("Disconnected data from remote host");
		return TRUE;
	}

	function _quit($force=FALSE) {
		if($this->_connected or $force) {
			@fclose($this->_ftp_control_sock);
			$this->_connected=false;
			$this->SendMSG("Socket closed");
		}
	}
}
?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              blog/wp-admin/includes/class-ftp-sockets.php                                                        0000755 0023433 0004734 00000020037 11060470721 020754  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**
 * PemFTP - A Ftp implementation in pure PHP
 *
 * @package PemFTP
 * @since 2.5
 *
 * @version 1.0
 * @copyright Alexey Dotsenko
 * @author Alexey Dotsenko
 * @link http://www.phpclasses.org/browse/package/1743.html Site
 * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
 */
class ftp extends ftp_base {

	function ftp($verb=FALSE, $le=FALSE) {
		$this->__construct($verb, $le);
	}

	function __construct($verb=FALSE, $le=FALSE) {
		parent::__construct(true, $verb, $le);
	}

// <!-- --------------------------------------------------------------------------------------- -->
// <!--       Private functions                                                                 -->
// <!-- --------------------------------------------------------------------------------------- -->

	function _settimeout($sock) {
		if(!@socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) {
			$this->PushError('_connect','socket set receive timeout',socket_strerror(socket_last_error($sock)));
			@socket_close($sock);
			return FALSE;
		}
		if(!@socket_set_option($sock, SOL_SOCKET , SO_SNDTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) {
			$this->PushError('_connect','socket set send timeout',socket_strerror(socket_last_error($sock)));
			@socket_close($sock);
			return FALSE;
		}
		return true;
	}

	function _connect($host, $port) {
		$this->SendMSG("Creating socket");
		if(!($sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) {
			$this->PushError('_connect','socket create failed',socket_strerror(socket_last_error($sock)));
			return FALSE;
		}
		if(!$this->_settimeout($sock)) return FALSE;
		$this->SendMSG("Connecting to \"".$host.":".$port."\"");
		if (!($res = @socket_connect($sock, $host, $port))) {
			$this->PushError('_connect','socket connect failed',socket_strerror(socket_last_error($sock)));
			@socket_close($sock);
			return FALSE;
		}
		$this->_connected=true;
		return $sock;
	}

	function _readmsg($fnction="_readmsg"){
		if(!$this->_connected) {
			$this->PushError($fnction,'Connect first');
			return FALSE;
		}
		$result=true;
		$this->_message="";
		$this->_code=0;
		$go=true;
		do {
			$tmp=@socket_read($this->_ftp_control_sock, 4096, PHP_BINARY_READ);
			if($tmp===false) {
				$go=$result=false;
				$this->PushError($fnction,'Read failed', socket_strerror(socket_last_error($this->_ftp_control_sock)));
			} else {
				$this->_message.=$tmp;
				$go = !preg_match("/^([0-9]{3})(-.+\\1)? [^".CRLF."]+".CRLF."$/Us", $this->_message, $regs);
			}
		} while($go);
		if($this->LocalEcho) echo "GET < ".rtrim($this->_message, CRLF).CRLF;
		$this->_code=(int)$regs[1];
		return $result;
	}

	function _exec($cmd, $fnction="_exec") {
		if(!$this->_ready) {
			$this->PushError($fnction,'Connect first');
			return FALSE;
		}
		if($this->LocalEcho) echo "PUT > ",$cmd,CRLF;
		$status=@socket_write($this->_ftp_control_sock, $cmd.CRLF);
		if($status===false) {
			$this->PushError($fnction,'socket write failed', socket_strerror(socket_last_error($this->stream)));
			return FALSE;
		}
		$this->_lastaction=time();
		if(!$this->_readmsg($fnction)) return FALSE;
		return TRUE;
	}

	function _data_prepare($mode=FTP_ASCII) {
		if(!$this->_settype($mode)) return FALSE;
		$this->SendMSG("Creating data socket");
		$this->_ftp_data_sock = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
		if ($this->_ftp_data_sock < 0) {
			$this->PushError('_data_prepare','socket create failed',socket_strerror(socket_last_error($this->_ftp_data_sock)));
			return FALSE;
		}
		if(!$this->_settimeout($this->_ftp_data_sock)) {
			$this->_data_close();
			return FALSE;
		}
		if($this->_passive) {
			if(!$this->_exec("PASV", "pasv")) {
				$this->_data_close();
				return FALSE;
			}
			if(!$this->_checkCode()) {
				$this->_data_close();
				return FALSE;
			}
			$ip_port = explode(",", ereg_replace("^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*".CRLF."$", "\\1", $this->_message));
			$this->_datahost=$ip_port[0].".".$ip_port[1].".".$ip_port[2].".".$ip_port[3];
            $this->_dataport=(((int)$ip_port[4])<<8) + ((int)$ip_port[5]);
			$this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
			if(!@socket_connect($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) {
				$this->PushError("_data_prepare","socket_connect", socket_strerror(socket_last_error($this->_ftp_data_sock)));
				$this->_data_close();
				return FALSE;
			}
			else $this->_ftp_temp_sock=$this->_ftp_data_sock;
		} else {
			if(!@socket_getsockname($this->_ftp_control_sock, $addr, $port)) {
				$this->PushError("_data_prepare","can't get control socket information", socket_strerror(socket_last_error($this->_ftp_control_sock)));
				$this->_data_close();
				return FALSE;
			}
			if(!@socket_bind($this->_ftp_data_sock,$addr)){
				$this->PushError("_data_prepare","can't bind data socket", socket_strerror(socket_last_error($this->_ftp_data_sock)));
				$this->_data_close();
				return FALSE;
			}
			if(!@socket_listen($this->_ftp_data_sock)) {
				$this->PushError("_data_prepare","can't listen data socket", socket_strerror(socket_last_error($this->_ftp_data_sock)));
				$this->_data_close();
				return FALSE;
			}
			if(!@socket_getsockname($this->_ftp_data_sock, $this->_datahost, $this->_dataport)) {
				$this->PushError("_data_prepare","can't get data socket information", socket_strerror(socket_last_error($this->_ftp_data_sock)));
				$this->_data_close();
				return FALSE;
			}
			if(!$this->_exec('PORT '.str_replace('.',',',$this->_datahost.'.'.($this->_dataport>>8).'.'.($this->_dataport&0x00FF)), "_port")) {
				$this->_data_close();
				return FALSE;
			}
			if(!$this->_checkCode()) {
				$this->_data_close();
				return FALSE;
			}
		}
		return TRUE;
	}

	function _data_read($mode=FTP_ASCII, $fp=NULL) {
		$NewLine=$this->_eol_code[$this->OS_local];
		if(is_resource($fp)) $out=0;
		else $out="";
		if(!$this->_passive) {
			$this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
			$this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock);
			if($this->_ftp_temp_sock===FALSE) {
				$this->PushError("_data_read","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock)));
				$this->_data_close();
				return FALSE;
			}
		}

		while(($block=@socket_read($this->_ftp_temp_sock, $this->_ftp_buff_size, PHP_BINARY_READ))!==false) {
			if($block==="") break;
			if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_local], $block);
			if(is_resource($fp)) $out+=fwrite($fp, $block, strlen($block));
			else $out.=$block;
		}
		return $out;
	}

	function _data_write($mode=FTP_ASCII, $fp=NULL) {
		$NewLine=$this->_eol_code[$this->OS_local];
		if(is_resource($fp)) $out=0;
		else $out="";
		if(!$this->_passive) {
			$this->SendMSG("Connecting to ".$this->_datahost.":".$this->_dataport);
			$this->_ftp_temp_sock=socket_accept($this->_ftp_data_sock);
			if($this->_ftp_temp_sock===FALSE) {
				$this->PushError("_data_write","socket_accept", socket_strerror(socket_last_error($this->_ftp_temp_sock)));
				$this->_data_close();
				return false;
			}
		}
		if(is_resource($fp)) {
			while(!feof($fp)) {
				$block=fread($fp, $this->_ftp_buff_size);
				if(!$this->_data_write_block($mode, $block)) return false;
			}
		} elseif(!$this->_data_write_block($mode, $fp)) return false;
		return true;
	}

	function _data_write_block($mode, $block) {
		if($mode!=FTP_BINARY) $block=preg_replace("/\r\n|\r|\n/", $this->_eol_code[$this->OS_remote], $block);
		do {
			if(($t=@socket_write($this->_ftp_temp_sock, $block))===FALSE) {
				$this->PushError("_data_write","socket_write", socket_strerror(socket_last_error($this->_ftp_temp_sock)));
				$this->_data_close();
				return FALSE;
			}
			$block=substr($block, $t);
		} while(!empty($block));
		return true;
	}

	function _data_close() {
		@socket_close($this->_ftp_temp_sock);
		@socket_close($this->_ftp_data_sock);
		$this->SendMSG("Disconnected data from remote host");
		return TRUE;
	}

	function _quit() {
		if($this->_connected) {
			@socket_close($this->_ftp_control_sock);
			$this->_connected=false;
			$this->SendMSG("Socket closed");
		}
	}
}
?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 blog/wp-admin/includes/class-ftp.php                                                                0000755 0023433 0004734 00000062470 11060470722 017313  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**
 * PemFTP - A Ftp implementation in pure PHP
 *
 * @package PemFTP
 * @since 2.5
 *
 * @version 1.0
 * @copyright Alexey Dotsenko
 * @author Alexey Dotsenko
 * @link http://www.phpclasses.org/browse/package/1743.html Site
 * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
 */
if(!defined('CRLF')) define('CRLF',"\r\n");
if(!defined("FTP_AUTOASCII")) define("FTP_AUTOASCII", -1);
if(!defined("FTP_BINARY")) define("FTP_BINARY", 1);
if(!defined("FTP_ASCII")) define("FTP_ASCII", 0);
if(!defined('FTP_FORCE')) define('FTP_FORCE', TRUE);
define('FTP_OS_Unix','u');
define('FTP_OS_Windows','w');
define('FTP_OS_Mac','m');

class ftp_base {
	/* Public variables */
	var $LocalEcho;
	var $Verbose;
	var $OS_local;
	var $OS_remote;

	/* Private variables */
	var $_lastaction;
	var $_errors;
	var $_type;
	var $_umask;
	var $_timeout;
	var $_passive;
	var $_host;
	var $_fullhost;
	var $_port;
	var $_datahost;
	var $_dataport;
	var $_ftp_control_sock;
	var $_ftp_data_sock;
	var $_ftp_temp_sock;
	var $_ftp_buff_size;
	var $_login;
	var $_password;
	var $_connected;
	var $_ready;
	var $_code;
	var $_message;
	var $_can_restore;
	var $_port_available;
	var $_curtype;
	var $_features;

	var $_error_array;
	var $AuthorizedTransferMode;
	var $OS_FullName;
	var $_eol_code;
	var $AutoAsciiExt;

	/* Constructor */
	function ftp_base($port_mode=FALSE) {
		$this->__construct($port_mode);
	}

	function __construct($port_mode=FALSE, $verb=FALSE, $le=FALSE) {
		$this->LocalEcho=$le;
		$this->Verbose=$verb;
		$this->_lastaction=NULL;
		$this->_error_array=array();
		$this->_eol_code=array(FTP_OS_Unix=>"\n", FTP_OS_Mac=>"\r", FTP_OS_Windows=>"\r\n");
		$this->AuthorizedTransferMode=array(FTP_AUTOASCII, FTP_ASCII, FTP_BINARY);
		$this->OS_FullName=array(FTP_OS_Unix => 'UNIX', FTP_OS_Windows => 'WINDOWS', FTP_OS_Mac => 'MACOS');
		$this->AutoAsciiExt=array("ASP","BAT","C","CPP","CSS","CSV","JS","H","HTM","HTML","SHTML","INI","LOG","PHP3","PHTML","PL","PERL","SH","SQL","TXT");
		$this->_port_available=($port_mode==TRUE);
		$this->SendMSG("Staring FTP client class".($this->_port_available?"":" without PORT mode support"));
		$this->_connected=FALSE;
		$this->_ready=FALSE;
		$this->_can_restore=FALSE;
		$this->_code=0;
		$this->_message="";
		$this->_ftp_buff_size=4096;
		$this->_curtype=NULL;
		$this->SetUmask(0022);
		$this->SetType(FTP_AUTOASCII);
		$this->SetTimeout(30);
		$this->Passive(!$this->_port_available);
		$this->_login="anonymous";
		$this->_password="anon@ftp.com";
		$this->_features=array();
	    $this->OS_local=FTP_OS_Unix;
		$this->OS_remote=FTP_OS_Unix;
		$this->features=array();
		if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') $this->OS_local=FTP_OS_Windows;
		elseif(strtoupper(substr(PHP_OS, 0, 3)) === 'MAC') $this->OS_local=FTP_OS_Mac;
	}

// <!-- --------------------------------------------------------------------------------------- -->
// <!--       Public functions                                                                  -->
// <!-- --------------------------------------------------------------------------------------- -->

	function parselisting($line) {
		$is_windows = ($this->OS_remote == FTP_OS_Windows);
		if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/",$line,$lucifer)) {
			$b = array();
			if ($lucifer[3]<70) { $lucifer[3]+=2000; } else { $lucifer[3]+=1900; } // 4digit year fix
			$b['isdir'] = ($lucifer[7]=="<DIR>");
			if ( $b['isdir'] )
				$b['type'] = 'd';
			else
				$b['type'] = 'f';
			$b['size'] = $lucifer[7];
			$b['month'] = $lucifer[1];
			$b['day'] = $lucifer[2];
			$b['year'] = $lucifer[3];
			$b['hour'] = $lucifer[4];
			$b['minute'] = $lucifer[5];
			$b['time'] = @mktime($lucifer[4]+(strcasecmp($lucifer[6],"PM")==0?12:0),$lucifer[5],0,$lucifer[1],$lucifer[2],$lucifer[3]);
			$b['am/pm'] = $lucifer[6];
			$b['name'] = $lucifer[8];
		} else if (!$is_windows && $lucifer=preg_split("/[ ]/",$line,9,PREG_SPLIT_NO_EMPTY)) {
			//echo $line."\n";
			$lcount=count($lucifer);
			if ($lcount<8) return '';
			$b = array();
			$b['isdir'] = $lucifer[0]{0} === "d";
			$b['islink'] = $lucifer[0]{0} === "l";
			if ( $b['isdir'] )
				$b['type'] = 'd';
			elseif ( $b['islink'] )
				$b['type'] = 'l';
			else
				$b['type'] = 'f';
			$b['perms'] = $lucifer[0];
			$b['number'] = $lucifer[1];
			$b['owner'] = $lucifer[2];
			$b['group'] = $lucifer[3];
			$b['size'] = $lucifer[4];
			if ($lcount==8) {
				sscanf($lucifer[5],"%d-%d-%d",$b['year'],$b['month'],$b['day']);
				sscanf($lucifer[6],"%d:%d",$b['hour'],$b['minute']);
				$b['time'] = @mktime($b['hour'],$b['minute'],0,$b['month'],$b['day'],$b['year']);
				$b['name'] = $lucifer[7];
			} else {
				$b['month'] = $lucifer[5];
				$b['day'] = $lucifer[6];
				if (preg_match("/([0-9]{2}):([0-9]{2})/",$lucifer[7],$l2)) {
					$b['year'] = date("Y");
					$b['hour'] = $l2[1];
					$b['minute'] = $l2[2];
				} else {
					$b['year'] = $lucifer[7];
					$b['hour'] = 0;
					$b['minute'] = 0;
				}
				$b['time'] = strtotime(sprintf("%d %s %d %02d:%02d",$b['day'],$b['month'],$b['year'],$b['hour'],$b['minute']));
				$b['name'] = $lucifer[8];
			}
		}

		return $b;
	}

	function SendMSG($message = "", $crlf=true) {
		if ($this->Verbose) {
			echo $message.($crlf?CRLF:"");
			flush();
		}
		return TRUE;
	}

	function SetType($mode=FTP_AUTOASCII) {
		if(!in_array($mode, $this->AuthorizedTransferMode)) {
			$this->SendMSG("Wrong type");
			return FALSE;
		}
		$this->_type=$mode;
		$this->SendMSG("Transfer type: ".($this->_type==FTP_BINARY?"binary":($this->_type==FTP_ASCII?"ASCII":"auto ASCII") ) );
		return TRUE;
	}

	function _settype($mode=FTP_ASCII) {
		if($this->_ready) {
			if($mode==FTP_BINARY) {
				if($this->_curtype!=FTP_BINARY) {
					if(!$this->_exec("TYPE I", "SetType")) return FALSE;
					$this->_curtype=FTP_BINARY;
				}
			} elseif($this->_curtype!=FTP_ASCII) {
				if(!$this->_exec("TYPE A", "SetType")) return FALSE;
				$this->_curtype=FTP_ASCII;
			}
		} else return FALSE;
		return TRUE;
	}

	function Passive($pasv=NULL) {
		if(is_null($pasv)) $this->_passive=!$this->_passive;
		else $this->_passive=$pasv;
		if(!$this->_port_available and !$this->_passive) {
			$this->SendMSG("Only passive connections available!");
			$this->_passive=TRUE;
			return FALSE;
		}
		$this->SendMSG("Passive mode ".($this->_passive?"on":"off"));
		return TRUE;
	}

	function SetServer($host, $port=21, $reconnect=true) {
		if(!is_long($port)) {
	        $this->verbose=true;
    	    $this->SendMSG("Incorrect port syntax");
			return FALSE;
		} else {
			$ip=@gethostbyname($host);
	        $dns=@gethostbyaddr($host);
	        if(!$ip) $ip=$host;
	        if(!$dns) $dns=$host;
			if(ip2long($ip) === -1) {
				$this->SendMSG("Wrong host name/address \"".$host."\"");
				return FALSE;
			}
	        $this->_host=$ip;
	        $this->_fullhost=$dns;
	        $this->_port=$port;
	        $this->_dataport=$port-1;
		}
		$this->SendMSG("Host \"".$this->_fullhost."(".$this->_host."):".$this->_port."\"");
		if($reconnect){
			if($this->_connected) {
				$this->SendMSG("Reconnecting");
				if(!$this->quit(FTP_FORCE)) return FALSE;
				if(!$this->connect()) return FALSE;
			}
		}
		return TRUE;
	}

	function SetUmask($umask=0022) {
		$this->_umask=$umask;
		umask($this->_umask);
		$this->SendMSG("UMASK 0".decoct($this->_umask));
		return TRUE;
	}

	function SetTimeout($timeout=30) {
		$this->_timeout=$timeout;
		$this->SendMSG("Timeout ".$this->_timeout);
		if($this->_connected)
			if(!$this->_settimeout($this->_ftp_control_sock)) return FALSE;
		return TRUE;
	}

	function connect($server=NULL) {
		if(!empty($server)) {
			if(!$this->SetServer($server)) return false;
		}
		if($this->_ready) return true;
	    $this->SendMsg('Local OS : '.$this->OS_FullName[$this->OS_local]);
		if(!($this->_ftp_control_sock = $this->_connect($this->_host, $this->_port))) {
			$this->SendMSG("Error : Cannot connect to remote host \"".$this->_fullhost." :".$this->_port."\"");
			return FALSE;
		}
		$this->SendMSG("Connected to remote host \"".$this->_fullhost.":".$this->_port."\". Waiting for greeting.");
		do {
			if(!$this->_readmsg()) return FALSE;
			if(!$this->_checkCode()) return FALSE;
			$this->_lastaction=time();
		} while($this->_code<200);
		$this->_ready=true;
		$syst=$this->systype();
		if(!$syst) $this->SendMSG("Can't detect remote OS");
		else {
			if(preg_match("/win|dos|novell/i", $syst[0])) $this->OS_remote=FTP_OS_Windows;
			elseif(preg_match("/os/i", $syst[0])) $this->OS_remote=FTP_OS_Mac;
			elseif(preg_match("/(li|u)nix/i", $syst[0])) $this->OS_remote=FTP_OS_Unix;
			else $this->OS_remote=FTP_OS_Mac;
			$this->SendMSG("Remote OS: ".$this->OS_FullName[$this->OS_remote]);
		}
		if(!$this->features()) $this->SendMSG("Can't get features list. All supported - disabled");
		else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features)));
		return TRUE;
	}

	function quit($force=false) {
		if($this->_ready) {
			if(!$this->_exec("QUIT") and !$force) return FALSE;
			if(!$this->_checkCode() and !$force) return FALSE;
			$this->_ready=false;
			$this->SendMSG("Session finished");
		}
		$this->_quit();
		return TRUE;
	}

	function login($user=NULL, $pass=NULL) {
		if(!is_null($user)) $this->_login=$user;
		else $this->_login="anonymous";
		if(!is_null($pass)) $this->_password=$pass;
		else $this->_password="anon@anon.com";
		if(!$this->_exec("USER ".$this->_login, "login")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		if($this->_code!=230) {
			if(!$this->_exec((($this->_code==331)?"PASS ":"ACCT ").$this->_password, "login")) return FALSE;
			if(!$this->_checkCode()) return FALSE;
		}
		$this->SendMSG("Authentication succeeded");
		if(empty($this->_features)) {
			if(!$this->features()) $this->SendMSG("Can't get features list. All supported - disabled");
			else $this->SendMSG("Supported features: ".implode(", ", array_keys($this->_features)));
		}
		return TRUE;
	}

	function pwd() {
		if(!$this->_exec("PWD", "pwd")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		return ereg_replace("^[0-9]{3} \"(.+)\".+", "\\1", $this->_message);
	}

	function cdup() {
		if(!$this->_exec("CDUP", "cdup")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		return true;
	}

	function chdir($pathname) {
		if(!$this->_exec("CWD ".$pathname, "chdir")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		return TRUE;
	}

	function rmdir($pathname) {
		if(!$this->_exec("RMD ".$pathname, "rmdir")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		return TRUE;
	}

	function mkdir($pathname) {
		if(!$this->_exec("MKD ".$pathname, "mkdir")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		return TRUE;
	}

	function rename($from, $to) {
		if(!$this->_exec("RNFR ".$from, "rename")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		if($this->_code==350) {
			if(!$this->_exec("RNTO ".$to, "rename")) return FALSE;
			if(!$this->_checkCode()) return FALSE;
		} else return FALSE;
		return TRUE;
	}

	function filesize($pathname) {
		if(!isset($this->_features["SIZE"])) {
			$this->PushError("filesize", "not supported by server");
			return FALSE;
		}
		if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		return ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message);
	}

	function abort() {
		if(!$this->_exec("ABOR", "abort")) return FALSE;
		if(!$this->_checkCode()) {
			if($this->_code!=426) return FALSE;
			if(!$this->_readmsg("abort")) return FALSE;
			if(!$this->_checkCode()) return FALSE;
		}
		return true;
	}

	function mdtm($pathname) {
		if(!isset($this->_features["MDTM"])) {
			$this->PushError("mdtm", "not supported by server");
			return FALSE;
		}
		if(!$this->_exec("MDTM ".$pathname, "mdtm")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		$mdtm = ereg_replace("^[0-9]{3} ([0-9]+)".CRLF, "\\1", $this->_message);
		$date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d");
		$timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]);
		return $timestamp;
	}

	function systype() {
		if(!$this->_exec("SYST", "systype")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		$DATA = explode(" ", $this->_message);
		return array($DATA[1], $DATA[3]);
	}

	function delete($pathname) {
		if(!$this->_exec("DELE ".$pathname, "delete")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		return TRUE;
	}

	function site($command, $fnction="site") {
		if(!$this->_exec("SITE ".$command, $fnction)) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		return TRUE;
	}

	function chmod($pathname, $mode) {
		if(!$this->site( sprintf('CHMOD %o %s', $mode, $pathname), "chmod")) return FALSE;
		return TRUE;
	}

	function restore($from) {
		if(!isset($this->_features["REST"])) {
			$this->PushError("restore", "not supported by server");
			return FALSE;
		}
		if($this->_curtype!=FTP_BINARY) {
			$this->PushError("restore", "can't restore in ASCII mode");
			return FALSE;
		}
		if(!$this->_exec("REST ".$from, "resore")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		return TRUE;
	}

	function features() {
		if(!$this->_exec("FEAT", "features")) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		$f=preg_split("/[".CRLF."]+/", preg_replace("/[0-9]{3}[ -].*[".CRLF."]+/", "", $this->_message), -1, PREG_SPLIT_NO_EMPTY);
		$this->_features=array();
		foreach($f as $k=>$v) {
			$v=explode(" ", trim($v));
			$this->_features[array_shift($v)]=$v;;
		}
		return true;
	}

	function rawlist($pathname="", $arg="") {
		return $this->_list(($arg?" ".$arg:"").($pathname?" ".$pathname:""), "LIST", "rawlist");
	}

	function nlist($pathname="") {
		return $this->_list(($arg?" ".$arg:"").($pathname?" ".$pathname:""), "NLST", "nlist");
	}

	function is_exists($pathname) {
		return $this->file_exists($pathname);
	}

	function file_exists($pathname) {
		$exists=true;
		if(!$this->_exec("RNFR ".$pathname, "rename")) $exists=FALSE;
		else {
			if(!$this->_checkCode()) $exists=FALSE;
			$this->abort();
		}
		if($exists) $this->SendMSG("Remote file ".$pathname." exists");
		else $this->SendMSG("Remote file ".$pathname." does not exist");
		return $exists;
	}

	function fget($fp, $remotefile,$rest=0) {
		if($this->_can_restore and $rest!=0) fseek($fp, $rest);
		$pi=pathinfo($remotefile);
		if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;
		else $mode=FTP_BINARY;
		if(!$this->_data_prepare($mode)) {
			return FALSE;
		}
		if($this->_can_restore and $rest!=0) $this->restore($rest);
		if(!$this->_exec("RETR ".$remotefile, "get")) {
			$this->_data_close();
			return FALSE;
		}
		if(!$this->_checkCode()) {
			$this->_data_close();
			return FALSE;
		}
		$out=$this->_data_read($mode, $fp);
		$this->_data_close();
		if(!$this->_readmsg()) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		return $out;
	}

	function get($remotefile, $localfile=NULL, $rest=0) {
		if(is_null($localfile)) $localfile=$remotefile;
		if (@file_exists($localfile)) $this->SendMSG("Warning : local file will be overwritten");
		$fp = @fopen($localfile, "w");
		if (!$fp) {
			$this->PushError("get","can't open local file", "Cannot create \"".$localfile."\"");
			return FALSE;
		}
		if($this->_can_restore and $rest!=0) fseek($fp, $rest);
		$pi=pathinfo($remotefile);
		if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;
		else $mode=FTP_BINARY;
		if(!$this->_data_prepare($mode)) {
			fclose($fp);
			return FALSE;
		}
		if($this->_can_restore and $rest!=0) $this->restore($rest);
		if(!$this->_exec("RETR ".$remotefile, "get")) {
			$this->_data_close();
			fclose($fp);
			return FALSE;
		}
		if(!$this->_checkCode()) {
			$this->_data_close();
			fclose($fp);
			return FALSE;
		}
		$out=$this->_data_read($mode, $fp);
		fclose($fp);
		$this->_data_close();
		if(!$this->_readmsg()) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		return $out;
	}

	function fput($remotefile, $fp) {
		if($this->_can_restore and $rest!=0) fseek($fp, $rest);
		$pi=pathinfo($remotefile);
		if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;
		else $mode=FTP_BINARY;
		if(!$this->_data_prepare($mode)) {
			return FALSE;
		}
		if($this->_can_restore and $rest!=0) $this->restore($rest);
		if(!$this->_exec("STOR ".$remotefile, "put")) {
			$this->_data_close();
			return FALSE;
		}
		if(!$this->_checkCode()) {
			$this->_data_close();
			return FALSE;
		}
		$ret=$this->_data_write($mode, $fp);
		$this->_data_close();
		if(!$this->_readmsg()) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		return $ret;
	}

	function put($localfile, $remotefile=NULL, $rest=0) {
		if(is_null($remotefile)) $remotefile=$localfile;
		if (!file_exists($localfile)) {
			$this->PushError("put","can't open local file", "No such file or directory \"".$localfile."\"");
			return FALSE;
		}
		$fp = @fopen($localfile, "r");

		if (!$fp) {
			$this->PushError("put","can't open local file", "Cannot read file \"".$localfile."\"");
			return FALSE;
		}
		if($this->_can_restore and $rest!=0) fseek($fp, $rest);
		$pi=pathinfo($localfile);
		if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII;
		else $mode=FTP_BINARY;
		if(!$this->_data_prepare($mode)) {
			fclose($fp);
			return FALSE;
		}
		if($this->_can_restore and $rest!=0) $this->restore($rest);
		if(!$this->_exec("STOR ".$remotefile, "put")) {
			$this->_data_close();
			fclose($fp);
			return FALSE;
		}
		if(!$this->_checkCode()) {
			$this->_data_close();
			fclose($fp);
			return FALSE;
		}
		$ret=$this->_data_write($mode, $fp);
		fclose($fp);
		$this->_data_close();
		if(!$this->_readmsg()) return FALSE;
		if(!$this->_checkCode()) return FALSE;
		return $ret;
	}

	function mput($local=".", $remote=NULL, $continious=false) {
		$local=realpath($local);
		if(!@file_exists($local)) {
			$this->PushError("mput","can't open local folder", "Cannot stat folder \"".$local."\"");
			return FALSE;
		}
		if(!is_dir($local)) return $this->put($local, $remote);
		if(empty($remote)) $remote=".";
		elseif(!$this->file_exists($remote) and !$this->mkdir($remote)) return FALSE;
		if($handle = opendir($local)) {
			$list=array();
			while (false !== ($file = readdir($handle))) {
				if ($file != "." && $file != "..") $list[]=$file;
			}
			closedir($handle);
		} else {
			$this->PushError("mput","can't open local folder", "Cannot read folder \"".$local."\"");
			return FALSE;
		}
		if(empty($list)) return TRUE;
		$ret=true;
		foreach($list as $el) {
			if(is_dir($local."/".$el)) $t=$this->mput($local."/".$el, $remote."/".$el);
			else $t=$this->put($local."/".$el, $remote."/".$el);
			if(!$t) {
				$ret=FALSE;
				if(!$continious) break;
			}
		}
		return $ret;

	}

	function mget($remote, $local=".", $continious=false) {
		$list=$this->rawlist($remote, "-lA");
		if($list===false) {
			$this->PushError("mget","can't read remote folder list", "Can't read remote folder \"".$remote."\" contents");
			return FALSE;
		}
		if(empty($list)) return true;
		if(!@file_exists($local)) {
			if(!@mkdir($local)) {
				$this->PushError("mget","can't create local folder", "Cannot create folder \"".$local."\"");
				return FALSE;
			}
		}
		foreach($list as $k=>$v) {
			$list[$k]=$this->parselisting($v);
			if($list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]);
		}
		$ret=true;
		foreach($list as $el) {
			if($el["type"]=="d") {
				if(!$this->mget($remote."/".$el["name"], $local."/".$el["name"], $continious)) {
					$this->PushError("mget", "can't copy folder", "Can't copy remote folder \"".$remote."/".$el["name"]."\" to local \"".$local."/".$el["name"]."\"");
					$ret=false;
					if(!$continious) break;
				}
			} else {
				if(!$this->get($remote."/".$el["name"], $local."/".$el["name"])) {
					$this->PushError("mget", "can't copy file", "Can't copy remote file \"".$remote."/".$el["name"]."\" to local \"".$local."/".$el["name"]."\"");
					$ret=false;
					if(!$continious) break;
				}
			}
			@chmod($local."/".$el["name"], $el["perms"]);
			$t=strtotime($el["date"]);
			if($t!==-1 and $t!==false) @touch($local."/".$el["name"], $t);
		}
		return $ret;
	}

	function mdel($remote, $continious=false) {
		$list=$this->rawlist($remote, "-la");
		if($list===false) {
			$this->PushError("mdel","can't read remote folder list", "Can't read remote folder \"".$remote."\" contents");
			return false;
		}

		foreach($list as $k=>$v) {
			$list[$k]=$this->parselisting($v);
			if($list[$k]["name"]=="." or $list[$k]["name"]=="..") unset($list[$k]);
		}
		$ret=true;

		foreach($list as $el) {
			if ( empty($el) )
				continue;

			if($el["type"]=="d") {
				if(!$this->mdel($remote."/".$el["name"], $continious)) {
					$ret=false;
					if(!$continious) break;
				}
			} else {
				if (!$this->delete($remote."/".$el["name"])) {
					$this->PushError("mdel", "can't delete file", "Can't delete remote file \"".$remote."/".$el["name"]."\"");
					$ret=false;
					if(!$continious) break;
				}
			}
		}

		if(!$this->rmdir($remote)) {
			$this->PushError("mdel", "can't delete folder", "Can't delete remote folder \"".$remote."/".$el["name"]."\"");
			$ret=false;
		}
		return $ret;
	}

	function mmkdir($dir, $mode = 0777) {
		if(empty($dir)) return FALSE;
		if($this->is_exists($dir) or $dir == "/" ) return TRUE;
		if(!$this->mmkdir(dirname($dir), $mode)) return false;
		$r=$this->mkdir($dir, $mode);
		$this->chmod($dir,$mode);
		return $r;
	}

	function glob($pattern, $handle=NULL) {
		$path=$output=null;
		if(PHP_OS=='WIN32') $slash='\\';
		else $slash='/';
		$lastpos=strrpos($pattern,$slash);
		if(!($lastpos===false)) {
			$path=substr($pattern,0,-$lastpos-1);
			$pattern=substr($pattern,$lastpos);
		} else $path=getcwd();
		if(is_array($handle) and !empty($handle)) {
			while($dir=each($handle)) {
				if($this->glob_pattern_match($pattern,$dir))
				$output[]=$dir;
			}
		} else {
			$handle=@opendir($path);
			if($handle===false) return false;
			while($dir=readdir($handle)) {
				if($this->glob_pattern_match($pattern,$dir))
				$output[]=$dir;
			}
			closedir($handle);
		}
		if(is_array($output)) return $output;
		return false;
	}

	function glob_pattern_match($pattern,$string) {
		$out=null;
		$chunks=explode(';',$pattern);
		foreach($chunks as $pattern) {
			$escape=array('$','^','.','{','}','(',')','[',']','|');
			while(strpos($pattern,'**')!==false)
				$pattern=str_replace('**','*',$pattern);
			foreach($escape as $probe)
				$pattern=str_replace($probe,"\\$probe",$pattern);
			$pattern=str_replace('?*','*',
				str_replace('*?','*',
					str_replace('*',".*",
						str_replace('?','.{1,1}',$pattern))));
			$out[]=$pattern;
		}
		if(count($out)==1) return($this->glob_regexp("^$out[0]$",$string));
		else {
			foreach($out as $tester)
				if($this->my_regexp("^$tester$",$string)) return true;
		}
		return false;
	}

	function glob_regexp($pattern,$probe) {
		$sensitive=(PHP_OS!='WIN32');
		return ($sensitive?
			ereg($pattern,$probe):
			eregi($pattern,$probe)
		);
	}

	function dirlist($remote) {
		$list=$this->rawlist($remote, "-la");
		if($list===false) {
			$this->PushError("dirlist","can't read remote folder list", "Can't read remote folder \"".$remote."\" contents");
			return false;
		}

		$dirlist = array();
		foreach($list as $k=>$v) {
			$entry=$this->parselisting($v);
			if ( empty($entry) )
				continue;

			if($entry["name"]=="." or $entry["name"]=="..")
				continue;

			$dirlist[$entry['name']] = $entry;
		}

		return $dirlist;
	}
// <!-- --------------------------------------------------------------------------------------- -->
// <!--       Private functions                                                                 -->
// <!-- --------------------------------------------------------------------------------------- -->
	function _checkCode() {
		return ($this->_code<400 and $this->_code>0);
	}

	function _list($arg="", $cmd="LIST", $fnction="_list") {
		if(!$this->_data_prepare()) return false;
		if(!$this->_exec($cmd.$arg, $fnction)) {
			$this->_data_close();
			return FALSE;
		}
		if(!$this->_checkCode()) {
			$this->_data_close();
			return FALSE;
		}
		$out="";
		if($this->_code<200) {
			$out=$this->_data_read();
			$this->_data_close();
			if(!$this->_readmsg()) return FALSE;
			if(!$this->_checkCode()) return FALSE;
			if($out === FALSE ) return FALSE;
			$out=preg_split("/[".CRLF."]+/", $out, -1, PREG_SPLIT_NO_EMPTY);
//			$this->SendMSG(implode($this->_eol_code[$this->OS_local], $out));
		}
		return $out;
	}

// <!-- --------------------------------------------------------------------------------------- -->
// <!-- Partie : gestion des erreurs                                                            -->
// <!-- --------------------------------------------------------------------------------------- -->
// Gnre une erreur pour traitement externe  la classe
	function PushError($fctname,$msg,$desc=false){
		$error=array();
		$error['time']=time();
		$error['fctname']=$fctname;
		$error['msg']=$msg;
		$error['desc']=$desc;
		if($desc) $tmp=' ('.$desc.')'; else $tmp='';
		$this->SendMSG($fctname.': '.$msg.$tmp);
		return(array_push($this->_error_array,$error));
	}

// Rcupre une erreur externe
	function PopError(){
		if(count($this->_error_array)) return(array_pop($this->_error_array));
			else return(false);
	}
}

$mod_sockets=TRUE;
if (!extension_loaded('sockets')) {
	$prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : '';
	if(!@dl($prefix . 'sockets.' . PHP_SHLIB_SUFFIX)) $mod_sockets=FALSE;
}
require_once "class-ftp-".($mod_sockets?"sockets":"pure").".php";
?>
                                                                                                                                                                                                        blog/wp-admin/includes/class-pclzip.php                                                             0000755 0023433 0004734 00000732636 11060470725 020036  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
// --------------------------------------------------------------------------------
// PhpConcept Library - Zip Module 2.5
// --------------------------------------------------------------------------------
// License GNU/LGPL - Vincent Blavet - March 2006
// http://www.phpconcept.net
// --------------------------------------------------------------------------------
//
// Presentation :
//   PclZip is a PHP library that manage ZIP archives.
//   So far tests show that archives generated by PclZip are readable by
//   WinZip application and other tools.
//
// Description :
//   See readme.txt and http://www.phpconcept.net
//
// Warning :
//   This library and the associated files are non commercial, non professional
//   work.
//   It should not have unexpected results. However if any damage is caused by
//   this software the author can not be responsible.
//   The use of this software is at the risk of the user.
//
// --------------------------------------------------------------------------------
// $Id: pclzip.lib.php,v 1.44 2006/03/08 21:23:59 vblavet Exp $
// --------------------------------------------------------------------------------

  // ----- Constants
  define( 'PCLZIP_READ_BLOCK_SIZE', 2048 );

  // ----- File list separator
  // In version 1.x of PclZip, the separator for file list is a space
  // (which is not a very smart choice, specifically for windows paths !).
  // A better separator should be a comma (,). This constant gives you the
  // abilty to change that.
  // However notice that changing this value, may have impact on existing
  // scripts, using space separated filenames.
  // Recommanded values for compatibility with older versions :
  //define( 'PCLZIP_SEPARATOR', ' ' );
  // Recommanded values for smart separation of filenames.
  define( 'PCLZIP_SEPARATOR', ',' );

  // ----- Error configuration
  // 0 : PclZip Class integrated error handling
  // 1 : PclError external library error handling. By enabling this
  //     you must ensure that you have included PclError library.
  // [2,...] : reserved for futur use
  define( 'PCLZIP_ERROR_EXTERNAL', 0 );

  // ----- Optional static temporary directory
  //       By default temporary files are generated in the script current
  //       path.
  //       If defined :
  //       - MUST BE terminated by a '/'.
  //       - MUST be a valid, already created directory
  //       Samples :
  // define( 'PCLZIP_TEMPORARY_DIR', '/temp/' );
  // define( 'PCLZIP_TEMPORARY_DIR', 'C:/Temp/' );
  define( 'PCLZIP_TEMPORARY_DIR', '' );

// --------------------------------------------------------------------------------
// ***** UNDER THIS LINE NOTHING NEEDS TO BE MODIFIED *****
// --------------------------------------------------------------------------------

  // ----- Global variables
  $g_pclzip_version = "2.5";

  // ----- Error codes
  //   -1 : Unable to open file in binary write mode
  //   -2 : Unable to open file in binary read mode
  //   -3 : Invalid parameters
  //   -4 : File does not exist
  //   -5 : Filename is too long (max. 255)
  //   -6 : Not a valid zip file
  //   -7 : Invalid extracted file size
  //   -8 : Unable to create directory
  //   -9 : Invalid archive extension
  //  -10 : Invalid archive format
  //  -11 : Unable to delete file (unlink)
  //  -12 : Unable to rename file (rename)
  //  -13 : Invalid header checksum
  //  -14 : Invalid archive size
  define( 'PCLZIP_ERR_USER_ABORTED', 2 );
  define( 'PCLZIP_ERR_NO_ERROR', 0 );
  define( 'PCLZIP_ERR_WRITE_OPEN_FAIL', -1 );
  define( 'PCLZIP_ERR_READ_OPEN_FAIL', -2 );
  define( 'PCLZIP_ERR_INVALID_PARAMETER', -3 );
  define( 'PCLZIP_ERR_MISSING_FILE', -4 );
  define( 'PCLZIP_ERR_FILENAME_TOO_LONG', -5 );
  define( 'PCLZIP_ERR_INVALID_ZIP', -6 );
  define( 'PCLZIP_ERR_BAD_EXTRACTED_FILE', -7 );
  define( 'PCLZIP_ERR_DIR_CREATE_FAIL', -8 );
  define( 'PCLZIP_ERR_BAD_EXTENSION', -9 );
  define( 'PCLZIP_ERR_BAD_FORMAT', -10 );
  define( 'PCLZIP_ERR_DELETE_FILE_FAIL', -11 );
  define( 'PCLZIP_ERR_RENAME_FILE_FAIL', -12 );
  define( 'PCLZIP_ERR_BAD_CHECKSUM', -13 );
  define( 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', -14 );
  define( 'PCLZIP_ERR_MISSING_OPTION_VALUE', -15 );
  define( 'PCLZIP_ERR_INVALID_OPTION_VALUE', -16 );
  define( 'PCLZIP_ERR_ALREADY_A_DIRECTORY', -17 );
  define( 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', -18 );
  define( 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION', -19 );
  define( 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE', -20 );
  define( 'PCLZIP_ERR_DIRECTORY_RESTRICTION', -21 );

  // ----- Options values
  define( 'PCLZIP_OPT_PATH', 77001 );
  define( 'PCLZIP_OPT_ADD_PATH', 77002 );
  define( 'PCLZIP_OPT_REMOVE_PATH', 77003 );
  define( 'PCLZIP_OPT_REMOVE_ALL_PATH', 77004 );
  define( 'PCLZIP_OPT_SET_CHMOD', 77005 );
  define( 'PCLZIP_OPT_EXTRACT_AS_STRING', 77006 );
  define( 'PCLZIP_OPT_NO_COMPRESSION', 77007 );
  define( 'PCLZIP_OPT_BY_NAME', 77008 );
  define( 'PCLZIP_OPT_BY_INDEX', 77009 );
  define( 'PCLZIP_OPT_BY_EREG', 77010 );
  define( 'PCLZIP_OPT_BY_PREG', 77011 );
  define( 'PCLZIP_OPT_COMMENT', 77012 );
  define( 'PCLZIP_OPT_ADD_COMMENT', 77013 );
  define( 'PCLZIP_OPT_PREPEND_COMMENT', 77014 );
  define( 'PCLZIP_OPT_EXTRACT_IN_OUTPUT', 77015 );
  define( 'PCLZIP_OPT_REPLACE_NEWER', 77016 );
  define( 'PCLZIP_OPT_STOP_ON_ERROR', 77017 );
  // Having big trouble with crypt. Need to multiply 2 long int
  // which is not correctly supported by PHP ...
  //define( 'PCLZIP_OPT_CRYPT', 77018 );
  define( 'PCLZIP_OPT_EXTRACT_DIR_RESTRICTION', 77019 );

  // ----- File description attributes
  define( 'PCLZIP_ATT_FILE_NAME', 79001 );
  define( 'PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002 );
  define( 'PCLZIP_ATT_FILE_NEW_FULL_NAME', 79003 );

  // ----- Call backs values
  define( 'PCLZIP_CB_PRE_EXTRACT', 78001 );
  define( 'PCLZIP_CB_POST_EXTRACT', 78002 );
  define( 'PCLZIP_CB_PRE_ADD', 78003 );
  define( 'PCLZIP_CB_POST_ADD', 78004 );
  /* For futur use
  define( 'PCLZIP_CB_PRE_LIST', 78005 );
  define( 'PCLZIP_CB_POST_LIST', 78006 );
  define( 'PCLZIP_CB_PRE_DELETE', 78007 );
  define( 'PCLZIP_CB_POST_DELETE', 78008 );
  */

  // --------------------------------------------------------------------------------
  // Class : PclZip
  // Description :
  //   PclZip is the class that represent a Zip archive.
  //   The public methods allow the manipulation of the archive.
  // Attributes :
  //   Attributes must not be accessed directly.
  // Methods :
  //   PclZip() : Object creator
  //   create() : Creates the Zip archive
  //   listContent() : List the content of the Zip archive
  //   extract() : Extract the content of the archive
  //   properties() : List the properties of the archive
  // --------------------------------------------------------------------------------
  class PclZip
  {
    // ----- Filename of the zip file
    var $zipname = '';

    // ----- File descriptor of the zip file
    var $zip_fd = 0;

    // ----- Internal error handling
    var $error_code = 1;
    var $error_string = '';

    // ----- Current status of the magic_quotes_runtime
    // This value store the php configuration for magic_quotes
    // The class can then disable the magic_quotes and reset it after
    var $magic_quotes_status;

  // --------------------------------------------------------------------------------
  // Function : PclZip()
  // Description :
  //   Creates a PclZip object and set the name of the associated Zip archive
  //   filename.
  //   Note that no real action is taken, if the archive does not exist it is not
  //   created. Use create() for that.
  // --------------------------------------------------------------------------------
  function PclZip($p_zipname)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::PclZip', "zipname=$p_zipname");

    // ----- Tests the zlib
    if (!function_exists('gzopen'))
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 1, "zlib extension seems to be missing");
      die('Abort '.basename(__FILE__).' : Missing zlib extensions');
    }

    // ----- Set the attributes
    $this->zipname = $p_zipname;
    $this->zip_fd = 0;
    $this->magic_quotes_status = -1;

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 1);
    return;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function :
  //   create($p_filelist, $p_add_dir="", $p_remove_dir="")
  //   create($p_filelist, $p_option, $p_option_value, ...)
  // Description :
  //   This method supports two different synopsis. The first one is historical.
  //   This method creates a Zip Archive. The Zip file is created in the
  //   filesystem. The files and directories indicated in $p_filelist
  //   are added in the archive. See the parameters description for the
  //   supported format of $p_filelist.
  //   When a directory is in the list, the directory and its content is added
  //   in the archive.
  //   In this synopsis, the function takes an optional variable list of
  //   options. See bellow the supported options.
  // Parameters :
  //   $p_filelist : An array containing file or directory names, or
  //                 a string containing one filename or one directory name, or
  //                 a string containing a list of filenames and/or directory
  //                 names separated by spaces.
  //   $p_add_dir : A path to add before the real path of the archived file,
  //                in order to have it memorized in the archive.
  //   $p_remove_dir : A path to remove from the real path of the file to archive,
  //                   in order to have a shorter path memorized in the archive.
  //                   When $p_add_dir and $p_remove_dir are set, $p_remove_dir
  //                   is removed first, before $p_add_dir is added.
  // Options :
  //   PCLZIP_OPT_ADD_PATH :
  //   PCLZIP_OPT_REMOVE_PATH :
  //   PCLZIP_OPT_REMOVE_ALL_PATH :
  //   PCLZIP_OPT_COMMENT :
  //   PCLZIP_CB_PRE_ADD :
  //   PCLZIP_CB_POST_ADD :
  // Return Values :
  //   0 on failure,
  //   The list of the added files, with a status of the add action.
  //   (see PclZip::listContent() for list entry format)
  // --------------------------------------------------------------------------------
  function create($p_filelist)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::create', "filelist='$p_filelist', ...");
    $v_result=1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Set default values
    $v_options = array();
    $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE;

    // ----- Look for variable options arguments
    $v_size = func_num_args();
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");

    // ----- Look for arguments
    if ($v_size > 1) {
      // ----- Get the arguments
      $v_arg_list = func_get_args();

      // ----- Remove from the options list the first argument
      array_shift($v_arg_list);
      $v_size--;

      // ----- Look for first arg
      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected");

        // ----- Parse the options
        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
                                            array (PCLZIP_OPT_REMOVE_PATH => 'optional',
                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
                                                   PCLZIP_OPT_ADD_PATH => 'optional',
                                                   PCLZIP_CB_PRE_ADD => 'optional',
                                                   PCLZIP_CB_POST_ADD => 'optional',
                                                   PCLZIP_OPT_NO_COMPRESSION => 'optional',
                                                   PCLZIP_OPT_COMMENT => 'optional'
                                                   //, PCLZIP_OPT_CRYPT => 'optional'
                                             ));
        if ($v_result != 1) {
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
          return 0;
        }
      }

      // ----- Look for 2 args
      // Here we need to support the first historic synopsis of the
      // method.
      else {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis");

        // ----- Get the first argument
        $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0];

        // ----- Look for the optional second argument
        if ($v_size == 2) {
          $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];
        }
        else if ($v_size > 2) {
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,
		                       "Invalid number / type of arguments");
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
          return 0;
        }
      }
    }

    // ----- Init
    $v_string_list = array();
    $v_att_list = array();
    $v_filedescr_list = array();
    $p_result_list = array();

    // ----- Look if the $p_filelist is really an array
    if (is_array($p_filelist)) {

      // ----- Look if the first element is also an array
      //       This will mean that this is a file description entry
      if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
        $v_att_list = $p_filelist;
      }

      // ----- The list is a list of string names
      else {
        $v_string_list = $p_filelist;
      }
    }

    // ----- Look if the $p_filelist is a string
    else if (is_string($p_filelist)) {
      // ----- Create a list from the string
      $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);
    }

    // ----- Invalid variable type for $p_filelist
    else {
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist");
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
      return 0;
    }

    // ----- Reformat the string list
    if (sizeof($v_string_list) != 0) {
      foreach ($v_string_list as $v_string) {
        if ($v_string != '') {
          $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
        }
        else {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Ignore an empty filename");
        }
      }
    }

    // ----- For each file in the list check the attributes
    $v_supported_attributes
    = array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
             ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional'
             ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional'
						);
    foreach ($v_att_list as $v_entry) {
      $v_result = $this->privFileDescrParseAtt($v_entry,
                                               $v_filedescr_list[],
                                               $v_options,
                                               $v_supported_attributes);
      if ($v_result != 1) {
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
        return 0;
      }
    }

    // ----- Expand the filelist (expand directories)
    $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);
    if ($v_result != 1) {
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
      return 0;
    }

    // ----- Call the create fct
    $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options);
    if ($v_result != 1) {
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
      return 0;
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list);
    return $p_result_list;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function :
  //   add($p_filelist, $p_add_dir="", $p_remove_dir="")
  //   add($p_filelist, $p_option, $p_option_value, ...)
  // Description :
  //   This method supports two synopsis. The first one is historical.
  //   This methods add the list of files in an existing archive.
  //   If a file with the same name already exists, it is added at the end of the
  //   archive, the first one is still present.
  //   If the archive does not exist, it is created.
  // Parameters :
  //   $p_filelist : An array containing file or directory names, or
  //                 a string containing one filename or one directory name, or
  //                 a string containing a list of filenames and/or directory
  //                 names separated by spaces.
  //   $p_add_dir : A path to add before the real path of the archived file,
  //                in order to have it memorized in the archive.
  //   $p_remove_dir : A path to remove from the real path of the file to archive,
  //                   in order to have a shorter path memorized in the archive.
  //                   When $p_add_dir and $p_remove_dir are set, $p_remove_dir
  //                   is removed first, before $p_add_dir is added.
  // Options :
  //   PCLZIP_OPT_ADD_PATH :
  //   PCLZIP_OPT_REMOVE_PATH :
  //   PCLZIP_OPT_REMOVE_ALL_PATH :
  //   PCLZIP_OPT_COMMENT :
  //   PCLZIP_OPT_ADD_COMMENT :
  //   PCLZIP_OPT_PREPEND_COMMENT :
  //   PCLZIP_CB_PRE_ADD :
  //   PCLZIP_CB_POST_ADD :
  // Return Values :
  //   0 on failure,
  //   The list of the added files, with a status of the add action.
  //   (see PclZip::listContent() for list entry format)
  // --------------------------------------------------------------------------------
  function add($p_filelist)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::add', "filelist='$p_filelist', ...");
    $v_result=1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Set default values
    $v_options = array();
    $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE;

    // ----- Look for variable options arguments
    $v_size = func_num_args();
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");

    // ----- Look for arguments
    if ($v_size > 1) {
      // ----- Get the arguments
      $v_arg_list = func_get_args();

      // ----- Remove form the options list the first argument
      array_shift($v_arg_list);
      $v_size--;

      // ----- Look for first arg
      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected");

        // ----- Parse the options
        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
                                            array (PCLZIP_OPT_REMOVE_PATH => 'optional',
                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
                                                   PCLZIP_OPT_ADD_PATH => 'optional',
                                                   PCLZIP_CB_PRE_ADD => 'optional',
                                                   PCLZIP_CB_POST_ADD => 'optional',
                                                   PCLZIP_OPT_NO_COMPRESSION => 'optional',
                                                   PCLZIP_OPT_COMMENT => 'optional',
                                                   PCLZIP_OPT_ADD_COMMENT => 'optional',
                                                   PCLZIP_OPT_PREPEND_COMMENT => 'optional'
                                                   //, PCLZIP_OPT_CRYPT => 'optional'
												   ));
        if ($v_result != 1) {
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
          return 0;
        }
      }

      // ----- Look for 2 args
      // Here we need to support the first historic synopsis of the
      // method.
      else {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis");

        // ----- Get the first argument
        $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0];

        // ----- Look for the optional second argument
        if ($v_size == 2) {
          $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];
        }
        else if ($v_size > 2) {
          // ----- Error log
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");

          // ----- Return
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
          return 0;
        }
      }
    }

    // ----- Init
    $v_string_list = array();
    $v_att_list = array();
    $v_filedescr_list = array();
    $p_result_list = array();

    // ----- Look if the $p_filelist is really an array
    if (is_array($p_filelist)) {

      // ----- Look if the first element is also an array
      //       This will mean that this is a file description entry
      if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
        $v_att_list = $p_filelist;
      }

      // ----- The list is a list of string names
      else {
        $v_string_list = $p_filelist;
      }
    }

    // ----- Look if the $p_filelist is a string
    else if (is_string($p_filelist)) {
      // ----- Create a list from the string
      $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);
    }

    // ----- Invalid variable type for $p_filelist
    else {
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist");
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
      return 0;
    }

    // ----- Reformat the string list
    if (sizeof($v_string_list) != 0) {
      foreach ($v_string_list as $v_string) {
        $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
      }
    }

    // ----- For each file in the list check the attributes
    $v_supported_attributes
    = array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
             ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional'
             ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional'
						);
    foreach ($v_att_list as $v_entry) {
      $v_result = $this->privFileDescrParseAtt($v_entry,
                                               $v_filedescr_list[],
                                               $v_options,
                                               $v_supported_attributes);
      if ($v_result != 1) {
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
        return 0;
      }
    }

    // ----- Expand the filelist (expand directories)
    $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);
    if ($v_result != 1) {
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
      return 0;
    }

    // ----- Call the create fct
    $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options);
    if ($v_result != 1) {
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
      return 0;
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list);
    return $p_result_list;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : listContent()
  // Description :
  //   This public method, gives the list of the files and directories, with their
  //   properties.
  //   The properties of each entries in the list are (used also in other functions) :
  //     filename : Name of the file. For a create or add action it is the filename
  //                given by the user. For an extract function it is the filename
  //                of the extracted file.
  //     stored_filename : Name of the file / directory stored in the archive.
  //     size : Size of the stored file.
  //     compressed_size : Size of the file's data compressed in the archive
  //                       (without the headers overhead)
  //     mtime : Last known modification date of the file (UNIX timestamp)
  //     comment : Comment associated with the file
  //     folder : true | false
  //     index : index of the file in the archive
  //     status : status of the action (depending of the action) :
  //              Values are :
  //                ok : OK !
  //                filtered : the file / dir is not extracted (filtered by user)
  //                already_a_directory : the file can not be extracted because a
  //                                      directory with the same name already exists
  //                write_protected : the file can not be extracted because a file
  //                                  with the same name already exists and is
  //                                  write protected
  //                newer_exist : the file was not extracted because a newer file exists
  //                path_creation_fail : the file is not extracted because the folder
  //                                     does not exists and can not be created
  //                write_error : the file was not extracted because there was a
  //                              error while writing the file
  //                read_error : the file was not extracted because there was a error
  //                             while reading the file
  //                invalid_header : the file was not extracted because of an archive
  //                                 format error (bad file header)
  //   Note that each time a method can continue operating when there
  //   is an action error on a file, the error is only logged in the file status.
  // Return Values :
  //   0 on an unrecoverable failure,
  //   The list of the files in the archive.
  // --------------------------------------------------------------------------------
  function listContent()
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::listContent', "");
    $v_result=1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Check archive
    if (!$this->privCheckFormat()) {
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
      return(0);
    }

    // ----- Call the extracting fct
    $p_list = array();
    if (($v_result = $this->privList($p_list)) != 1)
    {
      unset($p_list);
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
      return(0);
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list);
    return $p_list;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function :
  //   extract($p_path="./", $p_remove_path="")
  //   extract([$p_option, $p_option_value, ...])
  // Description :
  //   This method supports two synopsis. The first one is historical.
  //   This method extract all the files / directories from the archive to the
  //   folder indicated in $p_path.
  //   If you want to ignore the 'root' part of path of the memorized files
  //   you can indicate this in the optional $p_remove_path parameter.
  //   By default, if a newer file with the same name already exists, the
  //   file is not extracted.
  //
  //   If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions
  //   are used, the path indicated in PCLZIP_OPT_ADD_PATH is append
  //   at the end of the path value of PCLZIP_OPT_PATH.
  // Parameters :
  //   $p_path : Path where the files and directories are to be extracted
  //   $p_remove_path : First part ('root' part) of the memorized path
  //                    (if any similar) to remove while extracting.
  // Options :
  //   PCLZIP_OPT_PATH :
  //   PCLZIP_OPT_ADD_PATH :
  //   PCLZIP_OPT_REMOVE_PATH :
  //   PCLZIP_OPT_REMOVE_ALL_PATH :
  //   PCLZIP_CB_PRE_EXTRACT :
  //   PCLZIP_CB_POST_EXTRACT :
  // Return Values :
  //   0 or a negative value on failure,
  //   The list of the extracted files, with a status of the action.
  //   (see PclZip::listContent() for list entry format)
  // --------------------------------------------------------------------------------
  function extract()
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extract", "");
    $v_result=1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Check archive
    if (!$this->privCheckFormat()) {
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
      return(0);
    }

    // ----- Set default values
    $v_options = array();
//    $v_path = "./";
    $v_path = '';
    $v_remove_path = "";
    $v_remove_all_path = false;

    // ----- Look for variable options arguments
    $v_size = func_num_args();
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");

    // ----- Default values for option
    $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;

    // ----- Look for arguments
    if ($v_size > 0) {
      // ----- Get the arguments
      $v_arg_list = func_get_args();

      // ----- Look for first arg
      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options");

        // ----- Parse the options
        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
                                            array (PCLZIP_OPT_PATH => 'optional',
                                                   PCLZIP_OPT_REMOVE_PATH => 'optional',
                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
                                                   PCLZIP_OPT_ADD_PATH => 'optional',
                                                   PCLZIP_CB_PRE_EXTRACT => 'optional',
                                                   PCLZIP_CB_POST_EXTRACT => 'optional',
                                                   PCLZIP_OPT_SET_CHMOD => 'optional',
                                                   PCLZIP_OPT_BY_NAME => 'optional',
                                                   PCLZIP_OPT_BY_EREG => 'optional',
                                                   PCLZIP_OPT_BY_PREG => 'optional',
                                                   PCLZIP_OPT_BY_INDEX => 'optional',
                                                   PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
                                                   PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional',
                                                   PCLZIP_OPT_REPLACE_NEWER => 'optional'
                                                   ,PCLZIP_OPT_STOP_ON_ERROR => 'optional'
                                                   ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional'
												    ));
        if ($v_result != 1) {
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
          return 0;
        }

        // ----- Set the arguments
        if (isset($v_options[PCLZIP_OPT_PATH])) {
          $v_path = $v_options[PCLZIP_OPT_PATH];
        }
        if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
          $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
        }
        if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
          $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
        }
        if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
          // ----- Check for '/' in last path char
          if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {
            $v_path .= '/';
          }
          $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];
        }
      }

      // ----- Look for 2 args
      // Here we need to support the first historic synopsis of the
      // method.
      else {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis");

        // ----- Get the first argument
        $v_path = $v_arg_list[0];

        // ----- Look for the optional second argument
        if ($v_size == 2) {
          $v_remove_path = $v_arg_list[1];
        }
        else if ($v_size > 2) {
          // ----- Error log
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");

          // ----- Return
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
          return 0;
        }
      }
    }

    // ----- Trace
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'");

    // ----- Call the extracting fct
    $p_list = array();
    $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path,
	                                     $v_remove_all_path, $v_options);
    if ($v_result < 1) {
      unset($p_list);
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
      return(0);
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list);
    return $p_list;
  }
  // --------------------------------------------------------------------------------


  // --------------------------------------------------------------------------------
  // Function :
  //   extractByIndex($p_index, $p_path="./", $p_remove_path="")
  //   extractByIndex($p_index, [$p_option, $p_option_value, ...])
  // Description :
  //   This method supports two synopsis. The first one is historical.
  //   This method is doing a partial extract of the archive.
  //   The extracted files or folders are identified by their index in the
  //   archive (from 0 to n).
  //   Note that if the index identify a folder, only the folder entry is
  //   extracted, not all the files included in the archive.
  // Parameters :
  //   $p_index : A single index (integer) or a string of indexes of files to
  //              extract. The form of the string is "0,4-6,8-12" with only numbers
  //              and '-' for range or ',' to separate ranges. No spaces or ';'
  //              are allowed.
  //   $p_path : Path where the files and directories are to be extracted
  //   $p_remove_path : First part ('root' part) of the memorized path
  //                    (if any similar) to remove while extracting.
  // Options :
  //   PCLZIP_OPT_PATH :
  //   PCLZIP_OPT_ADD_PATH :
  //   PCLZIP_OPT_REMOVE_PATH :
  //   PCLZIP_OPT_REMOVE_ALL_PATH :
  //   PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and
  //     not as files.
  //     The resulting content is in a new field 'content' in the file
  //     structure.
  //     This option must be used alone (any other options are ignored).
  //   PCLZIP_CB_PRE_EXTRACT :
  //   PCLZIP_CB_POST_EXTRACT :
  // Return Values :
  //   0 on failure,
  //   The list of the extracted files, with a status of the action.
  //   (see PclZip::listContent() for list entry format)
  // --------------------------------------------------------------------------------
  //function extractByIndex($p_index, options...)
  function extractByIndex($p_index)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extractByIndex", "index='$p_index', ...");
    $v_result=1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Check archive
    if (!$this->privCheckFormat()) {
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
      return(0);
    }

    // ----- Set default values
    $v_options = array();
//    $v_path = "./";
    $v_path = '';
    $v_remove_path = "";
    $v_remove_all_path = false;

    // ----- Look for variable options arguments
    $v_size = func_num_args();
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");

    // ----- Default values for option
    $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;

    // ----- Look for arguments
    if ($v_size > 1) {
      // ----- Get the arguments
      $v_arg_list = func_get_args();

      // ----- Remove form the options list the first argument
      array_shift($v_arg_list);
      $v_size--;

      // ----- Look for first arg
      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options");

        // ----- Parse the options
        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
                                            array (PCLZIP_OPT_PATH => 'optional',
                                                   PCLZIP_OPT_REMOVE_PATH => 'optional',
                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
                                                   PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
                                                   PCLZIP_OPT_ADD_PATH => 'optional',
                                                   PCLZIP_CB_PRE_EXTRACT => 'optional',
                                                   PCLZIP_CB_POST_EXTRACT => 'optional',
                                                   PCLZIP_OPT_SET_CHMOD => 'optional',
                                                   PCLZIP_OPT_REPLACE_NEWER => 'optional'
                                                   ,PCLZIP_OPT_STOP_ON_ERROR => 'optional'
                                                   ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional'
												   ));
        if ($v_result != 1) {
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
          return 0;
        }

        // ----- Set the arguments
        if (isset($v_options[PCLZIP_OPT_PATH])) {
          $v_path = $v_options[PCLZIP_OPT_PATH];
        }
        if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
          $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
        }
        if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
          $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
        }
        if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
          // ----- Check for '/' in last path char
          if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {
            $v_path .= '/';
          }
          $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];
        }
        if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) {
          $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING not set.");
        }
        else {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING set.");
        }
      }

      // ----- Look for 2 args
      // Here we need to support the first historic synopsis of the
      // method.
      else {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis");

        // ----- Get the first argument
        $v_path = $v_arg_list[0];

        // ----- Look for the optional second argument
        if ($v_size == 2) {
          $v_remove_path = $v_arg_list[1];
        }
        else if ($v_size > 2) {
          // ----- Error log
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");

          // ----- Return
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
          return 0;
        }
      }
    }

    // ----- Trace
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "index='$p_index', path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'");

    // ----- Trick
    // Here I want to reuse extractByRule(), so I need to parse the $p_index
    // with privParseOptions()
    $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index);
    $v_options_trick = array();
    $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick,
                                        array (PCLZIP_OPT_BY_INDEX => 'optional' ));
    if ($v_result != 1) {
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
        return 0;
    }
    $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX];

    // ----- Call the extracting fct
    if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) {
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
        return(0);
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list);
    return $p_list;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function :
  //   delete([$p_option, $p_option_value, ...])
  // Description :
  //   This method removes files from the archive.
  //   If no parameters are given, then all the archive is emptied.
  // Parameters :
  //   None or optional arguments.
  // Options :
  //   PCLZIP_OPT_BY_INDEX :
  //   PCLZIP_OPT_BY_NAME :
  //   PCLZIP_OPT_BY_EREG :
  //   PCLZIP_OPT_BY_PREG :
  // Return Values :
  //   0 on failure,
  //   The list of the files which are still present in the archive.
  //   (see PclZip::listContent() for list entry format)
  // --------------------------------------------------------------------------------
  function delete()
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::delete", "");
    $v_result=1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Check archive
    if (!$this->privCheckFormat()) {
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
      return(0);
    }

    // ----- Set default values
    $v_options = array();

    // ----- Look for variable options arguments
    $v_size = func_num_args();
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");

    // ----- Look for arguments
    if ($v_size > 0) {
      // ----- Get the arguments
      $v_arg_list = func_get_args();

      // ----- Parse the options
      $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
                                        array (PCLZIP_OPT_BY_NAME => 'optional',
                                               PCLZIP_OPT_BY_EREG => 'optional',
                                               PCLZIP_OPT_BY_PREG => 'optional',
                                               PCLZIP_OPT_BY_INDEX => 'optional' ));
      if ($v_result != 1) {
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
          return 0;
      }
    }

    // ----- Magic quotes trick
    $this->privDisableMagicQuotes();

    // ----- Call the delete fct
    $v_list = array();
    if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) {
      $this->privSwapBackMagicQuotes();
      unset($v_list);
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
      return(0);
    }

    // ----- Magic quotes trick
    $this->privSwapBackMagicQuotes();

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_list);
    return $v_list;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : deleteByIndex()
  // Description :
  //   ***** Deprecated *****
  //   delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered.
  // --------------------------------------------------------------------------------
  function deleteByIndex($p_index)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::deleteByIndex", "index='$p_index'");

    $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index);

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list);
    return $p_list;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : properties()
  // Description :
  //   This method gives the properties of the archive.
  //   The properties are :
  //     nb : Number of files in the archive
  //     comment : Comment associated with the archive file
  //     status : not_exist, ok
  // Parameters :
  //   None
  // Return Values :
  //   0 on failure,
  //   An array with the archive properties.
  // --------------------------------------------------------------------------------
  function properties()
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::properties", "");

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Magic quotes trick
    $this->privDisableMagicQuotes();

    // ----- Check archive
    if (!$this->privCheckFormat()) {
      $this->privSwapBackMagicQuotes();
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
      return(0);
    }

    // ----- Default properties
    $v_prop = array();
    $v_prop['comment'] = '';
    $v_prop['nb'] = 0;
    $v_prop['status'] = 'not_exist';

    // ----- Look if file exists
    if (@is_file($this->zipname))
    {
      // ----- Open the zip file
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
      if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)
      {
        $this->privSwapBackMagicQuotes();

        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');

        // ----- Return
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), 0);
        return 0;
      }

      // ----- Read the central directory informations
      $v_central_dir = array();
      if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
      {
        $this->privSwapBackMagicQuotes();
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
        return 0;
      }

      // ----- Close the zip file
      $this->privCloseFd();

      // ----- Set the user attributes
      $v_prop['comment'] = $v_central_dir['comment'];
      $v_prop['nb'] = $v_central_dir['entries'];
      $v_prop['status'] = 'ok';
    }

    // ----- Magic quotes trick
    $this->privSwapBackMagicQuotes();

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_prop);
    return $v_prop;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : duplicate()
  // Description :
  //   This method creates an archive by copying the content of an other one. If
  //   the archive already exist, it is replaced by the new one without any warning.
  // Parameters :
  //   $p_archive : The filename of a valid archive, or
  //                a valid PclZip object.
  // Return Values :
  //   1 on success.
  //   0 or a negative value on error (error code).
  // --------------------------------------------------------------------------------
  function duplicate($p_archive)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::duplicate", "");
    $v_result = 1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Look if the $p_archive is a PclZip object
    if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip'))
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is valid PclZip object '".$p_archive->zipname."'");

      // ----- Duplicate the archive
      $v_result = $this->privDuplicate($p_archive->zipname);
    }

    // ----- Look if the $p_archive is a string (so a filename)
    else if (is_string($p_archive))
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is a filename '$p_archive'");

      // ----- Check that $p_archive is a valid zip file
      // TBC : Should also check the archive format
      if (!is_file($p_archive)) {
        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'");
        $v_result = PCLZIP_ERR_MISSING_FILE;
      }
      else {
        // ----- Duplicate the archive
        $v_result = $this->privDuplicate($p_archive);
      }
    }

    // ----- Invalid variable
    else
    {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add");
      $v_result = PCLZIP_ERR_INVALID_PARAMETER;
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : merge()
  // Description :
  //   This method merge the $p_archive_to_add archive at the end of the current
  //   one ($this).
  //   If the archive ($this) does not exist, the merge becomes a duplicate.
  //   If the $p_archive_to_add archive does not exist, the merge is a success.
  // Parameters :
  //   $p_archive_to_add : It can be directly the filename of a valid zip archive,
  //                       or a PclZip object archive.
  // Return Values :
  //   1 on success,
  //   0 or negative values on error (see below).
  // --------------------------------------------------------------------------------
  function merge($p_archive_to_add)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::merge", "");
    $v_result = 1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Check archive
    if (!$this->privCheckFormat()) {
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
      return(0);
    }

    // ----- Look if the $p_archive_to_add is a PclZip object
    if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip'))
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is valid PclZip object");

      // ----- Merge the archive
      $v_result = $this->privMerge($p_archive_to_add);
    }

    // ----- Look if the $p_archive_to_add is a string (so a filename)
    else if (is_string($p_archive_to_add))
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is a filename");

      // ----- Create a temporary archive
      $v_object_archive = new PclZip($p_archive_to_add);

      // ----- Merge the archive
      $v_result = $this->privMerge($v_object_archive);
    }

    // ----- Invalid variable
    else
    {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add");
      $v_result = PCLZIP_ERR_INVALID_PARAMETER;
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------



  // --------------------------------------------------------------------------------
  // Function : errorCode()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function errorCode()
  {
    if (PCLZIP_ERROR_EXTERNAL == 1) {
      return(PclErrorCode());
    }
    else {
      return($this->error_code);
    }
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : errorName()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function errorName($p_with_code=false)
  {
    $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR',
                      PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL',
                      PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL',
                      PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER',
                      PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE',
                      PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG',
                      PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP',
                      PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE',
                      PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL',
                      PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION',
                      PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT',
                      PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL',
                      PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL',
                      PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM',
                      PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP',
                      PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE',
                      PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE',
                      PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION',
                      PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION'
                      ,PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE'
                      ,PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION'
                    );

    if (isset($v_name[$this->error_code])) {
      $v_value = $v_name[$this->error_code];
    }
    else {
      $v_value = 'NoName';
    }

    if ($p_with_code) {
      return($v_value.' ('.$this->error_code.')');
    }
    else {
      return($v_value);
    }
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : errorInfo()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function errorInfo($p_full=false)
  {
    if (PCLZIP_ERROR_EXTERNAL == 1) {
      return(PclErrorString());
    }
    else {
      if ($p_full) {
        return($this->errorName(true)." : ".$this->error_string);
      }
      else {
        return($this->error_string." [code ".$this->error_code."]");
      }
    }
  }
  // --------------------------------------------------------------------------------


// --------------------------------------------------------------------------------
// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS *****
// *****                                                        *****
// *****       THESES FUNCTIONS MUST NOT BE USED DIRECTLY       *****
// --------------------------------------------------------------------------------



  // --------------------------------------------------------------------------------
  // Function : privCheckFormat()
  // Description :
  //   This method check that the archive exists and is a valid zip archive.
  //   Several level of check exists. (futur)
  // Parameters :
  //   $p_level : Level of check. Default 0.
  //              0 : Check the first bytes (magic codes) (default value))
  //              1 : 0 + Check the central directory (futur)
  //              2 : 1 + Check each file header (futur)
  // Return Values :
  //   true on success,
  //   false on error, the error code is set.
  // --------------------------------------------------------------------------------
  function privCheckFormat($p_level=0)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFormat", "");
    $v_result = true;

	// ----- Reset the file system cache
    clearstatcache();

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Look if the file exits
    if (!is_file($this->zipname)) {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'");
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo());
      return(false);
    }

    // ----- Check that the file is readeable
    if (!is_readable($this->zipname)) {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'");
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo());
      return(false);
    }

    // ----- Check the magic code
    // TBC

    // ----- Check the central header
    // TBC

    // ----- Check each file header
    // TBC

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privParseOptions()
  // Description :
  //   This internal methods reads the variable list of arguments ($p_options_list,
  //   $p_size) and generate an array with the options and values ($v_result_list).
  //   $v_requested_options contains the options that can be present and those that
  //   must be present.
  //   $v_requested_options is an array, with the option value as key, and 'optional',
  //   or 'mandatory' as value.
  // Parameters :
  //   See above.
  // Return Values :
  //   1 on success.
  //   0 on failure.
  // --------------------------------------------------------------------------------
  function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privParseOptions", "");
    $v_result=1;

    // ----- Read the options
    $i=0;
    while ($i<$p_size) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Looking for table index $i, option = '".PclZipUtilOptionText($p_options_list[$i])."(".$p_options_list[$i].")'");

      // ----- Check if the option is supported
      if (!isset($v_requested_options[$p_options_list[$i]])) {
        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method");

        // ----- Return
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
        return PclZip::errorCode();
      }

      // ----- Look for next option
      switch ($p_options_list[$i]) {
        // ----- Look for options that request a path value
        case PCLZIP_OPT_PATH :
        case PCLZIP_OPT_REMOVE_PATH :
        case PCLZIP_OPT_ADD_PATH :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

          // ----- Get the value
          $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false);
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
          $i++;
        break;

        case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

          // ----- Get the value
          if (   is_string($p_options_list[$i+1])
              && ($p_options_list[$i+1] != '')) {
            $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false);
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
            $i++;
          }
          else {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." set with an empty value is ignored.");
          }
        break;

        // ----- Look for options that request an array of string for value
        case PCLZIP_OPT_BY_NAME :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

          // ----- Get the value
          if (is_string($p_options_list[$i+1])) {
              $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1];
          }
          else if (is_array($p_options_list[$i+1])) {
              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
          }
          else {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }
          ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
          $i++;
        break;

        // ----- Look for options that request an EREG or PREG expression
        case PCLZIP_OPT_BY_EREG :
        case PCLZIP_OPT_BY_PREG :
        //case PCLZIP_OPT_CRYPT :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

          // ----- Get the value
          if (is_string($p_options_list[$i+1])) {
              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
          }
          else {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
          $i++;
        break;

        // ----- Look for options that takes a string
        case PCLZIP_OPT_COMMENT :
        case PCLZIP_OPT_ADD_COMMENT :
        case PCLZIP_OPT_PREPEND_COMMENT :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE,
			                     "Missing parameter value for option '"
								 .PclZipUtilOptionText($p_options_list[$i])
								 ."'");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

          // ----- Get the value
          if (is_string($p_options_list[$i+1])) {
              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
          }
          else {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE,
			                     "Wrong parameter value for option '"
								 .PclZipUtilOptionText($p_options_list[$i])
								 ."'");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
          $i++;
        break;

        // ----- Look for options that request an array of index
        case PCLZIP_OPT_BY_INDEX :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

          // ----- Get the value
          $v_work_list = array();
          if (is_string($p_options_list[$i+1])) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is a string '".$p_options_list[$i+1]."'");

              // ----- Remove spaces
              $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', '');

              // ----- Parse items
              $v_work_list = explode(",", $p_options_list[$i+1]);
          }
          else if (is_integer($p_options_list[$i+1])) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an integer '".$p_options_list[$i+1]."'");
              $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1];
          }
          else if (is_array($p_options_list[$i+1])) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an array");
              $v_work_list = $p_options_list[$i+1];
          }
          else {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

          // ----- Reduce the index list
          // each index item in the list must be a couple with a start and
          // an end value : [0,3], [5-5], [8-10], ...
          // ----- Check the format of each item
          $v_sort_flag=false;
          $v_sort_value=0;
          for ($j=0; $j<sizeof($v_work_list); $j++) {
              // ----- Explode the item
              $v_item_list = explode("-", $v_work_list[$j]);
              $v_size_item_list = sizeof($v_item_list);

              // ----- TBC : Here we might check that each item is a
              // real integer ...

              // ----- Look for single value
              if ($v_size_item_list == 1) {
                  // ----- Set the option value
                  $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];
                  $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[0];
              }
              elseif ($v_size_item_list == 2) {
                  // ----- Set the option value
                  $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];
                  $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[1];
              }
              else {
                  // ----- Error log
                  PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Too many values in index range for option '".PclZipUtilOptionText($p_options_list[$i])."'");

                  // ----- Return
                  //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
                  return PclZip::errorCode();
              }

              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extracted index item = [".$v_result_list[$p_options_list[$i]][$j]['start'].",".$v_result_list[$p_options_list[$i]][$j]['end']."]");

              // ----- Look for list sort
              if ($v_result_list[$p_options_list[$i]][$j]['start'] < $v_sort_value) {
                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The list should be sorted ...");
                  $v_sort_flag=true;

                  // ----- TBC : An automatic sort should be writen ...
                  // ----- Error log
                  PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Invalid order of index range for option '".PclZipUtilOptionText($p_options_list[$i])."'");

                  // ----- Return
                  //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
                  return PclZip::errorCode();
              }
              $v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start'];
          }

          // ----- Sort the items
          if ($v_sort_flag) {
              // TBC : To Be Completed
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "List sorting is not yet write ...");
          }

          // ----- Next option
          $i++;
        break;

        // ----- Look for options that request no value
        case PCLZIP_OPT_REMOVE_ALL_PATH :
        case PCLZIP_OPT_EXTRACT_AS_STRING :
        case PCLZIP_OPT_NO_COMPRESSION :
        case PCLZIP_OPT_EXTRACT_IN_OUTPUT :
        case PCLZIP_OPT_REPLACE_NEWER :
        case PCLZIP_OPT_STOP_ON_ERROR :
          $v_result_list[$p_options_list[$i]] = true;
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
        break;

        // ----- Look for options that request an octal value
        case PCLZIP_OPT_SET_CHMOD :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

          // ----- Get the value
          $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
          $i++;
        break;

        // ----- Look for options that request a call-back
        case PCLZIP_CB_PRE_EXTRACT :
        case PCLZIP_CB_POST_EXTRACT :
        case PCLZIP_CB_PRE_ADD :
        case PCLZIP_CB_POST_ADD :
        /* for futur use
        case PCLZIP_CB_PRE_DELETE :
        case PCLZIP_CB_POST_DELETE :
        case PCLZIP_CB_PRE_LIST :
        case PCLZIP_CB_POST_LIST :
        */
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

          // ----- Get the value
          $v_function_name = $p_options_list[$i+1];
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "call-back ".PclZipUtilOptionText($p_options_list[$i])." = '".$v_function_name."'");

          // ----- Check that the value is a valid existing function
          if (!function_exists($v_function_name)) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

          // ----- Set the attribute
          $v_result_list[$p_options_list[$i]] = $v_function_name;
          $i++;
        break;

        default :
          // ----- Error log
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,
		                       "Unknown parameter '"
							   .$p_options_list[$i]."'");

          // ----- Return
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
          return PclZip::errorCode();
      }

      // ----- Next options
      $i++;
    }

    // ----- Look for mandatory options
    if ($v_requested_options !== false) {
      for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) {
        // ----- Look for mandatory option
        if ($v_requested_options[$key] == 'mandatory') {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Detect a mandatory option : ".PclZipUtilOptionText($key)."(".$key.")");
          // ----- Look if present
          if (!isset($v_result_list[$key])) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")");

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }
        }
      }
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privFileDescrParseAtt()
  // Description :
  // Parameters :
  // Return Values :
  //   1 on success.
  //   0 on failure.
  // --------------------------------------------------------------------------------
  function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrParseAtt", "");
    $v_result=1;

    // ----- For each file in the list check the attributes
    foreach ($p_file_list as $v_key => $v_value) {

      // ----- Check if the option is supported
      if (!isset($v_requested_options[$v_key])) {
        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file");

        // ----- Return
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
        return PclZip::errorCode();
      }

      // ----- Look for attribute
      switch ($v_key) {
        case PCLZIP_ATT_FILE_NAME :
          if (!is_string($v_value)) {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

          $p_filedescr['filename'] = PclZipUtilPathReduction($v_value);
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'");

          if ($p_filedescr['filename'] == '') {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'");
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

        break;

        case PCLZIP_ATT_FILE_NEW_SHORT_NAME :
          if (!is_string($v_value)) {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

          $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value);
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'");

          if ($p_filedescr['new_short_name'] == '') {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'");
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }
        break;

        case PCLZIP_ATT_FILE_NEW_FULL_NAME :
          if (!is_string($v_value)) {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }

          $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value);
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($v_key)." = '".$v_value."'");

          if ($p_filedescr['new_full_name'] == '') {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'");
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
          }
        break;

        default :
          // ----- Error log
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,
		                           "Unknown parameter '".$v_key."'");

          // ----- Return
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
          return PclZip::errorCode();
      }

      // ----- Look for mandatory options
      if ($v_requested_options !== false) {
        for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) {
          // ----- Look for mandatory option
          if ($v_requested_options[$key] == 'mandatory') {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Detect a mandatory option : ".PclZipUtilOptionText($key)."(".$key.")");
            // ----- Look if present
            if (!isset($p_file_list[$key])) {
              PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")");
              //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
              return PclZip::errorCode();
            }
          }
        }
      }

    // end foreach
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privFileDescrExpand()
  // Description :
  // Parameters :
  // Return Values :
  //   1 on success.
  //   0 on failure.
  // --------------------------------------------------------------------------------
  function privFileDescrExpand(&$p_filedescr_list, &$p_options)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privFileDescrExpand", "");
    $v_result=1;

    // ----- Create a result list
    $v_result_list = array();

    // ----- Look each entry
    for ($i=0; $i<sizeof($p_filedescr_list); $i++) {
      // ----- Get filedescr
      $v_descr = $p_filedescr_list[$i];

      // ----- Reduce the filename
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filedescr before reduction :'".$v_descr['filename']."'");
      $v_descr['filename'] = PclZipUtilTranslateWinPath($v_descr['filename']);
      $v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filedescr after reduction :'".$v_descr['filename']."'");

      // ----- Get type of descr
      if (!file_exists($v_descr['filename'])) {
        // ----- Error log
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_descr['filename']."' does not exists");
        PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$v_descr['filename']."' does not exists");

        // ----- Return
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
        return PclZip::errorCode();
      }
      if (@is_file($v_descr['filename'])) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "This is a file");
        $v_descr['type'] = 'file';
      }
      else if (@is_dir($v_descr['filename'])) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "This is a folder");
        $v_descr['type'] = 'folder';
      }
      else if (@is_link($v_descr['filename'])) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Unsupported file type : link");
        // skip
        continue;
      }
      else {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Unsupported file type : unknown type");
        // skip
        continue;
      }

      // ----- Calculate the stored filename
      $this->privCalculateStoredFilename($v_descr, $p_options);

      // ----- Add the descriptor in result list
      $v_result_list[sizeof($v_result_list)] = $v_descr;

      // ----- Look for folder
      if ($v_descr['type'] == 'folder') {
        // ----- List of items in folder
        $v_dirlist_descr = array();
        $v_dirlist_nb = 0;
        if ($v_folder_handler = @opendir($v_descr['filename'])) {
          while (($v_item_handler = @readdir($v_folder_handler)) !== false) {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for '".$v_item_handler."' in the directory");

            // ----- Skip '.' and '..'
            if (($v_item_handler == '.') || ($v_item_handler == '..')) {
                continue;
            }

            // ----- Compose the full filename
            $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler;

            // ----- Look for different stored filename
            // Because the name of the folder was changed, the name of the
            // files/sub-folders also change
            if ($v_descr['stored_filename'] != $v_descr['filename']) {
              $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler;
            }

            $v_dirlist_nb++;
          }
        }
        else {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to open dir '".$v_descr['filename']."' in read mode. Skipped.");
          // TBC : unable to open folder in read mode
        }

        // ----- Expand each element of the list
        if ($v_dirlist_nb != 0) {
          // ----- Expand
          if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) {
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
            return $v_result;
          }

          // ----- Concat the resulting list
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Merging result list (size '".sizeof($v_result_list)."') with dirlist (size '".sizeof($v_dirlist_descr)."')");
          $v_result_list = array_merge($v_result_list, $v_dirlist_descr);
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "merged result list is size '".sizeof($v_result_list)."'");
        }
        else {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Nothing in this folder to expand.");
        }

        // ----- Free local array
        unset($v_dirlist_descr);
      }
    }

    // ----- Get the result list
    $p_filedescr_list = $v_result_list;

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privCreate()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privCreate($p_filedescr_list, &$p_result_list, &$p_options)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCreate", "list");
    $v_result=1;
    $v_list_detail = array();

    // ----- Magic quotes trick
    $this->privDisableMagicQuotes();

    // ----- Open the file in write mode
    if (($v_result = $this->privOpenFd('wb')) != 1)
    {
      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Add the list of files
    $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options);

    // ----- Close
    $this->privCloseFd();

    // ----- Magic quotes trick
    $this->privSwapBackMagicQuotes();

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privAdd()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privAdd($p_filedescr_list, &$p_result_list, &$p_options)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAdd", "list");
    $v_result=1;
    $v_list_detail = array();

    // ----- Look if the archive exists or is empty
    if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0))
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, or is empty, create it.");

      // ----- Do a create
      $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options);

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }
    // ----- Magic quotes trick
    $this->privDisableMagicQuotes();

    // ----- Open the zip file
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
    if (($v_result=$this->privOpenFd('rb')) != 1)
    {
      // ----- Magic quotes trick
      $this->privSwapBackMagicQuotes();

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Read the central directory informations
    $v_central_dir = array();
    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
    {
      $this->privCloseFd();
      $this->privSwapBackMagicQuotes();
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Go to beginning of File
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'");
    @rewind($this->zip_fd);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'");

    // ----- Creates a temporay file
    $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';

    // ----- Open the temporary file in write mode
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
    if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)
    {
      $this->privCloseFd();
      $this->privSwapBackMagicQuotes();

      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode');

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- Copy the files from the archive to the temporary file
    // TBC : Here I should better append the file and go back to erase the central dir
    $v_size = $v_central_dir['offset'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
      $v_buffer = fread($this->zip_fd, $v_read_size);
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Swap the file descriptor
    // Here is a trick : I swap the temporary fd with the zip fd, in order to use
    // the following methods on the temporary fil and not the real archive
    $v_swap = $this->zip_fd;
    $this->zip_fd = $v_zip_temp_fd;
    $v_zip_temp_fd = $v_swap;

    // ----- Add the files
    $v_header_list = array();
    if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1)
    {
      fclose($v_zip_temp_fd);
      $this->privCloseFd();
      @unlink($v_zip_temp_name);
      $this->privSwapBackMagicQuotes();

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Store the offset of the central dir
    $v_offset = @ftell($this->zip_fd);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset");

    // ----- Copy the block of file headers from the old archive
    $v_size = $v_central_dir['size'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
      $v_buffer = @fread($v_zip_temp_fd, $v_read_size);
      @fwrite($this->zip_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Create the Central Dir files header
    for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++)
    {
      // ----- Create the file header
      if ($v_header_list[$i]['status'] == 'ok') {
        if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
          fclose($v_zip_temp_fd);
          $this->privCloseFd();
          @unlink($v_zip_temp_name);
          $this->privSwapBackMagicQuotes();

          // ----- Return
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
          return $v_result;
        }
        $v_count++;
      }

      // ----- Transform the header to a 'usable' info
      $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
    }

    // ----- Zip file comment
    $v_comment = $v_central_dir['comment'];
    if (isset($p_options[PCLZIP_OPT_COMMENT])) {
      $v_comment = $p_options[PCLZIP_OPT_COMMENT];
    }
    if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) {
      $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT];
    }
    if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) {
      $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment;
    }

    // ----- Calculate the size of the central header
    $v_size = @ftell($this->zip_fd)-$v_offset;

    // ----- Create the central dir footer
    if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1)
    {
      // ----- Reset the file list
      unset($v_header_list);
      $this->privSwapBackMagicQuotes();

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Swap back the file descriptor
    $v_swap = $this->zip_fd;
    $this->zip_fd = $v_zip_temp_fd;
    $v_zip_temp_fd = $v_swap;

    // ----- Close
    $this->privCloseFd();

    // ----- Close the temporary file
    @fclose($v_zip_temp_fd);

    // ----- Magic quotes trick
    $this->privSwapBackMagicQuotes();

    // ----- Delete the zip file
    // TBC : I should test the result ...
    @unlink($this->zipname);

    // ----- Rename the temporary file
    // TBC : I should test the result ...
    //@rename($v_zip_temp_name, $this->zipname);
    PclZipUtilRename($v_zip_temp_name, $this->zipname);

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privOpenFd()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function privOpenFd($p_mode)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privOpenFd", 'mode='.$p_mode);
    $v_result=1;

    // ----- Look if already open
    if ($this->zip_fd != 0)
    {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open');

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- Open the zip file
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Open file in '.$p_mode.' mode');
    if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0)
    {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode');

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privCloseFd()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function privCloseFd()
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCloseFd", "");
    $v_result=1;

    if ($this->zip_fd != 0)
      @fclose($this->zip_fd);
    $this->zip_fd = 0;

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privAddList()
  // Description :
  //   $p_add_dir and $p_remove_dir will give the ability to memorize a path which is
  //   different from the real path of the file. This is usefull if you want to have PclTar
  //   running in any directory, and memorize relative path from an other directory.
  // Parameters :
  //   $p_list : An array containing the file or directory names to add in the tar
  //   $p_result_list : list of added files with their properties (specially the status field)
  //   $p_add_dir : Path to add in the filename path archived
  //   $p_remove_dir : Path to remove in the filename path archived
  // Return Values :
  // --------------------------------------------------------------------------------
//  function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options)
  function privAddList($p_filedescr_list, &$p_result_list, &$p_options)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddList", "list");
    $v_result=1;

    // ----- Add the files
    $v_header_list = array();
    if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1)
    {
      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Store the offset of the central dir
    $v_offset = @ftell($this->zip_fd);

    // ----- Create the Central Dir files header
    for ($i=0,$v_count=0; $i<sizeof($v_header_list); $i++)
    {
      // ----- Create the file header
      if ($v_header_list[$i]['status'] == 'ok') {
        if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
          // ----- Return
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
          return $v_result;
        }
        $v_count++;
      }

      // ----- Transform the header to a 'usable' info
      $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
    }

    // ----- Zip file comment
    $v_comment = '';
    if (isset($p_options[PCLZIP_OPT_COMMENT])) {
      $v_comment = $p_options[PCLZIP_OPT_COMMENT];
    }

    // ----- Calculate the size of the central header
    $v_size = @ftell($this->zip_fd)-$v_offset;

    // ----- Create the central dir footer
    if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1)
    {
      // ----- Reset the file list
      unset($v_header_list);

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privAddFileList()
  // Description :
  // Parameters :
  //   $p_filedescr_list : An array containing the file description
  //                      or directory names to add in the zip
  //   $p_result_list : list of added files with their properties (specially the status field)
  // Return Values :
  // --------------------------------------------------------------------------------
  function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFileList", "filedescr_list");
    $v_result=1;
    $v_header = array();

    // ----- Recuperate the current number of elt in list
    $v_nb = sizeof($p_result_list);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Before add, list have ".$v_nb." elements");

    // ----- Loop on the files
    for ($j=0; ($j<sizeof($p_filedescr_list)) && ($v_result==1); $j++) {
      // ----- Format the filename
      $p_filedescr_list[$j]['filename']
      = PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false);

      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for file '".$p_filedescr_list[$j]['filename']."'");

      // ----- Skip empty file names
      // TBC : Can this be possible ? not checked in DescrParseAtt ?
      if ($p_filedescr_list[$j]['filename'] == "") {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Skip empty filename");
        continue;
      }

      // ----- Check the filename
      if (!file_exists($p_filedescr_list[$j]['filename'])) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$p_filedescr_list[$j]['filename']."' does not exists");
        PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$p_filedescr_list[$j]['filename']."' does not exists");
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
        return PclZip::errorCode();
      }

      // ----- Look if it is a file or a dir with no all path remove option
      if (   (is_file($p_filedescr_list[$j]['filename']))
          || (   is_dir($p_filedescr_list[$j]['filename'])
              && (   !isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])
                  || !$p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) {

        // ----- Add the file
        $v_result = $this->privAddFile($p_filedescr_list[$j], $v_header,
                                       $p_options);
        if ($v_result != 1) {
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
          return $v_result;
        }

        // ----- Store the file infos
        $p_result_list[$v_nb++] = $v_header;
      }
    }
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "After add, list have ".$v_nb." elements");

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privAddFile()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privAddFile($p_filedescr, &$p_header, &$p_options)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFile", "filename='".$p_filedescr['filename']."'");
    $v_result=1;

    // ----- Working variable
    $p_filename = $p_filedescr['filename'];

    // TBC : Already done in the fileAtt check ... ?
    if ($p_filename == "") {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)");

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- Look for a stored different filename
    if (isset($p_filedescr['stored_filename'])) {
      $v_stored_filename = $p_filedescr['stored_filename'];
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'Stored filename is NOT the same "'.$v_stored_filename.'"');
    }
    else {
      $v_stored_filename = $p_filedescr['stored_filename'];
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'Stored filename is the same');
    }

    // ----- Set the file properties
    clearstatcache();
    $p_header['version'] = 20;
    $p_header['version_extracted'] = 10;
    $p_header['flag'] = 0;
    $p_header['compression'] = 0;
    $p_header['mtime'] = filemtime($p_filename);
    $p_header['crc'] = 0;
    $p_header['compressed_size'] = 0;
    $p_header['size'] = filesize($p_filename);
    $p_header['filename_len'] = strlen($p_filename);
    $p_header['extra_len'] = 0;
    $p_header['comment_len'] = 0;
    $p_header['disk'] = 0;
    $p_header['internal'] = 0;
//    $p_header['external'] = (is_file($p_filename)?0xFE49FFE0:0x41FF0010);
    $p_header['external'] = (is_file($p_filename)?0x00000000:0x00000010);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header external extension '".sprintf("0x%X",$p_header['external'])."'");
    $p_header['offset'] = 0;
    $p_header['filename'] = $p_filename;
    $p_header['stored_filename'] = $v_stored_filename;
    $p_header['extra'] = '';
    $p_header['comment'] = '';
    $p_header['status'] = 'ok';
    $p_header['index'] = -1;

    // ----- Look for pre-add callback
    if (isset($p_options[PCLZIP_CB_PRE_ADD])) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_ADD]."()') is defined for the extraction");

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_header, $v_local_header);

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);');
      if ($v_result == 0) {
        // ----- Change the file status
        $p_header['status'] = "skipped";
        $v_result = 1;
      }

      // ----- Update the informations
      // Only some fields can be modified
      if ($p_header['stored_filename'] != $v_local_header['stored_filename']) {
        $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']);
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New stored filename is '".$p_header['stored_filename']."'");
      }
    }

    // ----- Look for empty stored filename
    if ($p_header['stored_filename'] == "") {
      $p_header['status'] = "filtered";
    }

    // ----- Check the path length
    if (strlen($p_header['stored_filename']) > 0xFF) {
      $p_header['status'] = 'filename_too_long';
    }

    // ----- Look if no error, or file not skipped
    if ($p_header['status'] == 'ok') {

      // ----- Look for a file
      if (is_file($p_filename))
      {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a file");
        // ----- Open the source file
        if (($v_file = @fopen($p_filename, "rb")) == 0) {
          PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode");
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
          return PclZip::errorCode();
        }

        if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be compressed");
          // ----- Read the file content
          $v_content_compressed = @fread($v_file, $p_header['size']);

          // ----- Calculate the CRC
          $p_header['crc'] = @crc32($v_content_compressed);

          // ----- Set header parameters
          $p_header['compressed_size'] = $p_header['size'];
          $p_header['compression'] = 0;
        }
        else {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will be compressed");
          // ----- Read the file content
          $v_content = @fread($v_file, $p_header['size']);

          // ----- Calculate the CRC
          $p_header['crc'] = @crc32($v_content);

          // ----- Compress the file
          $v_content_compressed = @gzdeflate($v_content);

          // ----- Set header parameters
          $p_header['compressed_size'] = strlen($v_content_compressed);
          $p_header['compression'] = 8;
        }

        // ----- Look for encryption
        /*
        if ((isset($p_options[PCLZIP_OPT_CRYPT]))
		    && ($p_options[PCLZIP_OPT_CRYPT] != "")) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File need to be crypted ....");

          // Should be a random header
          $v_header = 'xxxxxxxxxxxx';
	      $v_content_compressed = PclZipUtilZipEncrypt($v_content_compressed,
		                                           $p_header['compressed_size'],
	                                               $v_header,
												   $p_header['crc'],
												   "test");

          $p_header['compressed_size'] += 12;
          $p_header['flag'] = 1;

          // ----- Add the header to the data
          $v_content_compressed = $v_header.$v_content_compressed;
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size after header : ".strlen($v_content_compressed)."");
        }
        */

        // ----- Call the header generation
        if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
          @fclose($v_file);
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
          return $v_result;
        }

        // ----- Write the compressed (or not) content
        @fwrite($this->zip_fd,
		            $v_content_compressed, $p_header['compressed_size']);

        // ----- Close the file
        @fclose($v_file);
      }

      // ----- Look for a directory
      else {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a folder");
        // ----- Look for directory last '/'
        if (@substr($p_header['stored_filename'], -1) != '/') {
          $p_header['stored_filename'] .= '/';
        }

        // ----- Set the file properties
        $p_header['size'] = 0;
        //$p_header['external'] = 0x41FF0010;   // Value for a folder : to be checked
        $p_header['external'] = 0x00000010;   // Value for a folder : to be checked

        // ----- Call the header generation
        if (($v_result = $this->privWriteFileHeader($p_header)) != 1)
        {
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
          return $v_result;
        }
      }
    }

    // ----- Look for post-add callback
    if (isset($p_options[PCLZIP_CB_POST_ADD])) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_ADD]."()') is defined for the extraction");

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_header, $v_local_header);

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
      eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);');
      if ($v_result == 0) {
        // ----- Ignored
        $v_result = 1;
      }

      // ----- Update the informations
      // Nothing can be modified
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privCalculateStoredFilename()
  // Description :
  //   Based on file descriptor properties and global options, this method
  //   calculate the filename that will be stored in the archive.
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privCalculateStoredFilename(&$p_filedescr, &$p_options)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCalculateStoredFilename", "filename='".$p_filedescr['filename']."'");
    $v_result=1;

    // ----- Working variables
    $p_filename = $p_filedescr['filename'];
    if (isset($p_options[PCLZIP_OPT_ADD_PATH])) {
      $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH];
    }
    else {
      $p_add_dir = '';
    }
    if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) {
      $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH];
    }
    else {
      $p_remove_dir = '';
    }
    if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
      $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH];
    }
    else {
      $p_remove_all_dir = 0;
    }

    // ----- Look for full name change
    if (isset($p_filedescr['new_full_name'])) {
      $v_stored_filename = $p_filedescr['new_full_name'];
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing full name of '".$p_filename."' for '".$v_stored_filename."'");
    }

    // ----- Look for path and/or short name change
    else {

      // ----- Look for short name change
      if (isset($p_filedescr['new_short_name'])) {
        $v_path_info = pathinfo($p_filename);
        $v_dir = '';
        if ($v_path_info['dirname'] != '') {
          $v_dir = $v_path_info['dirname'].'/';
        }
        $v_stored_filename = $v_dir.$p_filedescr['new_short_name'];
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Changing short name of '".$p_filename."' for '".$v_stored_filename."'");
      }
      else {
        // ----- Calculate the stored filename
        $v_stored_filename = $p_filename;
      }

      // ----- Look for all path to remove
      if ($p_remove_all_dir) {
        $v_stored_filename = basename($p_filename);
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Remove all path selected change '".$p_filename."' for '".$v_stored_filename."'");
      }
      // ----- Look for partial path remove
      else if ($p_remove_dir != "") {
        if (substr($p_remove_dir, -1) != '/')
          $p_remove_dir .= "/";

        if (   (substr($p_filename, 0, 2) == "./")
            || (substr($p_remove_dir, 0, 2) == "./")) {

          if (   (substr($p_filename, 0, 2) == "./")
              && (substr($p_remove_dir, 0, 2) != "./")) {
            $p_remove_dir = "./".$p_remove_dir;
          }
          if (   (substr($p_filename, 0, 2) != "./")
              && (substr($p_remove_dir, 0, 2) == "./")) {
            $p_remove_dir = substr($p_remove_dir, 2);
          }
        }

        $v_compare = PclZipUtilPathInclusion($p_remove_dir,
                                             $v_stored_filename);
        if ($v_compare > 0) {
          if ($v_compare == 2) {
            $v_stored_filename = "";
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Path to remove is the current folder");
          }
          else {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Remove path '$p_remove_dir' in file '$v_stored_filename'");
            $v_stored_filename = substr($v_stored_filename,
                                        strlen($p_remove_dir));
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Result is '$v_stored_filename'");
          }
        }
      }
      // ----- Look for path to add
      if ($p_add_dir != "") {
        if (substr($p_add_dir, -1) == "/")
          $v_stored_filename = $p_add_dir.$v_stored_filename;
        else
          $v_stored_filename = $p_add_dir."/".$v_stored_filename;
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_filename' = '$v_stored_filename'");
      }
    }

    // ----- Filename (reduce the path of stored name)
    $v_stored_filename = PclZipUtilPathReduction($v_stored_filename);
    $p_filedescr['stored_filename'] = $v_stored_filename;
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Stored filename will be '".$p_filedescr['stored_filename']."', strlen ".strlen($p_filedescr['stored_filename']));

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privWriteFileHeader()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privWriteFileHeader(&$p_header)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"');
    $v_result=1;

    // ----- Store the offset position of the file
    $p_header['offset'] = ftell($this->zip_fd);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'File offset of the header :'.$p_header['offset']);

    // ----- Transform UNIX mtime to DOS format mdate/mtime
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
    $v_date = getdate($p_header['mtime']);
    $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
    $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];

    // ----- Packed data
    $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50,
	                      $p_header['version_extracted'], $p_header['flag'],
                          $p_header['compression'], $v_mtime, $v_mdate,
                          $p_header['crc'], $p_header['compressed_size'],
						  $p_header['size'],
                          strlen($p_header['stored_filename']),
						  $p_header['extra_len']);

    // ----- Write the first 148 bytes of the header in the archive
    fputs($this->zip_fd, $v_binary_data, 30);

    // ----- Write the variable fields
    if (strlen($p_header['stored_filename']) != 0)
    {
      fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));
    }
    if ($p_header['extra_len'] != 0)
    {
      fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privWriteCentralFileHeader()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privWriteCentralFileHeader(&$p_header)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"');
    $v_result=1;

    // TBC
    //for(reset($p_header); $key = key($p_header); next($p_header)) {
    //  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "header[$key] = ".$p_header[$key]);
    //}

    // ----- Transform UNIX mtime to DOS format mdate/mtime
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
    $v_date = getdate($p_header['mtime']);
    $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
    $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];

    // ----- Packed data
    $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50,
	                      $p_header['version'], $p_header['version_extracted'],
                          $p_header['flag'], $p_header['compression'],
						  $v_mtime, $v_mdate, $p_header['crc'],
                          $p_header['compressed_size'], $p_header['size'],
                          strlen($p_header['stored_filename']),
						  $p_header['extra_len'], $p_header['comment_len'],
                          $p_header['disk'], $p_header['internal'],
						  $p_header['external'], $p_header['offset']);

    // ----- Write the 42 bytes of the header in the zip file
    fputs($this->zip_fd, $v_binary_data, 46);

    // ----- Write the variable fields
    if (strlen($p_header['stored_filename']) != 0)
    {
      fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));
    }
    if ($p_header['extra_len'] != 0)
    {
      fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);
    }
    if ($p_header['comment_len'] != 0)
    {
      fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']);
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privWriteCentralHeader()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralHeader", 'nb_entries='.$p_nb_entries.', size='.$p_size.', offset='.$p_offset.', comment="'.$p_comment.'"');
    $v_result=1;

    // ----- Packed data
    $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries,
	                      $p_nb_entries, $p_size,
						  $p_offset, strlen($p_comment));

    // ----- Write the 22 bytes of the header in the zip file
    fputs($this->zip_fd, $v_binary_data, 22);

    // ----- Write the variable fields
    if (strlen($p_comment) != 0)
    {
      fputs($this->zip_fd, $p_comment, strlen($p_comment));
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privList()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privList(&$p_list)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privList", "list");
    $v_result=1;

    // ----- Magic quotes trick
    $this->privDisableMagicQuotes();

    // ----- Open the zip file
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
    if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)
    {
      // ----- Magic quotes trick
      $this->privSwapBackMagicQuotes();

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- Read the central directory informations
    $v_central_dir = array();
    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
    {
      $this->privSwapBackMagicQuotes();
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Go to beginning of Central Dir
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Offset : ".$v_central_dir['offset']."'");
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'");
    @rewind($this->zip_fd);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'");
    if (@fseek($this->zip_fd, $v_central_dir['offset']))
    {
      $this->privSwapBackMagicQuotes();

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'");

    // ----- Read each entry
    for ($i=0; $i<$v_central_dir['entries']; $i++)
    {
      // ----- Read the file header
      if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1)
      {
        $this->privSwapBackMagicQuotes();
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
        return $v_result;
      }
      $v_header['index'] = $i;

      // ----- Get the only interesting attributes
      $this->privConvertHeader2FileInfo($v_header, $p_list[$i]);
      unset($v_header);
    }

    // ----- Close the zip file
    $this->privCloseFd();

    // ----- Magic quotes trick
    $this->privSwapBackMagicQuotes();

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privConvertHeader2FileInfo()
  // Description :
  //   This function takes the file informations from the central directory
  //   entries and extract the interesting parameters that will be given back.
  //   The resulting file infos are set in the array $p_info
  //     $p_info['filename'] : Filename with full path. Given by user (add),
  //                           extracted in the filesystem (extract).
  //     $p_info['stored_filename'] : Stored filename in the archive.
  //     $p_info['size'] = Size of the file.
  //     $p_info['compressed_size'] = Compressed size of the file.
  //     $p_info['mtime'] = Last modification date of the file.
  //     $p_info['comment'] = Comment associated with the file.
  //     $p_info['folder'] = true/false : indicates if the entry is a folder or not.
  //     $p_info['status'] = status of the action on the file.
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privConvertHeader2FileInfo($p_header, &$p_info)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privConvertHeader2FileInfo", "Filename='".$p_header['filename']."'");
    $v_result=1;

    // ----- Get the interesting attributes
    $p_info['filename'] = $p_header['filename'];
    $p_info['stored_filename'] = $p_header['stored_filename'];
    $p_info['size'] = $p_header['size'];
    $p_info['compressed_size'] = $p_header['compressed_size'];
    $p_info['mtime'] = $p_header['mtime'];
    $p_info['comment'] = $p_header['comment'];
    $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010);
    $p_info['index'] = $p_header['index'];
    $p_info['status'] = $p_header['status'];

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privExtractByRule()
  // Description :
  //   Extract a file or directory depending of rules (by index, by name, ...)
  // Parameters :
  //   $p_file_list : An array where will be placed the properties of each
  //                  extracted file
  //   $p_path : Path to add while writing the extracted files
  //   $p_remove_path : Path to remove (from the file memorized path) while writing the
  //                    extracted files. If the path does not match the file path,
  //                    the file is extracted with its memorized path.
  //                    $p_remove_path does not apply to 'list' mode.
  //                    $p_path and $p_remove_path are commulative.
  // Return Values :
  //   1 on success,0 or less on error (see error code list)
  // --------------------------------------------------------------------------------
  function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privExtractByRule", "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'");
    $v_result=1;

    // ----- Magic quotes trick
    $this->privDisableMagicQuotes();

    // ----- Check the path
    if (   ($p_path == "")
	    || (   (substr($p_path, 0, 1) != "/")
		    && (substr($p_path, 0, 3) != "../")
			&& (substr($p_path,1,2)!=":/")))
      $p_path = "./".$p_path;

    // ----- Reduce the path last (and duplicated) '/'
    if (($p_path != "./") && ($p_path != "/"))
    {
      // ----- Look for the path end '/'
      while (substr($p_path, -1) == "/")
      {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Destination path [$p_path] ends by '/'");
        $p_path = substr($p_path, 0, strlen($p_path)-1);
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Modified to [$p_path]");
      }
    }

    // ----- Look for path to remove format (should end by /)
    if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/'))
    {
      $p_remove_path .= '/';
    }
    $p_remove_path_size = strlen($p_remove_path);

    // ----- Open the zip file
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
    if (($v_result = $this->privOpenFd('rb')) != 1)
    {
      $this->privSwapBackMagicQuotes();
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Read the central directory informations
    $v_central_dir = array();
    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
    {
      // ----- Close the zip file
      $this->privCloseFd();
      $this->privSwapBackMagicQuotes();

      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Start at beginning of Central Dir
    $v_pos_entry = $v_central_dir['offset'];

    // ----- Read each entry
    $j_start = 0;
    for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++)
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry : '$i'");

      // ----- Read next Central dir entry
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position before rewind : ".ftell($this->zip_fd)."'");
      @rewind($this->zip_fd);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position after rewind : ".ftell($this->zip_fd)."'");
      if (@fseek($this->zip_fd, $v_pos_entry))
      {
        // ----- Close the zip file
        $this->privCloseFd();
        $this->privSwapBackMagicQuotes();

        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');

        // ----- Return
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
        return PclZip::errorCode();
      }
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position after fseek : ".ftell($this->zip_fd)."'");

      // ----- Read the file header
      $v_header = array();
      if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1)
      {
        // ----- Close the zip file
        $this->privCloseFd();
        $this->privSwapBackMagicQuotes();

        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
        return $v_result;
      }

      // ----- Store the index
      $v_header['index'] = $i;

      // ----- Store the file position
      $v_pos_entry = ftell($this->zip_fd);

      // ----- Look for the specific extract rules
      $v_extract = false;

      // ----- Look for extract by name rule
      if (   (isset($p_options[PCLZIP_OPT_BY_NAME]))
          && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'");

          // ----- Look if the filename is in the list
          for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_extract); $j++) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Compare with file '".$p_options[PCLZIP_OPT_BY_NAME][$j]."'");

              // ----- Look for a directory
              if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") {
                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The searched item is a directory");

                  // ----- Look if the directory is in the filename path
                  if (   (strlen($v_header['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))
                      && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
                      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path");
                      $v_extract = true;
                  }
              }
              // ----- Look for a filename
              elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one.");
                  $v_extract = true;
              }
          }
      }

      // ----- Look for extract by ereg rule
      else if (   (isset($p_options[PCLZIP_OPT_BY_EREG]))
               && ($p_options[PCLZIP_OPT_BY_EREG] != "")) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'");

          if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression");
              $v_extract = true;
          }
      }

      // ----- Look for extract by preg rule
      else if (   (isset($p_options[PCLZIP_OPT_BY_PREG]))
               && ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'");

          if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression");
              $v_extract = true;
          }
      }

      // ----- Look for extract by index rule
      else if (   (isset($p_options[PCLZIP_OPT_BY_INDEX]))
               && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'");

          // ----- Look if the index is in the list
          for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look if index '$i' is in [".$p_options[PCLZIP_OPT_BY_INDEX][$j]['start'].",".$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']."]");

              if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range");
                  $v_extract = true;
              }
              if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop");
                  $j_start = $j+1;
              }

              if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop");
                  break;
              }
          }
      }

      // ----- Look for no rule, which means extract all the archive
      else {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with no rule (extract all)");
          $v_extract = true;
      }

	  // ----- Check compression method
	  if (   ($v_extract)
	      && (   ($v_header['compression'] != 8)
		      && ($v_header['compression'] != 0))) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported compression method (".$v_header['compression'].")");
          $v_header['status'] = 'unsupported_compression';

          // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
          if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
		      && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");

              $this->privSwapBackMagicQuotes();

              PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION,
			                       "Filename '".$v_header['stored_filename']."' is "
				  	    	  	   ."compressed by an unsupported compression "
				  	    	  	   ."method (".$v_header['compression'].") ");

              //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
              return PclZip::errorCode();
		  }
	  }

	  // ----- Check encrypted files
	  if (($v_extract) && (($v_header['flag'] & 1) == 1)) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported file encryption");
          $v_header['status'] = 'unsupported_encryption';

          // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
          if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
		      && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");

              $this->privSwapBackMagicQuotes();

              PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION,
			                       "Unsupported encryption for "
				  	    	  	   ." filename '".$v_header['stored_filename']
								   ."'");

              //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
              return PclZip::errorCode();
		  }
    }

      // ----- Look for real extraction
      if (($v_extract) && ($v_header['status'] != 'ok')) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "No need for extract");
          $v_result = $this->privConvertHeader2FileInfo($v_header,
		                                        $p_file_list[$v_nb_extracted++]);
          if ($v_result != 1) {
              $this->privCloseFd();
              $this->privSwapBackMagicQuotes();
              //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
              return $v_result;
          }

          $v_extract = false;
      }

      // ----- Look for real extraction
      if ($v_extract)
      {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file '".$v_header['filename']."', index '$i'");

        // ----- Go to the file position
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'");
        @rewind($this->zip_fd);
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'");
        if (@fseek($this->zip_fd, $v_header['offset']))
        {
          // ----- Close the zip file
          $this->privCloseFd();

          $this->privSwapBackMagicQuotes();

          // ----- Error log
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');

          // ----- Return
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
          return PclZip::errorCode();
        }
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'");

        // ----- Look for extraction as string
        if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) {

          // ----- Extracting the file
          $v_result1 = $this->privExtractFileAsString($v_header, $v_string);
          if ($v_result1 < 1) {
            $this->privCloseFd();
            $this->privSwapBackMagicQuotes();
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1);
            return $v_result1;
          }

          // ----- Get the only interesting attributes
          if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1)
          {
            // ----- Close the zip file
            $this->privCloseFd();
            $this->privSwapBackMagicQuotes();

            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
            return $v_result;
          }

          // ----- Set the file content
          $p_file_list[$v_nb_extracted]['content'] = $v_string;

          // ----- Next extracted file
          $v_nb_extracted++;

          // ----- Look for user callback abort
          if ($v_result1 == 2) {
          	break;
          }
        }
        // ----- Look for extraction in standard output
        elseif (   (isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT]))
		        && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) {
          // ----- Extracting the file in standard output
          $v_result1 = $this->privExtractFileInOutput($v_header, $p_options);
          if ($v_result1 < 1) {
            $this->privCloseFd();
            $this->privSwapBackMagicQuotes();
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1);
            return $v_result1;
          }

          // ----- Get the only interesting attributes
          if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) {
            $this->privCloseFd();
            $this->privSwapBackMagicQuotes();
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
            return $v_result;
          }

          // ----- Look for user callback abort
          if ($v_result1 == 2) {
          	break;
          }
        }
        // ----- Look for normal extraction
        else {
          // ----- Extracting the file
          $v_result1 = $this->privExtractFile($v_header,
		                                      $p_path, $p_remove_path,
											  $p_remove_all_path,
											  $p_options);
          if ($v_result1 < 1) {
            $this->privCloseFd();
            $this->privSwapBackMagicQuotes();
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1);
            return $v_result1;
          }

          // ----- Get the only interesting attributes
          if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1)
          {
            // ----- Close the zip file
            $this->privCloseFd();
            $this->privSwapBackMagicQuotes();

            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
            return $v_result;
          }

          // ----- Look for user callback abort
          if ($v_result1 == 2) {
          	break;
          }
        }
      }
    }

    // ----- Close the zip file
    $this->privCloseFd();
    $this->privSwapBackMagicQuotes();

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privExtractFile()
  // Description :
  // Parameters :
  // Return Values :
  //
  // 1 : ... ?
  // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback
  // --------------------------------------------------------------------------------
  function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFile', "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'");
    $v_result=1;

    // ----- Read the file header
    if (($v_result = $this->privReadFileHeader($v_header)) != 1)
    {
      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'");

    // ----- Check that the file header is coherent with $p_entry info
    if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
        // TBC
    }

    // ----- Look for all path to remove
    if ($p_remove_all_path == true) {
        // ----- Look for folder entry that not need to be extracted
        if (($p_entry['external']&0x00000010)==0x00000010) {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The entry is a folder : need to be filtered");

            $p_entry['status'] = "filtered";

            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
            return $v_result;
        }

        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "All path is removed");
        // ----- Get the basename of the path
        $p_entry['filename'] = basename($p_entry['filename']);
    }

    // ----- Look for path to remove
    else if ($p_remove_path != "")
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look for some path to remove");
      if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2)
      {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The folder is the same as the removed path '".$p_entry['filename']."'");

        // ----- Change the file status
        $p_entry['status'] = "filtered";

        // ----- Return
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
        return $v_result;
      }

      $p_remove_path_size = strlen($p_remove_path);
      if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path)
      {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file '".$p_entry['filename']."'");

        // ----- Remove the path
        $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size);

        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Resulting file is '".$p_entry['filename']."'");
      }
    }

    // ----- Add the path
    if ($p_path != '') {
      $p_entry['filename'] = $p_path."/".$p_entry['filename'];
    }

    // ----- Check a base_dir_restriction
    if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Check the extract directory restriction");
      $v_inclusion
      = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION],
                                $p_entry['filename']);
      if ($v_inclusion == 0) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_EXTRACT_DIR_RESTRICTION is selected, file is outside restriction");

        PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION,
			                     "Filename '".$p_entry['filename']."' is "
								 ."outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION");

        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
        return PclZip::errorCode();
      }
    }

    // ----- Look for pre-extract callback
    if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction");

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
      if ($v_result == 0) {
        // ----- Change the file status
        $p_entry['status'] = "skipped";
        $v_result = 1;
      }

      // ----- Look for abort result
      if ($v_result == 2) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
        // ----- This status is internal and will be changed in 'skipped'
        $p_entry['status'] = "aborted";
      	$v_result = PCLZIP_ERR_USER_ABORTED;
      }

      // ----- Update the informations
      // Only some fields can be modified
      $p_entry['filename'] = $v_local_header['filename'];
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'");
    }

    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'");

    // ----- Look if extraction should be done
    if ($p_entry['status'] == 'ok') {

    // ----- Look for specific actions while the file exist
    if (file_exists($p_entry['filename']))
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$p_entry['filename']."' already exists");

      // ----- Look if file is a directory
      if (is_dir($p_entry['filename']))
      {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is a directory");

        // ----- Change the file status
        $p_entry['status'] = "already_a_directory";

        // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
        // For historical reason first PclZip implementation does not stop
        // when this kind of error occurs.
        if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
		    && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");

            PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY,
			                     "Filename '".$p_entry['filename']."' is "
								 ."already used by an existing directory");

            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
		}
      }
      // ----- Look if file is write protected
      else if (!is_writeable($p_entry['filename']))
      {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is write protected");

        // ----- Change the file status
        $p_entry['status'] = "write_protected";

        // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
        // For historical reason first PclZip implementation does not stop
        // when this kind of error occurs.
        if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
		    && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");

            PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,
			                     "Filename '".$p_entry['filename']."' exists "
								 ."and is write protected");

            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
            return PclZip::errorCode();
		}
      }

      // ----- Look if the extracted file is older
      else if (filemtime($p_entry['filename']) > $p_entry['mtime'])
      {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is newer (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")");
        // ----- Change the file status
        if (   (isset($p_options[PCLZIP_OPT_REPLACE_NEWER]))
		    && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_REPLACE_NEWER is selected, file will be replaced");
		}
		else {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be replaced");
            $p_entry['status'] = "newer_exist";

            // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
            // For historical reason first PclZip implementation does not stop
            // when this kind of error occurs.
            if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
		        && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
                //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");

                PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,
			             "Newer version of '".$p_entry['filename']."' exists "
					    ."and option PCLZIP_OPT_REPLACE_NEWER is not selected");

                //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
                return PclZip::errorCode();
		    }
		}
      }
      else {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is older than the extrated one - will be replaced by the extracted one (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")");
      }
    }

    // ----- Check the directory availability and create it if necessary
    else {
      if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/'))
        $v_dir_to_check = $p_entry['filename'];
      else if (!strstr($p_entry['filename'], "/"))
        $v_dir_to_check = "";
      else
        $v_dir_to_check = dirname($p_entry['filename']);

      if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '".$p_entry['filename']."'");

        // ----- Change the file status
        $p_entry['status'] = "path_creation_fail";

        // ----- Return
        ////--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
        //return $v_result;
        $v_result = 1;
      }
    }
    }

    // ----- Look if extraction should be done
    if ($p_entry['status'] == 'ok') {

      // ----- Do the extraction (if not a folder)
      if (!(($p_entry['external']&0x00000010)==0x00000010))
      {
        // ----- Look for not compressed file
        if ($p_entry['compression'] == 0) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file");

		  // ----- Opening destination file
          if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0)
          {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode");

            // ----- Change the file status
            $p_entry['status'] = "write_error";

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
            return $v_result;
          }

          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read '".$p_entry['size']."' bytes");

          // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
          $v_size = $p_entry['compressed_size'];
          while ($v_size != 0)
          {
            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read $v_read_size bytes");
            $v_buffer = @fread($this->zip_fd, $v_read_size);
            /* Try to speed up the code
            $v_binary_data = pack('a'.$v_read_size, $v_buffer);
            @fwrite($v_dest_file, $v_binary_data, $v_read_size);
            */
            @fwrite($v_dest_file, $v_buffer, $v_read_size);
            $v_size -= $v_read_size;
          }

          // ----- Closing the destination file
          fclose($v_dest_file);

          // ----- Change the file mtime
          touch($p_entry['filename'], $p_entry['mtime']);


        }
        else {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (Compression method ".$p_entry['compression'].")");
          // ----- TBC
          // Need to be finished
          if (($p_entry['flag'] & 1) == 1) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File is encrypted");
            /*
              // ----- Read the encryption header
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read 12 encryption header bytes");
              $v_encryption_header = @fread($this->zip_fd, 12);

              // ----- Read the encrypted & compressed file in a buffer
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".($p_entry['compressed_size']-12)."' compressed & encrypted bytes");
              $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']-12);

              // ----- Decrypt the buffer
              $this->privDecrypt($v_encryption_header, $v_buffer,
			                     $p_entry['compressed_size']-12, $p_entry['crc']);
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Buffer is '".$v_buffer."'");
              */
          }
          else {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".$p_entry['compressed_size']."' compressed bytes");
              // ----- Read the compressed file in a buffer (one shot)
              $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
          }

          // ----- Decompress the file
          $v_file_content = @gzinflate($v_buffer);
          unset($v_buffer);
          if ($v_file_content === FALSE) {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to inflate compressed file");

            // ----- Change the file status
            // TBC
            $p_entry['status'] = "error";

            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
            return $v_result;
          }

          // ----- Opening destination file
          if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode");

            // ----- Change the file status
            $p_entry['status'] = "write_error";

            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
            return $v_result;
          }

          // ----- Write the uncompressed data
          @fwrite($v_dest_file, $v_file_content, $p_entry['size']);
          unset($v_file_content);

          // ----- Closing the destination file
          @fclose($v_dest_file);

          // ----- Change the file mtime
          @touch($p_entry['filename'], $p_entry['mtime']);
        }

        // ----- Look for chmod option
        if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "chmod option activated '".$p_options[PCLZIP_OPT_SET_CHMOD]."'");

          // ----- Change the mode of the file
          @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]);
        }

        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done");
      }
    }

	// ----- Change abort status
	if ($p_entry['status'] == "aborted") {
      $p_entry['status'] = "skipped";
	}

    // ----- Look for post-extract callback
    elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction");

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
      eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');

      // ----- Look for abort result
      if ($v_result == 2) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
      	$v_result = PCLZIP_ERR_USER_ABORTED;
      }
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privExtractFileInOutput()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privExtractFileInOutput(&$p_entry, &$p_options)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileInOutput', "");
    $v_result=1;

    // ----- Read the file header
    if (($v_result = $this->privReadFileHeader($v_header)) != 1) {
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'");

    // ----- Check that the file header is coherent with $p_entry info
    if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
        // TBC
    }

    // ----- Look for pre-extract callback
    if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction");

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
      if ($v_result == 0) {
        // ----- Change the file status
        $p_entry['status'] = "skipped";
        $v_result = 1;
      }

      // ----- Look for abort result
      if ($v_result == 2) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
        // ----- This status is internal and will be changed in 'skipped'
        $p_entry['status'] = "aborted";
      	$v_result = PCLZIP_ERR_USER_ABORTED;
      }

      // ----- Update the informations
      // Only some fields can be modified
      $p_entry['filename'] = $v_local_header['filename'];
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'");
    }

    // ----- Trace
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'");

    // ----- Look if extraction should be done
    if ($p_entry['status'] == 'ok') {

      // ----- Do the extraction (if not a folder)
      if (!(($p_entry['external']&0x00000010)==0x00000010)) {
        // ----- Look for not compressed file
        if ($p_entry['compressed_size'] == $p_entry['size']) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file");
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes");

          // ----- Read the file in a buffer (one shot)
          $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);

          // ----- Send the file to the output
          echo $v_buffer;
          unset($v_buffer);
        }
        else {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file");
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Reading '".$p_entry['size']."' bytes");

          // ----- Read the compressed file in a buffer (one shot)
          $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);

          // ----- Decompress the file
          $v_file_content = gzinflate($v_buffer);
          unset($v_buffer);

          // ----- Send the file to the output
          echo $v_file_content;
          unset($v_file_content);
        }
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done");
      }
    }

	// ----- Change abort status
	if ($p_entry['status'] == "aborted") {
      $p_entry['status'] = "skipped";
	}

    // ----- Look for post-extract callback
    elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction");

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
      eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');

      // ----- Look for abort result
      if ($v_result == 2) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
      	$v_result = PCLZIP_ERR_USER_ABORTED;
      }
    }

    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privExtractFileAsString()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privExtractFileAsString(&$p_entry, &$p_string)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileAsString', "p_entry['filename']='".$p_entry['filename']."'");
    $v_result=1;

    // ----- Read the file header
    $v_header = array();
    if (($v_result = $this->privReadFileHeader($v_header)) != 1)
    {
      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'");

    // ----- Check that the file header is coherent with $p_entry info
    if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
        // TBC
    }

    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file in string (with path) '".$p_entry['filename']."', size '$v_header[size]'");

    // ----- Do the extraction (if not a folder)
    if (!(($p_entry['external']&0x00000010)==0x00000010))
    {
      // ----- Look for not compressed file
//      if ($p_entry['compressed_size'] == $p_entry['size'])
      if ($p_entry['compression'] == 0) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file");
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes");

        // ----- Reading the file
        $p_string = @fread($this->zip_fd, $p_entry['compressed_size']);
      }
      else {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (compression method '".$p_entry['compression']."')");

        // ----- Reading the file
        $v_data = @fread($this->zip_fd, $p_entry['compressed_size']);

        // ----- Decompress the file
        if (($p_string = @gzinflate($v_data)) === FALSE) {
            // TBC
        }
      }

      // ----- Trace
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done");
    }
    else {
        // TBC : error : can not extract a folder in a string
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privReadFileHeader()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privReadFileHeader(&$p_header)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadFileHeader", "");
    $v_result=1;

    // ----- Read the 4 bytes signature
    $v_binary_data = @fread($this->zip_fd, 4);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'");
    $v_data = unpack('Vid', $v_binary_data);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'");

    // ----- Check signature
    if ($v_data['id'] != 0x04034b50)
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid File header");

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- Read the first 42 bytes of the header
    $v_binary_data = fread($this->zip_fd, 26);

    // ----- Look for invalid block size
    if (strlen($v_binary_data) != 26)
    {
      $p_header['filename'] = "";
      $p_header['status'] = "invalid_header";
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data));

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data));

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- Extract the values
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header : '".$v_binary_data."'");
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header (Hex) : '".bin2hex($v_binary_data)."'");
    $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data);

    // ----- Get filename
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "File name length : ".$v_data['filename_len']);
    $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Filename : \''.$p_header['filename'].'\'');

    // ----- Get extra_fields
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extra field length : ".$v_data['extra_len']);
    if ($v_data['extra_len'] != 0) {
      $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']);
    }
    else {
      $p_header['extra'] = '';
    }
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Extra field : \''.bin2hex($p_header['extra']).'\'');

    // ----- Extract properties
    $p_header['version_extracted'] = $v_data['version'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : ('.$p_header['version_extracted'].') \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\'');
    $p_header['compression'] = $v_data['compression'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compression method : \''.$p_header['compression'].'\'');
    $p_header['size'] = $v_data['size'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_header['size'].'\'');
    $p_header['compressed_size'] = $v_data['compressed_size'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_header['compressed_size'].'\'');
    $p_header['crc'] = $v_data['crc'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\'');
    $p_header['flag'] = $v_data['flag'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Flag : \''.$p_header['flag'].'\'');
    $p_header['filename_len'] = $v_data['filename_len'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Filename_len : \''.$p_header['filename_len'].'\'');

    // ----- Recuperate date in UNIX format
    $p_header['mdate'] = $v_data['mdate'];
    $p_header['mtime'] = $v_data['mtime'];
    if ($p_header['mdate'] && $p_header['mtime'])
    {
      // ----- Extract time
      $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
      $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
      $v_seconde = ($p_header['mtime'] & 0x001F)*2;

      // ----- Extract date
      $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;
      $v_month = ($p_header['mdate'] & 0x01E0) >> 5;
      $v_day = $p_header['mdate'] & 0x001F;

      // ----- Get UNIX date format
      $p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);

      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
    }
    else
    {
      $p_header['mtime'] = time();
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
    }

    // TBC
    //for(reset($v_data); $key = key($v_data); next($v_data)) {
    //  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Attribut[$key] = ".$v_data[$key]);
    //}

    // ----- Set the stored filename
    $p_header['stored_filename'] = $p_header['filename'];

    // ----- Set the status field
    $p_header['status'] = "ok";

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privReadCentralFileHeader()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privReadCentralFileHeader(&$p_header)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadCentralFileHeader", "");
    $v_result=1;

    // ----- Read the 4 bytes signature
    $v_binary_data = @fread($this->zip_fd, 4);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'");
    $v_data = unpack('Vid', $v_binary_data);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'");

    // ----- Check signature
    if ($v_data['id'] != 0x02014b50)
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid Central Dir File signature");

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- Read the first 42 bytes of the header
    $v_binary_data = fread($this->zip_fd, 42);

    // ----- Look for invalid block size
    if (strlen($v_binary_data) != 42)
    {
      $p_header['filename'] = "";
      $p_header['status'] = "invalid_header";
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data));

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data));

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- Extract the values
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header : '".$v_binary_data."'");
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header (Hex) : '".bin2hex($v_binary_data)."'");
    $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data);

    // ----- Get filename
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File name length : ".$p_header['filename_len']);
    if ($p_header['filename_len'] != 0)
      $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']);
    else
      $p_header['filename'] = '';
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Filename : \''.$p_header['filename'].'\'');

    // ----- Get extra
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Extra length : ".$p_header['extra_len']);
    if ($p_header['extra_len'] != 0)
      $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']);
    else
      $p_header['extra'] = '';
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Extra : \''.$p_header['extra'].'\'');

    // ----- Get comment
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Comment length : ".$p_header['comment_len']);
    if ($p_header['comment_len'] != 0)
      $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']);
    else
      $p_header['comment'] = '';
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Comment : \''.$p_header['comment'].'\'');

    // ----- Extract properties
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version : \''.($p_header['version']/10).'.'.($p_header['version']%10).'\'');
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\'');
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Size : \''.$p_header['size'].'\'');
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Compressed Size : \''.$p_header['compressed_size'].'\'');
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\'');
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Flag : \''.$p_header['flag'].'\'');
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Offset : \''.$p_header['offset'].'\'');

    // ----- Recuperate date in UNIX format
    if ($p_header['mdate'] && $p_header['mtime'])
    {
      // ----- Extract time
      $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
      $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
      $v_seconde = ($p_header['mtime'] & 0x001F)*2;

      // ----- Extract date
      $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;
      $v_month = ($p_header['mdate'] & 0x01E0) >> 5;
      $v_day = $p_header['mdate'] & 0x001F;

      // ----- Get UNIX date format
      $p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);

      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
    }
    else
    {
      $p_header['mtime'] = time();
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
    }

    // ----- Set the stored filename
    $p_header['stored_filename'] = $p_header['filename'];

    // ----- Set default status to ok
    $p_header['status'] = 'ok';

    // ----- Look if it is a directory
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Internal (Hex) : '".sprintf("Ox%04X", $p_header['internal'])."'");
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "External (Hex) : '".sprintf("Ox%04X", $p_header['external'])."' (".(($p_header['external']&0x00000010)==0x00000010?'is a folder':'is a file').')');
    if (substr($p_header['filename'], -1) == '/') {
      //$p_header['external'] = 0x41FF0010;
      $p_header['external'] = 0x00000010;
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Force folder external : \''.sprintf("Ox%04X", $p_header['external']).'\'');
    }

    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Header of filename : \''.$p_header['filename'].'\'');

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privCheckFileHeaders()
  // Description :
  // Parameters :
  // Return Values :
  //   1 on success,
  //   0 on error;
  // --------------------------------------------------------------------------------
  function privCheckFileHeaders(&$p_local_header, &$p_central_header)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFileHeaders", "");
    $v_result=1;

	// ----- Check the static values
	// TBC
	if ($p_local_header['filename'] != $p_central_header['filename']) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename" : TBC To Be Completed');
	}
	if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "version_extracted" : TBC To Be Completed');
	}
	if ($p_local_header['flag'] != $p_central_header['flag']) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "flag" : TBC To Be Completed');
	}
	if ($p_local_header['compression'] != $p_central_header['compression']) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "compression" : TBC To Be Completed');
	}
	if ($p_local_header['mtime'] != $p_central_header['mtime']) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "mtime" : TBC To Be Completed');
	}
	if ($p_local_header['filename_len'] != $p_central_header['filename_len']) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename_len" : TBC To Be Completed');
	}

	// ----- Look for flag bit 3
	if (($p_local_header['flag'] & 8) == 8) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Purpose bit flag bit 3 set !');
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'File size, compression size and crc found in central header');
        $p_local_header['size'] = $p_central_header['size'];
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_local_header['size'].'\'');
        $p_local_header['compressed_size'] = $p_central_header['compressed_size'];
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_local_header['compressed_size'].'\'');
        $p_local_header['crc'] = $p_central_header['crc'];
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_local_header['crc']).'\'');
	}

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privReadEndCentralDir()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privReadEndCentralDir(&$p_central_dir)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadEndCentralDir", "");
    $v_result=1;

    // ----- Go to the end of the zip file
    $v_size = filesize($this->zipname);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size of the file :$v_size");
    @fseek($this->zip_fd, $v_size);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position at end of zip file : \''.ftell($this->zip_fd).'\'');
    if (@ftell($this->zip_fd) != $v_size)
    {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\'');

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- First try : look if this is an archive with no commentaries (most of the time)
    // in this case the end of central dir is at 22 bytes of the file end
    $v_found = 0;
    if ($v_size > 26) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Look for central dir with no comment');
      @fseek($this->zip_fd, $v_size-22);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after min central position : \''.ftell($this->zip_fd).'\'');
      if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22))
      {
        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\'');

        // ----- Return
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
        return PclZip::errorCode();
      }

      // ----- Read for bytes
      $v_binary_data = @fread($this->zip_fd, 4);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Binary data is : '".sprintf("%08x", $v_binary_data)."'");
      $v_data = @unpack('Vid', $v_binary_data);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'");

      // ----- Check signature
      if ($v_data['id'] == 0x06054b50) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found central dir at the default position.");
        $v_found = 1;
      }

      $v_pos = ftell($this->zip_fd);
    }

    // ----- Go back to the maximum possible size of the Central Dir End Record
    if (!$v_found) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Start extended search of end central dir');
      $v_maximum_size = 65557; // 0xFFFF + 22;
      if ($v_maximum_size > $v_size)
        $v_maximum_size = $v_size;
      @fseek($this->zip_fd, $v_size-$v_maximum_size);
      if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size))
      {
        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\'');

        // ----- Return
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
        return PclZip::errorCode();
      }
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after max central position : \''.ftell($this->zip_fd).'\'');

      // ----- Read byte per byte in order to find the signature
      $v_pos = ftell($this->zip_fd);
      $v_bytes = 0x00000000;
      while ($v_pos < $v_size)
      {
        // ----- Read a byte
        $v_byte = @fread($this->zip_fd, 1);

        // -----  Add the byte
        // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number
        // Otherwise on systems where we have 64bit integers the check below for the magic number will fail.
        $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);

        // ----- Compare the bytes
        if ($v_bytes == 0x504b0506)
        {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Found End Central Dir signature at position : \''.ftell($this->zip_fd).'\'');
          $v_pos++;
          break;
        }

        $v_pos++;
      }

      // ----- Look if not found end of central dir
      if ($v_pos == $v_size)
      {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to find End of Central Dir Record signature");

        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature");

        // ----- Return
        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
        return PclZip::errorCode();
      }
    }

    // ----- Read the first 18 bytes of the header
    $v_binary_data = fread($this->zip_fd, 18);

    // ----- Look for invalid block size
    if (strlen($v_binary_data) != 18)
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid End of Central Dir Record size : ".strlen($v_binary_data));

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data));

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- Extract the values
    ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record : '".$v_binary_data."'");
    ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record (Hex) : '".bin2hex($v_binary_data)."'");
    $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data);

    // ----- Check the global size
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Comment length : ".$v_data['comment_size']);
    if (($v_pos + $v_data['comment_size'] + 18) != $v_size) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The central dir is not at the end of the archive. Some trailing bytes exists after the archive.");

	  // ----- Removed in release 2.2 see readme file
	  // The check of the file size is a little too strict.
	  // Some bugs where found when a zip is encrypted/decrypted with 'crypt'.
	  // While decrypted, zip has training 0 bytes
	  if (0) {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT,
	                       'The central dir is not at the end of the archive.'
						   .' Some trailing bytes exists after the archive.');

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
	  }
    }

    // ----- Get comment
    if ($v_data['comment_size'] != 0)
      $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']);
    else
      $p_central_dir['comment'] = '';
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Comment : \''.$p_central_dir['comment'].'\'');

    $p_central_dir['entries'] = $v_data['entries'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries : \''.$p_central_dir['entries'].'\'');
    $p_central_dir['disk_entries'] = $v_data['disk_entries'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries for this disk : \''.$p_central_dir['disk_entries'].'\'');
    $p_central_dir['offset'] = $v_data['offset'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Offset of Central Dir : \''.$p_central_dir['offset'].'\'');
    $p_central_dir['size'] = $v_data['size'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size of Central Dir : \''.$p_central_dir['size'].'\'');
    $p_central_dir['disk'] = $v_data['disk'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Disk number : \''.$p_central_dir['disk'].'\'');
    $p_central_dir['disk_start'] = $v_data['disk_start'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Start disk number : \''.$p_central_dir['disk_start'].'\'');

    // TBC
    //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) {
    //  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "central_dir[$key] = ".$p_central_dir[$key]);
    //}

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privDeleteByRule()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privDeleteByRule(&$p_result_list, &$p_options)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDeleteByRule", "");
    $v_result=1;
    $v_list_detail = array();

    // ----- Open the zip file
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
    if (($v_result=$this->privOpenFd('rb')) != 1)
    {
      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Read the central directory informations
    $v_central_dir = array();
    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
    {
      $this->privCloseFd();
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Go to beginning of File
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'");
    @rewind($this->zip_fd);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'");

    // ----- Scan all the files
    // ----- Start at beginning of Central Dir
    $v_pos_entry = $v_central_dir['offset'];
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'");
    @rewind($this->zip_fd);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'");
    if (@fseek($this->zip_fd, $v_pos_entry))
    {
      // ----- Close the zip file
      $this->privCloseFd();

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'");

    // ----- Read each entry
    $v_header_list = array();
    $j_start = 0;
    for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++)
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry (index '$i')");

      // ----- Read the file header
      $v_header_list[$v_nb_extracted] = array();
      if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1)
      {
        // ----- Close the zip file
        $this->privCloseFd();

        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
        return $v_result;
      }

      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename (index '$i') : '".$v_header_list[$v_nb_extracted]['stored_filename']."'");

      // ----- Store the index
      $v_header_list[$v_nb_extracted]['index'] = $i;

      // ----- Look for the specific extract rules
      $v_found = false;

      // ----- Look for extract by name rule
      if (   (isset($p_options[PCLZIP_OPT_BY_NAME]))
          && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'");

          // ----- Look if the filename is in the list
          for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_found); $j++) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Compare with file '".$p_options[PCLZIP_OPT_BY_NAME][$j]."'");

              // ----- Look for a directory
              if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") {
                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The searched item is a directory");

                  // ----- Look if the directory is in the filename path
                  if (   (strlen($v_header_list[$v_nb_extracted]['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))
                      && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
                      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path");
                      $v_found = true;
                  }
                  elseif (   (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */
                          && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
                      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The entry is the searched directory");
                      $v_found = true;
                  }
              }
              // ----- Look for a filename
              elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one.");
                  $v_found = true;
              }
          }
      }

      // ----- Look for extract by ereg rule
      else if (   (isset($p_options[PCLZIP_OPT_BY_EREG]))
               && ($p_options[PCLZIP_OPT_BY_EREG] != "")) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'");

          if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression");
              $v_found = true;
          }
      }

      // ----- Look for extract by preg rule
      else if (   (isset($p_options[PCLZIP_OPT_BY_PREG]))
               && ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'");

          if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression");
              $v_found = true;
          }
      }

      // ----- Look for extract by index rule
      else if (   (isset($p_options[PCLZIP_OPT_BY_INDEX]))
               && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'");

          // ----- Look if the index is in the list
          for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_found); $j++) {
              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look if index '$i' is in [".$p_options[PCLZIP_OPT_BY_INDEX][$j]['start'].",".$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']."]");

              if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range");
                  $v_found = true;
              }
              if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop");
                  $j_start = $j+1;
              }

              if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop");
                  break;
              }
          }
      }
      else {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "No argument mean remove all file");
      	$v_found = true;
      }

      // ----- Look for deletion
      if ($v_found)
      {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' need to be deleted");
        unset($v_header_list[$v_nb_extracted]);
      }
      else
      {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' will not be deleted");
        $v_nb_extracted++;
      }
    }

    // ----- Look if something need to be deleted
    if ($v_nb_extracted > 0) {

        // ----- Creates a temporay file
        $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';

        // ----- Creates a temporary zip archive
        $v_temp_zip = new PclZip($v_zip_temp_name);

        // ----- Open the temporary zip file in write mode
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary write mode");
        if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) {
            $this->privCloseFd();

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
            return $v_result;
        }

        // ----- Look which file need to be kept
        for ($i=0; $i<sizeof($v_header_list); $i++) {
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Keep entry index '$i' : '".$v_header_list[$i]['filename']."'");

            // ----- Calculate the position of the header
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Offset='". $v_header_list[$i]['offset']."'");
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'");
            @rewind($this->zip_fd);
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'");
            if (@fseek($this->zip_fd,  $v_header_list[$i]['offset'])) {
                // ----- Close the zip file
                $this->privCloseFd();
                $v_temp_zip->privCloseFd();
                @unlink($v_zip_temp_name);

                // ----- Error log
                PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');

                // ----- Return
                //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
                return PclZip::errorCode();
            }
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'");

            // ----- Read the file header
            $v_local_header = array();
            if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) {
                // ----- Close the zip file
                $this->privCloseFd();
                $v_temp_zip->privCloseFd();
                @unlink($v_zip_temp_name);

                // ----- Return
                //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
                return $v_result;
            }

            // ----- Check that local file header is same as central file header
            if ($this->privCheckFileHeaders($v_local_header,
			                                $v_header_list[$i]) != 1) {
                // TBC
            }
            unset($v_local_header);

            // ----- Write the file header
            if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) {
                // ----- Close the zip file
                $this->privCloseFd();
                $v_temp_zip->privCloseFd();
                @unlink($v_zip_temp_name);

                // ----- Return
                //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
                return $v_result;
            }
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Offset for this file is '".$v_header_list[$i]['offset']."'");

            // ----- Read/write the data block
            if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) {
                // ----- Close the zip file
                $this->privCloseFd();
                $v_temp_zip->privCloseFd();
                @unlink($v_zip_temp_name);

                // ----- Return
                //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
                return $v_result;
            }
        }

        // ----- Store the offset of the central dir
        $v_offset = @ftell($v_temp_zip->zip_fd);
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "New offset of central dir : $v_offset");

        // ----- Re-Create the Central Dir files header
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the new central directory");
        for ($i=0; $i<sizeof($v_header_list); $i++) {
            // ----- Create the file header
            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Offset of file : ".$v_header_list[$i]['offset']);
            if (($v_result = $v_temp_zip->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
                $v_temp_zip->privCloseFd();
                $this->privCloseFd();
                @unlink($v_zip_temp_name);

                // ----- Return
                //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
                return $v_result;
            }

            // ----- Transform the header to a 'usable' info
            $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
        }

        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the central directory footer");

        // ----- Zip file comment
        $v_comment = '';
        if (isset($p_options[PCLZIP_OPT_COMMENT])) {
          $v_comment = $p_options[PCLZIP_OPT_COMMENT];
        }

        // ----- Calculate the size of the central header
        $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset;

        // ----- Create the central dir footer
        if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) {
            // ----- Reset the file list
            unset($v_header_list);
            $v_temp_zip->privCloseFd();
            $this->privCloseFd();
            @unlink($v_zip_temp_name);

            // ----- Return
            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
            return $v_result;
        }

        // ----- Close
        $v_temp_zip->privCloseFd();
        $this->privCloseFd();

        // ----- Delete the zip file
        // TBC : I should test the result ...
        @unlink($this->zipname);

        // ----- Rename the temporary file
        // TBC : I should test the result ...
        //@rename($v_zip_temp_name, $this->zipname);
        PclZipUtilRename($v_zip_temp_name, $this->zipname);

        // ----- Destroy the temporary archive
        unset($v_temp_zip);
    }

    // ----- Remove every files : reset the file
    else if ($v_central_dir['entries'] != 0) {
        $this->privCloseFd();

        if (($v_result = $this->privOpenFd('wb')) != 1) {
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
          return $v_result;
        }

        if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) {
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
          return $v_result;
        }

        $this->privCloseFd();
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privDirCheck()
  // Description :
  //   Check if a directory exists, if not it creates it and all the parents directory
  //   which may be useful.
  // Parameters :
  //   $p_dir : Directory path to check.
  // Return Values :
  //    1 : OK
  //   -1 : Unable to create directory
  // --------------------------------------------------------------------------------
  function privDirCheck($p_dir, $p_is_dir=false)
  {
    $v_result = 1;

    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDirCheck", "entry='$p_dir', is_dir='".($p_is_dir?"true":"false")."'");

    // ----- Remove the final '/'
    if (($p_is_dir) && (substr($p_dir, -1)=='/'))
    {
      $p_dir = substr($p_dir, 0, strlen($p_dir)-1);
    }
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Looking for entry '$p_dir'");

    // ----- Check the directory availability
    if ((is_dir($p_dir)) || ($p_dir == ""))
    {
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, "'$p_dir' is a directory");
      return 1;
    }

    // ----- Extract parent directory
    $p_parent_dir = dirname($p_dir);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Parent directory is '$p_parent_dir'");

    // ----- Just a check
    if ($p_parent_dir != $p_dir)
    {
      // ----- Look for parent directory
      if ($p_parent_dir != "")
      {
        if (($v_result = $this->privDirCheck($p_parent_dir)) != 1)
        {
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
          return $v_result;
        }
      }
    }

    // ----- Create the directory
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Create directory '$p_dir'");
    if (!@mkdir($p_dir, 0777))
    {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'");

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result, "Directory '$p_dir' created");
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privMerge()
  // Description :
  //   If $p_archive_to_add does not exist, the function exit with a success result.
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privMerge(&$p_archive_to_add)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privMerge", "archive='".$p_archive_to_add->zipname."'");
    $v_result=1;

    // ----- Look if the archive_to_add exists
    if (!is_file($p_archive_to_add->zipname))
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to add does not exist. End of merge.");

      // ----- Nothing to merge, so merge is a success
      $v_result = 1;

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Look if the archive exists
    if (!is_file($this->zipname))
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, duplicate the archive_to_add.");

      // ----- Do a duplicate
      $v_result = $this->privDuplicate($p_archive_to_add->zipname);

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Open the zip file
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
    if (($v_result=$this->privOpenFd('rb')) != 1)
    {
      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Read the central directory informations
    $v_central_dir = array();
    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
    {
      $this->privCloseFd();
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Go to beginning of File
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'");
    @rewind($this->zip_fd);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'");

    // ----- Open the archive_to_add file
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open archive_to_add in binary read mode");
    if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1)
    {
      $this->privCloseFd();

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Read the central directory informations
    $v_central_dir_to_add = array();
    if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1)
    {
      $this->privCloseFd();
      $p_archive_to_add->privCloseFd();

      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Go to beginning of File
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'");
    @rewind($p_archive_to_add->zip_fd);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'");

    // ----- Creates a temporay file
    $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';

    // ----- Open the temporary file in write mode
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
    if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)
    {
      $this->privCloseFd();
      $p_archive_to_add->privCloseFd();

      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode');

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- Copy the files from the archive to the temporary file
    // TBC : Here I should better append the file and go back to erase the central dir
    $v_size = $v_central_dir['offset'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
      $v_buffer = fread($this->zip_fd, $v_read_size);
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Copy the files from the archive_to_add into the temporary file
    $v_size = $v_central_dir_to_add['offset'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
      $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size);
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Store the offset of the central dir
    $v_offset = @ftell($v_zip_temp_fd);
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset");

    // ----- Copy the block of file headers from the old archive
    $v_size = $v_central_dir['size'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
      $v_buffer = @fread($this->zip_fd, $v_read_size);
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Copy the block of file headers from the archive_to_add
    $v_size = $v_central_dir_to_add['size'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
      $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size);
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Merge the file comments
    $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment'];

    // ----- Calculate the size of the (new) central header
    $v_size = @ftell($v_zip_temp_fd)-$v_offset;

    // ----- Swap the file descriptor
    // Here is a trick : I swap the temporary fd with the zip fd, in order to use
    // the following methods on the temporary fil and not the real archive fd
    $v_swap = $this->zip_fd;
    $this->zip_fd = $v_zip_temp_fd;
    $v_zip_temp_fd = $v_swap;

    // ----- Create the central dir footer
    if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1)
    {
      $this->privCloseFd();
      $p_archive_to_add->privCloseFd();
      @fclose($v_zip_temp_fd);
      $this->zip_fd = null;

      // ----- Reset the file list
      unset($v_header_list);

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Swap back the file descriptor
    $v_swap = $this->zip_fd;
    $this->zip_fd = $v_zip_temp_fd;
    $v_zip_temp_fd = $v_swap;

    // ----- Close
    $this->privCloseFd();
    $p_archive_to_add->privCloseFd();

    // ----- Close the temporary file
    @fclose($v_zip_temp_fd);

    // ----- Delete the zip file
    // TBC : I should test the result ...
    @unlink($this->zipname);

    // ----- Rename the temporary file
    // TBC : I should test the result ...
    //@rename($v_zip_temp_name, $this->zipname);
    PclZipUtilRename($v_zip_temp_name, $this->zipname);

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privDuplicate()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privDuplicate($p_archive_filename)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDuplicate", "archive_filename='$p_archive_filename'");
    $v_result=1;

    // ----- Look if the $p_archive_filename exists
    if (!is_file($p_archive_filename))
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to duplicate does not exist. End of duplicate.");

      // ----- Nothing to duplicate, so duplicate is a success.
      $v_result = 1;

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Open the zip file
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
    if (($v_result=$this->privOpenFd('wb')) != 1)
    {
      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
    }

    // ----- Open the temporary file in write mode
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
    if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0)
    {
      $this->privCloseFd();

      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode');

      // ----- Return
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
      return PclZip::errorCode();
    }

    // ----- Copy the files from the archive to the temporary file
    // TBC : Here I should better append the file and go back to erase the central dir
    $v_size = filesize($p_archive_filename);
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read $v_read_size bytes");
      $v_buffer = fread($v_zip_temp_fd, $v_read_size);
      @fwrite($this->zip_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Close
    $this->privCloseFd();

    // ----- Close the temporary file
    @fclose($v_zip_temp_fd);

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privErrorLog()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function privErrorLog($p_error_code=0, $p_error_string='')
  {
    if (PCLZIP_ERROR_EXTERNAL == 1) {
      PclError($p_error_code, $p_error_string);
    }
    else {
      $this->error_code = $p_error_code;
      $this->error_string = $p_error_string;
    }
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privErrorReset()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function privErrorReset()
  {
    if (PCLZIP_ERROR_EXTERNAL == 1) {
      PclErrorReset();
    }
    else {
      $this->error_code = 0;
      $this->error_string = '';
    }
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privDecrypt()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privDecrypt($p_encryption_header, &$p_buffer, $p_size, $p_crc)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privDecrypt', "size=".$p_size."");
    $v_result=1;

    // ----- To Be Modified ;-)
    $v_pwd = "test";

    $p_buffer = PclZipUtilZipDecrypt($p_buffer, $p_size, $p_encryption_header,
	                                 $p_crc, $v_pwd);

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privDisableMagicQuotes()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privDisableMagicQuotes()
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privDisableMagicQuotes', "");
    $v_result=1;

    // ----- Look if function exists
    if (   (!function_exists("get_magic_quotes_runtime"))
	    || (!function_exists("set_magic_quotes_runtime"))) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Functions *et_magic_quotes_runtime are not supported");
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
	}

    // ----- Look if already done
    if ($this->magic_quotes_status != -1) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "magic_quote already disabled");
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
	}

	// ----- Get and memorize the magic_quote value
	$this->magic_quotes_status = @get_magic_quotes_runtime();
    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Current magic_quotes_runtime status is '".($this->magic_quotes_status==0?'disable':'enable')."'");

	// ----- Disable magic_quotes
	if ($this->magic_quotes_status == 1) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Disable magic_quotes");
	  @set_magic_quotes_runtime(0);
	}

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privSwapBackMagicQuotes()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privSwapBackMagicQuotes()
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privSwapBackMagicQuotes', "");
    $v_result=1;

    // ----- Look if function exists
    if (   (!function_exists("get_magic_quotes_runtime"))
	    || (!function_exists("set_magic_quotes_runtime"))) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Functions *et_magic_quotes_runtime are not supported");
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
	}

    // ----- Look if something to do
    if ($this->magic_quotes_status != -1) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "magic_quote not modified");
      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
      return $v_result;
	}

	// ----- Swap back magic_quotes
	if ($this->magic_quotes_status == 1) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Enable back magic_quotes");
  	  @set_magic_quotes_runtime($this->magic_quotes_status);
	}

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  }
  // End of class
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : PclZipUtilPathReduction()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function PclZipUtilPathReduction($p_dir)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathReduction", "dir='$p_dir'");
    $v_result = "";

    // ----- Look for not empty path
    if ($p_dir != "") {
      // ----- Explode path by directory names
      $v_list = explode("/", $p_dir);

      // ----- Study directories from last to first
      $v_skip = 0;
      for ($i=sizeof($v_list)-1; $i>=0; $i--) {
        // ----- Look for current path
        if ($v_list[$i] == ".") {
          // ----- Ignore this directory
          // Should be the first $i=0, but no check is done
        }
        else if ($v_list[$i] == "..") {
		  $v_skip++;
        }
        else if ($v_list[$i] == "") {
		  // ----- First '/' i.e. root slash
		  if ($i == 0) {
            $v_result = "/".$v_result;
		    if ($v_skip > 0) {
		        // ----- It is an invalid path, so the path is not modified
		        // TBC
		        $v_result = $p_dir;
                //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid path is unchanged");
                $v_skip = 0;
		    }
		  }
		  // ----- Last '/' i.e. indicates a directory
		  else if ($i == (sizeof($v_list)-1)) {
            $v_result = $v_list[$i];
		  }
		  // ----- Double '/' inside the path
		  else {
            // ----- Ignore only the double '//' in path,
            // but not the first and last '/'
		  }
        }
        else {
		  // ----- Look for item to skip
		  if ($v_skip > 0) {
		    $v_skip--;
		  }
		  else {
            $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:"");
		  }
        }
      }

      // ----- Look for skip
      if ($v_skip > 0) {
        while ($v_skip > 0) {
            $v_result = '../'.$v_result;
            $v_skip--;
        }
      }
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : PclZipUtilPathInclusion()
  // Description :
  //   This function indicates if the path $p_path is under the $p_dir tree. Or,
  //   said in an other way, if the file or sub-dir $p_path is inside the dir
  //   $p_dir.
  //   The function indicates also if the path is exactly the same as the dir.
  //   This function supports path with duplicated '/' like '//', but does not
  //   support '.' or '..' statements.
  // Parameters :
  // Return Values :
  //   0 if $p_path is not inside directory $p_dir
  //   1 if $p_path is inside directory $p_dir
  //   2 if $p_path is exactly the same as $p_dir
  // --------------------------------------------------------------------------------
  function PclZipUtilPathInclusion($p_dir, $p_path)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathInclusion", "dir='$p_dir', path='$p_path'");
    $v_result = 1;

    // ----- Look for path beginning by ./
    if (   ($p_dir == '.')
        || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) {
      $p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Replacing ./ by full path in p_dir '".$p_dir."'");
    }
    if (   ($p_path == '.')
        || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) {
      $p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1);
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Replacing ./ by full path in p_path '".$p_path."'");
    }

    // ----- Explode dir and path by directory separator
    $v_list_dir = explode("/", $p_dir);
    $v_list_dir_size = sizeof($v_list_dir);
    $v_list_path = explode("/", $p_path);
    $v_list_path_size = sizeof($v_list_path);

    // ----- Study directories paths
    $i = 0;
    $j = 0;
    while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Working on dir($i)='".$v_list_dir[$i]."' and path($j)='".$v_list_path[$j]."'");

      // ----- Look for empty dir (path reduction)
      if ($v_list_dir[$i] == '') {
        $i++;
        continue;
      }
      if ($v_list_path[$j] == '') {
        $j++;
        continue;
      }

      // ----- Compare the items
      if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != ''))  {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Items ($i,$j) are different");
        $v_result = 0;
      }

      // ----- Next items
      $i++;
      $j++;
    }

    // ----- Look if everything seems to be the same
    if ($v_result) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Look for tie break");
      // ----- Skip all the empty items
      while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++;
      while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++;
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Looking on dir($i)='".($i < $v_list_dir_size?$v_list_dir[$i]:'')."' and path($j)='".($j < $v_list_path_size?$v_list_path[$j]:'')."'");

      if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) {
        // ----- There are exactly the same
        $v_result = 2;
      }
      else if ($i < $v_list_dir_size) {
        // ----- The path is shorter than the dir
        $v_result = 0;
      }
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : PclZipUtilCopyBlock()
  // Description :
  // Parameters :
  //   $p_mode : read/write compression mode
  //             0 : src & dest normal
  //             1 : src gzip, dest normal
  //             2 : src normal, dest gzip
  //             3 : src & dest gzip
  // Return Values :
  // --------------------------------------------------------------------------------
  function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilCopyBlock", "size=$p_size, mode=$p_mode");
    $v_result = 1;

    if ($p_mode==0)
    {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset before read :".(@ftell($p_src)));
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset before write :".(@ftell($p_dest)));
      while ($p_size != 0)
      {
        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
        $v_buffer = @fread($p_src, $v_read_size);
        @fwrite($p_dest, $v_buffer, $v_read_size);
        $p_size -= $v_read_size;
      }
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset after read :".(@ftell($p_src)));
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset after write :".(@ftell($p_dest)));
    }
    else if ($p_mode==1)
    {
      while ($p_size != 0)
      {
        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
        $v_buffer = @gzread($p_src, $v_read_size);
        @fwrite($p_dest, $v_buffer, $v_read_size);
        $p_size -= $v_read_size;
      }
    }
    else if ($p_mode==2)
    {
      while ($p_size != 0)
      {
        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
        $v_buffer = @fread($p_src, $v_read_size);
        @gzwrite($p_dest, $v_buffer, $v_read_size);
        $p_size -= $v_read_size;
      }
    }
    else if ($p_mode==3)
    {
      while ($p_size != 0)
      {
        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
        $v_buffer = @gzread($p_src, $v_read_size);
        @gzwrite($p_dest, $v_buffer, $v_read_size);
        $p_size -= $v_read_size;
      }
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : PclZipUtilRename()
  // Description :
  //   This function tries to do a simple rename() function. If it fails, it
  //   tries to copy the $p_src file in a new $p_dest file and then unlink the
  //   first one.
  // Parameters :
  //   $p_src : Old filename
  //   $p_dest : New filename
  // Return Values :
  //   1 on success, 0 on failure.
  // --------------------------------------------------------------------------------
  function PclZipUtilRename($p_src, $p_dest)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilRename", "source=$p_src, destination=$p_dest");
    $v_result = 1;

    // ----- Try to rename the files
    if (!@rename($p_src, $p_dest)) {
      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to rename file, try copy+unlink");

      // ----- Try to copy & unlink the src
      if (!@copy($p_src, $p_dest)) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to copy file");
        $v_result = 0;
      }
      else if (!@unlink($p_src)) {
        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to unlink old filename");
        $v_result = 0;
      }
    }

    // ----- Return
    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : PclZipUtilOptionText()
  // Description :
  //   Translate option value in text. Mainly for debug purpose.
  // Parameters :
  //   $p_option : the option value.
  // Return Values :
  //   The option text value.
  // --------------------------------------------------------------------------------
  function PclZipUtilOptionText($p_option)
  {
    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilOptionText", "option='".$p_option."'");

    $v_list = get_defined_constants();
    for (reset($v_list); $v_key = key($v_list); next($v_list)) {
	  $v_prefix = substr($v_key, 0, 10);
	  if ((   ($v_prefix == 'PCLZIP_OPT')
         || ($v_prefix == 'PCLZIP_CB_')
         || ($v_prefix == 'PCLZIP_ATT'))
	      && ($v_list[$v_key] == $p_option)) {
          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_key);
          return $v_key;
	    }
    }

    $v_result = 'Unknown';

    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : PclZipUtilTranslateWinPath()
  // Description :
  //   Translate windows path by replacing '\' by '/' and optionally removing
  //   drive letter.
  // Parameters :
  //   $p_path : path to translate.
  //   $p_remove_disk_letter : true | false
  // Return Values :
  //   The path translated.
  // --------------------------------------------------------------------------------
  function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true)
  {
    if (stristr(php_uname(), 'windows')) {
      // ----- Look for potential disk letter
      if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) {
          $p_path = substr($p_path, $v_position+1);
      }
      // ----- Change potential windows directory separator
      if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) {
          $p_path = strtr($p_path, '\\', '/');
      }
    }
    return $p_path;
  }
  // --------------------------------------------------------------------------------


?>
                                                                                                  blog/wp-admin/includes/class-wp-filesystem-base.php                                                 0000755 0023433 0004734 00000012273 11060470726 022242  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
class WP_Filesystem_Base{
	var $verbose = false;
	var $cache = array();
	
	var $method = '';
	
	function abspath() {
		if ( defined('FTP_BASE') && strpos($this->method, 'ftp') !== false ) 
			return FTP_BASE;
		return $this->find_folder(ABSPATH);
	}
	function wp_content_dir() {
		if ( defined('FTP_CONTENT_DIR') && strpos($this->method, 'ftp') !== false ) 
			return FTP_CONTENT_DIR;
		return $this->find_folder(WP_CONTENT_DIR);
	}
	function wp_plugins_dir() {
		if ( defined('FTP_PLUGIN_DIR') && strpos($this->method, 'ftp') !== false ) 
			return FTP_PLUGIN_DIR;
		return $this->find_folder(WP_PLUGIN_DIR);
	}
	function wp_themes_dir() {
		return $this->wp_content_dir() . '/themes';
	}
	//Back compat: use abspath() or wp_*_dir
	function find_base_dir($base = '.', $echo = false) {
		$this->verbose = $echo;
		return $this->abspath();
	}
	//Back compat: use ::abspath() or ::wp_*_dir
	function get_base_dir($base = '.', $echo = false) {
		$this->verbose = $echo;
		return $this->abspath();
	}
	
	function find_folder($folder) {
		$folder = str_replace('\\', '/', $folder); //Windows Sanitiation
		if ( isset($this->cache[ $folder ] ) )
			return $this->cache[ $folder ];

		if ( $this->exists($folder) ) { //Folder exists at that absolute path.
			$this->cache[ $folder ] = $folder;
			return $folder;
		}
		if( $return = $this->search_for_folder($folder) )
			$this->cache[ $folder ] = $return;
		return $return;
	}
	
	// Assumes $folder is windows sanitized;
	// Assumes that the drive letter is safe to be stripped off, Should not be a problem for windows servers.
	function search_for_folder($folder, $base = '.', $loop = false ) {
		if ( empty( $base ) || '.' == $base )
			$base = trailingslashit($this->cwd());
		
		$folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows driveletter if its there.
		
		$folder_parts = explode('/', $folder);
		$last_path = $folder_parts[ count($folder_parts) - 1 ];
		
		$files = $this->dirlist( $base );
		
		foreach ( $folder_parts as $key ) {
			if ( $key == $last_path )
				continue; //We want this to be caught by the next code block.

			//Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder, 
			// If its found, change into it and follow through looking for it. 
			// If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on.
			// If it reaches the end, and still cant find it, it'll return false for the entire function.
			if( isset($files[ $key ]) ){
				//Lets try that folder:
				$newdir = trailingslashit(path_join($base, $key));
				if( $this->verbose )
					printf( __('Changing to %s') . '<br/>', $newdir );
				if( $ret = $this->search_for_folder( $folder, $newdir, $loop) )
					return $ret;
			}
		}
		
		//Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take.
		if(isset( $files[ $last_path ] ) ) {
			if( $this->verbose )
				printf( __('Found %s') . '<br/>',  $base . $last_path );
			return $base . $last_path;
		}
		if( $loop )
			return false;//Prevent tihs function looping again.
		//As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups.
		return $this->search_for_folder($folder, '/', true); 
		
	}
	
	//Common Helper functions.
	function gethchmod($file){
		//From the PHP.net page for ...?
		$perms = $this->getchmod($file);
		if (($perms & 0xC000) == 0xC000) // Socket
			$info = 's';
		elseif (($perms & 0xA000) == 0xA000) // Symbolic Link
			$info = 'l';
		elseif (($perms & 0x8000) == 0x8000) // Regular
			$info = '-';
		elseif (($perms & 0x6000) == 0x6000) // Block special
			$info = 'b';
		elseif (($perms & 0x4000) == 0x4000) // Directory
			$info = 'd';
		elseif (($perms & 0x2000) == 0x2000) // Character special
			$info = 'c';
		elseif (($perms & 0x1000) == 0x1000)// FIFO pipe
			$info = 'p';
		else // Unknown
			$info = 'u';

		// Owner
		$info .= (($perms & 0x0100) ? 'r' : '-');
		$info .= (($perms & 0x0080) ? 'w' : '-');
		$info .= (($perms & 0x0040) ?
					(($perms & 0x0800) ? 's' : 'x' ) :
					(($perms & 0x0800) ? 'S' : '-'));

		// Group
		$info .= (($perms & 0x0020) ? 'r' : '-');
		$info .= (($perms & 0x0010) ? 'w' : '-');
		$info .= (($perms & 0x0008) ?
					(($perms & 0x0400) ? 's' : 'x' ) :
					(($perms & 0x0400) ? 'S' : '-'));

		// World
		$info .= (($perms & 0x0004) ? 'r' : '-');
		$info .= (($perms & 0x0002) ? 'w' : '-');
		$info .= (($perms & 0x0001) ?
					(($perms & 0x0200) ? 't' : 'x' ) :
					(($perms & 0x0200) ? 'T' : '-'));
		return $info;
	}
	function getnumchmodfromh($mode) {
		$realmode = "";
		$legal =  array("", "w", "r", "x", "-");
		$attarray = preg_split("//", $mode);

		for($i=0; $i < count($attarray); $i++)
		   if($key = array_search($attarray[$i], $legal))
			   $realmode .= $legal[$key];
			   
		$mode = str_pad($realmode, 9, '-');
		$trans = array('-'=>'0', 'r'=>'4', 'w'=>'2', 'x'=>'1');
		$mode = strtr($mode,$trans);
		
		$newmode = '';
		$newmode .= $mode[0] + $mode[1] + $mode[2];
		$newmode .= $mode[3] + $mode[4] + $mode[5];
		$newmode .= $mode[6] + $mode[7] + $mode[8];
		return $newmode;
	}
}
?>
                                                                                                                                                                                                                                                                                                                                     blog/wp-admin/includes/class-wp-filesystem-direct.php                                               0000755 0023433 0004734 00000014636 11060470727 022610  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

class WP_Filesystem_Direct  extends WP_Filesystem_Base {
	var $permission = null;
	var $errors = array();
	function WP_Filesystem_Direct($arg) {
		$this->method = 'direct';
		$this->errors = new WP_Error();
		$this->permission = umask();
	}
	function connect() {
		return true;
	}
	function setDefaultPermissions($perm) {
		$this->permission = $perm;
	}
	function get_contents($file) {
		return @file_get_contents($file);
	}
	function get_contents_array($file) {
		return @file($file);
	}
	function put_contents($file, $contents, $mode = false, $type = '') {
		if ( ! ($fp = @fopen($file, 'w' . $type)) )
			return false;
		@fwrite($fp, $contents);
		@fclose($fp);
		$this->chmod($file,$mode);
		return true;
	}
	function cwd() {
		return @getcwd();
	}
	function chdir($dir) {
		return @chdir($dir);
	}
	function chgrp($file, $group, $recursive = false) {
		if( ! $this->exists($file) )
			return false;
		if( ! $recursive )
			return @chgrp($file, $group);
		if( ! $this->is_dir($file) )
			return @chgrp($file, $group);
		//Is a directory, and we want recursive
		$file = trailingslashit($file);
		$filelist = $this->dirlist($file);
		foreach($filelist as $filename)
			$this->chgrp($file . $filename, $group, $recursive);

		return true;
	}
	function chmod($file, $mode = false, $recursive = false) {
		if( ! $mode )
			$mode = $this->permission;
		if( ! $this->exists($file) )
			return false;
		if( ! $recursive )
			return @chmod($file,$mode);
		if( ! $this->is_dir($file) )
			return @chmod($file, $mode);
		//Is a directory, and we want recursive
		$file = trailingslashit($file);
		$filelist = $this->dirlist($file);
		foreach($filelist as $filename)
			$this->chmod($file . $filename, $mode, $recursive);

		return true;
	}
	function chown($file, $owner, $recursive = false) {
		if( ! $this->exists($file) )
			return false;
		if( ! $recursive )
			return @chown($file, $owner);
		if( ! $this->is_dir($file) )
			return @chown($file, $owner);
		//Is a directory, and we want recursive
		$filelist = $this->dirlist($file);
		foreach($filelist as $filename){
			$this->chown($file . '/' . $filename, $owner, $recursive);
		}
		return true;
	}
	function owner($file) {
		$owneruid = @fileowner($file);
		if( ! $owneruid )
			return false;
		if( ! function_exists('posix_getpwuid') )
			return $owneruid;
		$ownerarray = posix_getpwuid($owneruid);
		return $ownerarray['name'];
	}
	function getchmod($file) {
		return @fileperms($file);
	}
	function group($file) {
		$gid = @filegroup($file);
		if( ! $gid )
			return false;
		if( ! function_exists('posix_getgrgid') )
			return $gid;
		$grouparray = posix_getgrgid($gid);
		return $grouparray['name'];
	}

	function copy($source, $destination, $overwrite = false) {
		if( ! $overwrite && $this->exists($destination) )
			return false;
		return copy($source, $destination);
	}

	function move($source, $destination, $overwrite = false) {
		//Possible to use rename()?
		if( $this->copy($source, $destination, $overwrite) && $this->exists($destination) ){
			$this->delete($source);
			return true;
		} else {
			return false;
		}
	}

	function delete($file, $recursive = false) {
		$file = str_replace('\\', '/', $file); //for win32, occasional problems deleteing files otherwise

		if( $this->is_file($file) )
			return @unlink($file);
		if( ! $recursive && $this->is_dir($file) )
			return @rmdir($file);

		//At this point its a folder, and we're in recursive mode
		$file = trailingslashit($file);
		$filelist = $this->dirlist($file, true);

		$retval = true;
		if( is_array($filelist) ) //false if no files, So check first.
			foreach($filelist as $filename => $fileinfo)
				if( ! $this->delete($file . $filename, $recursive) )
					$retval = false;

		if( ! @rmdir($file) )
			return false;
		return $retval;
	}

	function exists($file) {
		return @file_exists($file);
	}

	function is_file($file) {
		return @is_file($file);
	}

	function is_dir($path) {
		return @is_dir($path);
	}

	function is_readable($file) {
		return @is_readable($file);
	}

	function is_writable($file) {
		return @is_writable($file);
	}

	function atime($file) {
		return @fileatime($file);
	}

	function mtime($file) {
		return @filemtime($file);
	}
	function size($file) {
		return @filesize($file);
	}

	function touch($file, $time = 0, $atime = 0){
		if($time == 0)
			$time = time();
		if($atime == 0)
			$atime = time();
		return @touch($file, $time, $atime);
	}

	function mkdir($path, $chmod = false, $chown = false, $chgrp = false){
		if( ! $chmod)
			$chmod = $this->permission;

		if( ! @mkdir($path, $chmod) )
			return false;
		if( $chown )
			$this->chown($path, $chown);
		if( $chgrp )
			$this->chgrp($path, $chgrp);
		return true;
	}

	function rmdir($path, $recursive = false) {
		//Currently unused and untested, Use delete() instead.
		if( ! $recursive )
			return @rmdir($path);
		//recursive:
		$filelist = $this->dirlist($path);
		foreach($filelist as $filename => $det) {
			if ( '/' == substr($filename, -1, 1) )
				$this->rmdir($path . '/' . $filename, $recursive);
			@rmdir($filename);
		}
		return @rmdir($path);
	}

	function dirlist($path, $incdot = false, $recursive = false) {
		if( $this->is_file($path) ) {
			$limitFile = basename($path);
			$path = dirname($path);
		} else {
			$limitFile = false;
		}
		if( ! $this->is_dir($path) )
			return false;

		$ret = array();
		$dir = dir($path);
		while (false !== ($entry = $dir->read()) ) {
			$struc = array();
			$struc['name'] = $entry;

			if( '.' == $struc['name'] || '..' == $struc['name'] )
				continue; //Do not care about these folders.
			if( '.' == $struc['name'][0] && !$incdot)
				continue;
			if( $limitFile && $struc['name'] != $limitFile)
				continue;

			$struc['perms'] 	= $this->gethchmod($path.'/'.$entry);
			$struc['permsn']	= $this->getnumchmodfromh($struc['perms']);
			$struc['number'] 	= false;
			$struc['owner']    	= $this->owner($path.'/'.$entry);
			$struc['group']    	= $this->group($path.'/'.$entry);
			$struc['size']    	= $this->size($path.'/'.$entry);
			$struc['lastmodunix']= $this->mtime($path.'/'.$entry);
			$struc['lastmod']   = date('M j',$struc['lastmodunix']);
			$struc['time']    	= date('h:i:s',$struc['lastmodunix']);
			$struc['type']		= $this->is_dir($path.'/'.$entry) ? 'd' : 'f';

			if ( 'd' == $struc['type'] ) {
				if( $recursive )
					$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
				else
					$struc['files'] = array();
			}

			$ret[ $struc['name'] ] = $struc;
		}
		$dir->close();
		unset($dir);
		return $ret;
	}
}
?>
                                                                                                  blog/wp-admin/includes/class-wp-filesystem-ftpext.php                                               0000755 0023433 0004734 00000024253 11060470730 022636  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
class WP_Filesystem_FTPext extends WP_Filesystem_Base{
	var $link;
	var $timeout = 5;
	var $errors = array();
	var $options = array();

	var $permission = null;

	var $filetypes = array(
							'php'=>FTP_ASCII,
							'css'=>FTP_ASCII,
							'txt'=>FTP_ASCII,
							'js'=>FTP_ASCII,
							'html'=>FTP_ASCII,
							'htm'=>FTP_ASCII,
							'xml'=>FTP_ASCII,

							'jpg'=>FTP_BINARY,
							'png'=>FTP_BINARY,
							'gif'=>FTP_BINARY,
							'bmp'=>FTP_BINARY
							);

	function WP_Filesystem_FTPext($opt='') {
		$this->method = 'ftpext';
		$this->errors = new WP_Error();

		//Check if possible to use ftp functions.
		if ( ! extension_loaded('ftp') ) {
			$this->errors->add('no_ftp_ext', __('The ftp PHP extension is not available'));
			return false;
		}

		// Set defaults:
		if ( empty($opt['port']) )
			$this->options['port'] = 21;
		else
			$this->options['port'] = $opt['port'];

		if ( empty($opt['hostname']) )
			$this->errors->add('empty_hostname', __('FTP hostname is required'));
		else
			$this->options['hostname'] = $opt['hostname'];

		if ( isset($opt['base']) && ! empty($opt['base']) )
			$this->wp_base = $opt['base'];

		// Check if the options provided are OK.
		if ( empty ($opt['username']) )
			$this->errors->add('empty_username', __('FTP username is required'));
		else
			$this->options['username'] = $opt['username'];

		if ( empty ($opt['password']) )
			$this->errors->add('empty_password', __('FTP password is required'));
		else
			$this->options['password'] = $opt['password'];

		$this->options['ssl'] = ( !empty($opt['ssl']) );
	}

	function connect() {
		if ( $this->options['ssl'] && function_exists('ftp_ssl_connect') )
			$this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'],$this->timeout);
		else
			$this->link = @ftp_connect($this->options['hostname'], $this->options['port'],$this->timeout);

		if ( ! $this->link ) {
			$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
			return false;
		}

		if ( ! @ftp_login($this->link,$this->options['username'], $this->options['password']) ) {
			$this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username']));
			return false;
		}

		return true;
	}

	function setDefaultPermissions($perm) {
		$this->permission = $perm;
	}
	
	function get_contents($file, $type = '', $resumepos = 0 ){
		if( empty($type) ){
			$extension = substr(strrchr($file, "."), 1);
			$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
		}
		$temp = tmpfile();
		if ( ! $temp )
			return false;
		if( ! @ftp_fget($this->link, $temp, $file, $type, $resumepos) )
			return false;
		fseek($temp, 0); //Skip back to the start of the file being written to
		$contents = '';
		while (!feof($temp)) {
			$contents .= fread($temp, 8192);
		}
		fclose($temp);
		return $contents;
	}
	function get_contents_array($file) {
		return explode("\n", $this->get_contents($file));
	}
	function put_contents($file, $contents, $type = '' ) {
		if( empty($type) ) {
			$extension = substr(strrchr($file, "."), 1);
			$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
		}
		$temp = tmpfile();
		if ( ! $temp )
			return false;
		fwrite($temp, $contents);
		fseek($temp, 0); //Skip back to the start of the file being written to
		$ret = @ftp_fput($this->link, $file, $temp, $type);
		fclose($temp);
		return $ret;
	}
	function cwd() {
		$cwd = ftp_pwd($this->link);
		if( $cwd )
			$cwd = trailingslashit($cwd);
		return $cwd;
	}
	function chdir($dir) {
		return @ftp_chdir($dir);
	}
	function chgrp($file, $group, $recursive = false ) {
		return false;
	}
	function chmod($file, $mode = false, $recursive = false) {
		if( ! $mode )
			$mode = $this->permission;
		if( ! $mode )
			return false;
		if ( ! $this->exists($file) )
			return false;
		if ( ! $recursive || ! $this->is_dir($file) ) {
			if ( ! function_exists('ftp_chmod') )
				return @ftp_site($this->link, sprintf('CHMOD %o %s', $mode, $file));
			return @ftp_chmod($this->link, $mode, $file);
		}
		//Is a directory, and we want recursive
		$filelist = $this->dirlist($file);
		foreach($filelist as $filename){
			$this->chmod($file . '/' . $filename, $mode, $recursive);
		}
		return true;
	}
	function chown($file, $owner, $recursive = false ) {
		return false;
	}
	function owner($file) {
		$dir = $this->dirlist($file);
		return $dir[$file]['owner'];
	}
	function getchmod($file) {
		$dir = $this->dirlist($file);
		return $dir[$file]['permsn'];
	}
	function group($file) {
		$dir = $this->dirlist($file);
		return $dir[$file]['group'];
	}
	function copy($source, $destination, $overwrite = false ) {
		if( ! $overwrite && $this->exists($destination) )
			return false;
		$content = $this->get_contents($source);
		if( false === $content)
			return false;
		return $this->put_contents($destination, $content);
	}
	function move($source, $destination, $overwrite = false) {
		return ftp_rename($this->link, $source, $destination);
	}

	function delete($file,$recursive=false) {
		if ( $this->is_file($file) )
			return @ftp_delete($this->link, $file);
		if ( !$recursive )
			return @ftp_rmdir($this->link, $file);
		$filelist = $this->dirlist($file);
		foreach ((array) $filelist as $filename => $fileinfo) {
			$this->delete($file . '/' . $filename, $recursive);
		}
		return @ftp_rmdir($this->link, $file);
	}

	function exists($file) {
		$list = ftp_rawlist($this->link, $file, false);
		if( ! $list )
			return false;
		return count($list) == 1 ? true : false;
	}
	function is_file($file) {
		return $this->is_dir($file) ? false : true;
	}
	function is_dir($path) {
		$cwd = $this->cwd();
		$result = @ftp_chdir($this->link, $path);
		if( $result && $path == $this->cwd() || $this->cwd() != $cwd ) {
			@ftp_chdir($this->link, $cwd);
			return true;
		}
		return false;
	}
	function is_readable($file) {
		//Get dir list, Check if the file is writable by the current user??
		return true;
	}
	function is_writable($file) {
		//Get dir list, Check if the file is writable by the current user??
		return true;
	}
	function atime($file) {
		return false;
	}
	function mtime($file) {
		return ftp_mdtm($this->link, $file);
	}
	function size($file) {
		return ftp_size($this->link, $file);
	}
	function touch($file, $time = 0, $atime = 0) {
		return false;
	}
	function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
		if( !@ftp_mkdir($this->link, $path) )
			return false;
		if( $chmod )
			$this->chmod($path, $chmod);
		if( $chown )
			$this->chown($path, $chown);
		if( $chgrp )
			$this->chgrp($path, $chgrp);
		return true;
	}
	function rmdir($path, $recursive = false) {
		if( ! $recursive )
			return @ftp_rmdir($this->link, $path);

		//TODO: Recursive Directory delete, Have to delete files from the folder first.
		//$dir = $this->dirlist($path);
		//foreach($dir as $file)

	}

	function parselisting($line) {
		$is_windows = ($this->OS_remote == FTP_OS_Windows);
		if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/", $line, $lucifer)) {
			$b = array();
			if ($lucifer[3]<70) { $lucifer[3] +=2000; } else { $lucifer[3]+=1900; } // 4digit year fix
			$b['isdir'] = ($lucifer[7]=="<DIR>");
			if ( $b['isdir'] )
				$b['type'] = 'd';
			else
				$b['type'] = 'f';
			$b['size'] = $lucifer[7];
			$b['month'] = $lucifer[1];
			$b['day'] = $lucifer[2];
			$b['year'] = $lucifer[3];
			$b['hour'] = $lucifer[4];
			$b['minute'] = $lucifer[5];
			$b['time'] = @mktime($lucifer[4]+(strcasecmp($lucifer[6],"PM")==0?12:0),$lucifer[5],0,$lucifer[1],$lucifer[2],$lucifer[3]);
			$b['am/pm'] = $lucifer[6];
			$b['name'] = $lucifer[8];
		} else if (!$is_windows && $lucifer=preg_split("/[ ]/",$line,9,PREG_SPLIT_NO_EMPTY)) {
			//echo $line."\n";
			$lcount=count($lucifer);
			if ($lcount<8) return '';
			$b = array();
			$b['isdir'] = $lucifer[0]{0} === "d";
			$b['islink'] = $lucifer[0]{0} === "l";
			if ( $b['isdir'] )
				$b['type'] = 'd';
			elseif ( $b['islink'] )
				$b['type'] = 'l';
			else
				$b['type'] = 'f';
			$b['perms'] = $lucifer[0];
			$b['number'] = $lucifer[1];
			$b['owner'] = $lucifer[2];
			$b['group'] = $lucifer[3];
			$b['size'] = $lucifer[4];
			if ($lcount==8) {
				sscanf($lucifer[5],"%d-%d-%d",$b['year'],$b['month'],$b['day']);
				sscanf($lucifer[6],"%d:%d",$b['hour'],$b['minute']);
				$b['time'] = @mktime($b['hour'],$b['minute'],0,$b['month'],$b['day'],$b['year']);
				$b['name'] = $lucifer[7];
			} else {
				$b['month'] = $lucifer[5];
				$b['day'] = $lucifer[6];
				if (preg_match("/([0-9]{2}):([0-9]{2})/",$lucifer[7],$l2)) {
					$b['year'] = date("Y");
					$b['hour'] = $l2[1];
					$b['minute'] = $l2[2];
				} else {
					$b['year'] = $lucifer[7];
					$b['hour'] = 0;
					$b['minute'] = 0;
				}
				$b['time'] = strtotime(sprintf("%d %s %d %02d:%02d",$b['day'],$b['month'],$b['year'],$b['hour'],$b['minute']));
				$b['name'] = $lucifer[8];
			}
		}

		return $b;
	}

	function dirlist($path = '.', $incdot = false, $recursive = false) {
		if( $this->is_file($path) ) {
			$limitFile = basename($path);
			$path = dirname($path) . '/';
		} else {
			$limitFile = false;
		}

		$list = @ftp_rawlist($this->link, '-a ' . $path, false);

		if ( $list === false )
			return false;

		$dirlist = array();
		foreach ( $list as $k => $v ) {
			$entry = $this->parselisting($v);
			if ( empty($entry) )
				continue;

			if ( '.' == $entry["name"] || '..' == $entry["name"] )
				continue;

			$dirlist[ $entry['name'] ] = $entry;
		}

		if ( ! $dirlist )
			return false;
		if ( empty($dirlist) )
			return array();

		$ret = array();
		foreach ( $dirlist as $struc ) {

			if ( 'd' == $struc['type'] ) {
				$struc['files'] = array();

				if ( $incdot ){
					//We're including the doted starts
					if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
						if ($recursive)
							$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
					}
				} else { //No dots
					if ($recursive)
						$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
				}
			}
			//File
			$ret[$struc['name']] = $struc;
		}
		return $ret;
	}

	function __destruct(){
		if( $this->link )
			ftp_close($this->link);
	}
}

?>
                                                                                                                                                                                                                                                                                                                                                     blog/wp-admin/includes/class-wp-filesystem-ftpsockets.php                                           0000755 0023433 0004734 00000017214 11060470730 023510  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
	var $ftp = false;
	var $timeout = 5;
	var $errors;
	var $options = array();

	var $permission = null;

	var $filetypes = array(
							'php' => FTP_ASCII,
							'css' => FTP_ASCII,
							'txt' => FTP_ASCII,
							'js'  => FTP_ASCII,
							'html'=> FTP_ASCII,
							'htm' => FTP_ASCII,
							'xml' => FTP_ASCII,

							'jpg' => FTP_BINARY,
							'png' => FTP_BINARY,
							'gif' => FTP_BINARY,
							'bmp' => FTP_BINARY
							);

	function WP_Filesystem_ftpsockets($opt='') {
		$this->method = 'ftpsockets';
		$this->errors = new WP_Error();

		//Check if possible to use ftp functions.
		if( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' )
				return false;
		$this->ftp = new ftp();

		//Set defaults:
		if ( empty($opt['port']) )
			$this->options['port'] = 21;
		else
			$this->options['port'] = $opt['port'];

		if ( empty($opt['hostname']) )
			$this->errors->add('empty_hostname', __('FTP hostname is required'));
		else
			$this->options['hostname'] = $opt['hostname'];

		if ( isset($opt['base']) && ! empty($opt['base']) )
			$this->wp_base = $opt['base'];

		// Check if the options provided are OK.
		if ( empty ($opt['username']) )
			$this->errors->add('empty_username', __('FTP username is required'));
		else
			$this->options['username'] = $opt['username'];

		if ( empty ($opt['password']) )
			$this->errors->add('empty_password', __('FTP password is required'));
		else
			$this->options['password'] = $opt['password'];
	}

	function connect() {
		if ( ! $this->ftp )
			return false;

		//$this->ftp->Verbose = true;

		if ( ! $this->ftp->SetServer($this->options['hostname'], $this->options['port']) ) {
			$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
			return false;
		}
		if ( ! $this->ftp->connect() ) {
			$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
			return false;
		}

		if ( ! $this->ftp->login($this->options['username'], $this->options['password']) ) {
			$this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username']));
			return false;
		}

		$this->ftp->SetType(FTP_AUTOASCII);
		$this->ftp->Passive(true);
		return true;
	}

	function setDefaultPermissions($perm) {
		$this->permission = $perm;
	}

	function get_contents($file, $type = '', $resumepos = 0){
		if( ! $this->exists($file) )
			return false;

		if( empty($type) ){
			$extension = substr(strrchr($file, '.'), 1);
			$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_AUTOASCII;
		}
		$this->ftp->SetType($type);
		$temp = wp_tempnam( $file );
		if ( ! $temphandle = fopen($temp, 'w+') )
			return false;
		if ( ! $this->ftp->fget($temphandle, $file) ) {
			fclose($temphandle);
			unlink($temp);
			return ''; //Blank document, File does exist, Its just blank.
		}
		fseek($temphandle, 0); //Skip back to the start of the file being written to
		$contents = '';
		while ( ! feof($temphandle) )
			$contents .= fread($temphandle, 8192);
		fclose($temphandle);
		unlink($temp);
		return $contents;
	}

	function get_contents_array($file){
		return explode("\n", $this->get_contents($file) );
	}

	function put_contents($file, $contents, $type = '' ) {
		if( empty($type) ){
			$extension = substr(strrchr($file, '.'), 1);
			$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_AUTOASCII;
		}
		$this->ftp->SetType($type);

		$temp = wp_tempnam( $file );
		if ( ! $temphandle = fopen($temp, 'w+') ){
			unlink($temp);		
			return false;
		}
		fwrite($temphandle, $contents);
		fseek($temphandle, 0); //Skip back to the start of the file being written to
		$ret = $this->ftp->fput($file, $temphandle);
		fclose($temphandle);
		unlink($temp);
		return $ret;
	}

	function cwd() {
		$cwd = $this->ftp->pwd();
		if( $cwd )
			$cwd = trailingslashit($cwd);
		return $cwd;
	}

	function chdir($file) {
		return $this->ftp->chdir($file);
	}
	
	function chgrp($file, $group, $recursive = false ) {
		return false;
	}

	function chmod($file, $mode = false, $recursive = false ){
		if( ! $mode )
			$mode = $this->permission;
		if( ! $mode )
			return false;
		//if( ! $this->exists($file) )
		//	return false;
		if( ! $recursive || ! $this->is_dir($file) ) {
			return $this->ftp->chmod($file,$mode);
		}
		//Is a directory, and we want recursive
		$filelist = $this->dirlist($file);
		foreach($filelist as $filename){
			$this->chmod($file . '/' . $filename, $mode, $recursive);
		}
		return true;
	}

	function chown($file, $owner, $recursive = false ) {
		return false;
	}

	function owner($file) {
		$dir = $this->dirlist($file);
		return $dir[$file]['owner'];
	}

	function getchmod($file) {
		$dir = $this->dirlist($file);
		return $dir[$file]['permsn'];
	}

	function group($file) {
		$dir = $this->dirlist($file);
		return $dir[$file]['group'];
	}

	function copy($source, $destination, $overwrite = false ) {
		if( ! $overwrite && $this->exists($destination) )
			return false;

		$content = $this->get_contents($source);
		if ( false === $content )
			return false;

		return $this->put_contents($destination, $content);
	}

	function move($source, $destination, $overwrite = false ) {
		return $this->ftp->rename($source, $destination);
	}

	function delete($file, $recursive = false ) {
		if ( $this->is_file($file) )
			return $this->ftp->delete($file);
		if ( !$recursive )
			return $this->ftp->rmdir($file);

		return $this->ftp->mdel($file);
	}

	function exists($file) {
		return $this->ftp->is_exists($file);
	}

	function is_file($file) {
		return $this->is_dir($file) ? false : true;
	}

	function is_dir($path) {
		$cwd = $this->cwd();
		if ( $this->chdir($path) ) {
			$this->chdir($cwd);
			return true;
		}
		return false;
	}

	function is_readable($file) {
		//Get dir list, Check if the file is writable by the current user??
		return true;
	}

	function is_writable($file) {
		//Get dir list, Check if the file is writable by the current user??
		return true;
	}

	function atime($file) {
		return false;
	}

	function mtime($file) {
		return $this->ftp->mdtm($file);
	}

	function size($file) {
		return $this->ftp->filesize($file);
	}

	function touch($file, $time = 0, $atime = 0 ){
		return false;
	}

	function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
		if( ! $this->ftp->mkdir($path) )
			return false;
		if( $chmod )
			$this->chmod($path, $chmod);
		if( $chown )
			$this->chown($path, $chown);
		if( $chgrp )
			$this->chgrp($path, $chgrp);
		return true;
	}

	function rmdir($path, $recursive = false ) {
		if( ! $recursive )
			return $this->ftp->rmdir($path);

		return $this->ftp->mdel($path);
	}

	function dirlist($path = '.', $incdot = false, $recursive = false ) {
		if( $this->is_file($path) ) {
			$limitFile = basename($path);
			$path = dirname($path) . '/';
		} else {
			$limitFile = false;
		}

		$list = $this->ftp->dirlist($path);
		if( ! $list )
			return false;
		if( empty($list) )
			return array();

		$ret = array();
		foreach ( $list as $struc ) {

			if ( 'd' == $struc['type'] ) {
				$struc['files'] = array();

				if ( $incdot ){
					//We're including the doted starts
					if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
						if ($recursive)
							$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
					}
				} else { //No dots
					if ($recursive)
						$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
				}
			}
			//File
			$ret[$struc['name']] = $struc;
		}
		return $ret;
	}

	function __destruct(){
		$this->ftp->quit();
	}
}
?>
                                                                                                                                                                                                                                                                                                                                                                                    blog/wp-admin/includes/comment.php                                                                  0000755 0023433 0004734 00000006470 11060470731 017057  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

function comment_exists($comment_author, $comment_date) {
	global $wpdb;

	return $wpdb->get_var( $wpdb->prepare("SELECT comment_post_ID FROM $wpdb->comments
			WHERE comment_author = %s AND comment_date = %s", $comment_author, $comment_date) );
}

function edit_comment() {

	$comment_post_ID = (int) $_POST['comment_post_ID'];

	if (!current_user_can( 'edit_post', $comment_post_ID ))
		wp_die( __('You are not allowed to edit comments on this post, so you cannot edit this comment.' ));

	$_POST['comment_author'] = $_POST['newcomment_author'];
	$_POST['comment_author_email'] = $_POST['newcomment_author_email'];
	$_POST['comment_author_url'] = $_POST['newcomment_author_url'];
	$_POST['comment_approved'] = $_POST['comment_status'];
	$_POST['comment_content'] = $_POST['content'];
	$_POST['comment_ID'] = (int) $_POST['comment_ID'];

	foreach ( array ('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) {
		if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) {
			$_POST['edit_date'] = '1';
			break;
		}
	}


	if (!empty ( $_POST['edit_date'] ) ) {
		$aa = $_POST['aa'];
		$mm = $_POST['mm'];
		$jj = $_POST['jj'];
		$hh = $_POST['hh'];
		$mn = $_POST['mn'];
		$ss = $_POST['ss'];
		$jj = ($jj > 31 ) ? 31 : $jj;
		$hh = ($hh > 23 ) ? $hh -24 : $hh;
		$mn = ($mn > 59 ) ? $mn -60 : $mn;
		$ss = ($ss > 59 ) ? $ss -60 : $ss;
		$_POST['comment_date'] = "$aa-$mm-$jj $hh:$mn:$ss";
	}

	wp_update_comment( $_POST);
}

function get_comment_to_edit( $id ) {
	if ( !$comment = get_comment($id) )
		return false;

	$comment->comment_ID = (int) $comment->comment_ID;
	$comment->comment_post_ID = (int) $comment->comment_post_ID;

	$comment->comment_content = format_to_edit( $comment->comment_content );
	$comment->comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content);

	$comment->comment_author = format_to_edit( $comment->comment_author );
	$comment->comment_author_email = format_to_edit( $comment->comment_author_email );
	$comment->comment_author_url = clean_url($comment->comment_author_url);
	$comment->comment_author_url = format_to_edit( $comment->comment_author_url );

	return $comment;
}

function get_pending_comments_num( $post_id ) {
	global $wpdb;

	$single = false;
	if ( !is_array($post_id) ) {
		$post_id = (array) $post_id;
		$single = true;
	}
	$post_id = array_map('intval', $post_id);
	$post_id = "'" . implode("', '", $post_id) . "'";

	$pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id ) AND comment_approved = '0' GROUP BY comment_post_ID", ARRAY_N );

	if ( empty($pending) )
		return 0;

	if ( $single )
		return $pending[0][1];

	$pending_keyed = array();
	foreach ( $pending as $pend )
		$pending_keyed[$pend[0]] = $pend[1];

	return $pending_keyed;
}

// Add avatars to relevant places in admin, or try to

function floated_admin_avatar( $name ) {
	global $comment;

	$id = $avatar = false;
	if ( $comment->comment_author_email )
		$id = $comment->comment_author_email;
	if ( $comment->user_id )
		$id = $comment->user_id;

	if ( $id )
		$avatar = get_avatar( $id, 32 );

	return "$avatar $name";
}

if ( is_admin() && ('edit-comments.php' == $pagenow || 'edit.php' == $pagenow) ) {
	if ( get_option('show_avatars') )
		add_filter( 'comment_author', 'floated_admin_avatar' );
}

?>
                                                                                                                                                                                                        blog/wp-admin/includes/dashboard.php                                                                0000755 0023433 0004734 00000053447 11060470732 017353  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

// Registers dashboard widgets, handles POST data, sets up filters
function wp_dashboard_setup() {
	global $wpdb, $wp_dashboard_sidebars;
	$update = false;
	$widget_options = get_option( 'dashboard_widget_options' );
	if ( !$widget_options || !is_array($widget_options) )
		$widget_options = array();


	/* Register WP Dashboard Dynamic Sidebar */
	register_sidebar( array(
		'name' => 'WordPress Dashboard',
		'id' => 'wp_dashboard',
		'before_widget' => "\t<div class='dashboard-widget-holder %2\$s' id='%1\$s'>\n\n\t\t<div class='dashboard-widget'>\n\n",
		'after_widget' => "\t\t</div>\n\n\t</div>\n\n",
		'before_title' => "\t\t\t<h3 class='dashboard-widget-title'>",
		'after_title' => "</h3>\n\n"
	) );


	/* Register Widgets and Controls */

	// Recent Comments Widget
	$mod_comments = wp_count_comments();
	$mod_comments = $mod_comments->moderated;
	if ( current_user_can( 'moderate_comments' ) && $mod_comments ) {
		$notice = sprintf( __ngettext( '%d comment awaiting moderation', '%d comments awaiting moderation', $mod_comments ), $mod_comments );
		$notice = "<a href='edit-comments.php?comment_status=moderated'>$notice</a>";
	} else {
		$notice = '';
	}
	wp_register_sidebar_widget( 'dashboard_recent_comments', __( 'Recent Comments' ), 'wp_dashboard_recent_comments',
		array( 'all_link' => 'edit-comments.php', 'notice' => $notice, 'width' => 'half' )
	);

	// Incoming Links Widget
	if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
		$update = true;
		$widget_options['dashboard_incoming_links'] = array(
			'home' => get_option('home'),
			'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
			'url' => apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
			'items' => 5,
			'show_date' => 0
		);
	}
	wp_register_sidebar_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_empty',
		array( 'all_link' => $widget_options['dashboard_incoming_links']['link'], 'feed_link' => $widget_options['dashboard_incoming_links']['url'], 'width' => 'half' ),
		'wp_dashboard_cached_rss_widget', 'wp_dashboard_incoming_links_output'
	);
	wp_register_widget_control( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_rss_control', array(),
		array( 'widget_id' => 'dashboard_incoming_links', 'form_inputs' => array( 'title' => false, 'show_summary' => false, 'show_author' => false ) )
	);


	// WP Plugins Widget
	wp_register_sidebar_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_empty',
		array( 'all_link' => 'http://wordpress.org/extend/plugins/', 'feed_link' => 'http://wordpress.org/extend/plugins/rss/topics/', 'width' => 'half' ),
		'wp_dashboard_cached_rss_widget', 'wp_dashboard_plugins_output',
		array( 'http://wordpress.org/extend/plugins/rss/browse/popular/', 'http://wordpress.org/extend/plugins/rss/browse/new/', 'http://wordpress.org/extend/plugins/rss/browse/updated/' )
	);

	// Primary feed (Dev Blog) Widget
	if ( !isset( $widget_options['dashboard_primary'] ) ) {
		$update = true;
		$widget_options['dashboard_primary'] = array(
			'link' => apply_filters( 'dashboard_primary_link',  __( 'http://wordpress.org/development/' ) ),
			'url' => apply_filters( 'dashboard_primary_feed',  __( 'http://wordpress.org/development/feed/' ) ),
			'title' => apply_filters( 'dashboard_primary_title', __( 'WordPress Development Blog' ) ),
			'items' => 2,
			'show_summary' => 1,
			'show_author' => 0,
			'show_date' => 1
		);
	}
	wp_register_sidebar_widget( 'dashboard_primary', $widget_options['dashboard_primary']['title'], 'wp_dashboard_empty',
		array( 'all_link' => $widget_options['dashboard_primary']['link'], 'feed_link' => $widget_options['dashboard_primary']['url'], 'width' => 'half', 'class' => 'widget_rss' ),
		'wp_dashboard_cached_rss_widget', 'wp_dashboard_rss_output'
	);
	wp_register_widget_control( 'dashboard_primary', __( 'Primary Feed' ), 'wp_dashboard_rss_control', array(),
		array( 'widget_id' => 'dashboard_primary' )
	);


	// Secondary Feed (Planet) Widget
	if ( !isset( $widget_options['dashboard_secondary'] ) ) {
		$update = true;
		$widget_options['dashboard_secondary'] = array(
			'link' => apply_filters( 'dashboard_secondary_link',  __( 'http://planet.wordpress.org/' ) ),
			'url' => apply_filters( 'dashboard_secondary_feed',  __( 'http://planet.wordpress.org/feed/' ) ),
			'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),
			'items' => 15
		);
	}
	wp_register_sidebar_widget( 'dashboard_secondary', $widget_options['dashboard_secondary']['title'], 'wp_dashboard_empty',
		array( 'all_link' => $widget_options['dashboard_secondary']['link'], 'feed_link' => $widget_options['dashboard_secondary']['url'], 'width' => 'full' ),
		'wp_dashboard_cached_rss_widget', 'wp_dashboard_secondary_output'
	);
	wp_register_widget_control( 'dashboard_secondary', __( 'Secondary Feed' ), 'wp_dashboard_rss_control', array(),
		array( 'widget_id' => 'dashboard_secondary', 'form_inputs' => array( 'show_summary' => false, 'show_author' => false, 'show_date' => false ) )
	);


		/* Dashboard Widget Template
		wp_register_sidebar_widget( $widget_id (unique slug) , $widget_title, $output_callback,
			array(
				'all_link'  => full url for "See All" link,
				'feed_link' => full url for "RSS" link,
				'width'     => 'fourth', 'third', 'half', 'full' (defaults to 'half'),
				'height'    => 'single', 'double' (defaults to 'single'),
			),
			$wp_dashboard_empty_callback (only needed if using 'wp_dashboard_empty' as your $output_callback),
			$arg, $arg, $arg... (further args passed to callbacks)
		);

		// optional: if you want users to be able to edit the settings of your widget, you need to register a widget_control
		wp_register_widget_control( $widget_id, $widget_control_title, $control_output_callback,
			array(), // leave an empty array here: oddity in widget code
			array(
				'widget_id' => $widget_id, // Yes - again.  This is required: oddity in widget code
				'arg'       => an arg to pass to the $control_output_callback,
				'another'   => another arg to pass to the $control_output_callback,
				...
			)
		);
		*/

	// Hook to register new widgets
	do_action( 'wp_dashboard_setup' );

	// Hard code the sidebar's widgets and order
	$dashboard_widgets = array();
	$dashboard_widgets[] = 'dashboard_recent_comments';
	$dashboard_widgets[] = 'dashboard_incoming_links';
	$dashboard_widgets[] = 'dashboard_primary';
	if ( current_user_can( 'activate_plugins' ) )
		$dashboard_widgets[] = 'dashboard_plugins';
	$dashboard_widgets[] = 'dashboard_secondary';

	// Filter widget order
	$dashboard_widgets = apply_filters( 'wp_dashboard_widgets', $dashboard_widgets );

	$wp_dashboard_sidebars = array( 'wp_dashboard' => $dashboard_widgets, 'array_version' => 3.5 );

	add_filter( 'dynamic_sidebar_params', 'wp_dashboard_dynamic_sidebar_params' );

	if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget_id']) ) {
		ob_start(); // hack - but the same hack wp-admin/widgets.php uses
		wp_dashboard_trigger_widget_control( $_POST['widget_id'] );
		ob_end_clean();
		wp_redirect( remove_query_arg( 'edit' ) );
		exit;
	}

	if ( $update )
		update_option( 'dashboard_widget_options', $widget_options );
}

// Echoes out the dashboard
function wp_dashboard() {
	echo "<div id='dashboard-widgets'>\n\n";

	// We're already filtering dynamic_sidebar_params obove
	add_filter( 'option_sidebars_widgets', 'wp_dashboard_sidebars_widgets' ); // here there be hackery
	dynamic_sidebar( 'wp_dashboard' );
	remove_filter( 'option_sidebars_widgets', 'wp_dashboard_sidebars_widgets' );

	echo "<br class='clear' />\n</div>\n\n\n";
}

// Makes sidebar_widgets option reflect the dashboard settings
function wp_dashboard_sidebars_widgets() { // hackery
	return $GLOBALS['wp_dashboard_sidebars'];
}

// Modifies sidbar params on the fly to set up ids, class names, titles for each widget (called once per widget)
// Switches widget to edit mode if $_GET['edit']
function wp_dashboard_dynamic_sidebar_params( $params ) {
	global $wp_registered_widgets, $wp_registered_widget_controls;

	$sidebar_defaults = array('widget_id' => 0, 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '');
	extract( $sidebar_defaults, EXTR_PREFIX_ALL, 'sidebar' );
	extract( $params[0], EXTR_PREFIX_ALL, 'sidebar' );

	if ( !isset($wp_registered_widgets[$sidebar_widget_id]) || !is_array($wp_registered_widgets[$sidebar_widget_id]) ) {
		return $params;
	}
	$widget_defaults = array('id' => '', 'width' => '', 'height' => '', 'class' => '', 'feed_link' => '', 'all_link' => '', 'notice' => false, 'error' => false);
	extract( $widget_defaults, EXTR_PREFIX_ALL, 'widget' );
	extract( $wp_registered_widgets[$sidebar_widget_id], EXTR_PREFIX_ALL, 'widget' );

	$the_classes = array();
	if ( in_array($widget_width, array( 'third', 'fourth', 'full' ) ) )
		$the_classes[] = $widget_width;

	if ( 'double' == $widget_height )
		$the_classes[] = 'double';

	if ( $widget_class )
		$the_classes[] = $widget_class;

	// Add classes to the widget holder
	if ( $the_classes )
		$sidebar_before_widget = str_replace( "<div class='dashboard-widget-holder ", "<div class='dashboard-widget-holder " . join( ' ', $the_classes ) . ' ', $sidebar_before_widget );

	$links = array();
	if ( $widget_all_link )
		$links[] = '<a href="' . clean_url( $widget_all_link ) . '">' . __( 'See&nbsp;All' ) . '</a>';

	$content_class = 'dashboard-widget-content';
	if ( current_user_can( 'edit_dashboard' ) && isset($wp_registered_widget_controls[$widget_id]) && is_callable($wp_registered_widget_controls[$widget_id]['callback']) ) {
		// Switch this widget to edit mode
		if ( isset($_GET['edit']) && $_GET['edit'] == $widget_id ) {
			$content_class .= ' dashboard-widget-control';
			$wp_registered_widgets[$widget_id]['callback'] = 'wp_dashboard_empty';
			$sidebar_widget_name = $wp_registered_widget_controls[$widget_id]['name'];
			$params[1] = 'wp_dashboard_trigger_widget_control';
			$sidebar_before_widget .= '<form action="' . clean_url(remove_query_arg( 'edit' ))  . '" method="post">';
			$sidebar_after_widget   = "<div class='dashboard-widget-submit'><input type='hidden' name='sidebar' value='wp_dashboard' /><input type='hidden' name='widget_id' value='$widget_id' /><input type='submit' value='" . __( 'Save' ) . "' /></div></form>$sidebar_after_widget";
			$links[] = '<a href="' . clean_url(remove_query_arg( 'edit' )) . '">' . __( 'Cancel' ) . '</a>';
		} else {
			$links[] = '<a href="' . clean_url(add_query_arg( 'edit', $widget_id )) . "#$widget_id" . '">' . __( 'Edit' ) . '</a>';
		}
	}

	if ( $widget_feed_link )
		$links[] = '<img class="rss-icon" src="' . includes_url('images/rss.png') . '" alt="' . __( 'rss icon' ) . '" /> <a href="' . clean_url( $widget_feed_link ) . '">' . __( 'RSS' ) . '</a>';

	$links = apply_filters( "wp_dashboard_widget_links_$widget_id", $links );

	// Add links to widget's title bar
	if ( $links ) {
		$sidebar_before_title .= '<span>';
		$sidebar_after_title   = '</span><small>' . join( '&nbsp;|&nbsp;', $links ) . "</small><br class='clear' />$sidebar_after_title";
	}

	// Could have put this in widget-content.  Doesn't really matter
	if ( $widget_notice )
		$sidebar_after_title .= "\t\t\t<div class='dashboard-widget-notice'>$widget_notice</div>\n\n";

	if ( $widget_error )
		$sidebar_after_title .= "\t\t\t<div class='dashboard-widget-error'>$widget_error</div>\n\n";

	$sidebar_after_title .= "\t\t\t<div class='$content_class'>\n\n";

	$sidebar_after_widget .= "\t\t\t</div>\n\n";

	foreach( array_keys( $params[0] ) as $key )
		$$key = ${'sidebar_' . $key};

	$params[0] = compact( array_keys( $params[0] ) );

	return $params;
}


/* Dashboard Widgets */

function wp_dashboard_recent_comments( $sidebar_args ) {
	global $comment;
	extract( $sidebar_args, EXTR_SKIP );

	echo $before_widget;

	echo $before_title;
	echo $widget_name;
	echo $after_title;

	$lambda = create_function( '', 'return 5;' );
	add_filter( 'option_posts_per_rss', $lambda ); // hack - comments query doesn't accept per_page parameter
	$comments_query = new WP_Query(array('feed' => 'rss2', 'withcomments' => 1));
	remove_filter( 'option_posts_per_rss', $lambda );

	$is_first = true;

	if ( $comments_query->have_comments() ) {
		while ( $comments_query->have_comments() ) { $comments_query->the_comment();

			$comment_post_url = get_permalink( $comment->comment_post_ID );
			$comment_post_title = get_the_title( $comment->comment_post_ID );
			$comment_post_link = "<a href='$comment_post_url'>$comment_post_title</a>";
			$comment_link = '<a class="comment-link" href="' . get_comment_link() . '">#</a>';
			$comment_meta = sprintf( __( 'From <strong>%1$s</strong> on %2$s %3$s' ), get_comment_author(), $comment_post_link, $comment_link );

			if ( $is_first ) : $is_first = false;
?>
				<blockquote><p>&#8220;<?php comment_excerpt(); ?>&#8221;</p></blockquote>
				<p class='comment-meta'><?php echo $comment_meta; ?></p>
<?php
				if ( $comments_query->comment_count > 1 ) : ?>
				<ul id="dashboard-comments-list">
<?php
				endif; // comment_count
			else : // is_first
?>

					<li class='comment-meta'><?php echo $comment_meta; ?></li>
<?php
			endif; // is_first
		}

		if ( $comments_query->comment_count > 1 ) : ?>
				</ul>
<?php
		endif; // comment_count;

	}

	echo $after_widget;
}

// $sidebar_args are handled by wp_dashboard_empty()
function wp_dashboard_incoming_links_output() {
	$widgets = get_option( 'dashboard_widget_options' );
	@extract( @$widgets['dashboard_incoming_links'], EXTR_SKIP );
	$rss = @fetch_rss( $url );
	if ( isset($rss->items) && 0 < count($rss->items) )  {

		echo "<ul>\n";

		$rss->items = array_slice($rss->items, 0, $items);
		foreach ( $rss->items as $item ) {
			$publisher = '';
			$site_link = '';
			$link = '';
			$content = '';
			$date = '';
			$link = clean_url( strip_tags( $item['link'] ) );

			if ( isset( $item['author_uri'] ) )
				$site_link = clean_url( strip_tags( $item['author_uri'] ) );

			if ( !$publisher = wp_specialchars( strip_tags( isset($item['dc']['publisher']) ? $item['dc']['publisher'] : $item['author_name'] ) ) )
				$publisher = __( 'Somebody' );
			if ( $site_link )
				$publisher = "<a href='$site_link'>$publisher</a>";
			else
				$publisher = "<strong>$publisher</strong>";

			if ( isset($item['description']) )
				$content = $item['description'];
			elseif ( isset($item['summary']) )
				$content = $item['summary'];
			elseif ( isset($item['atom_content']) )
				$content = $item['atom_content'];
			else
				$content = __( 'something' );
			$content = wp_html_excerpt($content, 50) . ' ...';
			if ( $link )
				$text = _c( '%1$s linked here <a href="%2$s">saying</a>, "%3$s"|feed_display' );
			else
				$text = _c( '%1$s linked here saying, "%3$s"|feed_display' );

			if ( $show_date ) {
				if ( $show_author || $show_summary )
					$text .= _c( ' on %4$s|feed_display' );
				$date = wp_specialchars( strip_tags( isset($item['pubdate']) ? $item['pubdate'] : $item['published'] ) );
				$date = strtotime( $date );
				$date = gmdate( get_option( 'date_format' ), $date );
			}

			echo "\t<li>" . sprintf( _c( "$text|feed_display" ), $publisher, $link, $content, $date ) . "</li>\n";
		}

		echo "</ul>\n";

	} else {
		echo '<p>' . __('This dashboard widget queries <a href="http://blogsearch.google.com/">Google Blog Search</a> so that when another blog links to your site it will show up here. It has found no incoming links&hellip; yet. It&#8217;s okay &#8212; there is no rush.') . "</p>\n";
	}
}

// $sidebar_args are handled by wp_dashboard_empty()
function wp_dashboard_rss_output( $widget_id ) {
	$widgets = get_option( 'dashboard_widget_options' );
	wp_widget_rss_output( $widgets[$widget_id] );
}

// $sidebar_args are handled by wp_dashboard_empty()
function wp_dashboard_secondary_output() {
	$widgets = get_option( 'dashboard_widget_options' );
	@extract( @$widgets['dashboard_secondary'], EXTR_SKIP );
	$rss = @fetch_rss( $url );
	if ( !isset($rss->items) || 0 == count($rss->items) )
		return false;

	echo "<ul id='planetnews'>\n";

	$rss->items = array_slice($rss->items, 0, $items);
	foreach ($rss->items as $item ) {
		$title = wp_specialchars($item['title']);
		list($author,$post) = explode( ':', $title, 2 );
		$link = clean_url($item['link']);

		echo "\t<li><a href='$link'><span class='post'>$post</span><span class='hidden'> - </span><cite>$author</cite></a></li>\n";
	}

	echo "</ul>\n<br class='clear' />\n";
}

// $sidebar_args are handled by wp_dashboard_empty()
function wp_dashboard_plugins_output() {
	$popular = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/popular/' );
	$new     = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/new/' );
	$updated = @fetch_rss( 'http://wordpress.org/extend/plugins/rss/browse/updated/' );

	foreach ( array( 'popular' => __('Most Popular'), 'new' => __('Newest Plugins'), 'updated' => __('Recently Updated') ) as $feed => $label ) {
		if ( !isset($$feed->items) || 0 == count($$feed->items) )
			continue;

		$$feed->items = array_slice($$feed->items, 0, 5);
		$item_key = array_rand($$feed->items);

		// Eliminate some common badly formed plugin descriptions
		while ( ( null !== $item_key = array_rand($$feed->items) ) && false !== strpos( $$feed->items[$item_key]['description'], 'Plugin Name:' ) )
			unset($$feed->items[$item_key]);

		if ( !isset($$feed->items[$item_key]) )
			continue;

		$item = $$feed->items[$item_key];

		// current bbPress feed item titles are: user on "topic title"
		if ( preg_match( '/"(.*)"/s', $item['title'], $matches ) )
			$title = $matches[1];
		else // but let's make it forward compatible if things change
			$title = $item['title'];
		$title = wp_specialchars( $title );

		$description = wp_specialchars( strip_tags(html_entity_decode($item['description'], ENT_QUOTES)) );

		list($link, $frag) = explode( '#', $item['link'] );

		$link = clean_url($link);
		$dlink = rtrim($link, '/') . '/download/';

		echo "<h4>$label</h4>\n";
		echo "<h5><a href='$link'>$title</a></h5>&nbsp;<span>(<a href='$dlink'>" . __( 'Download' ) . "</a>)</span>\n";
		echo "<p>$description</p>\n";
	}
}

// Checks to see if all of the feed url in $check_urls are cached.
// If $check_urls is empty, look for the rss feed url found in the dashboard widget optios of $widget_id.
// If cached, call $callback, a function that echoes out output for this widget.
// If not cache, echo a "Loading..." stub which is later replaced by AJAX call (see top of /wp-admin/index.php)
function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array() ) {
	$loading = '<p class="widget-loading">' . __( 'Loading&#8230;' ) . '</p>';

	if ( empty($check_urls) ) {
		$widgets = get_option( 'dashboard_widget_options' );
		if ( empty($widgets[$widget_id]['url']) ) {
			echo $loading;
			return false;
		}
		$check_urls = array( $widgets[$widget_id]['url'] );
	}


	require_once( ABSPATH . WPINC . '/rss.php' );
	init(); // initialize rss constants

	$cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE );

	foreach ( $check_urls as $check_url ) {
		$status = $cache->check_cache( $check_url );
		if ( 'HIT' !== $status ) {
			echo $loading;
			return false;
		}
	}

	if ( $callback && is_callable( $callback ) ) {
		$args = array_slice( func_get_args(), 2 );
		array_unshift( $args, $widget_id );
		call_user_func_array( $callback, $args );
	}

	return true;
}

// Empty widget used for JS/AJAX created output.
// Callback inserts content between before_widget and after_widget.  Used when widget is in edit mode.  Can also be used for custom widgets.
function wp_dashboard_empty( $sidebar_args, $callback = false ) {
	extract( $sidebar_args, EXTR_SKIP );

	echo $before_widget;

	echo $before_title;
	echo $widget_name;
	echo $after_title;

	// When in edit mode, the callback passed to this function is the widget_control callback
	if ( $callback && is_callable( $callback ) ) {
		$args = array_slice( func_get_args(), 2 );
		array_unshift( $args, $widget_id );
		call_user_func_array( $callback, $args );
	}

	echo $after_widget;
}

/* Dashboard Widgets Controls. Ssee also wp_dashboard_empty() */

// Calls widget_control callback
function wp_dashboard_trigger_widget_control( $widget_control_id = false ) {
	global $wp_registered_widget_controls;
	if ( is_scalar($widget_control_id) && $widget_control_id && isset($wp_registered_widget_controls[$widget_control_id]) && is_callable($wp_registered_widget_controls[$widget_control_id]['callback']) )
		call_user_func_array( $wp_registered_widget_controls[$widget_control_id]['callback'], $wp_registered_widget_controls[$widget_control_id]['params'] );
}

// Sets up $args to be used as input to wp_widget_rss_form(), handles POST data from RSS-type widgets
function wp_dashboard_rss_control( $args ) {
	extract( $args );
	if ( !$widget_id )
		return false;

	if ( !$widget_options = get_option( 'dashboard_widget_options' ) )
		$widget_options = array();

	if ( !isset($widget_options[$widget_id]) )
		$widget_options[$widget_id] = array();

	$number = 1; // Hack to use wp_widget_rss_form()
	$widget_options[$widget_id]['number'] = $number;

	if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-rss'][$number]) ) {
		$_POST['widget-rss'][$number] = stripslashes_deep( $_POST['widget-rss'][$number] );
		$widget_options[$widget_id] = wp_widget_rss_process( $_POST['widget-rss'][$number] );
		// title is optional.  If black, fill it if possible
		if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) {
			require_once(ABSPATH . WPINC . '/rss.php');
			$rss = fetch_rss($widget_options[$widget_id]['url']);
			$widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->channel['title']));
		}
		update_option( 'dashboard_widget_options', $widget_options );
	}

	wp_widget_rss_form( $widget_options[$widget_id], $form_inputs );
}

?>
                                                                                                                                                                                                                         blog/wp-admin/includes/export.php                                                                   0000755 0023433 0004734 00000023514 11060470733 016736  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

// version number for the export format.  bump this when something changes that might affect compatibility.
define('WXR_VERSION', '1.0');

function export_wp($author='') {
global $wpdb, $post_ids, $post;

do_action('export_wp');

$filename = 'wordpress.' . date('Y-m-d') . '.xml';

header('Content-Description: File Transfer');
header("Content-Disposition: attachment; filename=$filename");
header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);

$where = '';
if ( $author and $author != 'all' ) {
	$author_id = (int) $author;
	$where = $wpdb->prepare(" WHERE post_author = %d ", $author_id);
}

// grab a snapshot of post IDs, just in case it changes during the export
$post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");

$categories = (array) get_categories('get=all');
$tags = (array) get_tags('get=all');

function wxr_missing_parents($categories) {
	if ( !is_array($categories) || empty($categories) )
		return array();

	foreach ( $categories as $category )
		$parents[$category->term_id] = $category->parent;

	$parents = array_unique(array_diff($parents, array_keys($parents)));

	if ( $zero = array_search('0', $parents) )
		unset($parents[$zero]);

	return $parents;
}

while ( $parents = wxr_missing_parents($categories) ) {
	$found_parents = get_categories("include=" . join(', ', $parents));
	if ( is_array($found_parents) && count($found_parents) )
		$categories = array_merge($categories, $found_parents);
	else
		break;
}

// Put them in order to be inserted with no child going before its parent
$pass = 0;
$passes = 1000 + count($categories);
while ( ( $cat = array_shift($categories) ) && ++$pass < $passes ) {
	if ( $cat->parent == 0 || isset($cats[$cat->parent]) ) {
		$cats[$cat->term_id] = $cat;
	} else {
		$categories[] = $cat;
	}
}
unset($categories);

function wxr_cdata($str) {
	if ( seems_utf8($str) == false )
		$str = utf8_encode($str);

	// $str = ent2ncr(wp_specialchars($str));

	$str = "<![CDATA[$str" . ( ( substr($str, -1) == ']' ) ? ' ' : '') . "]]>";

	return $str;
}

function wxr_site_url() {
	global $current_site;

	// mu: the base url
	if ( isset($current_site->domain) ) {
		return 'http://'.$current_site->domain.$current_site->path;
	}
	// wp: the blog url
	else {
		return get_bloginfo_rss('url');
	}
}

function wxr_cat_name($c) {
	if ( empty($c->name) )
		return;

	echo '<wp:cat_name>' . wxr_cdata($c->name) . '</wp:cat_name>';
}

function wxr_category_description($c) {
	if ( empty($c->description) )
		return;

	echo '<wp:category_description>' . wxr_cdata($c->description) . '</wp:category_description>';
}

function wxr_tag_name($t) {
	if ( empty($t->name) )
		return;

	echo '<wp:tag_name>' . wxr_cdata($t->name) . '</wp:tag_name>';
}

function wxr_tag_description($t) {
	if ( empty($t->description) )
		return;

	echo '<wp:tag_description>' . wxr_cdata($t->description) . '</wp:tag_description>';
}

function wxr_post_taxonomy() {
	$categories = get_the_category();
	$tags = get_the_tags();
	$the_list = '';
	$filter = 'rss';

	if ( !empty($categories) ) foreach ( (array) $categories as $category ) {
		$cat_name = sanitize_term_field('name', $category->name, $category->term_id, 'category', $filter);
		// for backwards compatibility
		$the_list .= "\n\t\t<category><![CDATA[$cat_name]]></category>\n";
		// forwards compatibility: use a unique identifier for each cat to avoid clashes
		// http://trac.wordpress.org/ticket/5447
		$the_list .= "\n\t\t<category domain=\"category\" nicename=\"{$category->slug}\"><![CDATA[$cat_name]]></category>\n";
	}

	if ( !empty($tags) ) foreach ( (array) $tags as $tag ) {
		$tag_name = sanitize_term_field('name', $tag->name, $tag->term_id, 'post_tag', $filter);
		$the_list .= "\n\t\t<category domain=\"tag\"><![CDATA[$tag_name]]></category>\n";
		// forwards compatibility as above
		$the_list .= "\n\t\t<category domain=\"tag\" nicename=\"{$tag->slug}\"><![CDATA[$tag_name]]></category>\n";
	}

	echo $the_list;
}

echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";

?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. -->
<!-- It contains information about your blog's posts, comments, and categories. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your blog. -->

<!-- To import this information into a WordPress blog follow these steps. -->
<!-- 1. Log into that blog as an administrator. -->
<!-- 2. Go to Manage: Import in the blog's admin panels. -->
<!-- 3. Choose "WordPress" from the list. -->
<!-- 4. Upload this file using the form provided on that page. -->
<!-- 5. You will first be asked to map the authors in this export file to users -->
<!--    on the blog.  For each author, you may choose to map to an -->
<!--    existing user on the blog or to create a new user -->
<!-- 6. WordPress will then import each of the posts, comments, and categories -->
<!--    contained in this file into your blog -->

<?php the_generator('export');?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:wp="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/"
>

<channel>
	<title><?php bloginfo_rss('name'); ?></title>
	<link><?php bloginfo_rss('url') ?></link>
	<description><?php bloginfo_rss("description") ?></description>
	<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>
	<generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
	<language><?php echo get_option('rss_language'); ?></language>
	<wp:wxr_version><?php echo WXR_VERSION; ?></wp:wxr_version>
	<wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url>
	<wp:base_blog_url><?php bloginfo_rss('url'); ?></wp:base_blog_url>
<?php if ( $cats ) : foreach ( $cats as $c ) : ?>
	<wp:category><wp:category_nicename><?php echo $c->slug; ?></wp:category_nicename><wp:category_parent><?php echo $c->parent ? $cats[$c->parent]->name : ''; ?></wp:category_parent><?php wxr_cat_name($c); ?><?php wxr_category_description($c); ?></wp:category>
<?php endforeach; endif; ?>
<?php if ( $tags ) : foreach ( $tags as $t ) : ?>
	<wp:tag><wp:tag_slug><?php echo $t->slug; ?></wp:tag_slug><?php wxr_tag_name($t); ?><?php wxr_tag_description($t); ?></wp:tag>
<?php endforeach; endif; ?>
	<?php do_action('rss2_head'); ?>
	<?php if ($post_ids) {
		global $wp_query;
		$wp_query->in_the_loop = true;  // Fake being in the loop.
		// fetch 20 posts at a time rather than loading the entire table into memory
		while ( $next_posts = array_splice($post_ids, 0, 20) ) {
			$where = "WHERE ID IN (".join(',', $next_posts).")";
			$posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
				foreach ($posts as $post) {
			setup_postdata($post); ?>
<item>
<title><?php echo apply_filters('the_title_rss', $post->post_title); ?></title>
<link><?php the_permalink_rss() ?></link>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
<dc:creator><?php echo wxr_cdata(get_the_author()); ?></dc:creator>
<?php wxr_post_taxonomy() ?>

<guid isPermaLink="false"><?php the_guid(); ?></guid>
<description></description>
<content:encoded><?php echo wxr_cdata( apply_filters('the_content_export', $post->post_content) ); ?></content:encoded>
<excerpt:encoded><?php echo wxr_cdata( apply_filters('the_excerpt_export', $post->post_excerpt) ); ?></excerpt:encoded>
<wp:post_id><?php echo $post->ID; ?></wp:post_id>
<wp:post_date><?php echo $post->post_date; ?></wp:post_date>
<wp:post_date_gmt><?php echo $post->post_date_gmt; ?></wp:post_date_gmt>
<wp:comment_status><?php echo $post->comment_status; ?></wp:comment_status>
<wp:ping_status><?php echo $post->ping_status; ?></wp:ping_status>
<wp:post_name><?php echo $post->post_name; ?></wp:post_name>
<wp:status><?php echo $post->post_status; ?></wp:status>
<wp:post_parent><?php echo $post->post_parent; ?></wp:post_parent>
<wp:menu_order><?php echo $post->menu_order; ?></wp:menu_order>
<wp:post_type><?php echo $post->post_type; ?></wp:post_type>
<wp:post_password><?php echo $post->post_password; ?></wp:post_password>
<?php
if ($post->post_type == 'attachment') { ?>
<wp:attachment_url><?php echo wp_get_attachment_url($post->ID); ?></wp:attachment_url>
<?php } ?>
<?php
$postmeta = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID) );
if ( $postmeta ) {
?>
<?php foreach( $postmeta as $meta ) { ?>
<wp:postmeta>
<wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
<wp:meta_value><?Php echo $meta->meta_value; ?></wp:meta_value>
</wp:postmeta>
<?php } ?>
<?php } ?>
<?php
$comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d", $post->ID) );
if ( $comments ) { foreach ( $comments as $c ) { ?>
<wp:comment>
<wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
<wp:comment_author><?php echo wxr_cdata($c->comment_author); ?></wp:comment_author>
<wp:comment_author_email><?php echo $c->comment_author_email; ?></wp:comment_author_email>
<wp:comment_author_url><?php echo $c->comment_author_url; ?></wp:comment_author_url>
<wp:comment_author_IP><?php echo $c->comment_author_IP; ?></wp:comment_author_IP>
<wp:comment_date><?php echo $c->comment_date; ?></wp:comment_date>
<wp:comment_date_gmt><?php echo $c->comment_date_gmt; ?></wp:comment_date_gmt>
<wp:comment_content><?php echo wxr_cdata($c->comment_content) ?></wp:comment_content>
<wp:comment_approved><?php echo $c->comment_approved; ?></wp:comment_approved>
<wp:comment_type><?php echo $c->comment_type; ?></wp:comment_type>
<wp:comment_parent><?php echo $c->comment_parent; ?></wp:comment_parent>
<wp:comment_user_id><?php echo $c->user_id; ?></wp:comment_user_id>
</wp:comment>
<?php } } ?>
	</item>
<?php } } } ?>
</channel>
</rss>
<?php
}

?>
                                                                                                                                                                                    blog/wp-admin/includes/file.php                                                                     0000755 0023433 0004734 00000040376 11060470734 016342  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

$wp_file_descriptions = array ('index.php' => __( 'Main Index Template' ), 'style.css' => __( 'Stylesheet' ), 'rtl.css' => __( 'RTL Stylesheet' ), 'comments.php' => __( 'Comments' ), 'comments-popup.php' => __( 'Popup Comments' ), 'footer.php' => __( 'Footer' ), 'header.php' => __( 'Header' ), 'sidebar.php' => __( 'Sidebar' ), 'archive.php' => __( 'Archives' ), 'category.php' => __( 'Category Template' ), 'page.php' => __( 'Page Template' ), 'search.php' => __( 'Search Results' ), 'searchform.php' => __( 'Search Form' ), 'single.php' => __( 'Single Post' ), '404.php' => __( '404 Template' ), 'link.php' => __( 'Links Template' ), 'functions.php' => __( 'Theme Functions' ), 'attachment.php' => __( 'Attachment Template' ), 'my-hacks.php' => __( 'my-hacks.php (legacy hacks support)' ), '.htaccess' => __( '.htaccess (for rewrite rules )' ),
	// Deprecated files
	'wp-layout.css' => __( 'Stylesheet' ), 'wp-comments.php' => __( 'Comments Template' ), 'wp-comments-popup.php' => __( 'Popup Comments Template' ));
function get_file_description( $file ) {
	global $wp_file_descriptions;

	if ( isset( $wp_file_descriptions[basename( $file )] ) ) {
		return $wp_file_descriptions[basename( $file )];
	}
	elseif ( file_exists( ABSPATH . $file ) && is_file( ABSPATH . $file ) ) {
		$template_data = implode( '', file( ABSPATH . $file ) );
		if ( preg_match( "|Template Name:(.*)|i", $template_data, $name ))
			return $name[1];
	}

	return basename( $file );
}

function get_home_path() {
	$home = get_option( 'home' );
	if ( $home != '' && $home != get_option( 'siteurl' ) ) {
		$home_path = parse_url( $home );
		$home_path = $home_path['path'];
		$root = str_replace( $_SERVER["PHP_SELF"], '', $_SERVER["SCRIPT_FILENAME"] );
		$home_path = trailingslashit( $root.$home_path );
	} else {
		$home_path = ABSPATH;
	}

	return $home_path;
}

function get_real_file_to_edit( $file ) {
	if ('index.php' == $file || '.htaccess' == $file ) {
		$real_file = get_home_path() . $file;
	} else {
		$real_file = WP_CONTENT_DIR . $file;
	}

	return $real_file;
}
//$folder = Full path to folder
//$levels = Levels of folders to follow, Default: 100 (PHP Loop limit)
function list_files( $folder = '', $levels = 100 ) {
	if( empty($folder) )
		return false;

	if( ! $levels )
		return false;

	$files = array();
	if ( $dir = @opendir( $folder ) ) {
		while (($file = readdir( $dir ) ) !== false ) {
			if ( in_array($file, array('.', '..') ) )
				continue;
			if ( is_dir( $folder . '/' . $file ) ) {
				$files2 = list_files( $folder . '/' . $file, $levels - 1);
				if( $files2 )
					$files = array_merge($files, $files2 );
				else
					$files[] = $folder . '/' . $file . '/';
			} else {
				$files[] = $folder . '/' . $file;
			}
		}
	}
	@closedir( $dir );
	return $files;
}

function get_temp_dir() {
	if ( defined('WP_TEMP_DIR') )
		return trailingslashit(WP_TEMP_DIR);

	$temp = WP_CONTENT_DIR . '/';
	if ( is_dir($temp) && is_writable($temp) )
		return $temp;

	if  ( function_exists('sys_get_temp_dir') )
		return trailingslashit(sys_get_temp_dir());

	return '/tmp/';
}

function wp_tempnam($filename = '', $dir = ''){
	if ( empty($dir) )
		$dir = get_temp_dir();
	$filename = basename($filename);
	if ( empty($filename) )
		$filename = time();

	$filename = $dir . wp_unique_filename($dir, $filename);
	touch($filename);
	return $filename;
}

function validate_file_to_edit( $file, $allowed_files = '' ) {
	$file = stripslashes( $file );

	$code = validate_file( $file, $allowed_files );

	if (!$code )
		return $file;

	switch ( $code ) {
		case 1 :
			wp_die( __('Sorry, can&#8217;t edit files with ".." in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.' ));

		case 2 :
			wp_die( __('Sorry, can&#8217;t call files with their real path.' ));

		case 3 :
			wp_die( __('Sorry, that file cannot be edited.' ));
	}
}

// array wp_handle_upload ( array &file [, array overrides] )
// file: reference to a single element of $_FILES. Call the function once for each uploaded file.
// overrides: an associative array of names=>values to override default variables with extract( $overrides, EXTR_OVERWRITE ).
// On success, returns an associative array of file attributes.
// On failure, returns $overrides['upload_error_handler'](&$file, $message ) or array( 'error'=>$message ).
function wp_handle_upload( &$file, $overrides = false ) {
	// The default error handler.
	if (! function_exists( 'wp_handle_upload_error' ) ) {
		function wp_handle_upload_error( &$file, $message ) {
			return array( 'error'=>$message );
		}
	}

	// You may define your own function and pass the name in $overrides['upload_error_handler']
	$upload_error_handler = 'wp_handle_upload_error';

	// $_POST['action'] must be set and its value must equal $overrides['action'] or this:
	$action = 'wp_handle_upload';

	// Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error'].
	$upload_error_strings = array( false,
		__( "The uploaded file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>." ),
		__( "The uploaded file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form." ),
		__( "The uploaded file was only partially uploaded." ),
		__( "No file was uploaded." ),
		__( "Missing a temporary folder." ),
		__( "Failed to write file to disk." ));

	// All tests are on by default. Most can be turned off by $override[{test_name}] = false;
	$test_form = true;
	$test_size = true;

	// If you override this, you must provide $ext and $type!!!!
	$test_type = true;
	$mimes = false;

	// Install user overrides. Did we mention that this voids your warranty?
	if ( is_array( $overrides ) )
		extract( $overrides, EXTR_OVERWRITE );

	// A correct form post will pass this test.
	if ( $test_form && (!isset( $_POST['action'] ) || ($_POST['action'] != $action ) ) )
		return $upload_error_handler( $file, __( 'Invalid form submission.' ));

	// A successful upload will pass this test. It makes no sense to override this one.
	if ( $file['error'] > 0 )
		return $upload_error_handler( $file, $upload_error_strings[$file['error']] );

	// A non-empty file will pass this test.
	if ( $test_size && !($file['size'] > 0 ) )
		return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.' ));

	// A properly uploaded file will pass this test. There should be no reason to override this one.
	if (! @ is_uploaded_file( $file['tmp_name'] ) )
		return $upload_error_handler( $file, __( 'Specified file failed upload test.' ));

	// A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter.
	if ( $test_type ) {
		$wp_filetype = wp_check_filetype( $file['name'], $mimes );

		extract( $wp_filetype );

		if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
			return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' ));

		if ( !$ext )
			$ext = ltrim(strrchr($file['name'], '.'), '.');

		if ( !$type )
			$type = $file['type'];
	}

	// A writable uploads dir will pass this test. Again, there's no point overriding this one.
	if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
		return $upload_error_handler( $file, $uploads['error'] );

	$filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback );

	// Move the file to the uploads dir
	$new_file = $uploads['path'] . "/$filename";
	if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) ) {
		return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) );
	}

	// Set correct file permissions
	$stat = stat( dirname( $new_file ));
	$perms = $stat['mode'] & 0000666;
	@ chmod( $new_file, $perms );

	// Compute the URL
	$url = $uploads['url'] . "/$filename";

	$return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );

	return $return;
}
// Pass this function an array similar to that of a $_FILES POST array.
function wp_handle_sideload( &$file, $overrides = false ) {
	// The default error handler.
	if (! function_exists( 'wp_handle_upload_error' ) ) {
		function wp_handle_upload_error( &$file, $message ) {
			return array( 'error'=>$message );
		}
	}

	// You may define your own function and pass the name in $overrides['upload_error_handler']
	$upload_error_handler = 'wp_handle_upload_error';

	// $_POST['action'] must be set and its value must equal $overrides['action'] or this:
	$action = 'wp_handle_sideload';

	// Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error'].
	$upload_error_strings = array( false,
		__( "The file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>." ),
		__( "The file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form." ),
		__( "The file was only partially uploaded." ),
		__( "No file was sent." ),
		__( "Missing a temporary folder." ),
		__( "Failed to write file to disk." ));

	// All tests are on by default. Most can be turned off by $override[{test_name}] = false;
	$test_form = true;
	$test_size = true;

	// If you override this, you must provide $ext and $type!!!!
	$test_type = true;
	$mimes = false;

	// Install user overrides. Did we mention that this voids your warranty?
	if ( is_array( $overrides ) )
		extract( $overrides, EXTR_OVERWRITE );

	// A correct form post will pass this test.
	if ( $test_form && (!isset( $_POST['action'] ) || ($_POST['action'] != $action ) ) )
		return $upload_error_handler( $file, __( 'Invalid form submission.' ));

	// A successful upload will pass this test. It makes no sense to override this one.
	if ( $file['error'] > 0 )
		return $upload_error_handler( $file, $upload_error_strings[$file['error']] );

	// A non-empty file will pass this test.
	if ( $test_size && !(filesize($file['tmp_name']) > 0 ) )
		return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.' ));

	// A properly uploaded file will pass this test. There should be no reason to override this one.
	if (! @ is_file( $file['tmp_name'] ) )
		return $upload_error_handler( $file, __( 'Specified file does not exist.' ));

	// A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter.
	if ( $test_type ) {
		$wp_filetype = wp_check_filetype( $file['name'], $mimes );

		extract( $wp_filetype );

		if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
			return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' ));

		if ( !$ext )
			$ext = ltrim(strrchr($file['name'], '.'), '.');

		if ( !$type )
			$type = $file['type'];
	}

	// A writable uploads dir will pass this test. Again, there's no point overriding this one.
	if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
		return $upload_error_handler( $file, $uploads['error'] );

	$filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback );
	
	// Strip the query strings.
	$filename = str_replace('?','-', $filename);
	$filename = str_replace('&','-', $filename);
	
	// Move the file to the uploads dir
	$new_file = $uploads['path'] . "/$filename";
	if ( false === @ rename( $file['tmp_name'], $new_file ) ) {
		return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) );
	}

	// Set correct file permissions
	$stat = stat( dirname( $new_file ));
	$perms = $stat['mode'] & 0000666;
	@ chmod( $new_file, $perms );

	// Compute the URL
	$url = $uploads['url'] . "/$filename";

	$return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );

	return $return;
}

/**
* Downloads a url to a local file using the Snoopy HTTP Class
*
* @param string $url the URL of the file to download
* @return mixed WP_Error on failure, string Filename on success.
*/
function download_url( $url ) {
	//WARNING: The file is not automatically deleted, The script must unlink() the file.
	if( ! $url )
		return new WP_Error('http_no_url', __('Invalid URL Provided'));

	$tmpfname = wp_tempnam($url);
	if( ! $tmpfname )
		return new WP_Error('http_no_file', __('Could not create Temporary file'));

	$handle = @fopen($tmpfname, 'w');
	if( ! $handle )
		return new WP_Error('http_no_file', __('Could not create Temporary file'));

	require_once( ABSPATH . 'wp-includes/class-snoopy.php' );
	$snoopy = new Snoopy();
	$snoopy->fetch($url);

	if( $snoopy->status != '200' ){
		fclose($handle);
		unlink($tmpfname);
		return new WP_Error('http_404', trim($snoopy->response_code));
	}
	fwrite($handle, $snoopy->results);
	fclose($handle);

	return $tmpfname;
}

function unzip_file($file, $to) {
	global $wp_filesystem;

	if ( ! $wp_filesystem || !is_object($wp_filesystem) )
		return new WP_Error('fs_unavailable', __('Could not access filesystem.'));

	$fs =& $wp_filesystem;

	require_once(ABSPATH . 'wp-admin/includes/class-pclzip.php');

	$archive = new PclZip($file);

	// Is the archive valid?
	if ( false == ($archive_files = $archive->extract(PCLZIP_OPT_EXTRACT_AS_STRING)) )
		return new WP_Error('incompatible_archive', __('Incompatible archive'), $archive->errorInfo(true));

	if ( 0 == count($archive_files) )
		return new WP_Error('empty_archive', __('Empty archive'));

	$to = trailingslashit($to);
	$path = explode('/', $to);
	$tmppath = '';
	for ( $j = 0; $j < count($path) - 1; $j++ ) {
		$tmppath .= $path[$j] . '/';
		if ( ! $fs->is_dir($tmppath) )
			$fs->mkdir($tmppath, 0755);
	}

	foreach ($archive_files as $file) {
		$path = explode('/', $file['filename']);
		$tmppath = '';

		// Loop through each of the items and check that the folder exists.
		for ( $j = 0; $j < count($path) - 1; $j++ ) {
			$tmppath .= $path[$j] . '/';
			if ( ! $fs->is_dir($to . $tmppath) )
				if ( !$fs->mkdir($to . $tmppath, 0755) )
					return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $tmppath);
		}

		// We've made sure the folders are there, so let's extract the file now:
		if ( ! $file['folder'] )
			if ( !$fs->put_contents( $to . $file['filename'], $file['content']) )
				return new WP_Error('copy_failed', __('Could not copy file'), $to . $file['filename']);
			$fs->chmod($to . $file['filename'], 0644);
	}

	return true;
}

function copy_dir($from, $to) {
	global $wp_filesystem;

	$dirlist = $wp_filesystem->dirlist($from);

	$from = trailingslashit($from);
	$to = trailingslashit($to);

	foreach ( (array) $dirlist as $filename => $fileinfo ) {
		if ( 'f' == $fileinfo['type'] ) {
			if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true) )
				return new WP_Error('copy_failed', __('Could not copy file'), $to . $filename);
			$wp_filesystem->chmod($to . $filename, 0644);
		} elseif ( 'd' == $fileinfo['type'] ) {
			if ( !$wp_filesystem->mkdir($to . $filename, 0755) )
				return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $filename);
			$result = copy_dir($from . $filename, $to . $filename);
			if ( is_wp_error($result) )
				return $result;
		}
	}
}

function WP_Filesystem( $args = false ) {
	global $wp_filesystem;

	require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php');

	$method = get_filesystem_method();

	if ( ! $method )
		return false;

	$abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-'.$method.'.php', $method);
	if( ! file_exists($abstraction_file) )
		return;

	require_once($abstraction_file);
	$method = "WP_Filesystem_$method";

	$wp_filesystem = new $method($args);

	if ( $wp_filesystem->errors->get_error_code() )
		return false;

	if ( !$wp_filesystem->connect() )
		return false; //There was an erorr connecting to the server.

	return true;
}

function get_filesystem_method() {
	$method = false;
	if( function_exists('getmyuid') && function_exists('fileowner') ){
		$temp_file = wp_tempnam();
		if ( getmyuid() == fileowner($temp_file) )
			$method = 'direct';
		unlink($temp_file);
	}

	if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext';
	if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread
	return apply_filters('filesystem_method', $method);
}

?>                                                                                                                                                                                                                                                                  blog/wp-admin/includes/image.php                                                                    0000755 0023433 0004734 00000022432 11060470735 016477  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
/**
 * File contains all the administration image manipulation functions.
 *
 * @package WordPress
 */

/**
 * wp_create_thumbnail() - Create a thumbnail from an Image given a maximum side size.
 *
 * @package WordPress
 * @param	mixed	$file	Filename of the original image, Or attachment id
 * @param	int		$max_side	Maximum length of a single side for the thumbnail
 * @return	string			Thumbnail path on success, Error string on failure
 *
 * This function can handle most image file formats which PHP supports.
 * If PHP does not have the functionality to save in a file of the same format, the thumbnail will be created as a jpeg.
 */
function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
	
	$thumbpath = image_resize( $file, $max_side, $max_side );
	return apply_filters( 'wp_create_thumbnail', $thumbpath );
}

/**
 * wp_crop_image() - Crop an Image to a given size.
 *
 * @package WordPress
 * @internal Missing Long Description
 * @param	int	$src_file	The source file
 * @param	int	$src_x		The start x position to crop from
 * @param	int	$src_y		The start y position to crop from
 * @param	int	$src_w		The width to crop
 * @param	int	$src_h		The height to crop
 * @param	int	$dst_w		The destination width
 * @param	int	$dst_h		The destination height
 * @param	int	$src_abs	If the source crop points are absolute
 * @param	int	$dst_file	The destination file to write to
 * @return	string			New filepath on success, String error message on failure
 *
 */
function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) {
	if ( is_numeric( $src_file ) ) // Handle int as attachment ID
		$src_file = get_attached_file( $src_file );

	$src = wp_load_image( $src_file );

	if ( !is_resource( $src ))
		return $src;

	$dst = imagecreatetruecolor( $dst_w, $dst_h );

	if ( $src_abs ) {
		$src_w -= $src_x;
		$src_h -= $src_y;
	}

	if (function_exists('imageantialias'))
		imageantialias( $dst, true );

	imagecopyresampled( $dst, $src, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h );

	imagedestroy( $src ); // Free up memory

	if ( ! $dst_file )
		$dst_file = str_replace( basename( $src_file ), 'cropped-' . basename( $src_file ), $src_file );

	$dst_file = preg_replace( '/\\.[^\\.]+$/', '.jpg', $dst_file );

	if ( imagejpeg( $dst, $dst_file ) )
		return $dst_file;
	else
		return false;
}

/**
 * wp_generate_attachment_metadata() - Generate post Image attachment Metadata
 *
 * @package WordPress
 * @internal Missing Long Description
 * @param	int		$attachment_id	Attachment Id to process
 * @param	string	$file	Filepath of the Attached image
 * @return	mixed			Metadata for attachment
 *
 */
function wp_generate_attachment_metadata( $attachment_id, $file ) {
	$attachment = get_post( $attachment_id );

	$metadata = array();
	if ( preg_match('!^image/!', get_post_mime_type( $attachment )) && file_is_displayable_image($file) ) {
		$imagesize = getimagesize( $file );
		$metadata['width'] = $imagesize[0];
		$metadata['height'] = $imagesize[1];
		list($uwidth, $uheight) = wp_shrink_dimensions($metadata['width'], $metadata['height']);
		$metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
		$metadata['file'] = $file;

		// make thumbnails and other intermediate sizes
		$sizes = array('thumbnail', 'medium');
		$sizes = apply_filters('intermediate_image_sizes', $sizes);
		
		foreach ($sizes as $size) {
			$resized = image_make_intermediate_size( $file, get_option("{$size}_size_w"), get_option("{$size}_size_h"), get_option("{$size}_crop") );
			if ( $resized )
				$metadata['sizes'][$size] = $resized;
		}
			
		// fetch additional metadata from exif/iptc
		$image_meta = wp_read_image_metadata( $file );
		if ($image_meta)
			$metadata['image_meta'] = $image_meta;

	}
	return apply_filters( 'wp_generate_attachment_metadata', $metadata );
}

/**
 * wp_load_image() - Load an image which PHP Supports.
 *
 * @package WordPress
 * @internal Missing Long Description
 * @param	string	$file	Filename of the image to load
 * @return	resource		The resulting image resource on success, Error string on failure.
 *
 */
function wp_load_image( $file ) {
	if ( is_numeric( $file ) )
		$file = get_attached_file( $file );

	if ( ! file_exists( $file ) )
		return sprintf(__("File '%s' doesn't exist?"), $file);

	if ( ! function_exists('imagecreatefromstring') )
		return __('The GD image library is not installed.');

	// Set artificially high because GD uses uncompressed images in memory
	@ini_set('memory_limit', '256M');
	$image = imagecreatefromstring( file_get_contents( $file ) );

	if ( !is_resource( $image ) )
		return sprintf(__("File '%s' is not an image."), $file);

	return $image;
}

/**
 * get_udims() - Calculated the new dimentions for downsampled images
 *
 * @package WordPress
 * @internal Missing Description
 * @see wp_shrink_dimensions()
 * @param	int		$width	Current width of the image
 * @param	int 	$height	Current height of the image
 * @return	mixed			Array(height,width) of shrunk dimensions.
 *
 */
function get_udims( $width, $height) {
	return wp_shrink_dimensions( $width, $height );
}
/**
 * wp_shrink_dimensions() - Calculates the new dimentions for a downsampled image.
 *
 * @package WordPress
 * @internal Missing Long Description
 * @param	int		$width	Current width of the image
 * @param	int 	$height	Current height of the image
 * @param	int		$wmax	Maximum wanted width
 * @param	int		$hmax	Maximum wanted height
 * @return	mixed			Array(height,width) of shrunk dimensions.
 *
 */
function wp_shrink_dimensions( $width, $height, $wmax = 128, $hmax = 96 ) {
	return wp_constrain_dimensions( $width, $height, $wmax, $hmax );
}

// convert a fraction string to a decimal
function wp_exif_frac2dec($str) {
	@list( $n, $d ) = explode( '/', $str );
	if ( !empty($d) )
		return $n / $d;
	return $str;
}

// convert the exif date format to a unix timestamp
function wp_exif_date2ts($str) {
	// seriously, who formats a date like 'YYYY:MM:DD hh:mm:ss'?
	@list( $date, $time ) = explode( ' ', trim($str) );
	@list( $y, $m, $d ) = explode( ':', $date );

	return strtotime( "{$y}-{$m}-{$d} {$time}" );
}

// get extended image metadata, exif or iptc as available
function wp_read_image_metadata( $file ) {
	if ( !file_exists( $file ) )
		return false;

	list(,,$sourceImageType) = getimagesize( $file );

	// exif contains a bunch of data we'll probably never need formatted in ways that are difficult to use.
	// We'll normalize it and just extract the fields that are likely to be useful.  Fractions and numbers
	// are converted to floats, dates to unix timestamps, and everything else to strings.
	$meta = array(
		'aperture' => 0,
		'credit' => '',
		'camera' => '',
		'caption' => '',
		'created_timestamp' => 0,
		'copyright' => '',
		'focal_length' => 0,
		'iso' => 0,
		'shutter_speed' => 0,
		'title' => '',
	);

	// read iptc first, since it might contain data not available in exif such as caption, description etc
	if ( is_callable('iptcparse') ) {
		getimagesize($file, $info);
		if ( !empty($info['APP13']) ) {
			$iptc = iptcparse($info['APP13']);
			if ( !empty($iptc['2#110'][0]) ) // credit
				$meta['credit'] = trim( $iptc['2#110'][0] );
			elseif ( !empty($iptc['2#080'][0]) ) // byline
				$meta['credit'] = trim( $iptc['2#080'][0] );
			if ( !empty($iptc['2#055'][0]) and !empty($iptc['2#060'][0]) ) // created datee and time
				$meta['created_timestamp'] = strtotime($iptc['2#055'][0] . ' ' . $iptc['2#060'][0]);
			if ( !empty($iptc['2#120'][0]) ) // caption
				$meta['caption'] = trim( $iptc['2#120'][0] );
			if ( !empty($iptc['2#116'][0]) ) // copyright
				$meta['copyright'] = trim( $iptc['2#116'][0] );
			if ( !empty($iptc['2#005'][0]) ) // title
				$meta['title'] = trim( $iptc['2#005'][0] );
		 }
	}

	// fetch additional info from exif if available
	if ( is_callable('exif_read_data') && in_array($sourceImageType, apply_filters('wp_read_image_metadata_types', array(IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM)) ) ) {
		$exif = @exif_read_data( $file );
		if (!empty($exif['FNumber']))
			$meta['aperture'] = round( wp_exif_frac2dec( $exif['FNumber'] ), 2 );
		if (!empty($exif['Model']))
			$meta['camera'] = trim( $exif['Model'] );
		if (!empty($exif['DateTimeDigitized']))
			$meta['created_timestamp'] = wp_exif_date2ts($exif['DateTimeDigitized']);
		if (!empty($exif['FocalLength']))
			$meta['focal_length'] = wp_exif_frac2dec( $exif['FocalLength'] );
		if (!empty($exif['ISOSpeedRatings']))
			$meta['iso'] = $exif['ISOSpeedRatings'];
		if (!empty($exif['ExposureTime']))
			$meta['shutter_speed'] = wp_exif_frac2dec( $exif['ExposureTime'] );
	}
	// FIXME: try other exif libraries if available

	return apply_filters( 'wp_read_image_metadata', $meta, $file, $sourceImageType );

}

// is the file a real image file?
function file_is_valid_image($path) {
	$size = @getimagesize($path);
	return !empty($size);
}

// is the file an image suitable for displaying within a web page?
function file_is_displayable_image($path) {
	$info = @getimagesize($path);
	if ( empty($info) )
		$result = false;
	elseif ( !in_array($info[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)) )
		// only gif, jpeg and png images can reliably be displayed
		$result = false;
	elseif ( $info['channels'] > 0 && $info['channels'] != 3 ) {
		// some web browsers can't display cmyk or grayscale jpegs
		$result = false;
	}
	else
		$result = true;
		
	return apply_filters('file_is_displayable_image', $result, $path);
}

?>
                                                                                                                                                                                                                                      blog/wp-admin/includes/import.php                                                                   0000755 0023433 0004734 00000002143 11060470735 016724  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

function get_importers() {
	global $wp_importers;
	if ( is_array($wp_importers) )
		uasort($wp_importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);'));
	return $wp_importers;
}

function register_importer( $id, $name, $description, $callback ) {
	global $wp_importers;
	if ( is_wp_error( $callback ) )
		return $callback;
	$wp_importers[$id] = array ( $name, $description, $callback );
}

function wp_import_cleanup( $id ) {
	wp_delete_attachment( $id );
}

function wp_import_handle_upload() {
	$overrides = array( 'test_form' => false, 'test_type' => false );
	$_FILES['import']['name'] .= '.import';
	$file = wp_handle_upload( $_FILES['import'], $overrides );

	if ( isset( $file['error'] ) )
		return $file;

	$url = $file['url'];
	$type = $file['type'];
	$file = addslashes( $file['file'] );
	$filename = basename( $file );

	// Construct the object array
	$object = array( 'post_title' => $filename,
		'post_content' => $url,
		'post_mime_type' => $type,
		'guid' => $url
	);

	// Save the data
	$id = wp_insert_attachment( $object, $file );

	return array( 'file' => $file, 'id' => $id );
}

?>
                                                                                                                                                                                                                                                                                                                                                                                                                             blog/wp-admin/includes/media.php                                                                    0000755 0023433 0004734 00000145067 11060470736 016507  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

function media_upload_tabs() {
	$_default_tabs = array(
		'type' => __('Choose File'), // handler action suffix => tab text
		'gallery' => __('Gallery'),
		'library' => __('Media Library'),
	);

	return apply_filters('media_upload_tabs', $_default_tabs);
}

function update_gallery_tab($tabs) {
	global $wpdb;
	if ( !isset($_REQUEST['post_id']) ) {
		unset($tabs['gallery']);
		return $tabs;
	}
	if ( intval($_REQUEST['post_id']) )
		$attachments = intval($wpdb->get_var($wpdb->prepare("SELECT count(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = %d", $_REQUEST['post_id'])));

	$tabs['gallery'] = sprintf(__('Gallery (%s)'), "<span id='attachments-count'>$attachments</span>");

	return $tabs;
}
add_filter('media_upload_tabs', 'update_gallery_tab');

function the_media_upload_tabs() {
	global $redir_tab;
	$tabs = media_upload_tabs();

	if ( !empty($tabs) ) {
		echo "<ul id='sidemenu'>\n";
		if ( isset($redir_tab) && array_key_exists($redir_tab, $tabs) )
			$current = $redir_tab;
		elseif ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) )
			$current = $_GET['tab'];
		else {
			$keys = array_keys($tabs);
			$current = array_shift($keys);
		}
		foreach ( $tabs as $callback => $text ) {
			$class = '';
			if ( $current == $callback )
				$class = " class='current'";
			$href = add_query_arg(array('tab'=>$callback, 's'=>false, 'paged'=>false, 'post_mime_type'=>false, 'm'=>false));
			$link = "<a href='" . clean_url($href) . "'$class>$text</a>";
			echo "\t<li id='" . attribute_escape("tab-$callback") . "'>$link</li>\n";
		}
		echo "</ul>\n";
	}
}

function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = false, $size='medium') {

	$html = get_image_tag($id, $alt, $title, $align, $size);

	$rel = $rel ? ' rel="attachment wp-att-'.attribute_escape($id).'"' : '';

	if ( $url )
		$html = '<a href="' . clean_url($url) . "\"$rel>$html</a>";

	$html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size );

	return $html;
}

function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) {

	if ( empty($alt) || apply_filters( 'disable_captions', '' ) ) return $html;
	$id = ( 0 < (int) $id ) ? 'attachment_' . $id : '';

	preg_match( '/width="([0-9]+)/', $html, $matches );
	if ( ! isset($matches[1]) ) return $html;
	$width = $matches[1];

	$html = preg_replace( '/align[^\s\'"]+\s?/', '', $html );
	if ( empty($align) ) $align = 'none';

	$shcode = '[caption id="' . $id . '" align="align' . $align
	. '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/caption]';

	return apply_filters( 'image_add_caption_shortcode', $shcode, $html );
}
add_filter( 'image_send_to_editor', 'image_add_caption', 20, 7 );

function media_send_to_editor($html) {
	?>
<script type="text/javascript">
/* <![CDATA[ */
var win = window.dialogArguments || opener || parent || top;
win.send_to_editor('<?php echo addslashes($html); ?>');
/* ]]> */
</script>
	<?php
	exit;
}

// this handles the file upload POST itself, creating the attachment post
function media_handle_upload($file_id, $post_id, $post_data = array()) {
	$overrides = array('test_form'=>false);
	$file = wp_handle_upload($_FILES[$file_id], $overrides);

	if ( isset($file['error']) )
		return new WP_Error( 'upload_error', $file['error'] );

	$url = $file['url'];
	$type = $file['type'];
	$file = $file['file'];
	$title = preg_replace('/\.[^.]+$/', '', basename($file));
	$content = '';

	// use image exif/iptc data for title and caption defaults if possible
	if ( $image_meta = @wp_read_image_metadata($file) ) {
		if ( trim($image_meta['title']) )
			$title = $image_meta['title'];
		if ( trim($image_meta['caption']) )
			$content = $image_meta['caption'];
	}

	// Construct the attachment array
	$attachment = array_merge( array(
		'post_mime_type' => $type,
		'guid' => $url,
		'post_parent' => $post_id,
		'post_title' => $title,
		'post_content' => $content,
	), $post_data );

	// Save the data
	$id = wp_insert_attachment($attachment, $file, $post_parent);
	if ( !is_wp_error($id) ) {
		wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
	}

	return $id;

}

function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = array()) {
	$overrides = array('test_form'=>false);
	$file = wp_handle_sideload($file_array, $overrides);

	if ( isset($file['error']) )
		return new WP_Error( 'upload_error', $file['error'] );

	$url = $file['url'];
	$type = $file['type'];
	$file = $file['file'];
	$title = preg_replace('/\.[^.]+$/', '', basename($file));
	$content = '';

	// use image exif/iptc data for title and caption defaults if possible
	if ( $image_meta = @wp_read_image_metadata($file) ) {
		if ( trim($image_meta['title']) )
			$title = $image_meta['title'];
		if ( trim($image_meta['caption']) )
			$content = $image_meta['caption'];
	}

	$title = @$desc;

	// Construct the attachment array
	$attachment = array_merge( array(
		'post_mime_type' => $type,
		'guid' => $url,
		'post_parent' => $post_id,
		'post_title' => $title,
		'post_content' => $content,
	), $post_data );

	// Save the data
	$id = wp_insert_attachment($attachment, $file, $post_parent);
	if ( !is_wp_error($id) ) {
		wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
		return $url;
	}
	return $id;
}


// wrap iframe content (produced by $content_func) in a doctype, html head/body etc
// any additional function args will be passed to content_func
function wp_iframe($content_func /* ... */) {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
<title><?php bloginfo('name') ?> &rsaquo; <?php _e('Uploads'); ?> &#8212; <?php _e('WordPress'); ?></title>
<?php
wp_enqueue_style( 'global' );
wp_enqueue_style( 'wp-admin' );
wp_enqueue_style( 'colors' );
if ( 0 === strpos( $content_func, 'media' ) )
	wp_enqueue_style( 'media' );

?>
<script type="text/javascript">
//<![CDATA[
function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}
//]]>
</script>
<?php
do_action('admin_print_styles');
do_action('admin_print_scripts');
do_action('admin_head');
if ( is_string($content_func) )
	do_action( "admin_head_{$content_func}" );
?>
</head>
<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?>>
<?php
	$args = func_get_args();
	$args = array_slice($args, 1);
	call_user_func_array($content_func, $args);
?>
</body>
</html>
<?php
}

function media_buttons() {
	global $post_ID, $temp_ID;
	$uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID);
	$context = apply_filters('media_buttons_context', __('Add media: %s'));
	$media_upload_iframe_src = "media-upload.php?post_id=$uploading_iframe_ID";
	$media_title = __('Add Media');
	$image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src&amp;type=image");
	$image_title = __('Add an Image');
	$video_upload_iframe_src = apply_filters('video_upload_iframe_src', "$media_upload_iframe_src&amp;type=video");
	$video_title = __('Add Video');
	$audio_upload_iframe_src = apply_filters('audio_upload_iframe_src', "$media_upload_iframe_src&amp;type=audio");
	$audio_title = __('Add Audio');
	$out = <<<EOF

	<a href="{$image_upload_iframe_src}&amp;TB_iframe=true" id="add_image" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>
	<a href="{$video_upload_iframe_src}&amp;TB_iframe=true" id="add_video" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>
	<a href="{$audio_upload_iframe_src}&amp;TB_iframe=true" id="add_audio" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a>
	<a href="{$media_upload_iframe_src}&amp;TB_iframe=true" id="add_media" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>

EOF;
	printf($context, $out);
}
add_action( 'media_buttons', 'media_buttons' );
add_action('media_upload_media', 'media_upload_handler');

function media_upload_form_handler() {
	check_admin_referer('media-form');

	if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) {
		$post = $_post = get_post($attachment_id, ARRAY_A);
		if ( isset($attachment['post_content']) )
			$post['post_content'] = $attachment['post_content'];
		if ( isset($attachment['post_title']) )
			$post['post_title'] = $attachment['post_title'];
		if ( isset($attachment['post_excerpt']) )
			$post['post_excerpt'] = $attachment['post_excerpt'];
		if ( isset($attachment['menu_order']) )
			$post['menu_order'] = $attachment['menu_order'];

		$post = apply_filters('attachment_fields_to_save', $post, $attachment);

		if ( isset($post['errors']) ) {
			$errors[$attachment_id] = $post['errors'];
			unset($post['errors']);
		}

		if ( $post != $_post )
			wp_update_post($post);

		foreach ( get_attachment_taxonomies($post) as $t )
			if ( isset($attachment[$t]) )
				wp_set_object_terms($attachment_id, array_map('trim', preg_split('/,+/', $attachment[$t])), $t, false);
	}

	if ( isset($_POST['insert-gallery']) )
		return media_send_to_editor('[gallery]');

	if ( isset($_POST['send']) ) {
		$keys = array_keys($_POST['send']);
		$send_id = (int) array_shift($keys);
		$attachment = stripslashes_deep( $_POST['attachments'][$send_id] );
		$html = $attachment['post_title'];
		if ( !empty($attachment['url']) ) {
			if ( strpos($attachment['url'], 'attachment_id') || false !== strpos($attachment['url'], get_permalink($_POST['post_id'])) )
				$rel = " rel='attachment wp-att-".attribute_escape($send_id)."'";
			$html = "<a href='{$attachment['url']}'$rel>$html</a>";
		}
		$html = apply_filters('media_send_to_editor', $html, $send_id, $attachment);
		return media_send_to_editor($html);
	}

	return $errors;
}

function media_upload_image() {
	if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
		// Upload File button was clicked
		$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
		unset($_FILES);
		if ( is_wp_error($id) ) {
			$errors['upload_error'] = $id;
			$id = false;
		}
	}

	if ( !empty($_POST['insertonlybutton']) ) {
		$src = $_POST['insertonly']['src'];
		if ( !empty($src) && !strpos($src, '://') )
			$src = "http://$src";
		$alt = attribute_escape($_POST['insertonly']['alt']);
		if ( isset($_POST['insertonly']['align']) ) {
			$align = attribute_escape($_POST['insertonly']['align']);
			$class = " class='align$align'";
		}
		if ( !empty($src) )
			$html = "<img src='$src' alt='$alt'$class />";
		return media_send_to_editor($html);
	}

	if ( !empty($_POST) ) {
		$return = media_upload_form_handler();

		if ( is_string($return) )
			return $return;
		if ( is_array($return) )
			$errors = $return;
	}

	if ( isset($_POST['save']) ) {
		$errors['upload_notice'] = __('Saved.');
		return media_upload_gallery();
	}

	return wp_iframe( 'media_upload_type_form', 'image', $errors, $id );
}

function media_sideload_image($file, $post_id, $desc = null) {
	if (!empty($file) ) {
		$file_array['name'] = basename($file);
		$file_array['tmp_name'] = download_url($file);
		$desc = @$desc;

		$id = media_handle_sideload($file_array, $post_id, $desc);
		$src = $id;

		if ( is_wp_error($id) ) {
			@unlink($file_array['tmp_name']);
			return $id;
		}
	}

	if ( !empty($src) ) {
		$alt = @$desc;
		$html = "<img src='$src' alt='$alt' />";
		return $html;
	}
}

function media_upload_audio() {
	if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
		// Upload File button was clicked
		$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
		unset($_FILES);
		if ( is_wp_error($id) ) {
			$errors['upload_error'] = $id;
			$id = false;
		}
	}

	if ( !empty($_POST['insertonlybutton']) ) {
		$href = $_POST['insertonly']['href'];
		if ( !empty($href) && !strpos($href, '://') )
			$href = "http://$href";
		$title = attribute_escape($_POST['insertonly']['title']);
		if ( empty($title) )
			$title = basename($href);
		if ( !empty($title) && !empty($href) )
			$html = "<a href='$href' >$title</a>";
		return media_send_to_editor($html);
	}

	if ( !empty($_POST) ) {
		$return = media_upload_form_handler();

		if ( is_string($return) )
			return $return;
		if ( is_array($return) )
			$errors = $return;
	}

	if ( isset($_POST['save']) ) {
		$errors['upload_notice'] = __('Saved.');
		return media_upload_gallery();
	}

	return wp_iframe( 'media_upload_type_form', 'audio', $errors, $id );
}

function media_upload_video() {
	if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
		// Upload File button was clicked
		$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
		unset($_FILES);
		if ( is_wp_error($id) ) {
			$errors['upload_error'] = $id;
			$id = false;
		}
	}

	if ( !empty($_POST['insertonlybutton']) ) {
		$href = $_POST['insertonly']['href'];
		if ( !empty($href) && !strpos($href, '://') )
			$href = "http://$href";
		$title = attribute_escape($_POST['insertonly']['title']);
		if ( empty($title) )
			$title = basename($href);
		if ( !empty($title) && !empty($href) )
			$html = "<a href='$href' >$title</a>";
		return media_send_to_editor($html);
	}

	if ( !empty($_POST) ) {
		$return = media_upload_form_handler();

		if ( is_string($return) )
			return $return;
		if ( is_array($return) )
			$errors = $return;
	}

	if ( isset($_POST['save']) ) {
		$errors['upload_notice'] = __('Saved.');
		return media_upload_gallery();
	}

	return wp_iframe( 'media_upload_type_form', 'video', $errors, $id );
}

function media_upload_file() {
	if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
		// Upload File button was clicked
		$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
		unset($_FILES);
		if ( is_wp_error($id) ) {
			$errors['upload_error'] = $id;
			$id = false;
		}
	}

	if ( !empty($_POST['insertonlybutton']) ) {
		$href = $_POST['insertonly']['href'];
		if ( !empty($href) && !strpos($href, '://') )
			$href = "http://$href";
		$title = attribute_escape($_POST['insertonly']['title']);
		if ( empty($title) )
			$title = basename($href);
		if ( !empty($title) && !empty($href) )
			$html = "<a href='$href' >$title</a>";
		return media_send_to_editor($html);
	}

	if ( !empty($_POST) ) {
		$return = media_upload_form_handler();

		if ( is_string($return) )
			return $return;
		if ( is_array($return) )
			$errors = $return;
	}

	if ( isset($_POST['save']) ) {
		$errors['upload_notice'] = __('Saved.');
		return media_upload_gallery();
	}

	return wp_iframe( 'media_upload_type_form', 'file', $errors, $id );
}

function media_upload_gallery() {
	if ( !empty($_POST) ) {
		$return = media_upload_form_handler();

		if ( is_string($return) )
			return $return;
		if ( is_array($return) )
			$errors = $return;
	}

	wp_enqueue_script('admin-gallery');
	return wp_iframe( 'media_upload_gallery_form', $errors );
}

function media_upload_library() {
	if ( !empty($_POST) ) {
		$return = media_upload_form_handler();

		if ( is_string($return) )
			return $return;
		if ( is_array($return) )
			$errors = $return;
	}

	return wp_iframe( 'media_upload_library_form', $errors );
}

function image_attachment_fields_to_edit($form_fields, $post) {
	if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
		$form_fields['post_title']['required'] = true;

		$form_fields['post_excerpt']['label'] = __('Caption');
		$form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image');

		$form_fields['post_content']['label'] = __('Description');

		$thumb = wp_get_attachment_thumb_url($post->ID);

		$form_fields['align'] = array(
			'label' => __('Alignment'),
			'input' => 'html',
			'html'  => "
				<input type='radio' name='attachments[$post->ID][align]' id='image-align-none-$post->ID' value='none' checked='checked' />
				<label for='image-align-none-$post->ID' class='align image-align-none-label'>" . __('None') . "</label>
				<input type='radio' name='attachments[$post->ID][align]' id='image-align-left-$post->ID' value='left' />
				<label for='image-align-left-$post->ID' class='align image-align-left-label'>" . __('Left') . "</label>
				<input type='radio' name='attachments[$post->ID][align]' id='image-align-center-$post->ID' value='center' />
				<label for='image-align-center-$post->ID' class='align image-align-center-label'>" . __('Center') . "</label>
				<input type='radio' name='attachments[$post->ID][align]' id='image-align-right-$post->ID' value='right' />
				<label for='image-align-right-$post->ID' class='align image-align-right-label'>" . __('Right') . "</label>\n",
		);
		$form_fields['image-size'] = array(
			'label' => __('Size'),
			'input' => 'html',
			'html'  => "
				" . ( $thumb ? "<input type='radio' name='attachments[$post->ID][image-size]' id='image-size-thumb-$post->ID' value='thumbnail' />
				<label for='image-size-thumb-$post->ID'>" . __('Thumbnail') . "</label>
				" : '' ) . "<input type='radio' name='attachments[$post->ID][image-size]' id='image-size-medium-$post->ID' value='medium' checked='checked' />
				<label for='image-size-medium-$post->ID'>" . __('Medium') . "</label>
				<input type='radio' name='attachments[$post->ID][image-size]' id='image-size-full-$post->ID' value='full' />
				<label for='image-size-full-$post->ID'>" . __('Full size') . "</label>",
		);
	}
	return $form_fields;
}

add_filter('attachment_fields_to_edit', 'image_attachment_fields_to_edit', 10, 2);

function media_single_attachment_fields_to_edit( $form_fields, $post ) {
	unset($form_fields['url'], $form_fields['align'], $form_fields['image-size']);
	return $form_fields;
}

function image_attachment_fields_to_save($post, $attachment) {
	if ( substr($post['post_mime_type'], 0, 5) == 'image' ) {
		if ( strlen(trim($post['post_title'])) == 0 ) {
			$post['post_title'] = preg_replace('/\.\w+$/', '', basename($post['guid']));
			$post['errors']['post_title']['errors'][] = __('Empty Title filled from filename.');
		}
	}

	return $post;
}

add_filter('attachment_fields_to_save', 'image_attachment_fields_to_save', 10, 2);

function image_media_send_to_editor($html, $attachment_id, $attachment) {
	$post =& get_post($attachment_id);
	if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
		$url = $attachment['url'];

		if ( isset($attachment['align']) )
			$align = $attachment['align'];
		else
			$align = 'none';

		if ( !empty($attachment['image-size']) )
			$size = $attachment['image-size'];
		else
			$size = 'medium';

		$rel = ( $url == get_attachment_link($attachment_id) );

		return get_image_send_to_editor($attachment_id, $attachment['post_excerpt'], $attachment['post_title'], $align, $url, $rel, $size);
	}

	return $html;
}

add_filter('media_send_to_editor', 'image_media_send_to_editor', 10, 3);

function get_attachment_fields_to_edit($post, $errors = null) {
	if ( is_int($post) )
		$post =& get_post($post);
	if ( is_array($post) )
		$post = (object) $post;

	$edit_post = sanitize_post($post, 'edit');
	$file = wp_get_attachment_url($post->ID);
	$link = get_attachment_link($post->ID);

	$form_fields = array(
		'post_title'   => array(
			'label'      => __('Title'),
			'value'      => $edit_post->post_title,
		),
		'post_excerpt' => array(
			'label'      => __('Caption'),
			'value'      => $edit_post->post_excerpt,
		),
		'post_content' => array(
			'label'      => __('Description'),
			'value'      => $edit_post->post_content,
			'input'      => 'textarea',
		),
		'url'          => array(
			'label'      => __('Link URL'),
			'input'      => 'html',
			'html'       => "
				<input type='text' name='attachments[$post->ID][url]' value='" . attribute_escape($file) . "' /><br />
				<button type='button' class='button url-$post->ID' value=''>" . __('None') . "</button>
				<button type='button' class='button url-$post->ID' value='" . attribute_escape($file) . "'>" . __('File URL') . "</button>
				<button type='button' class='button url-$post->ID' value='" . attribute_escape($link) . "'>" . __('Post URL') . "</button>
				<script type='text/javascript'>
				jQuery('button.url-$post->ID').bind('click', function(){jQuery(this).siblings('input').val(this.value);});
				</script>\n",
			'helps'      => __('Enter a link URL or click above for presets.'),
		),
    	'menu_order'   => array(
			'label'      => __('Order'),
			'value'      => $edit_post->menu_order
		),
	);

	foreach ( get_attachment_taxonomies($post) as $taxonomy ) {
		$t = (array) get_taxonomy($taxonomy);
		if ( empty($t['label']) )
			$t['label'] = $taxonomy;
		if ( empty($t['args']) )
			$t['args'] = array();

		$terms = get_object_term_cache($post->ID, $taxonomy);
		if ( empty($terms) )
			$terms = wp_get_object_terms($post->ID, $taxonomy, $t['args']);

		$values = array();

		foreach ( $terms as $term )
			$values[] = $term->name;
		$t['value'] = join(', ', $values);

		$form_fields[$taxonomy] = $t;
	}

	// Merge default fields with their errors, so any key passed with the error (e.g. 'error', 'helps', 'value') will replace the default
	// The recursive merge is easily traversed with array casting: foreach( (array) $things as $thing )
	$form_fields = array_merge_recursive($form_fields, (array) $errors);

	$form_fields = apply_filters('attachment_fields_to_edit', $form_fields, $post);

	return $form_fields;
}

function get_media_items( $post_id, $errors ) {
	if ( $post_id ) {
		$post = get_post($post_id);
		if ( $post && $post->post_type == 'attachment' )
			$attachments = array($post->ID => $post);
		else
			$attachments = get_children( array( 'post_parent' => $post_id, 'post_type' => 'attachment', 'orderby' => 'menu_order ASC, ID', 'order' => 'DESC') );
	} else {
		if ( is_array($GLOBALS['wp_the_query']->posts) )
			foreach ( $GLOBALS['wp_the_query']->posts as $attachment )
				$attachments[$attachment->ID] = $attachment;
	}

	if ( empty($attachments) )
		return '';

	foreach ( $attachments as $id => $attachment )
		if ( $item = get_media_item( $id, array( 'errors' => isset($errors[$id]) ? $errors[$id] : null) ) )
			$output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div class='progress'><div class='bar'></div></div><div id='media-upload-error-$id'></div><div class='filename'></div>$item\n</div>";

	return $output;
}

function get_media_item( $attachment_id, $args = null ) {
	global $redir_tab;

	$default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true );
	$args = wp_parse_args( $args, $default_args );
	extract( $args, EXTR_SKIP );

	global $post_mime_types;
	if ( ( $attachment_id = intval($attachment_id) ) && $thumb_url = get_attachment_icon_src( $attachment_id ) )
		$thumb_url = $thumb_url[0];
	else
		return false;

	$title_label = __('Title');
	$description_label = __('Description');
	$tags_label = __('Tags');

	$toggle_on = __('Show');
	$toggle_off = __('Hide');

	$post = get_post($attachment_id);

	$filename = basename($post->guid);
	$title = attribute_escape($post->post_title);
	$description = attribute_escape($post->post_content);
	if ( $_tags = get_the_tags($attachment_id) ) {
		foreach ( $_tags as $tag )
			$tags[] = $tag->name;
		$tags = attribute_escape(join(', ', $tags));
	}

	if ( isset($post_mime_types) ) {
		$keys = array_keys(wp_match_mime_types(array_keys($post_mime_types), $post->post_mime_type));
		$type = array_shift($keys);
		$type = "<input type='hidden' id='type-of-$attachment_id' value='" . attribute_escape( $type ) . "' />";
	}

	$form_fields = get_attachment_fields_to_edit($post, $errors);

	if ( $toggle ) {
		$class = empty($errors) ? 'startclosed' : 'startopen';
		$toggle_links = "
	<a class='toggle describe-toggle-on' href='#'>$toggle_on</a>
	<a class='toggle describe-toggle-off' href='#'>$toggle_off</a>";
	} else {
		$class = 'form-table';
		$toggle_links = '';
	}

	$display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
	$display_title = wp_html_excerpt($display_title, 60);

	$gallery = ( (isset($_REQUEST['tab']) && 'gallery' == $_REQUEST['tab']) || (isset($redir_tab) && 'gallery' == $redir_tab) ) ? true : false;
	$order = '';

	foreach ( $form_fields as $key => $val ) {
		if ( 'menu_order' == $key ) {
			if ( $gallery )
				$order = '<div class="menu_order"> <input class="menu_order_input" type="text" id="attachments['.$attachment_id.'][menu_order]" name="attachments['.$attachment_id.'][menu_order]" value="'.$val['value'].'" /></div>';
			else
				$order = '<input type="hidden" name="attachments['.$attachment_id.'][menu_order]" value="'.$val['value'].'" />';

			unset($form_fields['menu_order']);
			break;
		}
	}

	$item = "
	$type
	$toggle_links
	$order
	<div class='filename new'>$display_title</div>
	<table class='slidetoggle describe $class'>
		<thead class='media-item-info'>
		<tr>
			<td class='A1B1' rowspan='4'><img class='thumbnail' src='$thumb_url' alt='' /></td>
			<td>$filename</td>
		</tr>
		<tr><td>$post->post_mime_type</td></tr>
		<tr><td>" . mysql2date($post->post_date, get_option('time_format')) . "</td></tr>
		<tr><td>" . apply_filters('media_meta', '', $post) . "</td></tr>
		</thead>
		<tbody>\n";

	$defaults = array(
		'input'      => 'text',
		'required'   => false,
		'value'      => '',
		'extra_rows' => array(),
	);

	$delete_href = wp_nonce_url("post.php?action=delete-post&amp;post=$attachment_id", 'delete-post_' . $attachment_id);
	if ( $send )
		$send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . attribute_escape( __( 'Insert into Post' ) ) . "' />";
	if ( $delete )
		$delete = "<a href=\"#\" class=\"del-link\" onclick=\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\">" . __('Delete') . "</a>";
	if ( ( $send || $delete ) && !isset($form_fields['buttons']) )
		$form_fields['buttons'] = array('tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>$send $delete
		<div id=\"del_attachment_$attachment_id\" class=\"del-attachment\" style=\"display:none;\">" . sprintf(__("You are about to delete <strong>%s</strong>."), $filename) . " <a href=\"$delete_href\" id=\"del[$attachment_id]\" class=\"delete\">" . __('Continue') . "</a>
		<a href=\"#\" class=\"del-link\" onclick=\"this.parentNode.style.display='none';return false;\">" . __('Cancel') . "</a></div></td></tr>\n");

	$hidden_fields = array();

	foreach ( $form_fields as $id => $field ) {
		if ( $id{0} == '_' )
			continue;

		if ( !empty($field['tr']) ) {
			$item .= $field['tr'];
			continue;
		}

		$field = array_merge($defaults, $field);
		$name = "attachments[$attachment_id][$id]";

		if ( $field['input'] == 'hidden' ) {
			$hidden_fields[$name] = $field['value'];
			continue;
		}

		$required = $field['required'] ? '<abbr title="required" class="required">*</abbr>' : '';
		$aria_required = $field['required'] ? " aria-required='true' " : '';
		$class  = $id;
		$class .= $field['required'] ? ' form-required' : '';

		$item .= "\t\t<tr class='$class'>\n\t\t\t<th valign='top' scope='row' class='label'><label for='$name'><span class='alignleft'>{$field['label']}</span><span class='alignright'>$required</span><br class='clear' /></label></th>\n\t\t\t<td class='field'>";
		if ( !empty($field[$field['input']]) )
			$item .= $field[$field['input']];
		elseif ( $field['input'] == 'textarea' ) {
			$item .= "<textarea type='text' id='$name' name='$name'>" . attribute_escape( $field['value'] ) . $aria_required . "</textarea>";
		} else {
			$item .= "<input type='text' id='$name' name='$name' value='" . attribute_escape( $field['value'] ) . "'" . $aria_required . "/>";
		}
		if ( !empty($field['helps']) )
			$item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique((array) $field['helps']) ) . '</p>';
		$item .= "</td>\n\t\t</tr>\n";

		$extra_rows = array();

		if ( !empty($field['errors']) )
			foreach ( array_unique((array) $field['errors']) as $error )
				$extra_rows['error'][] = $error;

		if ( !empty($field['extra_rows']) )
			foreach ( $field['extra_rows'] as $class => $rows )
				foreach ( (array) $rows as $html )
					$extra_rows[$class][] = $html;

		foreach ( $extra_rows as $class => $rows )
			foreach ( $rows as $html )
				$item .= "\t\t<tr><td></td><td class='$class'>$html</td></tr>\n";
	}

	if ( !empty($form_fields['_final']) )
		$item .= "\t\t<tr class='final'><td colspan='2'>{$form_fields['_final']}</td></tr>\n";
	$item .= "\t</tbody>\n";
	$item .= "\t</table>\n";

	foreach ( $hidden_fields as $name => $value )
		$item .= "\t<input type='hidden' name='$name' id='$name' value='" . attribute_escape( $value ) . "' />\n";

	return $item;
}

function media_upload_header() {
	?>
	<script type="text/javascript">post_id = <?php echo intval($_REQUEST['post_id']); ?>;</script>
	<div id="media-upload-header">
	<?php the_media_upload_tabs(); ?>
	</div>
	<?php
}

function media_upload_form( $errors = null ) {
	global $type, $tab;

	$flash_action_url = admin_url('async-upload.php');

	// If Mac and mod_security, no Flash. :(
	$flash = true;
	if ( false !== strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'mac') && apache_mod_loaded('mod_security') )
		$flash = false;

	$flash = apply_filters('flash_uploader', $flash);
	$post_id = intval($_REQUEST['post_id']);

?>
<div id="media-upload-notice">
<?php if (isset($errors['upload_notice']) ) { ?>
	<?php echo $errors['upload_notice']; ?>
<?php } ?>
</div>
<div id="media-upload-error">
<?php if (isset($errors['upload_error']) && is_wp_error($errors['upload_error'])) { ?>
	<?php echo $errors['upload_error']->get_error_message(); ?>
<?php } ?>
</div>

<?php do_action('pre-upload-ui'); ?>

<?php if ( $flash ) : ?>
<script type="text/javascript">
<!--
jQuery(function($){
	swfu = new SWFUpload({
			upload_url : "<?php echo attribute_escape( $flash_action_url ); ?>",
			flash_url : "<?php echo includes_url('js/swfupload/swfupload_f9.swf'); ?>",
			file_post_name: "async-upload",
			file_types: "<?php echo apply_filters('upload_file_glob', '*.*'); ?>",
			post_params : {
				"post_id" : "<?php echo $post_id; ?>",
				"auth_cookie" : "<?php if ( is_ssl() ) echo $_COOKIE[SECURE_AUTH_COOKIE]; else echo $_COOKIE[AUTH_COOKIE]; ?>",
				"_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>",
				"type" : "<?php echo $type; ?>",
				"tab" : "<?php echo $tab; ?>",
				"short" : "1"
			},
			file_size_limit : "<?php echo wp_max_upload_size(); ?>b",
			swfupload_element_id : "flash-upload-ui", // id of the element displayed when swfupload is available
			degraded_element_id : "html-upload-ui",   // when swfupload is unavailable
			file_dialog_start_handler : fileDialogStart,
			file_queued_handler : fileQueued,
			upload_start_handler : uploadStart,
			upload_progress_handler : uploadProgress,
			upload_error_handler : uploadError,
			upload_success_handler : uploadSuccess,
			upload_complete_handler : uploadComplete,
			file_queue_error_handler : fileQueueError,
			file_dialog_complete_handler : fileDialogComplete,

			debug: false
		});
	$("#flash-browse-button").bind( "click", function(){swfu.selectFiles();});
});
//-->
</script>

<div id="flash-upload-ui">
<?php do_action('pre-flash-upload-ui'); ?>
	<p><input id="flash-browse-button" type="button" value="<?php echo attribute_escape( __( 'Choose files to upload' ) ); ?>" class="button" /></p>
<?php do_action('post-flash-upload-ui'); ?>
	<p class="howto"><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p>
</div>

<?php endif; // $flash ?>

<div id="html-upload-ui">
<?php do_action('pre-html-upload-ui'); ?>
	<p>
	<input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php echo attribute_escape(__('Upload')); ?>" /> <a href="#" onclick="return top.tb_remove();"><?php _e('Cancel'); ?></a>
	</p>
	<br class="clear" />
	<?php if ( is_lighttpd_before_150() ): ?>
	<p><?php _e('If you want to use all capabilities of the uploader, like uploading multiple files at once, please upgrade to lighttpd 1.5.'); ?></p>
	<?php endif;?>
<?php do_action('post-html-upload-ui'); ?>
</div>
<?php do_action('post-upload-ui'); ?>
<?php
}

function media_upload_type_form($type = 'file', $errors = null, $id = null) {
	media_upload_header();

	$post_id = intval($_REQUEST['post_id']);

	$form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id");
	$form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);

	$callback = "type_form_$type";
?>

<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form type-form validate" id="<?php echo $type; ?>-form">
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
<?php wp_nonce_field('media-form'); ?>
<h3><?php _e('From Computer'); ?></h3>
<?php media_upload_form( $errors ); ?>

<script type="text/javascript">
<!--
jQuery(function($){
	var preloaded = $(".media-item.preloaded");
	if ( preloaded.length > 0 ) {
		preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
	}
	updateMediaForm();
});
-->
</script>
<?php if ( $id && !is_wp_error($id) ) : ?>
<div id="media-items">
<?php echo get_media_items( $id, $errors ); ?>
</div>
<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />

<?php elseif ( is_callable($callback) ) : ?>

<div class="media-blank">
<p style="text-align:center"><?php _e('&mdash; OR &mdash;'); ?></p>
<h3><?php _e('From URL'); ?></h3>
</div>

<script type="text/javascript">
//<![CDATA[
var addExtImage = {

	width : '',
	height : '',
	align : 'alignnone',

	insert : function() {
		var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = null;

		if ( '' == f.src.value || '' == t.width ) return false;

		if ( f.title.value ) {
			title = f.title.value.replace(/['"<>]+/g, '');
			title = ' title="'+title+'"';
		}

		if ( f.alt.value ) {
			alt = f.alt.value.replace(/['"<>]+/g, '');
<?php if ( ! apply_filters( 'disable_captions', '' ) ) { ?>
			caption = f.alt.value.replace(/'/g, '&#39;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
<?php } ?>
		}

		cls = caption ? '' : ' class="'+t.align+'"';

		html = '<img alt="'+alt+'" src="'+f.src.value+'"'+title+cls+' width="'+t.width+'" height="'+t.height+'" />';

		if ( f.url.value )
			html = '<a href="'+f.url.value+'">'+html+'</a>';

		if ( caption )
			html = '[caption id="" align="'+t.align+'" width="'+t.width+'" caption="'+caption+'"]'+html+'[/caption]';

		var win = window.dialogArguments || opener || parent || top;
		win.send_to_editor(html);
	},

	resetImageData : function() {
		var t = addExtImage;

		t.width = t.height = '';
		document.getElementById('go_button').style.color = '#bbb';
		if ( ! document.forms[0].src.value )
			document.getElementById('status_img').src = 'images/required.gif';
		else document.getElementById('status_img').src = 'images/no.png';
	},

	updateImageData : function() {
		var t = addExtImage;

		t.width = t.preloadImg.width;
		t.height = t.preloadImg.height;
		document.getElementById('go_button').style.color = '#333';
		document.getElementById('status_img').src = 'images/yes.png';
	},

	getImageData : function() {
		var t = addExtImage, src = document.forms[0].src.value;

		if ( ! src ) {
			t.resetImageData();
			return false;
		}
		document.getElementById('status_img').src = 'images/loading.gif';
		t.preloadImg = new Image();
		t.preloadImg.onload = t.updateImageData;
		t.preloadImg.onerror = t.resetImageData;
		t.preloadImg.src = src;
	}
}
//]]>
</script>

<div id="media-items">
<div class="media-item media-blank">
<?php echo call_user_func($callback); ?>
</div>
</div>
<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
</form>
<?php
	endif;
}

function media_upload_gallery_form($errors) {
	global $redir_tab;

	$redir_tab = 'gallery';
	media_upload_header();

	$post_id = intval($_REQUEST['post_id']);
	$form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=gallery&post_id=$post_id");
?>

<script type="text/javascript">
<!--
jQuery(function($){
	var preloaded = $(".media-item.preloaded");
	if ( preloaded.length > 0 ) {
		preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
		updateMediaForm();
	}
});
-->
</script>

<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form validate" id="gallery-form">
<?php wp_nonce_field('media-form'); ?>
<?php //media_upload_form( $errors ); ?>
<table class="widefat">
<thead><tr>
<th><?php _e('Media'); ?></th>
<th class="order-head"><?php _e('Order'); ?></th>
</tr></thead>
</table>
<div id="media-items">
<?php echo get_media_items($post_id, $errors); ?>
</div>
<p class="ml-submit">
<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
<input type="submit" class="button insert-gallery" name="insert-gallery" value="<?php echo attribute_escape( __( 'Insert gallery into post' ) ); ?>" />
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
<input type="hidden" name="type" value="<?php echo attribute_escape( $GLOBALS['type'] ); ?>" />
<input type="hidden" name="tab" value="<?php echo attribute_escape( $GLOBALS['tab'] ); ?>" />
</p>
</form>
<?php
}

function media_upload_library_form($errors) {
	global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;

	media_upload_header();

	$post_id = intval($_REQUEST['post_id']);

	$form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=library&post_id=$post_id");

	$_GET['paged'] = intval($_GET['paged']);
	if ( $_GET['paged'] < 1 )
		$_GET['paged'] = 1;
	$start = ( $_GET['paged'] - 1 ) * 10;
	if ( $start < 1 )
		$start = 0;
	add_filter( 'post_limits', $limit_filter = create_function( '$a', "return 'LIMIT $start, 10';" ) );

	list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();

?>

<form id="filter" action="" method="get">
<input type="hidden" name="type" value="<?php echo attribute_escape( $type ); ?>" />
<input type="hidden" name="tab" value="<?php echo attribute_escape( $tab ); ?>" />
<input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" />
<input type="hidden" name="post_mime_type" value="<?php echo attribute_escape( $_GET['post_mime_type'] ); ?>" />

<div id="search-filter">
	<label class="hidden" for="post-search-input"><?php _e('Search Media');?>:</label>
	<input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />
	<input type="submit" value="<?php echo attribute_escape( __( 'Search Media' ) ); ?>" class="button" />
</div>

<ul class="subsubsub">
<?php
$type_links = array();
$_num_posts = (array) wp_count_attachments();
$matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
foreach ( $matches as $_type => $reals )
	foreach ( $reals as $real )
		$num_posts[$_type] += $_num_posts[$real];
// If available type specified by media button clicked, filter by that type
if ( empty($_GET['post_mime_type']) && !empty($num_posts[$type]) ) {
	$_GET['post_mime_type'] = $type;
	list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
}
if ( empty($_GET['post_mime_type']) || $_GET['post_mime_type'] == 'all' )
	$class = ' class="current"';
$type_links[] = "<li><a href='" . clean_url(add_query_arg(array('post_mime_type'=>'all', 'paged'=>false, 'm'=>false))) . "'$class>".__('All Types')."</a>";
foreach ( $post_mime_types as $mime_type => $label ) {
	$class = '';

	if ( !wp_match_mime_types($mime_type, $avail_post_mime_types) )
		continue;

	if ( wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
		$class = ' class="current"';

	$type_links[] = "<li><a href='" . clean_url(add_query_arg(array('post_mime_type'=>$mime_type, 'paged'=>false))) . "'$class>" . sprintf(__ngettext($label[2][0], $label[2][1], $num_posts[$mime_type]), "<span id='$mime_type-counter'>" . number_format_i18n( $num_posts[$mime_type] ) . '</span>') . '</a>';
}
echo implode(' | </li>', $type_links) . '</li>';
unset($type_links);
?>
</ul>

<div class="tablenav">

<?php
$page_links = paginate_links( array(
	'base' => add_query_arg( 'paged', '%#%' ),
	'format' => '',
	'total' => ceil($wp_query->found_posts / 10),
	'current' => $_GET['paged']
));

if ( $page_links )
	echo "<div class='tablenav-pages'>$page_links</div>";
?>

<div class="alignleft">
<?php

$arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC";

$arc_result = $wpdb->get_results( $arc_query );

$month_count = count($arc_result);

if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ?>
<select name='m'>
<option<?php selected( @$_GET['m'], 0 ); ?> value='0'><?php _e('Show all dates'); ?></option>
<?php
foreach ($arc_result as $arc_row) {
	if ( $arc_row->yyear == 0 )
		continue;
	$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );

	if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] )
		$default = ' selected="selected"';
	else
		$default = '';

	echo "<option$default value='" . attribute_escape( $arc_row->yyear . $arc_row->mmonth ) . "'>";
	echo wp_specialchars( $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear" );
	echo "</option>\n";
}
?>
</select>
<?php } ?>

<input type="submit" id="post-query-submit" value="<?php echo attribute_escape( __( 'Filter &#187;' ) ); ?>" class="button-secondary" />

</div>

<br class="clear" />
</div>
</form>

<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form validate" id="library-form">

<?php wp_nonce_field('media-form'); ?>
<?php //media_upload_form( $errors ); ?>

<script type="text/javascript">
<!--
jQuery(function($){
	var preloaded = $(".media-item.preloaded");
	if ( preloaded.length > 0 ) {
		preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
		updateMediaForm();
	}
});
-->
</script>

<div id="media-items">
<?php echo get_media_items(null, $errors); ?>
</div>
<p class="ml-submit">
<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
</p>
</form>
<?php
}

function type_form_image() {

	if ( apply_filters( 'disable_captions', '' ) ) {
		$alt = __('Alternate Text');
		$alt_help = __('Alt text for the image, e.g. "The Mona Lisa"');
	} else {
		$alt = __('Image Caption');
		$alt_help = __('Also used as alternate text for the image');
	}

	return '
	<table class="describe"><tbody>
		<tr>
			<th valign="top" scope="row" class="label" style="width:120px;">
				<span class="alignleft"><label for="src">' . __('Source') . '</label></span>
				<span class="alignright"><img id="status_img" src="images/required.gif" title="required" alt="required" /></span>
			</th>
			<td class="field"><input id="src" name="src" value="" type="text" aria-required="true" onblur="addExtImage.getImageData()" /></td>
		</tr>

		<tr>
			<th valign="top" scope="row" class="label">
				<span class="alignleft"><label for="title">' . __('Image Title') . '</label></span>
				<span class="alignright"><abbr title="required" class="required">*</abbr></span>
			</th>
			<td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td>
		</tr>

		<tr>
			<th valign="top" scope="row" class="label">
				<span class="alignleft"><label for="alt">' . $alt . '</label></span>
			</th>
			<td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" />
			<p class="help">' . $alt_help . '</p></td>
		</tr>

		<tr class="align">
			<th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th>
			<td class="field">
				<input name="align" id="align-none" value="alignnone" onclick="addExtImage.align=this.value" type="radio" checked="checked" />
				<label for="align-none" class="align image-align-none-label">' . __('None') . '</label>
				<input name="align" id="align-left" value="alignleft" onclick="addExtImage.align=this.value" type="radio" />
				<label for="align-left" class="align image-align-left-label">' . __('Left') . '</label>
				<input name="align" id="align-center" value="aligncenter" onclick="addExtImage.align=this.value" type="radio" />
				<label for="align-center" class="align image-align-center-label">' . __('Center') . '</label>
				<input name="align" id="align-right" value="alignright" onclick="addExtImage.align=this.value" type="radio" />
				<label for="align-right" class="align image-align-right-label">' . __('Right') . '</label>
			</td>
		</tr>

		<tr>
			<th valign="top" scope="row" class="label">
				<span class="alignleft"><label for="url">' . __('Link URL') . '</label></span>
			</th>
			<td class="field"><input id="url" name="url" value="" type="text" /><br />

			<button type="button" class="button" value="" onclick="document.forms[0].url.value=null">' . __('None') . '</button>
			<button type="button" class="button" value="" onclick="document.forms[0].url.value=document.forms[0].src.value">' . __('Link to image') . '</button>
			<p class="help">' . __('Enter a link URL or click above for presets.') . '</p></td>
		</tr>

		<tr>
			<td></td>
			<td>
				<input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . attribute_escape(__('Insert into Post')) . '" />
			</td>
		</tr>
	</tbody></table>
';

}

function type_form_audio() {
	return '
	<table class="describe"><tbody>
		<tr>
			<th valign="top" scope="row" class="label">
				<span class="alignleft"><label for="insertonly[href]">' . __('Audio File URL') . '</label></span>
				<span class="alignright"><abbr title="required" class="required">*</abbr></span>
			</th>
			<td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
		</tr>
		<tr>
			<th valign="top" scope="row" class="label">
				<span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span>
				<span class="alignright"><abbr title="required" class="required">*</abbr></span>
			</th>
			<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
		</tr>
		<tr><td></td><td class="help">' . __('Link text, e.g. "Still Alive by Jonathan Coulton"') . '</td></tr>
		<tr>
			<td></td>
			<td>
				<input type="submit" class="button" name="insertonlybutton" value="' . attribute_escape(__('Insert into Post')) . '" />
			</td>
		</tr>
	</tbody></table>
';
}

function type_form_video() {
	return '
	<table class="describe"><tbody>
		<tr>
			<th valign="top" scope="row" class="label">
				<span class="alignleft"><label for="insertonly[href]">' . __('Video URL') . '</label></span>
				<span class="alignright"><abbr title="required" class="required">*</abbr></span>
			</th>
			<td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
		</tr>
		<tr>
			<th valign="top" scope="row" class="label">
				<span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span>
				<span class="alignright"><abbr title="required" class="required">*</abbr></span>
			</th>
			<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
		</tr>
		<tr><td></td><td class="help">' . __('Link text, e.g. "Lucy on YouTube"') . '</td></tr>
		<tr>
			<td></td>
			<td>
				<input type="submit" class="button" name="insertonlybutton" value="' . attribute_escape(__('Insert into Post')) . '" />
			</td>
		</tr>
	</tbody></table>
';
}

function type_form_file() {
	return '
	<table class="describe"><tbody>
		<tr>
			<th valign="top" scope="row" class="label">
				<span class="alignleft"><label for="insertonly[href]">' . __('URL') . '</label></span>
				<span class="alignright"><abbr title="required" class="required">*</abbr></span>
			</th>
			<td class="field"><input id="insertonly[href]" name="insertonly[href]" value="" type="text" aria-required="true"></td>
		</tr>
		<tr>
			<th valign="top" scope="row" class="label">
				<span class="alignleft"><label for="insertonly[title]">' . __('Title') . '</label></span>
				<span class="alignright"><abbr title="required" class="required">*</abbr></span>
			</th>
			<td class="field"><input id="insertonly[title]" name="insertonly[title]" value="" type="text" aria-required="true"></td>
		</tr>
		<tr><td></td><td class="help">' . __('Link text, e.g. "Ransom Demands (PDF)"') . '</td></tr>
		<tr>
			<td></td>
			<td>
				<input type="submit" class="button" name="insertonlybutton" value="' . attribute_escape(__('Insert into Post')) . '" />
			</td>
		</tr>
	</tbody></table>
';
}

// support a GET parameter for disabling the flash uploader
function media_upload_use_flash($flash) {
        if ( array_key_exists('flash', $_REQUEST) )
                $flash = !empty($_REQUEST['flash']);
        return $flash;
}

add_filter('flash_uploader', 'media_upload_use_flash');

function media_upload_flash_bypass() {
        echo '<p class="upload-flash-bypass">';
        printf( __('You are using the Flash uploader.  Problems?  Try the <a href="%s">Browser uploader</a> instead.'), clean_url(add_query_arg('flash', 0)) );
        echo '</p>';
}

add_action('post-flash-upload-ui', 'media_upload_flash_bypass');

function media_upload_html_bypass() {
        echo '<p class="upload-html-bypass">';
        if ( array_key_exists('flash', $_REQUEST) )
                // the user manually selected the browser uploader, so let them switch back to Flash
                printf( __('You are using the Browser uploader.  Try the <a href="%s">Flash uploader</a> instead.'), clean_url(add_query_arg('flash', 1)) );
        else
                // the user probably doesn't have Flash
                printf( __('You are using the Browser uploader.') );

        echo '</p>';
}

add_action('post-flash-upload-ui', 'media_upload_flash_bypass');
add_action('post-html-upload-ui', 'media_upload_html_bypass');

// make sure the GET parameter sticks when we submit a form
function media_upload_bypass_url($url) {
        if ( array_key_exists('flash', $_REQUEST) )
                $url = add_query_arg('flash', intval($_REQUEST['flash']));
        return $url;
}

add_filter('media_upload_form_url', 'media_upload_bypass_url');



add_filter('async_upload_image', 'get_media_item', 10, 2);
add_filter('async_upload_audio', 'get_media_item', 10, 2);
add_filter('async_upload_video', 'get_media_item', 10, 2);
add_filter('async_upload_file', 'get_media_item', 10, 2);

add_action('media_upload_image', 'media_upload_image');
add_action('media_upload_audio', 'media_upload_audio');
add_action('media_upload_video', 'media_upload_video');
add_action('media_upload_file', 'media_upload_file');

add_filter('media_upload_gallery', 'media_upload_gallery');

add_filter('media_upload_library', 'media_upload_library');

?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                         blog/wp-admin/includes/misc.php                                                                     0000755 0023433 0004734 00000010575 11060470737 016357  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

function got_mod_rewrite() {
	$got_rewrite = apache_mod_loaded('mod_rewrite', true);
	return apply_filters('got_rewrite', $got_rewrite);
}

// Returns an array of strings from a file (.htaccess ) from between BEGIN
// and END markers.
function extract_from_markers( $filename, $marker ) {
	$result = array ();

	if (!file_exists( $filename ) ) {
		return $result;
	}

	if ( $markerdata = explode( "\n", implode( '', file( $filename ) ) ));
	{
		$state = false;
		foreach ( $markerdata as $markerline ) {
			if (strpos($markerline, '# END ' . $marker) !== false)
				$state = false;
			if ( $state )
				$result[] = $markerline;
			if (strpos($markerline, '# BEGIN ' . $marker) !== false)
				$state = true;
		}
	}

	return $result;
}

// Inserts an array of strings into a file (.htaccess ), placing it between
// BEGIN and END markers.  Replaces existing marked info.  Retains surrounding
// data.  Creates file if none exists.
// Returns true on write success, false on failure.
function insert_with_markers( $filename, $marker, $insertion ) {
	if (!file_exists( $filename ) || is_writeable( $filename ) ) {
		if (!file_exists( $filename ) ) {
			$markerdata = '';
		} else {
			$markerdata = explode( "\n", implode( '', file( $filename ) ) );
		}

		$f = fopen( $filename, 'w' );
		$foundit = false;
		if ( $markerdata ) {
			$state = true;
			foreach ( $markerdata as $n => $markerline ) {
				if (strpos($markerline, '# BEGIN ' . $marker) !== false)
					$state = false;
				if ( $state ) {
					if ( $n + 1 < count( $markerdata ) )
						fwrite( $f, "{$markerline}\n" );
					else
						fwrite( $f, "{$markerline}" );
				}
				if (strpos($markerline, '# END ' . $marker) !== false) {
					fwrite( $f, "# BEGIN {$marker}\n" );
					if ( is_array( $insertion ))
						foreach ( $insertion as $insertline )
							fwrite( $f, "{$insertline}\n" );
					fwrite( $f, "# END {$marker}\n" );
					$state = true;
					$foundit = true;
				}
			}
		}
		if (!$foundit) {
			fwrite( $f, "\n# BEGIN {$marker}\n" );
			foreach ( $insertion as $insertline )
				fwrite( $f, "{$insertline}\n" );
			fwrite( $f, "# END {$marker}\n" );
		}
		fclose( $f );
		return true;
	} else {
		return false;
	}
}

/**
 * Updates the htaccess file with the current rules if it is writable.
 *
 * Always writes to the file if it exists and is writable to ensure that we blank out old rules.
 */

function save_mod_rewrite_rules() {
	global $wp_rewrite;

	$home_path = get_home_path();
	$htaccess_file = $home_path.'.htaccess';

	// If the file doesn't already exists check for write access to the directory and whether of not we have some rules.
	// else check for write access to the file.
	if ((!file_exists($htaccess_file) && is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks()) || is_writable($htaccess_file)) {
		if ( got_mod_rewrite() ) {
			$rules = explode( "\n", $wp_rewrite->mod_rewrite_rules() );
			return insert_with_markers( $htaccess_file, 'WordPress', $rules );
		}
	}

	return false;
}

function update_recently_edited( $file ) {
	$oldfiles = (array ) get_option( 'recently_edited' );
	if ( $oldfiles ) {
		$oldfiles = array_reverse( $oldfiles );
		$oldfiles[] = $file;
		$oldfiles = array_reverse( $oldfiles );
		$oldfiles = array_unique( $oldfiles );
		if ( 5 < count( $oldfiles ))
			array_pop( $oldfiles );
	} else {
		$oldfiles[] = $file;
	}
	update_option( 'recently_edited', $oldfiles );
}

// If siteurl or home changed, flush rewrite rules.
function update_home_siteurl( $old_value, $value ) {
	global $wp_rewrite;

	if ( defined( "WP_INSTALLING" ) )
		return;

	// If home changed, write rewrite rules to new location.
	$wp_rewrite->flush_rules();
}

add_action( 'update_option_home', 'update_home_siteurl', 10, 2 );
add_action( 'update_option_siteurl', 'update_home_siteurl', 10, 2 );

function url_shorten( $url ) {
	$short_url = str_replace( 'http://', '', stripslashes( $url ));
	$short_url = str_replace( 'www.', '', $short_url );
	if ('/' == substr( $short_url, -1 ))
		$short_url = substr( $short_url, 0, -1 );
	if ( strlen( $short_url ) > 35 )
		$short_url = substr( $short_url, 0, 32 ).'...';
	return $short_url;
}

function wp_reset_vars( $vars ) {
	for ( $i=0; $i<count( $vars ); $i += 1 ) {
		$var = $vars[$i];
		global $$var;

		if (!isset( $$var ) ) {
			if ( empty( $_POST["$var"] ) ) {
				if ( empty( $_GET["$var"] ) )
					$$var = '';
				else
					$$var = $_GET["$var"];
			} else {
				$$var = $_POST["$var"];
			}
		}
	}
}

?>
                                                                                                                                   blog/wp-admin/includes/plugin.php                                                                   0000755 0023433 0004734 00000037400 11060470740 016710  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

function get_plugin_data( $plugin_file ) {
	$plugin_data = implode( '', file( $plugin_file ));
	preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $plugin_name );
	preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $plugin_uri );
	preg_match( '|Description:(.*)$|mi', $plugin_data, $description );
	preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
	preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri );

	if ( preg_match( "|Version:(.*)|i", $plugin_data, $version ))
		$version = trim( $version[1] );
	else
		$version = '';

	$description = wptexturize( trim( $description[1] ));

	$name = $plugin_name[1];
	$name = trim( $name );
	$plugin = $name;
	if ('' != trim($plugin_uri[1]) && '' != $name ) {
		$plugin = '<a href="' . trim( $plugin_uri[1] ) . '" title="'.__( 'Visit plugin homepage' ).'">'.$plugin.'</a>';
	}

	if ('' == $author_uri[1] ) {
		$author = trim( $author_name[1] );
	} else {
		$author = '<a href="' . trim( $author_uri[1] ) . '" title="'.__( 'Visit author homepage' ).'">' . trim( $author_name[1] ) . '</a>';
	}

	return array('Name' => $name, 'Title' => $plugin, 'Description' => $description, 'Author' => $author, 'Version' => $version);
}

function get_plugins($plugin_folder = '') {
	
	if ( ! $cache_plugins = wp_cache_get('plugins', 'plugins') )
		$cache_plugins = array();
	
	if ( isset($cache_plugins[ $plugin_folder ]) )
		return $cache_plugins[ $plugin_folder ];
	
	$wp_plugins = array ();
	$plugin_root = WP_PLUGIN_DIR;
	if( !empty($plugin_folder) )
		$plugin_root .= $plugin_folder;

	// Files in wp-content/plugins directory
	$plugins_dir = @ opendir( $plugin_root);
	if ( $plugins_dir ) {
		while (($file = readdir( $plugins_dir ) ) !== false ) {
			if ( substr($file, 0, 1) == '.' )
				continue;
			if ( is_dir( $plugin_root.'/'.$file ) ) {
				$plugins_subdir = @ opendir( $plugin_root.'/'.$file );
				if ( $plugins_subdir ) {
					while (($subfile = readdir( $plugins_subdir ) ) !== false ) {
						if ( substr($subfile, 0, 1) == '.' )
							continue;
						if ( substr($subfile, -4) == '.php' )
							$plugin_files[] = "$file/$subfile";
					}
				}
			} else {
				if ( substr($file, -4) == '.php' )
					$plugin_files[] = $file;
			}
		}
	}
	@closedir( $plugins_dir );
	@closedir( $plugins_subdir );

	if ( !$plugins_dir || !$plugin_files )
		return $wp_plugins;

	foreach ( $plugin_files as $plugin_file ) {
		if ( !is_readable( "$plugin_root/$plugin_file" ) )
			continue;

		$plugin_data = get_plugin_data( "$plugin_root/$plugin_file" );

		if ( empty ( $plugin_data['Name'] ) )
			continue;

		$wp_plugins[plugin_basename( $plugin_file )] = $plugin_data;
	}

	uasort( $wp_plugins, create_function( '$a, $b', 'return strnatcasecmp( $a["Name"], $b["Name"] );' ));

	$cache_plugins[ $plugin_folder ] = $wp_plugins; 
	wp_cache_set('plugins', $cache_plugins, 'plugins'); 

	return $wp_plugins;
}

function is_plugin_active($plugin){
	return in_array($plugin, get_option('active_plugins'));
}

function activate_plugin($plugin, $redirect = '') {
		$current = get_option('active_plugins');
		$plugin = trim($plugin);

		$valid = validate_plugin($plugin);
		if ( is_wp_error($valid) )
			return $valid;

		if ( !in_array($plugin, $current) ) {
			if ( !empty($redirect) )
				wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error
			ob_start();
			@include(WP_PLUGIN_DIR . '/' . $plugin);
			$current[] = $plugin;
			sort($current);
			update_option('active_plugins', $current);
			do_action('activate_' . $plugin);
			ob_end_clean();
		}

		return null;
}

function deactivate_plugins($plugins, $silent= false) {
	$current = get_option('active_plugins');

	if ( !is_array($plugins) )
		$plugins = array($plugins);

	foreach ( $plugins as $plugin ) {
		if( ! is_plugin_active($plugin) )
			continue;
		array_splice($current, array_search( $plugin, $current), 1 ); // Fixed Array-fu!
		if ( ! $silent ) //Used by Plugin updater to internally deactivate plugin, however, not to notify plugins of the fact to prevent plugin output.
			do_action('deactivate_' . trim( $plugin ));
	}

	update_option('active_plugins', $current);
}

function activate_plugins($plugins, $redirect = '') {
	if ( !is_array($plugins) )
		$plugins = array($plugins);

	$errors = array();
	foreach ( (array) $plugins as $plugin ) {
		if ( !empty($redirect) )
			$redirect = add_query_arg('plugin', $plugin, $redirect);
		$result = activate_plugin($plugin, $redirect);
		if ( is_wp_error($result) )
			$errors[$plugin] = $result;
	}

	if ( !empty($errors) )
		return new WP_Error('plugins_invalid', __('One of the plugins is invalid.'), $errors);

	return true;
}

function delete_plugins($plugins, $redirect = '' ) {
	global $wp_filesystem;

	if( empty($plugins) )
		return false;

	$checked = array();
	foreach( $plugins as $plugin )
		$checked[] = 'checked[]=' . $plugin;

	ob_start();
	$url = wp_nonce_url('plugins.php?action=delete-selected&verify-delete=1&' . implode('&', $checked), 'bulk-manage-plugins');
	if ( false === ($credentials = request_filesystem_credentials($url)) ) {
		$data = ob_get_contents();
		ob_end_clean();
		if( ! empty($data) ){
			include_once( ABSPATH . 'wp-admin/admin-header.php');
			echo $data;
			include( ABSPATH . 'wp-admin/admin-footer.php');
			exit;
		}
		return;
	}

	if ( ! WP_Filesystem($credentials) ) {
		request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again
		$data = ob_get_contents();
		ob_end_clean();
		if( ! empty($data) ){
			include_once( ABSPATH . 'wp-admin/admin-header.php');
			echo $data;
			include( ABSPATH . 'wp-admin/admin-footer.php');
			exit;
		}
		return;
	}

	if ( $wp_filesystem->errors->get_error_code() ) {
		return $wp_filesystem->errors;
	}

	if ( ! is_object($wp_filesystem) )
		return new WP_Error('fs_unavailable', __('Could not access filesystem.'));

	if ( $wp_filesystem->errors->get_error_code() )
		return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors);

	//Get the base plugin folder
	$plugins_dir = $wp_filesystem->wp_plugins_dir();
	if ( empty($plugins_dir) )
		return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.'));
	
	$plugins_dir = trailingslashit( $plugins_dir );

	$errors = array();

	foreach( $plugins as $plugin_file ) {
		$this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin_file) );
		// If plugin is in its own directory, recursively delete the directory.
		if ( strpos($plugin_file, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder
			$deleted = $wp_filesystem->delete($this_plugin_dir, true);
		else
			$deleted = $wp_filesystem->delete($plugins_dir . $plugin_file);
	
		if ( ! $deleted )
			$errors[] = $plugin_file;
	}
	
	if( ! empty($errors) )
		return new WP_Error('could_not_remove_plugin', sprintf(__('Could not fully remove the plugin(s) %s'), implode(', ', $errors)) );
	
	return true;
}

function validate_active_plugins() {
	$check_plugins = get_option('active_plugins');

	// Sanity check.  If the active plugin list is not an array, make it an
	// empty array.
	if ( !is_array($check_plugins) ) {
		update_option('active_plugins', array());
		return;
	}

	//Invalid is any plugin that is deactivated due to error.
	$invalid = array(); 

	// If a plugin file does not exist, remove it from the list of active
	// plugins.
	foreach ( $check_plugins as $check_plugin ) {
		$result = validate_plugin($check_plugin);
		if ( is_wp_error( $result ) ) {
			$invalid[$check_plugin] = $result;
			deactivate_plugins( $check_plugin, true);
		}
	}
	return $invalid;
}

function validate_plugin($plugin) {
	if ( validate_file($plugin) )
		return new WP_Error('plugin_invalid', __('Invalid plugin.'));
	if ( ! file_exists(WP_PLUGIN_DIR . '/' . $plugin) )
		return new WP_Error('plugin_not_found', __('Plugin file does not exist.'));

	return 0;
}

//
// Menu
//

function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
	global $menu, $admin_page_hooks;

	$file = plugin_basename( $file );

	$menu[] = array ( $menu_title, $access_level, $file, $page_title );

	$admin_page_hooks[$file] = sanitize_title( $menu_title );

	$hookname = get_plugin_page_hookname( $file, '' );
	if (!empty ( $function ) && !empty ( $hookname ))
		add_action( $hookname, $function );

	return $hookname;
}

function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function = '' ) {
	global $submenu;
	global $menu;
	global $_wp_real_parent_file;
	global $_wp_submenu_nopriv;

	$file = plugin_basename( $file );

	$parent = plugin_basename( $parent);
	if ( isset( $_wp_real_parent_file[$parent] ) )
		$parent = $_wp_real_parent_file[$parent];

	if ( !current_user_can( $access_level ) ) {
		$_wp_submenu_nopriv[$parent][$file] = true;
		return false;
	}

	// If the parent doesn't already have a submenu, add a link to the parent
	// as the first item in the submenu.  If the submenu file is the same as the
	// parent file someone is trying to link back to the parent manually.  In
	// this case, don't automatically add a link back to avoid duplication.
	if (!isset( $submenu[$parent] ) && $file != $parent  ) {
		foreach ( $menu as $parent_menu ) {
			if ( $parent_menu[2] == $parent && current_user_can( $parent_menu[1] ) )
				$submenu[$parent][] = $parent_menu;
		}
	}

	$submenu[$parent][] = array ( $menu_title, $access_level, $file, $page_title );

	$hookname = get_plugin_page_hookname( $file, $parent);
	if (!empty ( $function ) && !empty ( $hookname ))
		add_action( $hookname, $function );

	return $hookname;
}

function add_management_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
	return add_submenu_page( 'edit.php', $page_title, $menu_title, $access_level, $file, $function );
}

function add_options_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
	return add_submenu_page( 'options-general.php', $page_title, $menu_title, $access_level, $file, $function );
}

function add_theme_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
	return add_submenu_page( 'themes.php', $page_title, $menu_title, $access_level, $file, $function );
}

function add_users_page( $page_title, $menu_title, $access_level, $file, $function = '' ) {
	if ( current_user_can('edit_users') )
		$parent = 'users.php';
	else
		$parent = 'profile.php';
	return add_submenu_page( $parent, $page_title, $menu_title, $access_level, $file, $function );
}

//
// Pluggable Menu Support -- Private
//

function get_admin_page_parent() {
	global $parent_file;
	global $menu;
	global $submenu;
	global $pagenow;
	global $plugin_page;
	global $_wp_real_parent_file;
	global $_wp_menu_nopriv;
	global $_wp_submenu_nopriv;

	if ( !empty ( $parent_file ) ) {
		if ( isset( $_wp_real_parent_file[$parent_file] ) )
			$parent_file = $_wp_real_parent_file[$parent_file];

		return $parent_file;
	}

	if ( $pagenow == 'admin.php' && isset( $plugin_page ) ) {
		foreach ( $menu as $parent_menu ) {
			if ( $parent_menu[2] == $plugin_page ) {
				$parent_file = $plugin_page;
				if ( isset( $_wp_real_parent_file[$parent_file] ) )
					$parent_file = $_wp_real_parent_file[$parent_file];
				return $parent_file;
			}
		}
		if ( isset( $_wp_menu_nopriv[$plugin_page] ) ) {
			$parent_file = $plugin_page;
			if ( isset( $_wp_real_parent_file[$parent_file] ) )
					$parent_file = $_wp_real_parent_file[$parent_file];
			return $parent_file;
		}
	}

	if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) ) {
		$parent_file = $pagenow;
		if ( isset( $_wp_real_parent_file[$parent_file] ) )
			$parent_file = $_wp_real_parent_file[$parent_file];
		return $parent_file;
	}

	foreach (array_keys( $submenu ) as $parent) {
		foreach ( $submenu[$parent] as $submenu_array ) {
			if ( isset( $_wp_real_parent_file[$parent] ) )
				$parent = $_wp_real_parent_file[$parent];
			if ( $submenu_array[2] == $pagenow ) {
				$parent_file = $parent;
				return $parent;
			} else
				if ( isset( $plugin_page ) && ($plugin_page == $submenu_array[2] ) ) {
					$parent_file = $parent;
					return $parent;
				}
		}
	}

	$parent_file = '';
	return '';
}

function get_admin_page_title() {
	global $title;
	global $menu;
	global $submenu;
	global $pagenow;
	global $plugin_page;

	if ( isset( $title ) && !empty ( $title ) ) {
		return $title;
	}

	$hook = get_plugin_page_hook( $plugin_page, $pagenow );

	$parent = $parent1 = get_admin_page_parent();
	if ( empty ( $parent) ) {
		foreach ( $menu as $menu_array ) {
			if ( isset( $menu_array[3] ) ) {
				if ( $menu_array[2] == $pagenow ) {
					$title = $menu_array[3];
					return $menu_array[3];
				} else
					if ( isset( $plugin_page ) && ($plugin_page == $menu_array[2] ) && ($hook == $menu_array[3] ) ) {
						$title = $menu_array[3];
						return $menu_array[3];
					}
			} else {
				$title = $menu_array[0];
				return $title;
			}
		}
	} else {
		foreach (array_keys( $submenu ) as $parent) {
			foreach ( $submenu[$parent] as $submenu_array ) {
				if ( isset( $plugin_page ) &&
					($plugin_page == $submenu_array[2] ) &&
					(($parent == $pagenow ) || ($parent == $plugin_page ) || ($plugin_page == $hook ) || (($pagenow == 'admin.php' ) && ($parent1 != $submenu_array[2] ) ) )
					) {
						$title = $submenu_array[3];
						return $submenu_array[3];
					}

				if ( $submenu_array[2] != $pagenow || isset( $_GET['page'] ) ) // not the current page
					continue;

				if ( isset( $submenu_array[3] ) ) {
					$title = $submenu_array[3];
					return $submenu_array[3];
				} else {
					$title = $submenu_array[0];
					return $title;
				}
			}
		}
	}

	return $title;
}

function get_plugin_page_hook( $plugin_page, $parent_page ) {
	$hook = get_plugin_page_hookname( $plugin_page, $parent_page );
	if ( has_action($hook) )
		return $hook;
	else
		return null;
}

function get_plugin_page_hookname( $plugin_page, $parent_page ) {
	global $admin_page_hooks;

	$parent = get_admin_page_parent();

	$page_type = 'admin';
	if ( empty ( $parent_page ) || 'admin.php' == $parent_page ) {
		if ( isset( $admin_page_hooks[$plugin_page] ))
			$page_type = 'toplevel';
		else
			if ( isset( $admin_page_hooks[$parent] ))
				$page_type = $admin_page_hooks[$parent];
	} else if ( isset( $admin_page_hooks[$parent_page] ) ) {
		$page_type = $admin_page_hooks[$parent_page];
	}

	$plugin_name = preg_replace( '!\.php!', '', $plugin_page );

	return $page_type.'_page_'.$plugin_name;
}

function user_can_access_admin_page() {
	global $pagenow;
	global $menu;
	global $submenu;
	global $_wp_menu_nopriv;
	global $_wp_submenu_nopriv;
	global $plugin_page;

	$parent = get_admin_page_parent();

	if ( isset( $_wp_submenu_nopriv[$parent][$pagenow] ) )
		return false;

	if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) )
		return false;

	if ( empty( $parent) ) {
		if ( isset( $_wp_menu_nopriv[$pagenow] ) )
			return false;
		if ( isset( $_wp_submenu_nopriv[$pagenow][$pagenow] ) )
			return false;
		if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) )
			return false;
		foreach (array_keys( $_wp_submenu_nopriv ) as $key ) {
			if ( isset( $_wp_submenu_nopriv[$key][$pagenow] ) )
				return false;
			if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$key][$plugin_page] ) )
			return false;
		}
		return true;
	}

	if ( isset( $submenu[$parent] ) ) {
		foreach ( $submenu[$parent] as $submenu_array ) {
			if ( isset( $plugin_page ) && ( $submenu_array[2] == $plugin_page ) ) {
				if ( current_user_can( $submenu_array[1] ))
					return true;
				else
					return false;
			} else if ( $submenu_array[2] == $pagenow ) {
				if ( current_user_can( $submenu_array[1] ))
					return true;
				else
					return false;
			}
		}
	}

	foreach ( $menu as $menu_array ) {
		if ( $menu_array[2] == $parent) {
			if ( current_user_can( $menu_array[1] ))
				return true;
			else
				return false;
		}
	}

	return true;
}

?>
                                                                                                                                                                                                                                                                blog/wp-admin/includes/post.php                                                                     0000755 0023433 0004734 00000053623 11060470741 016405  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

/**
 * _wp_translate_postdata() - Rename $_POST data from form names to DB post columns.
 *
 * Manipulates $_POST directly.
 *
 * @package WordPress
 * @since 2.6
 *
 * @param bool $update Are we updating a pre-existing post?
 * @return object|bool WP_Error on failure, true on success.
 */
function _wp_translate_postdata( $update = false ) {
	if ( $update )
		$_POST['ID'] = (int) $_POST['post_ID'];
	$_POST['post_content'] = $_POST['content'];
	$_POST['post_excerpt'] = $_POST['excerpt'];
	$_POST['post_parent'] = isset($_POST['parent_id'])? $_POST['parent_id'] : '';
	$_POST['to_ping'] = $_POST['trackback_url'];

	if (!empty ( $_POST['post_author_override'] ) ) {
		$_POST['post_author'] = (int) $_POST['post_author_override'];
	} else {
		if (!empty ( $_POST['post_author'] ) ) {
			$_POST['post_author'] = (int) $_POST['post_author'];
		} else {
			$_POST['post_author'] = (int) $_POST['user_ID'];
		}
	}

	if ( $_POST['post_author'] != $_POST['user_ID'] ) {
		if ( 'page' == $_POST['post_type'] ) {
			if ( !current_user_can( 'edit_others_pages' ) ) {
				return new WP_Error( 'edit_others_pages', $update ?
					__( 'You are not allowed to edit pages as this user.' ) :
					__( 'You are not allowed to create pages as this user.' )
				);
			}
		} else {
			if ( !current_user_can( 'edit_others_posts' ) ) {
				return new WP_Error( 'edit_others_posts', $update ?
					__( 'You are not allowed to edit posts as this user.' ) :
					__( 'You are not allowed to post as this user.' )
				);
			}
		}
	}

	// What to do based on which button they pressed
	if ( isset($_POST['saveasdraft']) && '' != $_POST['saveasdraft'] )
		$_POST['post_status'] = 'draft';
	if ( isset($_POST['saveasprivate']) && '' != $_POST['saveasprivate'] )
		$_POST['post_status'] = 'private';
	if ( isset($_POST['publish']) && ( '' != $_POST['publish'] ) && ( $_POST['post_status'] != 'private' ) )
		$_POST['post_status'] = 'publish';
	if ( isset($_POST['advanced']) && '' != $_POST['advanced'] )
		$_POST['post_status'] = 'draft';

	$previous_status = get_post_field('post_status',  $_POST['ID']);

	// Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published. 
	// Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts.
	if ( 'page' == $_POST['post_type'] ) {
		if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_pages' ) )
			if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_pages') )
				$_POST['post_status'] = 'pending';
	} else {
		if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) ) :
			// Stop attempts to publish new posts, but allow already published posts to be saved if appropriate.
			if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_posts') )
				$_POST['post_status'] = 'pending';
		endif;
	}

	if (!isset( $_POST['comment_status'] ))
		$_POST['comment_status'] = 'closed';

	if (!isset( $_POST['ping_status'] ))
		$_POST['ping_status'] = 'closed';

	foreach ( array('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit ) {
		if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) {
			$_POST['edit_date'] = '1';
			break;
		}
	}

	if ( !empty( $_POST['edit_date'] ) ) {
		$aa = $_POST['aa'];
		$mm = $_POST['mm'];
		$jj = $_POST['jj'];
		$hh = $_POST['hh'];
		$mn = $_POST['mn'];
		$ss = $_POST['ss'];
		$aa = ($aa <= 0 ) ? date('Y') : $aa;
		$mm = ($mm <= 0 ) ? date('n') : $mm;
		$jj = ($jj > 31 ) ? 31 : $jj;
		$jj = ($jj <= 0 ) ? date('j') : $jj;
		$hh = ($hh > 23 ) ? $hh -24 : $hh;
		$mn = ($mn > 59 ) ? $mn -60 : $mn;
		$ss = ($ss > 59 ) ? $ss -60 : $ss;
		$_POST['post_date'] = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss );
		$_POST['post_date_gmt'] = get_gmt_from_date( $_POST['post_date'] );
	}

	return true;
}


// Update an existing post with values provided in $_POST.
function edit_post() {

	$post_ID = (int) $_POST['post_ID'];

	if ( 'page' == $_POST['post_type'] ) {
		if ( !current_user_can( 'edit_page', $post_ID ) )
			wp_die( __('You are not allowed to edit this page.' ));
	} else {
		if ( !current_user_can( 'edit_post', $post_ID ) )
			wp_die( __('You are not allowed to edit this post.' ));
	}

	// Autosave shouldn't save too soon after a real save
	if ( 'autosave' == $_POST['action'] ) {
		$post =& get_post( $post_ID );
		$now = time();
		$then = strtotime($post->post_date_gmt . ' +0000');
		$delta = AUTOSAVE_INTERVAL / 2;
		if ( ($now - $then) < $delta )
			return $post_ID;
	}

	$translated = _wp_translate_postdata( true );
	if ( is_wp_error($translated) )
		wp_die( $translated->get_error_message() );

	// Meta Stuff
	if ( isset($_POST['meta']) && $_POST['meta'] ) {
		foreach ( $_POST['meta'] as $key => $value )
			update_meta( $key, $value['key'], $value['value'] );
	}

	if ( isset($_POST['deletemeta']) && $_POST['deletemeta'] ) {
		foreach ( $_POST['deletemeta'] as $key => $value )
			delete_meta( $key );
	}

	add_meta( $post_ID );

	wp_update_post( $_POST );

	// Reunite any orphaned attachments with their parent
	if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) )
		$draft_ids = array();
	if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) )
		_relocate_children( $draft_temp_id, $post_ID );

	// Now that we have an ID we can fix any attachment anchor hrefs
	_fix_attachment_links( $post_ID );

	wp_set_post_lock( $post_ID, $GLOBALS['current_user']->ID );

	return $post_ID;
}

// Default post information to use when populating the "Write Post" form.
function get_default_post_to_edit() {
	if ( !empty( $_REQUEST['post_title'] ) )
		$post_title = wp_specialchars( stripslashes( $_REQUEST['post_title'] ));
	else if ( !empty( $_REQUEST['popuptitle'] ) ) {
		$post_title = wp_specialchars( stripslashes( $_REQUEST['popuptitle'] ));
		$post_title = funky_javascript_fix( $post_title );
	} else {
		$post_title = '';
	}

	$post_content = '';
	if ( !empty( $_REQUEST['content'] ) )
		$post_content = wp_specialchars( stripslashes( $_REQUEST['content'] ));
	else if ( !empty( $post_title ) ) {
		$text       = wp_specialchars( stripslashes( urldecode( $_REQUEST['text'] ) ) );
		$text       = funky_javascript_fix( $text);
		$popupurl   = clean_url($_REQUEST['popupurl']);
        $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text";
    }

	if ( !empty( $_REQUEST['excerpt'] ) )
		$post_excerpt = wp_specialchars( stripslashes( $_REQUEST['excerpt'] ));
	else
		$post_excerpt = '';

	$post->ID = 0;
	$post->post_name = '';
	$post->post_author = '';
	$post->post_date = '';
	$post->post_status = 'draft';
	$post->post_type = 'post';
	$post->to_ping = '';
	$post->pinged = '';
	$post->comment_status = get_option( 'default_comment_status' );
	$post->ping_status = get_option( 'default_ping_status' );
	$post->post_pingback = get_option( 'default_pingback_flag' );
	$post->post_category = get_option( 'default_category' );
	$post->post_content = apply_filters( 'default_content', $post_content);
	$post->post_title = apply_filters( 'default_title', $post_title );
	$post->post_excerpt = apply_filters( 'default_excerpt', $post_excerpt);
	$post->page_template = 'default';
	$post->post_parent = 0;
	$post->menu_order = 0;

	return $post;
}

function get_default_page_to_edit() {
 	$page = get_default_post_to_edit();
 	$page->post_type = 'page';
 	return $page;
}

// Get an existing post and format it for editing.
function get_post_to_edit( $id ) {

	$post = get_post( $id, OBJECT, 'edit' );

	if ( $post->post_type == 'page' )
		$post->page_template = get_post_meta( $id, '_wp_page_template', true );

	return $post;
}

function post_exists($title, $content = '', $post_date = '') {
	global $wpdb;

	if (!empty ($post_date))
		$post_date = $wpdb->prepare("AND post_date = %s", $post_date);

	if (!empty ($title))
		return $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_title = %s $post_date", $title) );
	else
		if (!empty ($content))
			return $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_content = %s $post_date", $content) );

	return 0;
}

// Creates a new post from the "Write Post" form using $_POST information.
function wp_write_post() {
	global $user_ID;

	if ( 'page' == $_POST['post_type'] ) {
		if ( !current_user_can( 'edit_pages' ) )
			return new WP_Error( 'edit_pages', __( 'You are not allowed to create pages on this blog.' ) );
	} else {
		if ( !current_user_can( 'edit_posts' ) )
			return new WP_Error( 'edit_posts', __( 'You are not allowed to create posts or drafts on this blog.' ) );
	}


	// Check for autosave collisions
	$temp_id = false;
	if ( isset($_POST['temp_ID']) ) {
		$temp_id = (int) $_POST['temp_ID'];
		if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) )
			$draft_ids = array();
		foreach ( $draft_ids as $temp => $real )
			if ( time() + $temp > 86400 ) // 1 day: $temp is equal to -1 * time( then )
				unset($draft_ids[$temp]);

		if ( isset($draft_ids[$temp_id]) ) { // Edit, don't write
			$_POST['post_ID'] = $draft_ids[$temp_id];
			unset($_POST['temp_ID']);
			update_user_option( $user_ID, 'autosave_draft_ids', $draft_ids );
			return edit_post();
		}
	}

	$translated = _wp_translate_postdata( false );
	if ( is_wp_error($translated) )
		return $translated;

	// Create the post.
	$post_ID = wp_insert_post( $_POST );
	if ( is_wp_error( $post_ID ) )
		return $post_ID;

	if ( empty($post_ID) )
		return 0;

	add_meta( $post_ID );

	// Reunite any orphaned attachments with their parent
	if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) )
		$draft_ids = array();
	if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) )
		_relocate_children( $draft_temp_id, $post_ID );
	if ( $temp_id && $temp_id != $draft_temp_id )
		_relocate_children( $temp_id, $post_ID );

	// Update autosave collision detection
	if ( $temp_id ) {
		$draft_ids[$temp_id] = $post_ID;
		update_user_option( $user_ID, 'autosave_draft_ids', $draft_ids );
	}

	// Now that we have an ID we can fix any attachment anchor hrefs
	_fix_attachment_links( $post_ID );

	wp_set_post_lock( $post_ID, $GLOBALS['current_user']->ID );

	return $post_ID;
}

function write_post() {
	$result = wp_write_post();
	if( is_wp_error( $result ) )
		wp_die( $result->get_error_message() );
	else
		return $result;
}

//
// Post Meta
//

function add_meta( $post_ID ) {
	global $wpdb;
	$post_ID = (int) $post_ID;

	$protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' );

	$metakeyselect = $wpdb->escape( stripslashes( trim( $_POST['metakeyselect'] ) ) );
	$metakeyinput = $wpdb->escape( stripslashes( trim( $_POST['metakeyinput'] ) ) );
	$metavalue = maybe_serialize( stripslashes( (trim( $_POST['metavalue'] ) ) ));
	$metavalue = $wpdb->escape( $metavalue );

	if ( ('0' === $metavalue || !empty ( $metavalue ) ) && ((('#NONE#' != $metakeyselect) && !empty ( $metakeyselect) ) || !empty ( $metakeyinput) ) ) {
		// We have a key/value pair. If both the select and the
		// input for the key have data, the input takes precedence:

 		if ('#NONE#' != $metakeyselect)
			$metakey = $metakeyselect;

		if ( $metakeyinput)
			$metakey = $metakeyinput; // default

		if ( in_array($metakey, $protected) )
			return false;

		wp_cache_delete($post_ID, 'post_meta');

		$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->postmeta 
			(post_id,meta_key,meta_value ) VALUES (%s, %s, %s)",
			$post_ID, $metakey, $metavalue) );
		return $wpdb->insert_id;
	}
	return false;
} // add_meta

function delete_meta( $mid ) {
	global $wpdb;
	$mid = (int) $mid;

	$post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
	wp_cache_delete($post_id, 'post_meta');

	return $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
}

// Get a list of previously defined keys
function get_meta_keys() {
	global $wpdb;

	$keys = $wpdb->get_col( "
			SELECT meta_key
			FROM $wpdb->postmeta
			GROUP BY meta_key
			ORDER BY meta_key" );

	return $keys;
}

function get_post_meta_by_id( $mid ) {
	global $wpdb;
	$mid = (int) $mid;

	$meta = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE meta_id = %d", $mid) );
	if ( is_serialized_string( $meta->meta_value ) )
		$meta->meta_value = maybe_unserialize( $meta->meta_value );
	return $meta;
}

// Some postmeta stuff
function has_meta( $postid ) {
	global $wpdb;

	return $wpdb->get_results( $wpdb->prepare("SELECT meta_key, meta_value, meta_id, post_id
			FROM $wpdb->postmeta WHERE post_id = %d
			ORDER BY meta_key,meta_id", $postid), ARRAY_A );

}

function update_meta( $meta_id, $meta_key, $meta_value ) {
	global $wpdb;

	$protected = array( '_wp_attached_file', '_wp_attachment_metadata', '_wp_old_slug', '_wp_page_template' );

	if ( in_array($meta_key, $protected) )
		return false;

	$post_id = $wpdb->get_var( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_id = %d", $meta_id) );
	wp_cache_delete($post_id, 'post_meta');

	$meta_value = maybe_serialize( stripslashes( $meta_value ));
	$meta_id = (int) $meta_id;
	
	$data  = compact( 'meta_key', 'meta_value' );
	$where = compact( 'meta_id' );

	return $wpdb->update( $wpdb->postmeta, $data, $where );
}

//
// Private
//

// Replace hrefs of attachment anchors with up-to-date permalinks.
function _fix_attachment_links( $post_ID ) {

	$post = & get_post( $post_ID, ARRAY_A );

	$search = "#<a[^>]+rel=('|\")[^'\"]*attachment[^>]*>#ie";

	// See if we have any rel="attachment" links
	if ( 0 == preg_match_all( $search, $post['post_content'], $anchor_matches, PREG_PATTERN_ORDER ) )
		return;

	$i = 0;
	$search = "#[\s]+rel=(\"|')(.*?)wp-att-(\d+)\\1#i";
	foreach ( $anchor_matches[0] as $anchor ) {
		if ( 0 == preg_match( $search, $anchor, $id_matches ) )
			continue;

		$id = (int) $id_matches[3];

		// While we have the attachment ID, let's adopt any orphans.
		$attachment = & get_post( $id, ARRAY_A );
		if ( ! empty( $attachment) && ! is_object( get_post( $attachment['post_parent'] ) ) ) {
			$attachment['post_parent'] = $post_ID;
			// Escape data pulled from DB.
			$attachment = add_magic_quotes( $attachment);
			wp_update_post( $attachment);
		}

		$post_search[$i] = $anchor;
		$post_replace[$i] = preg_replace( "#href=(\"|')[^'\"]*\\1#e", "stripslashes( 'href=\\1' ).get_attachment_link( $id ).stripslashes( '\\1' )", $anchor );
		++$i;
	}

	$post['post_content'] = str_replace( $post_search, $post_replace, $post['post_content'] );

	// Escape data pulled from DB.
	$post = add_magic_quotes( $post);

	return wp_update_post( $post);
}

// Move child posts to a new parent
function _relocate_children( $old_ID, $new_ID ) {
	global $wpdb;
	$old_ID = (int) $old_ID;
	$new_ID = (int) $new_ID;
	return $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = %d WHERE post_parent = %d", $new_ID, $old_ID) );
}

function get_available_post_statuses($type = 'post') {
	$stati = wp_count_posts($type);

	return array_keys(get_object_vars($stati));
}

function wp_edit_posts_query( $q = false ) {
	global $wpdb;
	if ( false === $q )
		$q = $_GET;
	$q['m']   = (int) $q['m'];
	$q['cat'] = (int) $q['cat'];
	$post_stati  = array(	//	array( adj, noun )
				'publish' => array(__('Published'), __('Published posts'), __ngettext_noop('Published (%s)', 'Published (%s)')),
				'future' => array(__('Scheduled'), __('Scheduled posts'), __ngettext_noop('Scheduled (%s)', 'Scheduled (%s)')),
				'pending' => array(__('Pending Review'), __('Pending posts'), __ngettext_noop('Pending Review (%s)', 'Pending Review (%s)')),
				'draft' => array(__('Draft'), _c('Drafts|manage posts header'), __ngettext_noop('Draft (%s)', 'Drafts (%s)')),
				'private' => array(__('Private'), __('Private posts'), __ngettext_noop('Private (%s)', 'Private (%s)')),
			);

	$post_stati = apply_filters('post_stati', $post_stati);

	$avail_post_stati = get_available_post_statuses('post');

	$post_status_q = '';
	if ( isset($q['post_status']) && in_array( $q['post_status'], array_keys($post_stati) ) ) {
		$post_status_q = '&post_status=' . $q['post_status'];
		$post_status_q .= '&perm=readable';
	}

	if ( 'pending' === $q['post_status'] ) {
		$order = 'ASC';
		$orderby = 'modified';
	} elseif ( 'draft' === $q['post_status'] ) {
		$order = 'DESC';
		$orderby = 'modified';
	} else {
		$order = 'DESC';
		$orderby = 'date';
	}

	wp("post_type=post&what_to_show=posts$post_status_q&posts_per_page=15&order=$order&orderby=$orderby");

	return array($post_stati, $avail_post_stati);
}

function get_available_post_mime_types($type = 'attachment') {
	global $wpdb;

	$types = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT post_mime_type FROM $wpdb->posts WHERE post_type = %s", $type));
	return $types;
}

function wp_edit_attachments_query( $q = false ) {
	global $wpdb;
	if ( false === $q )
		$q = $_GET;
	$q['m']   = (int) $q['m'];
	$q['cat'] = (int) $q['cat'];
	$q['post_type'] = 'attachment';
	$q['post_status'] = 'any';
	$q['posts_per_page'] = 15;
	$post_mime_types = array(	//	array( adj, noun )
				'image' => array(__('Images'), __('Manage Images'), __ngettext_noop('Image (%s)', 'Images (%s)')),
				'audio' => array(__('Audio'), __('Manage Audio'), __ngettext_noop('Audio (%s)', 'Audio (%s)')),
				'video' => array(__('Video'), __('Manage Video'), __ngettext_noop('Video (%s)', 'Video (%s)')),
			);
	$post_mime_types = apply_filters('post_mime_types', $post_mime_types);

	$avail_post_mime_types = get_available_post_mime_types('attachment');

	if ( isset($q['post_mime_type']) && !array_intersect( (array) $q['post_mime_type'], array_keys($post_mime_types) ) )
		unset($q['post_mime_type']);

	wp($q);

	return array($post_mime_types, $avail_post_mime_types);
}

function postbox_classes( $id, $page ) {
	$current_user = wp_get_current_user();
	if ( $closed = get_usermeta( $current_user->ID, 'closedpostboxes_'.$page ) ) {
		if ( !is_array( $closed ) ) return '';
		return in_array( $id, $closed )? 'if-js-closed' : '';
	} else {
		if ( 'tagsdiv' == $id || 'categorydiv' == $id ) return '';
		else return 'if-js-closed';
	}
}

function get_sample_permalink($id, $title=null, $name = null) {
	$post = &get_post($id);
	if (!$post->ID) {
		return array('', '');
	}
	$original_status = $post->post_status;
	$original_date = $post->post_date;
	$original_name = $post->post_name;

	// Hack: get_permalink would return ugly permalink for
	// drafts, so we will fake, that our post is published
	if (in_array($post->post_status, array('draft', 'pending'))) {
		$post->post_status = 'publish';
		$post->post_date = date('Y-m-d H:i:s');
		$post->post_name = sanitize_title($post->post_name? $post->post_name : $post->post_title, $post->ID); 
	}

	// If the user wants to set a new name -- override the current one
	// Note: if empty name is supplied -- use the title instead, see #6072
	if (!is_null($name)) {
		$post->post_name = sanitize_title($name? $name : $title, $post->ID);
	}

	$permalink = get_permalink($post, true);

	// Handle page hierarchy
	if ( 'page' == $post->post_type ) {
		$uri = get_page_uri($post->ID);
		$uri = untrailingslashit($uri);
		$uri = strrev( stristr( strrev( $uri ), '/' ) );
		$uri = untrailingslashit($uri);
		if ( !empty($uri) )
			$uri .='/';
		$permalink = str_replace('%pagename%', "${uri}%pagename%", $permalink);
	}

	$permalink = array($permalink, apply_filters('editable_slug', $post->post_name));
	$post->post_status = $original_status;
	$post->post_date = $original_date;
	$post->post_name = $original_name;
	return $permalink;
}

function get_sample_permalink_html($id, $new_title=null, $new_slug=null) {
	$post = &get_post($id);
	list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
	if (false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%')) {
		return '';
	}
	$title = __('Click to edit this part of the permalink');
	if (strlen($post_name) > 30) {
		$post_name_abridged = substr($post_name, 0, 14). '&hellip;' . substr($post_name, -14);
	} else {
		$post_name_abridged = $post_name;
	}
	$post_name_html = '<span id="editable-post-name" title="'.$title.'">'.$post_name_abridged.'</span><span id="editable-post-name-full">'.$post_name.'</span>';
	$display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink);
	$return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink">' . $display_link . "</span>\n";
	$return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug" onclick="edit_permalink(' . $id . '); return false;">' . __('Edit') . "</a></span>\n";
	return $return;
}

// false: not locked or locked by current user
// int: user ID of user with lock
function wp_check_post_lock( $post_id ) {
	global $current_user;

	if ( !$post = get_post( $post_id ) )
		return false;

	$lock = get_post_meta( $post->ID, '_edit_lock', true );
	$last = get_post_meta( $post->ID, '_edit_last', true );

	$time_window = apply_filters( 'wp_check_post_lock_window', AUTOSAVE_INTERVAL * 2 );

	if ( $lock && $lock > time() - $time_window && $last != $current_user->ID )
		return $last;
	return false;
}

function wp_set_post_lock( $post_id ) {
	global $current_user;
	if ( !$post = get_post( $post_id ) )
		return false;
	if ( !$current_user || !$current_user->ID )
		return false;

	$now = time();

	if ( !add_post_meta( $post->ID, '_edit_lock', $now, true ) )
		update_post_meta( $post->ID, '_edit_lock', $now );
	if ( !add_post_meta( $post->ID, '_edit_last', $current_user->ID, true ) )
		update_post_meta( $post->ID, '_edit_last', $current_user->ID );
}

/**
 * wp_create_post_autosave() - creates autosave data for the specified post from $_POST data
 *
 * @package WordPress
 * @subpackage Post Revisions
 * @since 2.6
 *
 * @uses _wp_translate_postdata()
 * @uses _wp_post_revision_fields()
 */
function wp_create_post_autosave( $post_id ) {
	$translated = _wp_translate_postdata( true );
	if ( is_wp_error( $translated ) )
		return $translated;

	// Only store one autosave.  If there is already an autosave, overwrite it.
	if ( $old_autosave = wp_get_post_autosave( $post_id ) ) {
		$new_autosave = _wp_post_revision_fields( $_POST, true );
		$new_autosave['ID'] = $old_autosave->ID;
		return wp_update_post( $new_autosave );
	}

	// Otherwise create the new autosave as a special post revision
	return _wp_put_post_revision( $_POST, true );
}
                                                                                                             blog/wp-admin/includes/schema.php                                                                   0000755 0023433 0004734 00000036276 11060470742 016666  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
// Here we keep the DB structure and option values

$charset_collate = '';

// Declare these as global in case schema.php is included from a function.
global $wpdb, $wp_queries;

if ( $wpdb->supports_collation() ) {
	if ( ! empty($wpdb->charset) )
		$charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
	if ( ! empty($wpdb->collate) )
		$charset_collate .= " COLLATE $wpdb->collate";
}

$wp_queries="CREATE TABLE $wpdb->terms (
 term_id bigint(20) NOT NULL auto_increment,
 name varchar(200) NOT NULL default '',
 slug varchar(200) NOT NULL default '',
 term_group bigint(10) NOT NULL default 0,
 PRIMARY KEY  (term_id),
 UNIQUE KEY slug (slug),
 KEY name (name)
) $charset_collate;
CREATE TABLE $wpdb->term_taxonomy (
 term_taxonomy_id bigint(20) NOT NULL auto_increment,
 term_id bigint(20) NOT NULL default 0,
 taxonomy varchar(32) NOT NULL default '',
 description longtext NOT NULL,
 parent bigint(20) NOT NULL default 0,
 count bigint(20) NOT NULL default 0,
 PRIMARY KEY  (term_taxonomy_id),
 UNIQUE KEY term_id_taxonomy (term_id,taxonomy)
) $charset_collate;
CREATE TABLE $wpdb->term_relationships (
 object_id bigint(20) NOT NULL default 0,
 term_taxonomy_id bigint(20) NOT NULL default 0,
 term_order int(11) NOT NULL default 0,
 PRIMARY KEY  (object_id,term_taxonomy_id),
 KEY term_taxonomy_id (term_taxonomy_id)
) $charset_collate;
CREATE TABLE $wpdb->comments (
  comment_ID bigint(20) unsigned NOT NULL auto_increment,
  comment_post_ID int(11) NOT NULL default '0',
  comment_author tinytext NOT NULL,
  comment_author_email varchar(100) NOT NULL default '',
  comment_author_url varchar(200) NOT NULL default '',
  comment_author_IP varchar(100) NOT NULL default '',
  comment_date datetime NOT NULL default '0000-00-00 00:00:00',
  comment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',
  comment_content text NOT NULL,
  comment_karma int(11) NOT NULL default '0',
  comment_approved varchar(20) NOT NULL default '1',
  comment_agent varchar(255) NOT NULL default '',
  comment_type varchar(20) NOT NULL default '',
  comment_parent bigint(20) NOT NULL default '0',
  user_id bigint(20) NOT NULL default '0',
  PRIMARY KEY  (comment_ID),
  KEY comment_approved (comment_approved),
  KEY comment_post_ID (comment_post_ID),
  KEY comment_approved_date_gmt (comment_approved,comment_date_gmt),
  KEY comment_date_gmt (comment_date_gmt)
) $charset_collate;
CREATE TABLE $wpdb->links (
  link_id bigint(20) NOT NULL auto_increment,
  link_url varchar(255) NOT NULL default '',
  link_name varchar(255) NOT NULL default '',
  link_image varchar(255) NOT NULL default '',
  link_target varchar(25) NOT NULL default '',
  link_category bigint(20) NOT NULL default '0',
  link_description varchar(255) NOT NULL default '',
  link_visible varchar(20) NOT NULL default 'Y',
  link_owner int(11) NOT NULL default '1',
  link_rating int(11) NOT NULL default '0',
  link_updated datetime NOT NULL default '0000-00-00 00:00:00',
  link_rel varchar(255) NOT NULL default '',
  link_notes mediumtext NOT NULL,
  link_rss varchar(255) NOT NULL default '',
  PRIMARY KEY  (link_id),
  KEY link_category (link_category),
  KEY link_visible (link_visible)
) $charset_collate;
CREATE TABLE $wpdb->options (
  option_id bigint(20) NOT NULL auto_increment,
  blog_id int(11) NOT NULL default '0',
  option_name varchar(64) NOT NULL default '',
  option_value longtext NOT NULL,
  autoload varchar(20) NOT NULL default 'yes',
  PRIMARY KEY  (option_id,blog_id,option_name),
  KEY option_name (option_name)
) $charset_collate;
CREATE TABLE $wpdb->postmeta (
  meta_id bigint(20) NOT NULL auto_increment,
  post_id bigint(20) NOT NULL default '0',
  meta_key varchar(255) default NULL,
  meta_value longtext,
  PRIMARY KEY  (meta_id),
  KEY post_id (post_id),
  KEY meta_key (meta_key)
) $charset_collate;
CREATE TABLE $wpdb->posts (
  ID bigint(20) unsigned NOT NULL auto_increment,
  post_author bigint(20) NOT NULL default '0',
  post_date datetime NOT NULL default '0000-00-00 00:00:00',
  post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',
  post_content longtext NOT NULL,
  post_title text NOT NULL,
  post_category int(4) NOT NULL default '0',
  post_excerpt text NOT NULL,
  post_status varchar(20) NOT NULL default 'publish',
  comment_status varchar(20) NOT NULL default 'open',
  ping_status varchar(20) NOT NULL default 'open',
  post_password varchar(20) NOT NULL default '',
  post_name varchar(200) NOT NULL default '',
  to_ping text NOT NULL,
  pinged text NOT NULL,
  post_modified datetime NOT NULL default '0000-00-00 00:00:00',
  post_modified_gmt datetime NOT NULL default '0000-00-00 00:00:00',
  post_content_filtered text NOT NULL,
  post_parent bigint(20) NOT NULL default '0',
  guid varchar(255) NOT NULL default '',
  menu_order int(11) NOT NULL default '0',
  post_type varchar(20) NOT NULL default 'post',
  post_mime_type varchar(100) NOT NULL default '',
  comment_count bigint(20) NOT NULL default '0',
  PRIMARY KEY  (ID),
  KEY post_name (post_name),
  KEY type_status_date (post_type,post_status,post_date,ID)
) $charset_collate;
CREATE TABLE $wpdb->users (
  ID bigint(20) unsigned NOT NULL auto_increment,
  user_login varchar(60) NOT NULL default '',
  user_pass varchar(64) NOT NULL default '',
  user_nicename varchar(50) NOT NULL default '',
  user_email varchar(100) NOT NULL default '',
  user_url varchar(100) NOT NULL default '',
  user_registered datetime NOT NULL default '0000-00-00 00:00:00',
  user_activation_key varchar(60) NOT NULL default '',
  user_status int(11) NOT NULL default '0',
  display_name varchar(250) NOT NULL default '',
  PRIMARY KEY  (ID),
  KEY user_login_key (user_login),
  KEY user_nicename (user_nicename)
) $charset_collate;
CREATE TABLE $wpdb->usermeta (
  umeta_id bigint(20) NOT NULL auto_increment,
  user_id bigint(20) NOT NULL default '0',
  meta_key varchar(255) default NULL,
  meta_value longtext,
  PRIMARY KEY  (umeta_id),
  KEY user_id (user_id),
  KEY meta_key (meta_key)
) $charset_collate;";

function populate_options() {
	global $wpdb, $wp_db_version;
	
	$guessurl = wp_guess_url();
	
	do_action('populate_options');
	
	add_option('siteurl', $guessurl);
	add_option('blogname', __('My Blog'));
	add_option('blogdescription', __('Just another WordPress weblog'));
	add_option('users_can_register', 0);
	add_option('admin_email', 'you@example.com');
	add_option('start_of_week', 1);
	add_option('use_balanceTags', 0);
	add_option('use_smilies', 1);
	add_option('require_name_email', 1);
	add_option('comments_notify', 1);
	add_option('posts_per_rss', 10);
	add_option('rss_excerpt_length', 50);
	add_option('rss_use_excerpt', 0);
	add_option('mailserver_url', 'mail.example.com');
	add_option('mailserver_login', 'login@example.com');
	add_option('mailserver_pass', 'password');
	add_option('mailserver_port', 110);
	add_option('default_category', 1);
	add_option('default_comment_status', 'open');
	add_option('default_ping_status', 'open');
	add_option('default_pingback_flag', 1);
	add_option('default_post_edit_rows', 10);
	add_option('posts_per_page', 10);
	add_option('what_to_show', 'posts');
	add_option('date_format', __('F j, Y'));
	add_option('time_format', __('g:i a'));
	add_option('links_updated_date_format', __('F j, Y g:i a'));
	add_option('links_recently_updated_prepend', '<em>');
	add_option('links_recently_updated_append', '</em>');
	add_option('links_recently_updated_time', 120);
	add_option('comment_moderation', 0);
	add_option('moderation_notify', 1);
	add_option('permalink_structure');
	add_option('gzipcompression', 0);
	add_option('hack_file', 0);
	add_option('blog_charset', 'UTF-8');
	add_option('moderation_keys');
	add_option('active_plugins');
	add_option('home', $guessurl);
	// in case it is set, but blank, update "home"
	if ( !__get_option('home') ) update_option('home', $guessurl);
	add_option('category_base');
	add_option('ping_sites', 'http://rpc.pingomatic.com/');
	add_option('advanced_edit', 0);
	add_option('comment_max_links', 2);
	add_option('gmt_offset', date('Z') / 3600);
	// 1.5
	add_option('default_email_category', 1);
	add_option('recently_edited');
	add_option('use_linksupdate', 0);
	add_option('template', 'default');
	add_option('stylesheet', 'default');
	add_option('comment_whitelist', 1);
	add_option('page_uris');
	add_option('blacklist_keys');
	add_option('comment_registration', 0);
	add_option('rss_language', 'en');
	add_option('html_type', 'text/html');
	// 1.5.1
	add_option('use_trackback', 0);
	// 2.0
	add_option('default_role', 'subscriber');
	add_option('db_version', $wp_db_version);
	// 2.0.1
	if ( ini_get('safe_mode') ) {
		// Safe mode screws up mkdir(), so we must use a flat structure.
		add_option('uploads_use_yearmonth_folders', 0);
		add_option('upload_path', WP_CONTENT_DIR);
	} else {
		add_option('uploads_use_yearmonth_folders', 1);
		add_option('upload_path', WP_CONTENT_DIR . '/uploads');
	}

	// 2.0.3
	add_option('secret', wp_generate_password(64));

	// 2.1
	add_option('blog_public', '1');
	add_option('default_link_category', 2);
	add_option('show_on_front', 'posts');

	// 2.2
	add_option('tag_base');

	// 2.5
	add_option('show_avatars', '1');
	add_option('avatar_rating', 'G');
	add_option('upload_url_path', '');
	add_option('thumbnail_size_w', 150);
	add_option('thumbnail_size_h', 150);
	add_option('thumbnail_crop', 1);
	add_option('medium_size_w', 300);
	add_option('medium_size_h', 300);

	// 2.6
	add_option('avatar_default', 'mystery');
	add_option('enable_app', 0);
	add_option('enable_xmlrpc', 0);
	
	// Delete unused options
	$unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl', 'weblogs_xml_url', 'new_users_can_blog', '_wpnonce', '_wp_http_referer', 'Update', 'action', 'rich_editing', 'autosave_interval', 'deactivated_plugins');
	foreach ($unusedoptions as $option) :
		delete_option($option);
	endforeach;

	// Set up a few options not to load by default
	$fatoptions = array( 'moderation_keys', 'recently_edited', 'blacklist_keys' );
	foreach ($fatoptions as $fatoption) :
		$wpdb->query("UPDATE $wpdb->options SET `autoload` = 'no' WHERE option_name = '$fatoption'");
	endforeach;
}

function populate_roles() {
	populate_roles_160();
	populate_roles_210();
	populate_roles_230();
	populate_roles_250();
	populate_roles_260();
}

function populate_roles_160() {
	// Add roles

	// Dummy gettext calls to get strings in the catalog.
	_c('Administrator|User role');
	_c('Editor|User role');
	_c('Author|User role');
	_c('Contributor|User role');
	_c('Subscriber|User role');

	add_role('administrator', 'Administrator|User role');
	add_role('editor', 'Editor|User role');
	add_role('author', 'Author|User role');
	add_role('contributor', 'Contributor|User role');
	add_role('subscriber', 'Subscriber|User role');

	// Add caps for Administrator role
	$role = get_role('administrator');
	$role->add_cap('switch_themes');
	$role->add_cap('edit_themes');
	$role->add_cap('activate_plugins');
	$role->add_cap('edit_plugins');
	$role->add_cap('edit_users');
	$role->add_cap('edit_files');
	$role->add_cap('manage_options');
	$role->add_cap('moderate_comments');
	$role->add_cap('manage_categories');
	$role->add_cap('manage_links');
	$role->add_cap('upload_files');
	$role->add_cap('import');
	$role->add_cap('unfiltered_html');
	$role->add_cap('edit_posts');
	$role->add_cap('edit_others_posts');
	$role->add_cap('edit_published_posts');
	$role->add_cap('publish_posts');
	$role->add_cap('edit_pages');
	$role->add_cap('read');
	$role->add_cap('level_10');
	$role->add_cap('level_9');
	$role->add_cap('level_8');
	$role->add_cap('level_7');
	$role->add_cap('level_6');
	$role->add_cap('level_5');
	$role->add_cap('level_4');
	$role->add_cap('level_3');
	$role->add_cap('level_2');
	$role->add_cap('level_1');
	$role->add_cap('level_0');

	// Add caps for Editor role
	$role = get_role('editor');
	$role->add_cap('moderate_comments');
	$role->add_cap('manage_categories');
	$role->add_cap('manage_links');
	$role->add_cap('upload_files');
	$role->add_cap('unfiltered_html');
	$role->add_cap('edit_posts');
	$role->add_cap('edit_others_posts');
	$role->add_cap('edit_published_posts');
	$role->add_cap('publish_posts');
	$role->add_cap('edit_pages');
	$role->add_cap('read');
	$role->add_cap('level_7');
	$role->add_cap('level_6');
	$role->add_cap('level_5');
	$role->add_cap('level_4');
	$role->add_cap('level_3');
	$role->add_cap('level_2');
	$role->add_cap('level_1');
	$role->add_cap('level_0');

	// Add caps for Author role
	$role = get_role('author');
	$role->add_cap('upload_files');
	$role->add_cap('edit_posts');
	$role->add_cap('edit_published_posts');
	$role->add_cap('publish_posts');
	$role->add_cap('read');
	$role->add_cap('level_2');
	$role->add_cap('level_1');
	$role->add_cap('level_0');

	// Add caps for Contributor role
	$role = get_role('contributor');
	$role->add_cap('edit_posts');
	$role->add_cap('read');
	$role->add_cap('level_1');
	$role->add_cap('level_0');

	// Add caps for Subscriber role
	$role = get_role('subscriber');
	$role->add_cap('read');
	$role->add_cap('level_0');
}

function populate_roles_210() {
	$roles = array('administrator', 'editor');
	foreach ($roles as $role) {
		$role = get_role($role);
		if ( empty($role) )
			continue;

		$role->add_cap('edit_others_pages');
		$role->add_cap('edit_published_pages');
		$role->add_cap('publish_pages');
		$role->add_cap('delete_pages');
		$role->add_cap('delete_others_pages');
		$role->add_cap('delete_published_pages');
		$role->add_cap('delete_posts');
		$role->add_cap('delete_others_posts');
		$role->add_cap('delete_published_posts');
		$role->add_cap('delete_private_posts');
		$role->add_cap('edit_private_posts');
		$role->add_cap('read_private_posts');
		$role->add_cap('delete_private_pages');
		$role->add_cap('edit_private_pages');
		$role->add_cap('read_private_pages');
	}

	$role = get_role('administrator');
	if ( ! empty($role) ) {
		$role->add_cap('delete_users');
		$role->add_cap('create_users');
	}

	$role = get_role('author');
	if ( ! empty($role) ) {
		$role->add_cap('delete_posts');
		$role->add_cap('delete_published_posts');
	}

	$role = get_role('contributor');
	if ( ! empty($role) ) {
		$role->add_cap('delete_posts');
	}
}

function populate_roles_230() {
	$role = get_role( 'administrator' );

	if ( !empty( $role ) ) {
		$role->add_cap( 'unfiltered_upload' );
	}
}

function populate_roles_250() {
	$role = get_role( 'administrator' );

	if ( !empty( $role ) ) {
		$role->add_cap( 'edit_dashboard' );
	}
}

function populate_roles_260() {
	$role = get_role( 'administrator' );

	if ( !empty( $role ) ) {
		$role->add_cap( 'update_plugins' );
		$role->add_cap( 'delete_plugins' );
	}
}

?>
                                                                                                                                                                                                                                                                                                                                  blog/wp-admin/includes/taxonomy.php                                                                 0000755 0023433 0004734 00000006462 11060470742 017276  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

//
// Category
//

function category_exists($cat_name) {
	$id = is_term($cat_name, 'category');
	if ( is_array($id) )
		$id = $id['term_id'];
	return $id;
}

function get_category_to_edit( $id ) {
	$category = get_category( $id, OBJECT, 'edit' );
	return $category;
}

function wp_create_category( $cat_name, $parent = 0 ) {
	if ( $id = category_exists($cat_name) )
		return $id;

	return wp_insert_category( array('cat_name' => $cat_name, 'category_parent' => $parent) );
}

function wp_create_categories($categories, $post_id = '') {
	$cat_ids = array ();
	foreach ($categories as $category) {
		if ($id = category_exists($category))
			$cat_ids[] = $id;
		else
			if ($id = wp_create_category($category))
				$cat_ids[] = $id;
	}

	if ($post_id)
		wp_set_post_categories($post_id, $cat_ids);

	return $cat_ids;
}

function wp_delete_category($cat_ID) {
	$cat_ID = (int) $cat_ID;
	$default = get_option('default_category');

	// Don't delete the default cat
	if ( $cat_ID == $default )
		return 0;

	return wp_delete_term($cat_ID, 'category', array('default' => $default));
}

function wp_insert_category($catarr, $wp_error = false) {
	$cat_defaults = array('cat_ID' => 0, 'cat_name' => '', 'category_description' => '', 'category_nicename' => '', 'category_parent' => '');
	$cat_arr = wp_parse_args($cat_arr, $cat_defaults);
	extract($catarr, EXTR_SKIP);

	if ( trim( $cat_name ) == '' ) {
		if ( ! $wp_error )
			return 0;
		else
			return new WP_Error( 'cat_name', __('You did not enter a category name.') );
	}

	$cat_ID = (int) $cat_ID;

	// Are we updating or creating?
	if ( !empty ($cat_ID) )
		$update = true;
	else
		$update = false;

	$name = $cat_name;
	$description = $category_description;
	$slug = $category_nicename;
	$parent = $category_parent;

	$parent = (int) $parent;
	if ( $parent < 0 )
		$parent = 0;

	if ( empty($parent) || !category_exists( $parent ) || ($cat_ID && cat_is_ancestor_of($cat_ID, $parent) ) )
		$parent = 0;

	$args = compact('name', 'slug', 'parent', 'description');

	if ( $update )
		$cat_ID = wp_update_term($cat_ID, 'category', $args);
	else
		$cat_ID = wp_insert_term($cat_name, 'category', $args);

	if ( is_wp_error($cat_ID) ) {
		if ( $wp_error )
			return $cat_ID;
		else
			return 0;
	}

	return $cat_ID['term_id'];
}

function wp_update_category($catarr) {
	$cat_ID = (int) $catarr['cat_ID'];

	if ( $cat_ID == $catarr['category_parent'] )
		return false;

	// First, get all of the original fields
	$category = get_category($cat_ID, ARRAY_A);

	// Escape data pulled from DB.
	$category = add_magic_quotes($category);

	// Merge old and new fields with new fields overwriting old ones.
	$catarr = array_merge($category, $catarr);

	return wp_insert_category($catarr);
}

//
// Tags
//

function get_tags_to_edit( $post_id ) {
	$post_id = (int) $post_id;
	if ( !$post_id )
		return false;

	$tags = wp_get_post_tags($post_id);

	if ( !$tags )
		return false;

	foreach ( $tags as $tag )
		$tag_names[] = $tag->name;
	$tags_to_edit = join( ',', $tag_names );
	$tags_to_edit = attribute_escape( $tags_to_edit );
	$tags_to_edit = apply_filters( 'tags_to_edit', $tags_to_edit );
	return $tags_to_edit;
}

function tag_exists($tag_name) {
	return is_term($tag_name, 'post_tag');
}

function wp_create_tag($tag_name) {
	if ( $id = tag_exists($tag_name) )
		return $id;

	return wp_insert_term($tag_name, 'post_tag');
}

?>
                                                                                                                                                                                                              blog/wp-admin/includes/template.php                                                                 0000755 0023433 0004734 00000127771 11060470744 017244  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

//
// Big Mess
//

// Ugly recursive category stuff.
function cat_rows( $parent = 0, $level = 0, $categories = 0, $page = 1, $per_page = 20 ) {
	$count = 0;
	_cat_rows($categories, $count, $parent, $level, $page, $per_page);
}

function _cat_rows( $categories, &$count, $parent = 0, $level = 0, $page = 1, $per_page = 20 ) {
	if ( empty($categories) ) {
		$args = array('hide_empty' => 0);
		if ( !empty($_GET['s']) )
			$args['search'] = $_GET['s'];
		$categories = get_categories( $args );
	}

	if ( !$categories )
		return false;

	$children = _get_term_hierarchy('category');

	$start = ($page - 1) * $per_page;
	$end = $start + $per_page;
	$i = -1;
	ob_start();
	foreach ( $categories as $category ) {
		if ( $count >= $end )
			break;

		$i++;

		if ( $category->parent != $parent )
			continue;

		// If the page starts in a subtree, print the parents.
		if ( $count == $start && $category->parent > 0 ) {
			$my_parents = array();
			$my_parent = $category->parent;
			while ( $my_parent) {
				$my_parent = get_category($my_parent);
				$my_parents[] = $my_parent;
				if ( !$my_parent->parent )
					break;
				$my_parent = $my_parent->parent;
			}
			$num_parents = count($my_parents);
			while( $my_parent = array_pop($my_parents) ) {
				echo "\t" . _cat_row( $my_parent, $level - $num_parents );
				$num_parents--;
			}
		}

		if ( $count >= $start )
			echo "\t" . _cat_row( $category, $level );

		unset($categories[$i]); // Prune the working set		
		$count++;

		if ( isset($children[$category->term_id]) )
			_cat_rows( $categories, $count, $category->term_id, $level + 1, $page, $per_page );

	}

	$output = ob_get_contents();
	ob_end_clean();

	$output = apply_filters('cat_rows', $output);

	echo $output;
}

function _cat_row( $category, $level, $name_override = false ) {
	global $class;

	$category = get_category( $category );

	$pad = str_repeat( '&#8212; ', $level );
	$name = ( $name_override ? $name_override : $pad . ' ' . $category->name );
	if ( current_user_can( 'manage_categories' ) ) {
		$edit = "<a class='row-title' href='categories.php?action=edit&amp;cat_ID=$category->term_id' title='" . attribute_escape(sprintf(__('Edit "%s"'), $category->name)) . "'>$name</a>";
	} else {
		$edit = $name;
	}

	$class = " class='alternate'" == $class ? '' : " class='alternate'";

	$category->count = number_format_i18n( $category->count );
	$posts_count = ( $category->count > 0 ) ? "<a href='edit.php?cat=$category->term_id'>$category->count</a>" : $category->count;
	$output = "<tr id='cat-$category->term_id'$class>
			   <th scope='row' class='check-column'>";
	if ( absint(get_option( 'default_category' ) ) != $category->term_id ) {
		$output .= "<input type='checkbox' name='delete[]' value='$category->term_id' />";
	} else {
		$output .= "&nbsp;";
	}
	$output .= "</th>
				<td>$edit</td>
				<td>$category->description</td>
				<td class='num'>$posts_count</td>\n\t</tr>\n";

	return apply_filters('cat_row', $output);
}

function link_cat_row( $category ) {
	global $class;

	if ( !$category = get_term( $category, 'link_category' ) )
		return false;
	if ( is_wp_error( $category ) )
		return $category;

	$name = ( $name_override ? $name_override : $category->name );
	if ( current_user_can( 'manage_categories' ) ) {
		$edit = "<a class='row-title' href='link-category.php?action=edit&amp;cat_ID=$category->term_id' title='" . attribute_escape(sprintf(__('Edit "%s"'), $category->name)) . "' class='edit'>$name</a>";
		$default_cat_id = (int) get_option( 'default_link_category' );
	} else {
		$edit = $name;
	}

	$class = " class='alternate'" == $class ? '' : " class='alternate'";

	$category->count = number_format_i18n( $category->count );
	$count = ( $category->count > 0 ) ? "<a href='link-manager.php?cat_id=$category->term_id'>$category->count</a>" : $category->count;
	$output = "<tr id='link-cat-$category->term_id'$class>
			   <th scope='row' class='check-column'>";
	if ( absint( get_option( 'default_link_category' ) ) != $category->term_id ) {
		$output .= "<input type='checkbox' name='delete[]' value='$category->term_id' />";
	} else {
		$output .= "&nbsp;";
	}
	$output .= "</th>
				<td>$edit</td>
				<td>$category->description</td>
				<td class='num'>$count</td></tr>";

	return apply_filters( 'link_cat_row', $output );
}

function checked( $checked, $current) {
	if ( $checked == $current)
		echo ' checked="checked"';
}

function selected( $selected, $current) {
	if ( $selected == $current)
		echo ' selected="selected"';
}

//
// Category Checklists
//

// Deprecated. Use wp_link_category_checklist
function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {
	global $post_ID;
	wp_category_checklist($post_ID);
}

class Walker_Category_Checklist extends Walker {
	var $tree_type = 'category';
	var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); //TODO: decouple this

	function start_lvl(&$output, $depth, $args) {
		$indent = str_repeat("\t", $depth);
		$output .= "$indent<ul class='children'>\n";
	}

	function end_lvl(&$output, $depth, $args) {
		$indent = str_repeat("\t", $depth);
		$output .= "$indent</ul>\n";
	}

	function start_el(&$output, $category, $depth, $args) {
		extract($args);

		$class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : '';
		$output .= "\n<li id='category-$category->term_id'$class>" . '<label for="in-category-' . $category->term_id . '" class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="post_category[]" id="in-category-' . $category->term_id . '"' . (in_array( $category->term_id, $selected_cats ) ? ' checked="checked"' : "" ) . '/> ' . wp_specialchars( apply_filters('the_category', $category->name )) . '</label>';
	}

	function end_el(&$output, $category, $depth, $args) {
		$output .= "</li>\n";
	}
}

function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false ) {
	$walker = new Walker_Category_Checklist;
	$descendants_and_self = (int) $descendants_and_self;

	$args = array();
	
	if ( is_array( $selected_cats ) )
		$args['selected_cats'] = $selected_cats;
	elseif ( $post_id )
		$args['selected_cats'] = wp_get_post_categories($post_id);
	else
		$args['selected_cats'] = array();

	if ( is_array( $popular_cats ) )
		$args['popular_cats'] = $popular_cats;
	else
		$args['popular_cats'] = get_terms( 'category', array( 'fields' => 'ids', 'orderby' => 'count', 'order' => 'DESC', 'number' => 10, 'hierarchical' => false ) );

	if ( $descendants_and_self ) {
		$categories = get_categories( "child_of=$descendants_and_self&hierarchical=0&hide_empty=0" );
		$self = get_category( $descendants_and_self );
		array_unshift( $categories, $self );
	} else {
		$categories = get_categories('get=all');
	}

	// Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
	$checked_categories = array();
	for ( $i = 0; isset($categories[$i]); $i++ ) {
		if ( in_array($categories[$i]->term_id, $args['selected_cats']) ) {
			$checked_categories[] = $categories[$i];
			unset($categories[$i]);
		}
	}

	// Put checked cats on top
	echo call_user_func_array(array(&$walker, 'walk'), array($checked_categories, 0, $args));
	// Then the rest of them
	echo call_user_func_array(array(&$walker, 'walk'), array($categories, 0, $args));
}

function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) {
	global $post_ID;
	if ( $post_ID )
		$checked_categories = wp_get_post_categories($post_ID);
	else
		$checked_categories = array();
	$categories = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) );

	$popular_ids = array();
	foreach ( (array) $categories as $category ) {
		$popular_ids[] = $category->term_id;
		if ( !$echo ) // hack for AJAX use
			continue;
		$id = "popular-category-$category->term_id";
		?>

		<li id="<?php echo $id; ?>" class="popular-category">
			<label class="selectit" for="in-<?php echo $id; ?>">
			<input id="in-<?php echo $id; ?>" type="checkbox" value="<?php echo (int) $category->term_id; ?>" />
				<?php echo wp_specialchars( apply_filters( 'the_category', $category->name ) ); ?>
			</label>
		</li>

		<?php
	}
	return $popular_ids;
}

// Deprecated. Use wp_link_category_checklist
function dropdown_link_categories( $default = 0 ) {
	global $link_id;

	wp_link_category_checklist($link_id);
}

function wp_link_category_checklist( $link_id = 0 ) {
	if ( $link_id ) {
		$checked_categories = wp_get_link_cats($link_id);

		if ( count( $checked_categories ) == 0 ) {
			// No selected categories, strange
			$checked_categories[] = $default;
		}
	} else {
		$checked_categories[] = $default;
	}

	$categories = get_terms('link_category', 'orderby=count&hide_empty=0');

	if ( empty($categories) )
		return;

	foreach ( $categories as $category ) {
		$cat_id = $category->term_id;
		$name = wp_specialchars( apply_filters('the_category', $category->name));
		$checked = in_array( $cat_id, $checked_categories );
		echo '<li id="link-category-', $cat_id, '"><label for="in-link-category-', $cat_id, '" class="selectit"><input value="', $cat_id, '" type="checkbox" name="link_category[]" id="in-link-category-', $cat_id, '"', ($checked ? ' checked="checked"' : "" ), '/> ', $name, "</label></li>";
	}
}

// Tag stuff

// Returns a single tag row (see tag_rows below)
// Note: this is also used in admin-ajax.php!
function _tag_row( $tag, $class = '' ) {
		$count = number_format_i18n( $tag->count );
		$count = ( $count > 0 ) ? "<a href='edit.php?tag=$tag->slug'>$count</a>" : $count;

		$name = apply_filters( 'term_name', $tag->name );
		$out = '';
		$out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>';
		$out .= '<th scope="row" class="check-column"> <input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" /></th>';
		$out .= '<td><strong><a class="row-title" href="edit-tags.php?action=edit&amp;tag_ID=' . $tag->term_id . '" title="' . attribute_escape(sprintf(__('Edit "%s"'), $name)) . '">' .
			$name . '</a></td>';

		$out .= "<td class='num'>$count</td>";
		$out .= '</tr>';

		return $out;
}

// Outputs appropriate rows for the Nth page of the Tag Management screen,
// assuming M tags displayed at a time on the page
// Returns the number of tags displayed
function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) {

	// Get a page worth of tags
	$start = ($page - 1) * $pagesize;

	$args = array('offset' => $start, 'number' => $pagesize, 'hide_empty' => 0);

	if ( !empty( $searchterms ) ) {
		$args['search'] = $searchterms;
	}

	$tags = get_terms( 'post_tag', $args );

	// convert it to table rows
	$out = '';
	$class = '';
	$count = 0;
	foreach( $tags as $tag )
		$out .= _tag_row( $tag, ++$count % 2 ? ' class="alternate"' : '' );

	// filter and send to screen
	$out = apply_filters('tag_rows', $out);
	echo $out;
	return $count;
}

// define the columns to display, the syntax is 'internal name' => 'display name'
function wp_manage_posts_columns() {
	$posts_columns = array();
	$posts_columns['cb'] = '<input type="checkbox" />';
	if ( 'draft' === $_GET['post_status'] )
		$posts_columns['modified'] = __('Modified');
	elseif ( 'pending' === $_GET['post_status'] )
		$posts_columns['modified'] = __('Submitted');
	else
		$posts_columns['date'] = __('Date');
	$posts_columns['title'] = __('Title');
	$posts_columns['author'] = __('Author');
	$posts_columns['categories'] = __('Categories');
	$posts_columns['tags'] = __('Tags');
	if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) )
		$posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>';
	$posts_columns['status'] = __('Status');
	$posts_columns = apply_filters('manage_posts_columns', $posts_columns);

	return $posts_columns;
}

// define the columns to display, the syntax is 'internal name' => 'display name'
function wp_manage_media_columns() {
	$posts_columns = array();
	$posts_columns['cb'] = '<input type="checkbox" />';
	$posts_columns['icon'] = '';
	$posts_columns['media'] = _c('Media|media column header');
	$posts_columns['desc'] = _c('Description|media column header');
	$posts_columns['date'] = _c('Date Added|media column header');
	$posts_columns['parent'] = _c('Appears with|media column header');
	$posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>';
	$posts_columns['location'] = _c('Location|media column header');
	$posts_columns = apply_filters('manage_media_columns', $posts_columns);

	return $posts_columns;
}

function wp_manage_pages_columns() {
	$posts_columns = array();
	$posts_columns['cb'] = '<input type="checkbox" />';
	if ( 'draft' === $_GET['post_status'] )
		$posts_columns['modified'] = __('Modified');
	elseif ( 'pending' === $_GET['post_status'] )
		$posts_columns['modified'] = __('Submitted');
	else
		$posts_columns['date'] = __('Date');
	$posts_columns['title'] = __('Title');
	$posts_columns['author'] = __('Author');
	if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) )
		$posts_columns['comments'] = '<div class="vers"><img alt="" src="images/comment-grey-bubble.png" /></div>';
	$posts_columns['status'] = __('Status');
	$posts_columns = apply_filters('manage_pages_columns', $posts_columns);

	return $posts_columns;
}

/*
 * display one row if the page doesn't have any children
 * otherwise, display the row and its children in subsequent rows
 */
function display_page_row( $page, $level = 0 ) {
	global $post;
	static $class;

	$post = $page;
	setup_postdata($page);

	$page->post_title = wp_specialchars( $page->post_title );
	$pad = str_repeat( '&#8212; ', $level );
	$id = (int) $page->ID;
	$class = ('alternate' == $class ) ? '' : 'alternate';
	$posts_columns = wp_manage_pages_columns();
	$title = get_the_title();
	if ( empty($title) )
		$title = __('(no title)');
?>
  <tr id='page-<?php echo $id; ?>' class='<?php echo $class; ?>'>


 <?php

foreach ($posts_columns as $column_name=>$column_display_name) {

	switch ($column_name) {

	case 'cb':
		?>
		<th scope="row" class="check-column"><input type="checkbox" name="delete[]" value="<?php the_ID(); ?>" /></th>
		<?php
		break;
	case 'modified':
	case 'date':
		if ( '0000-00-00 00:00:00' == $page->post_date && 'date' == $column_name ) {
			$t_time = $h_time = __('Unpublished');
		} else {
			if ( 'modified' == $column_name ) {
				$t_time = get_the_modified_time(__('Y/m/d g:i:s A'));
				$m_time = $page->post_modified;
				$time = get_post_modified_time('G', true);
			} else {
				$t_time = get_the_time(__('Y/m/d g:i:s A'));
				$m_time = $page->post_date;
				$time = get_post_time('G', true);
			}
			if ( ( abs(time() - $time) ) < 86400 ) {
				if ( ( 'future' == $page->post_status) )
					$h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
				else
					$h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
			} else {
				$h_time = mysql2date(__('Y/m/d'), $m_time);
			}
		}
		?>
		<td><abbr title="<?php echo $t_time ?>"><?php echo $h_time ?></abbr></td>
		<?php
		break;
	case 'title':
		?>
		<td><strong><a class="row-title" href="page.php?action=edit&amp;post=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a></strong>
		<?php if ('private' == $page->post_status) _e(' &#8212; <strong>Private</strong>'); ?></td>
		<?php
		break;

	case 'comments':
		?>
		<td class="num"><div class="post-com-count-wrapper">
		<?php
		$left = get_pending_comments_num( $page->ID );
		$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
		if ( $left )
			echo '<strong>';
		comments_number("<a href='edit-pages.php?page_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit-pages.php?page_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit-pages.php?page_id=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
		if ( $left )
			echo '</strong>';
		?>
		</div></td>
		<?php
		break;

	case 'author':
		?>
		<td><a href="edit-pages.php?author=<?php the_author_ID(); ?>"><?php the_author() ?></a></td>
		<?php
		break;

	case 'status':
		?>
		<td>
		<a href="<?php the_permalink(); ?>" title="<?php echo attribute_escape(sprintf(__('View "%s"'), $title)); ?>" rel="permalink">
		<?php
		switch ( $page->post_status ) {
			case 'publish' :
			case 'private' :
				_e('Published');
				break;
			case 'future' :
				_e('Scheduled');
				break;
			case 'pending' :
				_e('Pending Review');
				break;
			case 'draft' :
				_e('Unpublished');
				break;
		}
		?>
		</a>
		</td>
		<?php
		break;

	default:
		?>
		<td><?php do_action('manage_pages_custom_column', $column_name, $id); ?></td>
		<?php
		break;
	}
}
 ?>

   </tr>

<?php
}

/*
 * displays pages in hierarchical order with paging support
 */
function page_rows($pages, $pagenum = 1, $per_page = 20) {
	$level = 0;

	if ( ! $pages ) {
		$pages = get_pages( array('sort_column' => 'menu_order') );

		if ( ! $pages )
			return false;
	}

	/* 
	 * arrange pages into two parts: top level pages and children_pages
	 * children_pages is two dimensional array, eg. 
	 * children_pages[10][] contains all sub-pages whose parent is 10. 
	 * It only takes O(N) to arrange this and it takes O(1) for subsequent lookup operations
	 * If searching, ignore hierarchy and treat everything as top level
	 */
	if ( empty($_GET['s']) )  {
		
		$top_level_pages = array();
		$children_pages  = array();
		
		foreach ( $pages as $page ) {
			
			// catch and repair bad pages
			if ( $page->post_parent == $page->ID ) {
				$page->post_parent = 0;
				$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = '0' WHERE ID = %d", $page->ID) );
				clean_page_cache( $page->ID );
			}
	
			if ( 0 == $page->post_parent )
				$top_level_pages[] = $page;
			else
				$children_pages[ $page->post_parent ][] = $page;
		}

		$pages = &$top_level_pages;
	}

	$count = 0;
	$start = ($pagenum - 1) * $per_page;
	$end = $start + $per_page;
	
	foreach ( $pages as $page ) {
		if ( $count >= $end )
			break;

		if ( $count >= $start )
			echo "\t" . display_page_row( $page, $level );

		$count++;

		if ( isset($children_pages) )
			_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page );
	}
	
	// if it is the last pagenum and there are orphaned pages, display them with paging as well
	if ( isset($children_pages) && $count < $end ){
		foreach( $children_pages as $orphans ){
			foreach ( $orphans as $op ) {
				if ( $count >= $end )
					break;
				if ( $count >= $start )
					echo "\t" . display_page_row( $op, 0 );
				$count++;
			}
		}
	}
}

/*
 * Given a top level page ID, display the nested hierarchy of sub-pages
 * together with paging support
 */
function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {
	
	if ( ! isset( $children_pages[$parent] ) )
		return; 
		
	$start = ($pagenum - 1) * $per_page;
	$end = $start + $per_page;
	
	foreach ( $children_pages[$parent] as $page ) {
		
		if ( $count >= $end )
			break;
			
		// If the page starts in a subtree, print the parents.
		if ( $count == $start && $page->post_parent > 0 ) {
			$my_parents = array();
			$my_parent = $page->post_parent;
			while ( $my_parent) {
				$my_parent = get_post($my_parent);
				$my_parents[] = $my_parent;
				if ( !$my_parent->post_parent )
					break;
				$my_parent = $my_parent->post_parent;
			}
			$num_parents = count($my_parents);
			while( $my_parent = array_pop($my_parents) ) {
				echo "\t" . display_page_row( $my_parent, $level - $num_parents );
				$num_parents--;
			}
		}

		if ( $count >= $start )
			echo "\t" . display_page_row( $page, $level );
			
		$count++;

		_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page );
	}
	
	unset( $children_pages[$parent] ); //required in order to keep track of orphans
}

function user_row( $user_object, $style = '', $role = '' ) {
	global $wp_roles;

	$current_user = wp_get_current_user();
	
	if ( !( is_object( $user_object) && is_a( $user_object, 'WP_User' ) ) )
		$user_object = new WP_User( (int) $user_object );
	$email = $user_object->user_email;
	$url = $user_object->user_url;
	$short_url = str_replace( 'http://', '', $url );
	$short_url = str_replace( 'www.', '', $short_url );
	if ('/' == substr( $short_url, -1 ))
		$short_url = substr( $short_url, 0, -1 );
	if ( strlen( $short_url ) > 35 )
		$short_url =  substr( $short_url, 0, 32 ).'...';
	$numposts = get_usernumposts( $user_object->ID );
	if ( current_user_can( 'edit_user', $user_object->ID ) ) {
		if ($current_user->ID == $user_object->ID) {
			$edit = 'profile.php';
		} else {
			$edit = clean_url( add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$user_object->ID" ) );
		}
		$edit = "<a href=\"$edit\">$user_object->user_login</a>";
	} else {
		$edit = $user_object->user_login;
	}
	$role_name = $wp_roles->role_names[$role] ? translate_with_context($wp_roles->role_names[$role]) : __('None');
	$r = "<tr id='user-$user_object->ID'$style>
		<th scope='row' class='check-column'><input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' /></th>
		<td><strong>$edit</strong></td>
		<td>$user_object->first_name $user_object->last_name</td>
		<td><a href='mailto:$email' title='" . sprintf( __('e-mail: %s' ), $email ) . "'>$email</a></td>
		<td>$role_name</td>";
	$r .= "\n\t\t<td class='num'>";
	if ( $numposts > 0 ) {
		$r .= "<a href='edit.php?author=$user_object->ID' title='" . __( 'View posts by this author' ) . "' class='edit'>";
		$r .= $numposts;
		$r .= '</a>';
	} else {
		$r .= 0;
	}
	$r .= "</td>\n\t</tr>";
	return $r;
}

function _wp_get_comment_list( $status = '', $s = false, $start, $num ) {
	global $wpdb;

	$start = abs( (int) $start );
	$num = (int) $num;

	if ( 'moderated' == $status )
		$approved = "comment_approved = '0'";
	elseif ( 'approved' == $status )
		$approved = "comment_approved = '1'";
	elseif ( 'spam' == $status )
		$approved = "comment_approved = 'spam'";
	else
		$approved = "( comment_approved = '0' OR comment_approved = '1' )";

	if ( $s ) {
		$s = $wpdb->escape($s);
		$comments = $wpdb->get_results("SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments WHERE
			(comment_author LIKE '%$s%' OR
			comment_author_email LIKE '%$s%' OR
			comment_author_url LIKE ('%$s%') OR
			comment_author_IP LIKE ('%$s%') OR
			comment_content LIKE ('%$s%') ) AND
			$approved
			ORDER BY comment_date_gmt DESC LIMIT $start, $num");
	} else {
		$comments = $wpdb->get_results( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->comments USE INDEX (comment_date_gmt) WHERE $approved ORDER BY comment_date_gmt DESC LIMIT $start, $num" );
	}

	update_comment_cache($comments);

	$total = $wpdb->get_var( "SELECT FOUND_ROWS()" );

	return array($comments, $total);
}

function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true ) {
	global $comment, $post;
	$comment = get_comment( $comment_id );
	$post = get_post($comment->comment_post_ID);
	$authordata = get_userdata($post->post_author);
	$the_comment_status = wp_get_comment_status($comment->comment_ID);
	$class = ('unapproved' == $the_comment_status) ? 'unapproved' : '';

	if ( current_user_can( 'edit_post', $post->ID ) ) {
		$post_link = "<a href='" . get_comment_link() . "'>";

		$post_link .= get_the_title($comment->comment_post_ID) . '</a>';
			
		$edit_link_start = "<a class='row-title' href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>";
		$edit_link_end = '</a>';
	} else {
		$post_link = get_the_title($comment->comment_post_ID);
		$edit_link_start = $edit_link_end ='';
	}
	
	$author_url = get_comment_author_url();
	if ( 'http://' == $author_url )
		$author_url = '';
	$author_url_display = $author_url;
	if ( strlen($author_url_display) > 50 )
		$author_url_display = substr($author_url_display, 0, 49) . '...';

	$ptime = date('G', strtotime( $comment->comment_date ) );
	if ( ( abs(time() - $ptime) ) < 86400 )
		$ptime = sprintf( __('%s ago'), human_time_diff( $ptime ) );
	else
		$ptime = mysql2date(__('Y/m/d \a\t g:i A'), $comment->comment_date );

	$delete_url    = clean_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
	$approve_url   = clean_url( wp_nonce_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "approve-comment_$comment->comment_ID" ) );
	$unapprove_url = clean_url( wp_nonce_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "unapprove-comment_$comment->comment_ID" ) );
	$spam_url      = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );

?>
  <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $class; ?>'>
<?php if ( $checkbox ) : ?>
    <td class="check-column"><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td>
<?php endif; ?>
    <td class="comment">
    <p class="comment-author"><strong><?php echo $edit_link_start; comment_author(); echo $edit_link_end; ?></strong><br />
    <?php if ( !empty($author_url) ) : ?>
    <a href="<?php echo $author_url ?>"><?php echo $author_url_display; ?></a> |
    <?php endif; ?>
    <?php if ( current_user_can( 'edit_post', $post->ID ) ) : ?>
    <?php if ( !empty($comment->comment_author_email) ): ?>
    <?php comment_author_email_link() ?> |
    <?php endif; ?>
    <a href="edit-comments.php?s=<?php comment_author_IP() ?>&amp;mode=detail"><?php comment_author_IP() ?></a>
	<?php endif; //current_user_can?>    
    </p>
   	<?php if ( 'detail' == $mode ) comment_text(); ?>
   	<p><?php printf(__('From %1$s, %2$s'), $post_link, $ptime) ?></p>
    </td>
    <td><?php comment_date(__('Y/m/d')); ?></td>
    <td class="action-links">
<?php

	$actions = array();

	if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
		$actions['approve']   = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | ';
		$actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | ';

		// we're looking at list of only approved or only unapproved comments
		if ( 'moderated' == $comment_status ) {
			$actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | ';
			unset($actions['unapprove']);
		} elseif ( 'approved' == $comment_status ) {
			$actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | ';
			unset($actions['approve']);
		}

		$actions['spam']      = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | ';
		$actions['delete']    = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . '</a>';
		$actions = apply_filters( 'comment_row_actions', $actions, $comment );
		foreach ( $actions as $action => $link )
			echo "<span class='$action'>$link</span>";
	}
	?>
	</td>
  </tr>
	<?php
}

function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
	if (!$categories )
		$categories = get_categories( array('hide_empty' => 0) );

	if ( $categories ) {
		foreach ( $categories as $category ) {
			if ( $currentcat != $category->term_id && $parent == $category->parent) {
				$pad = str_repeat( '&#8211; ', $level );
				$category->name = wp_specialchars( $category->name );
				echo "\n\t<option value='$category->term_id'";
				if ( $currentparent == $category->term_id )
					echo " selected='selected'";
				echo ">$pad$category->name</option>";
				wp_dropdown_cats( $currentcat, $currentparent, $category->term_id, $level +1, $categories );
			}
		}
	} else {
		return false;
	}
}

function list_meta( $meta ) {
	// Exit if no meta
	if (!$meta ) {
		echo '<tbody id="the-list" class="list:meta"><tr style="display: none;"><td>&nbsp;</td></tr></tbody>'; //TBODY needed for list-manipulation JS
		return;
	}
	$count = 0;
?>
	<thead>
	<tr>
		<th><?php _e( 'Key' ) ?></th>
		<th><?php _e( 'Value' ) ?></th>
		<th colspan='2'><?php _e( 'Action' ) ?></th>
	</tr>
	</thead>
	<tbody id='the-list' class='list:meta'>
<?php
	foreach ( $meta as $entry )
		echo _list_meta_row( $entry, $count );
	echo "\n\t</tbody>";
}

function _list_meta_row( $entry, &$count ) {
	static $update_nonce = false;
	if ( !$update_nonce )
		$update_nonce = wp_create_nonce( 'add-meta' );

	$r = '';
	++ $count;
	if ( $count % 2 )
		$style = 'alternate';
	else
		$style = '';
	if ('_' == $entry['meta_key'] { 0 } )
		$style .= ' hidden';

	if ( is_serialized( $entry['meta_value'] ) ) {
		if ( is_serialized_string( $entry['meta_value'] ) ) {
			// this is a serialized string, so we should display it
			$entry['meta_value'] = maybe_unserialize( $entry['meta_value'] );
		} else {
			// this is a serialized array/object so we should NOT display it
			--$count;
			return;
		}
	}

	$entry['meta_key']   = attribute_escape($entry['meta_key']);
	$entry['meta_value'] = htmlspecialchars($entry['meta_value']); // using a <textarea />
	$entry['meta_id'] = (int) $entry['meta_id'];

	$delete_nonce = wp_create_nonce( 'delete-meta_' . $entry['meta_id'] );

	$r .= "\n\t<tr id='meta-{$entry['meta_id']}' class='$style'>";
	$r .= "\n\t\t<td valign='top'><label class='hidden' for='meta[{$entry['meta_id']}][key]'>" . __( 'Key' ) . "</label><input name='meta[{$entry['meta_id']}][key]' id='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>";
	$r .= "\n\t\t<td><label class='hidden' for='meta[{$entry['meta_id']}][value]'>" . __( 'Value' ) . "</label><textarea name='meta[{$entry['meta_id']}][value]' id='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>";
	$r .= "\n\t\t<td style='text-align: center;'><input name='updatemeta' type='submit' tabindex='6' value='".attribute_escape(__( 'Update' ))."' class='add:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$update_nonce updatemeta' /><br />";
	$r .= "\n\t\t<input name='deletemeta[{$entry['meta_id']}]' type='submit' ";
	$r .= "class='delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta' tabindex='6' value='".attribute_escape(__( 'Delete' ))."' />";
	$r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );
	$r .= "</td>\n\t</tr>";
	return $r;
}

function meta_form() {
	global $wpdb;
	$limit = (int) apply_filters( 'postmeta_form_limit', 30 );
	$keys = $wpdb->get_col( "
		SELECT meta_key
		FROM $wpdb->postmeta
		WHERE meta_key NOT LIKE '\_%'
		GROUP BY meta_key
		ORDER BY meta_id DESC
		LIMIT $limit" );
	if ( $keys )
		natcasesort($keys);
?>
<p><strong><?php _e( 'Add a new custom field:' ) ?></strong></p>
<table id="newmeta" cellspacing="3" cellpadding="3">
	<tr>
<th colspan="2"><label <?php if ( $keys ) : ?> for="metakeyselect" <?php else : ?> for="metakeyinput" <?php endif; ?>><?php _e( 'Key' ) ?></label></th>
<th><label for="metavalue"><?php _e( 'Value' ) ?></label></th>
</tr>
	<tr valign="top">
		<td style="width: 18%;" class="textright">
<?php if ( $keys ) : ?>
<select id="metakeyselect" name="metakeyselect" tabindex="7">
<option value="#NONE#"><?php _e( '- Select -' ); ?></option>
<?php

	foreach ( $keys as $key ) {
		$key = attribute_escape( $key );
		echo "\n\t<option value='$key'>$key</option>";
	}
?>
</select> <label for="metakeyinput"><?php _e( 'or' ); ?></label>
<?php endif; ?>
</td>
<td><input type="text" id="metakeyinput" name="metakeyinput" tabindex="7" /></td>
		<td><textarea id="metavalue" name="metavalue" rows="3" cols="25" tabindex="8"></textarea></td>
	</tr>
<tr class="submit"><td colspan="3">
	<?php wp_nonce_field( 'add-meta', '_ajax_nonce', false ); ?>
	<input type="submit" id="addmetasub" name="addmeta" class="add:the-list:newmeta" tabindex="9" value="<?php _e( 'Add Custom Field' ) ?>" />
</td></tr>
</table>
<?php

}

function touch_time( $edit = 1, $for_post = 1, $tab_index = 0 ) {
	global $wp_locale, $post, $comment;

	if ( $for_post )
		$edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true;

	$tab_index_attribute = '';
	if ( (int) $tab_index > 0 )
		$tab_index_attribute = " tabindex=\"$tab_index\"";

	// echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';

	$time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );
	$post_date = ($for_post) ? $post->post_date : $comment->comment_date;
	$jj = ($edit) ? mysql2date( 'd', $post_date ) : gmdate( 'd', $time_adj );
	$mm = ($edit) ? mysql2date( 'm', $post_date ) : gmdate( 'm', $time_adj );
	$aa = ($edit) ? mysql2date( 'Y', $post_date ) : gmdate( 'Y', $time_adj );
	$hh = ($edit) ? mysql2date( 'H', $post_date ) : gmdate( 'H', $time_adj );
	$mn = ($edit) ? mysql2date( 'i', $post_date ) : gmdate( 'i', $time_adj );
	$ss = ($edit) ? mysql2date( 's', $post_date ) : gmdate( 's', $time_adj );

	$month = "<select id=\"mm\" name=\"mm\"$tab_index_attribute>\n";
	for ( $i = 1; $i < 13; $i = $i +1 ) {
		$month .= "\t\t\t" . '<option value="' . zeroise($i, 2) . '"';
		if ( $i == $mm )
			$month .= ' selected="selected"';
		$month .= '>' . $wp_locale->get_month( $i ) . "</option>\n";
	}
	$month .= '</select>';

	$day = '<input type="text" id="jj" name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off"  />';
	$year = '<input type="text" id="aa" name="aa" value="' . $aa . '" size="4" maxlength="5"' . $tab_index_attribute . ' autocomplete="off"  />';
	$hour = '<input type="text" id="hh" name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off"  />';
	$minute = '<input type="text" id="mn" name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off"  />';
	printf(_c('%1$s%2$s, %3$s <br />@ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute);
	echo "\n\n";
	foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit )
		echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $$timeunit . '" />' . "\n";
?>

<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" />
<?php
}

function page_template_dropdown( $default = '' ) {
	$templates = get_page_templates();
	ksort( $templates );
	foreach (array_keys( $templates ) as $template )
		: if ( $default == $templates[$template] )
			$selected = " selected='selected'";
		else
			$selected = '';
	echo "\n\t<option value='".$templates[$template]."' $selected>$template</option>";
	endforeach;
}

function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
	global $wpdb, $post_ID;
	$items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) );

	if ( $items ) {
		foreach ( $items as $item ) {
			// A page cannot be its own parent.
			if (!empty ( $post_ID ) ) {
				if ( $item->ID == $post_ID ) {
					continue;
				}
			}
			$pad = str_repeat( '&nbsp;', $level * 3 );
			if ( $item->ID == $default)
				$current = ' selected="selected"';
			else
				$current = '';

			echo "\n\t<option value='$item->ID'$current>$pad " . wp_specialchars($item->post_title) . "</option>";
			parent_dropdown( $default, $item->ID, $level +1 );
		}
	} else {
		return false;
	}
}

function browse_happy() {
	$getit = __( 'WordPress recommends a better browser' );
	echo '
		<span id="bh" class="alignright"><a href="http://browsehappy.com/" title="'.$getit.'"><img src="images/browse-happy.gif" alt="Browse Happy" /></a></span>
		';
}

if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)
	add_action( 'in_admin_footer', 'browse_happy' );

function the_attachment_links( $id = false ) {
	$id = (int) $id;
	$post = & get_post( $id );

	if ( $post->post_type != 'attachment' )
		return false;

	$icon = get_attachment_icon( $post->ID );
	$attachment_data = wp_get_attachment_metadata( $id );
	$thumb = isset( $attachment_data['thumb'] );
?>
<form id="the-attachment-links">
<table>
	<col />
	<col class="widefat" />
	<tr>
		<th scope="row"><?php _e( 'URL' ) ?></th>
		<td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><?php echo wp_get_attachment_url(); ?></textarea></td>
	</tr>
<?php if ( $icon ) : ?>
	<tr>
		<th scope="row"><?php $thumb ? _e( 'Thumbnail linked to file' ) : _e( 'Image linked to file' ); ?></th>
		<td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>"><?php echo $icon ?></a></textarea></td>
	</tr>
	<tr>
		<th scope="row"><?php $thumb ? _e( 'Thumbnail linked to page' ) : _e( 'Image linked to page' ); ?></th>
		<td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link( $post->ID ) ?>" rel="attachment wp-att-<?php echo $post->ID; ?>"><?php echo $icon ?></a></textarea></td>
	</tr>
<?php else : ?>
	<tr>
		<th scope="row"><?php _e( 'Link to file' ) ?></th>
		<td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo wp_get_attachment_url(); ?>" class="attachmentlink"><?php echo basename( wp_get_attachment_url() );  ?></a></textarea></td>
	</tr>
	<tr>
		<th scope="row"><?php _e( 'Link to page' ) ?></th>
		<td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link( $post->ID ) ?>" rel="attachment wp-att-<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td>
	</tr>
<?php endif; ?>
</table>
</form>
<?php
}

function wp_dropdown_roles( $default = false ) {
	global $wp_roles;
	$r = '';
	foreach( $wp_roles->role_names as $role => $name ) {
		$name = translate_with_context($name);
		if ( $default == $role ) // Make default first in list
			$p = "\n\t<option selected='selected' value='$role'>$name</option>";
		else
			$r .= "\n\t<option value='$role'>$name</option>";
	}
	echo $p . $r;
}

function wp_convert_hr_to_bytes( $size ) {
	$size = strtolower($size);
	$bytes = (int) $size;
	if ( strpos($size, 'k') !== false )
		$bytes = intval($size) * 1024;
	elseif ( strpos($size, 'm') !== false )
		$bytes = intval($size) * 1024 * 1024;
	elseif ( strpos($size, 'g') !== false )
		$bytes = intval($size) * 1024 * 1024 * 1024;
	return $bytes;
}

function wp_convert_bytes_to_hr( $bytes ) {
	$units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' );
	$log = log( $bytes, 1024 );
	$power = (int) $log;
	$size = pow(1024, $log - $power);
	return $size . $units[$power];
}

function wp_max_upload_size() {
	$u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) );
	$p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) );
	$bytes = apply_filters( 'upload_size_limit', min($u_bytes, $p_bytes), $u_bytes, $p_bytes );
	return $bytes;
}

function wp_import_upload_form( $action ) {
	$bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
	$size = wp_convert_bytes_to_hr( $bytes );
?>
<form enctype="multipart/form-data" id="import-upload-form" method="post" action="<?php echo attribute_escape($action) ?>">
<p>
<?php wp_nonce_field('import-upload'); ?>
<label for="upload"><?php _e( 'Choose a file from your computer:' ); ?></label> (<?php printf( __('Maximum size: %s' ), $size ); ?>)
<input type="file" id="upload" name="import" size="25" />
<input type="hidden" name="action" value="save" />
<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
</p>
<p class="submit">
<input type="submit" class="button" value="<?php _e( 'Upload file and import' ); ?>" />
</p>
</form>
<?php
}

function wp_remember_old_slug() {
	global $post;
	$name = attribute_escape($post->post_name); // just in case
	if ( strlen($name) )
		echo '<input type="hidden" id="wp-old-slug" name="wp-old-slug" value="' . $name . '" />';
}

/**
 * add_meta_box() - Add a meta box to an edit form
 *
 * @since 2.5
 *
 * @param string $id String for use in the 'id' attribute of tags.
 * @param string $title Title of the meta box
 * @param string $callback Function that fills the box with the desired content.  The function should echo its output.
 * @param string $page The type of edit page on which to show the box (post, page, link)
 * @param string $context The context within the page where the boxes should show ('normal', 'advanced')
 * @param string $priority The priority within the context where the boxes should show ('high', 'low')
 */
function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default') {
	global $wp_meta_boxes;

	
	if  ( !isset($wp_meta_boxes) )
		$wp_meta_boxes = array();
	if ( !isset($wp_meta_boxes[$page]) )
		$wp_meta_boxes[$page] = array();
	if ( !isset($wp_meta_boxes[$page][$context]) )
		$wp_meta_boxes[$page][$context] = array();

	foreach ( array('high', 'core', 'default', 'low') as $a_priority ) {
		if ( !isset($wp_meta_boxes[$page][$context][$a_priority][$id]) )
			continue;
		// If a core box was previously added or removed by a plugin, don't add.
		if ( 'core' == $priority ) {
			// If core box previously deleted, don't add
			if ( false === $wp_meta_boxes[$page][$context][$a_priority][$id] )
				return;
			// If box was added with default priority, give it core priority to maintain sort order
			if ( 'default' == $a_priority ) {
				$wp_meta_boxes[$page][$context]['core'][$id] = $wp_meta_boxes[$page][$context]['default'][$id];
				unset($wp_meta_boxes[$page][$context]['default'][$id]);
			}
			return;
		}
		// If no priority given and id already present, use existing priority
		if ( empty($priority) )
			$priority = $a_priority;
		// An id can be in only one priority
		if ( $priority != $a_priority )
			unset($wp_meta_boxes[$page][$context][$a_priority][$id]);
	}

	if ( empty($priority) )
		$priority = low;

	if ( !isset($wp_meta_boxes[$page][$context][$priority]) )
		$wp_meta_boxes[$page][$context][$priority] = array();

	$wp_meta_boxes[$page][$context][$priority][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback);
}

function do_meta_boxes($page, $context, $object) {
	global $wp_meta_boxes;

	do_action('do_meta_boxes', $page, $context, $object);

	if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) )
		return;

	foreach ( array('high', 'core', 'default', 'low') as $priority ) {
		foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) {
			if ( false === $box )
				continue;
			echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '">' . "\n";
			echo "<h3>{$box['title']}</h3>\n";
			echo '<div class="inside">' . "\n";
			call_user_func($box['callback'], $object, $box);
			echo "</div>\n";
			echo "</div>\n";
		}
	}
}

/**
 * remove_meta_box() - Remove a meta box from an edit form
 *
 * @since 2.6
 *
 * @param string $id String for use in the 'id' attribute of tags.
 * @param string $page The type of edit page on which to show the box (post, page, link)
 * @param string $context The context within the page where the boxes should show ('normal', 'advanced')
 */
function remove_meta_box($id, $page, $context) {
	global $wp_meta_boxes;

	if  ( !isset($wp_meta_boxes) )
		$wp_meta_boxes = array();
	if ( !isset($wp_meta_boxes[$page]) )
		$wp_meta_boxes[$page] = array();
	if ( !isset($wp_meta_boxes[$page][$context]) )
		$wp_meta_boxes[$page][$context] = array();

	foreach ( array('high', 'core', 'default', 'low') as $priority )
		$wp_meta_boxes[$page][$context][$priority][$id] = false;
}

?>
       blog/wp-admin/includes/theme.php                                                                    0000755 0023433 0004734 00000002742 11060470744 016521  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

function current_theme_info() {
	$themes = get_themes();
	$current_theme = get_current_theme();
	$ct->name = $current_theme;
	$ct->title = $themes[$current_theme]['Title'];
	$ct->version = $themes[$current_theme]['Version'];
	$ct->parent_theme = $themes[$current_theme]['Parent Theme'];
	$ct->template_dir = $themes[$current_theme]['Template Dir'];
	$ct->stylesheet_dir = $themes[$current_theme]['Stylesheet Dir'];
	$ct->template = $themes[$current_theme]['Template'];
	$ct->stylesheet = $themes[$current_theme]['Stylesheet'];
	$ct->screenshot = $themes[$current_theme]['Screenshot'];
	$ct->description = $themes[$current_theme]['Description'];
	$ct->author = $themes[$current_theme]['Author'];
	$ct->tags = $themes[$current_theme]['Tags'];
	return $ct;
}

function get_broken_themes() {
	global $wp_broken_themes;

	get_themes();
	return $wp_broken_themes;
}

function get_page_templates() {
	$themes = get_themes();
	$theme = get_current_theme();
	$templates = $themes[$theme]['Template Files'];
	$page_templates = array ();

	if ( is_array( $templates ) ) {
		foreach ( $templates as $template ) {
			$template_data = implode( '', file( WP_CONTENT_DIR.$template ));

			preg_match( '|Template Name:(.*)$|mi', $template_data, $name );
			preg_match( '|Description:(.*)$|mi', $template_data, $description );

			$name = $name[1];
			$description = $description[1];

			if ( !empty( $name ) ) {
				$page_templates[trim( $name )] = basename( $template );
			}
		}
	}

	return $page_templates;
}

?>
                              blog/wp-admin/includes/update.php                                                                   0000755 0023433 0004734 00000016127 11060470745 016704  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

// The admin side of our 1.1 update system

function core_update_footer( $msg = '' ) {
	if ( !current_user_can('manage_options') )
		return sprintf( '| '.__( 'Version %s' ), $GLOBALS['wp_version'] );

	$cur = get_option( 'update_core' );

	switch ( $cur->response ) {
	case 'development' :
		return sprintf( '| '.__( 'You are using a development version (%s). Cool! Please <a href="%s">stay updated</a>.' ), $GLOBALS['wp_version'], $cur->url, $cur->current );
	break;

	case 'upgrade' :
		if ( current_user_can('manage_options') ) {
			return sprintf( '| <strong>'.__( '<a href="%2$s">Get Version %3$s</a>' ).'</strong>', $GLOBALS['wp_version'], $cur->url, $cur->current );
			break;
		}

	case 'latest' :
	default :
		return sprintf( '| '.__( 'Version %s' ), $GLOBALS['wp_version'], $cur->url, $cur->current );
	break;
	}
}
add_filter( 'update_footer', 'core_update_footer' );

function update_nag() {
	$cur = get_option( 'update_core' );

	if ( ! isset( $cur->response ) || $cur->response != 'upgrade' )
		return false;

	if ( current_user_can('manage_options') )
		$msg = sprintf( __('WordPress %2$s is available! <a href="%1$s">Please update now</a>.'), $cur->url, $cur->current );
	else
		$msg = sprintf( __('WordPress %2$s is available! Please notify the site administrator.'), $cur->url, $cur->current );

	echo "<div id='update-nag'>$msg</div>";
}
add_action( 'admin_notices', 'update_nag', 3 );

// Called directly from dashboard
function update_right_now_message() {
	$cur = get_option( 'update_core' );

	$msg = sprintf( __('This is WordPress version %s.'), $GLOBALS['wp_version'] );
	if ( isset( $cur->response ) && $cur->response == 'upgrade' && current_user_can('manage_options') )
		$msg .= " <a href='$cur->url' class='rbutton'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';

	echo "<span id='wp-version-message'>$msg</span>";
}

function wp_plugin_update_row( $file, $plugin_data ) {
	$current = get_option( 'update_plugins' );
	if ( !isset( $current->response[ $file ] ) )
		return false;

	$r = $current->response[ $file ];

	echo '<tr><td colspan="5" class="plugin-update">';
	if ( ! current_user_can('update_plugins') )
		printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a>.'), $plugin_data['Name'], $r->url, $r->new_version);
	else if ( empty($r->package) )
		printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> <em>automatic upgrade unavailable for this plugin</em>.'), $plugin_data['Name'], $r->url, $r->new_version);
	else
		printf( __('There is a new version of %1$s available. <a href="%2$s">Download version %3$s here</a> or <a href="%4$s">upgrade automatically</a>.'), $plugin_data['Name'], $r->url, $r->new_version, wp_nonce_url('update.php?action=upgrade-plugin&amp;plugin=' . $file, 'upgrade-plugin_' . $file) );
	
	echo '</td></tr>';
}
add_action( 'after_plugin_row', 'wp_plugin_update_row', 10, 2 );

function wp_update_plugin($plugin, $feedback = '') {
	global $wp_filesystem;

	if ( !empty($feedback) )
		add_filter('update_feedback', $feedback);

	// Is an update available?
	$current = get_option( 'update_plugins' );
	if ( !isset( $current->response[ $plugin ] ) )
		return new WP_Error('up_to_date', __('The plugin is at the latest version.'));

	// Is a filesystem accessor setup?
	if ( ! $wp_filesystem || ! is_object($wp_filesystem) )
		WP_Filesystem();

	if ( ! is_object($wp_filesystem) )
		return new WP_Error('fs_unavailable', __('Could not access filesystem.'));

	if ( $wp_filesystem->errors->get_error_code() )
		return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors);

	//Get the base plugin folder
	$plugins_dir = $wp_filesystem->wp_plugins_dir();
	if ( empty($plugins_dir) )
		return new WP_Error('fs_no_plugins_dir', __('Unable to locate WordPress Plugin directory.'));

	//And the same for the Content directory.
	$content_dir = $wp_filesystem->wp_content_dir();
	if( empty($content_dir) )
		return new WP_Error('fs_no_content_dir', __('Unable to locate WordPress Content directory (wp-content).'));
	
	$plugins_dir = trailingslashit( $plugins_dir );
	$content_dir = trailingslashit( $content_dir );

	// Get the URL to the zip file
	$r = $current->response[ $plugin ];

	if ( empty($r->package) )
		return new WP_Error('no_package', __('Upgrade package not available.'));

	// Download the package
	$package = $r->package;
	apply_filters('update_feedback', sprintf(__('Downloading update from %s'), $package));
	$download_file = download_url($package);

	if ( is_wp_error($download_file) )
		return new WP_Error('download_failed', __('Download failed.'), $download_file->get_error_message());

	$working_dir = $content_dir . 'upgrade/' . basename($plugin, '.php');

	// Clean up working directory
	if ( $wp_filesystem->is_dir($working_dir) )
		$wp_filesystem->delete($working_dir, true);

	apply_filters('update_feedback', __('Unpacking the update'));
	// Unzip package to working directory
	$result = unzip_file($download_file, $working_dir);
	
	// Once extracted, delete the package
	unlink($download_file);
	
	if ( is_wp_error($result) ) {
		$wp_filesystem->delete($working_dir, true);
		return $result;
	}

	if ( is_plugin_active($plugin) ) {
		//Deactivate the plugin silently, Prevent deactivation hooks from running.
		apply_filters('update_feedback', __('Deactivating the plugin'));
		deactivate_plugins($plugin, true);
	}

	// Remove the existing plugin.
	apply_filters('update_feedback', __('Removing the old version of the plugin'));
	$this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin) );
	
	// If plugin is in its own directory, recursively delete the directory.
	if ( strpos($plugin, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder
		$deleted = $wp_filesystem->delete($this_plugin_dir, true);
	else
		$deleted = $wp_filesystem->delete($plugins_dir . $plugin);

	if ( ! $deleted ) {
		$wp_filesystem->delete($working_dir, true);
		return new WP_Error('delete_failed', __('Could not remove the old plugin'));
	}

	apply_filters('update_feedback', __('Installing the latest version'));
	// Copy new version of plugin into place.
	$result = copy_dir($working_dir, $plugins_dir);
	if ( is_wp_error($result) ) {
		//$wp_filesystem->delete($working_dir, true); //TODO: Uncomment? This DOES mean that the new files are available in the upgrade folder if it fails.
		return $result;
	}

	//Get a list of the directories in the working directory before we delete it, We need to know the new folder for the plugin
	$filelist = array_keys( $wp_filesystem->dirlist($working_dir) );

	// Remove working directory
	$wp_filesystem->delete($working_dir, true);

	// Force refresh of plugin update information
	delete_option('update_plugins');
	
	if( empty($filelist) )
		return false; //We couldnt find any files in the working dir, therefor no plugin installed? Failsafe backup.
	
	$folder = $filelist[0];
	$plugin = get_plugins('/' . $folder); //Ensure to pass with leading slash
	$pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list

	return  $folder . '/' . $pluginfiles[0];
}

?>
                                                                                                                                                                                                                                                                                                                                                                                                                                         blog/wp-admin/includes/upgrade.php                                                                  0000755 0023433 0004734 00000136324 11060470746 017054  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

if ( file_exists(WP_CONTENT_DIR . '/install.php') )
	require (WP_CONTENT_DIR . '/install.php');
require_once(ABSPATH . 'wp-admin/includes/admin.php');
require_once(ABSPATH . 'wp-admin/includes/schema.php');

if ( !function_exists('wp_install') ) :
function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='') {
	global $wp_rewrite;

	wp_check_mysql_version();
	wp_cache_flush();
	make_db_current_silent();
	populate_options();
	populate_roles();

	update_option('blogname', $blog_title);
	update_option('admin_email', $user_email);
	update_option('blog_public', $public);

	$guessurl = wp_guess_url();

	update_option('siteurl', $guessurl);

	// If not a public blog, don't ping.
	if ( ! $public )
		update_option('default_pingback_flag', 0);

	// Create default user.  If the user already exists, the user tables are
	// being shared among blogs.  Just set the role in that case.
	$user_id = username_exists($user_name);
	if ( !$user_id ) {
		$random_password = wp_generate_password();
		$user_id = wp_create_user($user_name, $random_password, $user_email);
	} else {
		$random_password = __('User already exists.  Password inherited.');
	}

	$user = new WP_User($user_id);
	$user->set_role('administrator');

	wp_install_defaults($user_id);

	$wp_rewrite->flush_rules();

	wp_new_blog_notification($blog_title, $guessurl, $user_id, $random_password);

	wp_cache_flush();

	return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $random_password);
}
endif;

if ( !function_exists('wp_install_defaults') ) :
function wp_install_defaults($user_id) {
	global $wpdb;

	// Default category
	$cat_name = $wpdb->escape(__('Uncategorized'));
	$cat_slug = sanitize_title(_c('Uncategorized|Default category slug'));
	$wpdb->query("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES ('$cat_name', '$cat_slug', '0')");
	$wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('1', 'category', '', '0', '1')");

	// Default link category
	$cat_name = $wpdb->escape(__('Blogroll'));
	$cat_slug = sanitize_title(_c('Blogroll|Default link category slug'));
	$wpdb->query("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES ('$cat_name', '$cat_slug', '0')");
	$wpdb->query("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ('2', 'link_category', '', '0', '7')");

	// Now drop in some default links
	$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://codex.wordpress.org/', 'Documentation', 0, '', '');");
	$wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (1, 2)" );

	$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/development/', 'Development Blog', 0, 'http://wordpress.org/development/feed/', '');");
	$wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (2, 2)" );

	$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/ideas/', 'Suggest Ideas', 0, '', '');");
	$wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (3, 2)" );

	$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/support/', 'Support Forum', 0, '', '');");
	$wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (4, 2)" );

	$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/plugins/', 'Plugins', 0, '', '');");
	$wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (5, 2)" );

	$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://wordpress.org/extend/themes/', 'Themes', 0, '', '');");
	$wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (6, 2)" );

	$wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_category, link_rss, link_notes) VALUES ('http://planet.wordpress.org/', 'WordPress Planet', 0, '', '');");
	$wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (7, 2)" );

	// First post
	$now = date('Y-m-d H:i:s');
	$now_gmt = gmdate('Y-m-d H:i:s');
	$first_post_guid = get_option('home') . '/?p=1';
	$wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, guid, comment_count, to_ping, pinged, post_content_filtered) VALUES ($user_id, '$now', '$now_gmt', '".$wpdb->escape(__('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!'))."', '', '".$wpdb->escape(__('Hello world!'))."', '0', '".$wpdb->escape(_c('hello-world|Default post slug'))."', '$now', '$now_gmt', '$first_post_guid', '1', '', '', '')");
	$wpdb->query( "INSERT INTO $wpdb->term_relationships (`object_id`, `term_taxonomy_id`) VALUES (1, 1)" );

	// Default comment
	$wpdb->query("INSERT INTO $wpdb->comments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_date, comment_date_gmt, comment_content) VALUES ('1', '".$wpdb->escape(__('Mr WordPress'))."', '', 'http://wordpress.org/', '$now', '$now_gmt', '".$wpdb->escape(__('Hi, this is a comment.<br />To delete a comment, just log in and view the post&#039;s comments. There you will have the option to edit or delete them.'))."')");

	// First Page
	$first_post_guid = get_option('home') . '/?page_id=2';
	$wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_excerpt, post_title, post_category, post_name, post_modified, post_modified_gmt, guid, post_status, post_type, to_ping, pinged, post_content_filtered) VALUES ($user_id, '$now', '$now_gmt', '".$wpdb->escape(__('This is an example of a WordPress page, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many pages like this one or sub-pages as you like and manage all of your content inside of WordPress.'))."', '', '".$wpdb->escape(__('About'))."', '0', '".$wpdb->escape(_c('about|Default page slug'))."', '$now', '$now_gmt','$first_post_guid', 'publish', 'page', '', '', '')");
}
endif;

if ( !function_exists('wp_new_blog_notification') ) :
function wp_new_blog_notification($blog_title, $blog_url, $user_id, $password) {
	$user = new WP_User($user_id);
	$email = $user->user_email;
	$name = $user->user_login;
	$message_headers = 'From: "' . $blog_title . '" <wordpress@' . $_SERVER['SERVER_NAME'] . '>';
	$message = sprintf(__("Your new WordPress blog has been successfully set up at:

%1\$s

You can log in to the administrator account with the following information:

Username: %2\$s
Password: %3\$s

We hope you enjoy your new blog. Thanks!

--The WordPress Team
http://wordpress.org/
"), $blog_url, $name, $password);

	@wp_mail($email, __('New WordPress Blog'), $message, $message_headers);
}
endif;

if ( !function_exists('wp_upgrade') ) :
function wp_upgrade() {
	global $wp_current_db_version, $wp_db_version;

	$wp_current_db_version = __get_option('db_version');

	// We are up-to-date.  Nothing to do.
	if ( $wp_db_version == $wp_current_db_version )
		return;

	wp_check_mysql_version();
	wp_cache_flush();
	make_db_current_silent();
	upgrade_all();
	wp_cache_flush();
}
endif;

// Functions to be called in install and upgrade scripts
function upgrade_all() {
	global $wp_current_db_version, $wp_db_version, $wp_rewrite;
	$wp_current_db_version = __get_option('db_version');

	// We are up-to-date.  Nothing to do.
	if ( $wp_db_version == $wp_current_db_version )
		return;

	// If the version is not set in the DB, try to guess the version.
	if ( empty($wp_current_db_version) ) {
		$wp_current_db_version = 0;

		// If the template option exists, we have 1.5.
		$template = __get_option('template');
		if ( !empty($template) )
			$wp_current_db_version = 2541;
	}

	if ( $wp_current_db_version < 6039 )
		upgrade_230_options_table();

	populate_options();

	if ( $wp_current_db_version < 2541 ) {
		upgrade_100();
		upgrade_101();
		upgrade_110();
		upgrade_130();
	}

	if ( $wp_current_db_version < 3308 )
		upgrade_160();

	if ( $wp_current_db_version < 4772 )
		upgrade_210();

	if ( $wp_current_db_version < 4351 )
		upgrade_old_slugs();

	if ( $wp_current_db_version < 5539 )
		upgrade_230();

	if ( $wp_current_db_version < 6124 )
		upgrade_230_old_tables();

	if ( $wp_current_db_version < 7499 )
		upgrade_250();

	if ( $wp_current_db_version < 7796 )
		upgrade_251();

	if ( $wp_current_db_version < 7935 )
		upgrade_252();

	if ( $wp_current_db_version < 8201 )
		upgrade_260();

	maybe_disable_automattic_widgets();

	$wp_rewrite->flush_rules();

	update_option('db_version', $wp_db_version);
}

function upgrade_100() {
	global $wpdb;

	// Get the title and ID of every post, post_name to check if it already has a value
	$posts = $wpdb->get_results("SELECT ID, post_title, post_name FROM $wpdb->posts WHERE post_name = ''");
	if ($posts) {
		foreach($posts as $post) {
			if ('' == $post->post_name) {
				$newtitle = sanitize_title($post->post_title);
				$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_name = %s WHERE ID = %d", $newtitle, $post->ID) );
			}
		}
	}

	$categories = $wpdb->get_results("SELECT cat_ID, cat_name, category_nicename FROM $wpdb->categories");
	foreach ($categories as $category) {
		if ('' == $category->category_nicename) {
			$newtitle = sanitize_title($category->cat_name);
			$wpdb->query( $wpdb->prepare("UPDATE $wpdb->categories SET category_nicename = %s WHERE cat_ID = %d", $newtitle, $category->cat_ID) );
		}
	}


	$wpdb->query("UPDATE $wpdb->options SET option_value = REPLACE(option_value, 'wp-links/links-images/', 'wp-images/links/')
	WHERE option_name LIKE 'links_rating_image%'
	AND option_value LIKE 'wp-links/links-images/%'");

	$done_ids = $wpdb->get_results("SELECT DISTINCT post_id FROM $wpdb->post2cat");
	if ($done_ids) :
		foreach ($done_ids as $done_id) :
			$done_posts[] = $done_id->post_id;
		endforeach;
		$catwhere = ' AND ID NOT IN (' . implode(',', $done_posts) . ')';
	else:
		$catwhere = '';
	endif;

	$allposts = $wpdb->get_results("SELECT ID, post_category FROM $wpdb->posts WHERE post_category != '0' $catwhere");
	if ($allposts) :
		foreach ($allposts as $post) {
			// Check to see if it's already been imported
			$cat = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->post2cat WHERE post_id = %d AND category_id = %d", $post->ID, $post->post_category) );
			if (!$cat && 0 != $post->post_category) { // If there's no result
				$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->post2cat
					(post_id, category_id)
					VALUES (%s, %s)
					", $post->ID, $post->post_category) );
			}
		}
	endif;
}

function upgrade_101() {
	global $wpdb;

	// Clean up indices, add a few
	add_clean_index($wpdb->posts, 'post_name');
	add_clean_index($wpdb->posts, 'post_status');
	add_clean_index($wpdb->categories, 'category_nicename');
	add_clean_index($wpdb->comments, 'comment_approved');
	add_clean_index($wpdb->comments, 'comment_post_ID');
	add_clean_index($wpdb->links , 'link_category');
	add_clean_index($wpdb->links , 'link_visible');
}


function upgrade_110() {
	global $wpdb;

	// Set user_nicename.
	$users = $wpdb->get_results("SELECT ID, user_nickname, user_nicename FROM $wpdb->users");
	foreach ($users as $user) {
		if ('' == $user->user_nicename) {
			$newname = sanitize_title($user->user_nickname);
			$wpdb->query( $wpdb->prepare("UPDATE $wpdb->users SET user_nicename = %s WHERE ID = %d", $newname, $user->ID) );
		}
	}

	$users = $wpdb->get_results("SELECT ID, user_pass from $wpdb->users");
	foreach ($users as $row) {
		if (!preg_match('/^[A-Fa-f0-9]{32}$/', $row->user_pass)) {
			$wpdb->query('UPDATE '.$wpdb->users.' SET user_pass = MD5(\''.$row->user_pass.'\') WHERE ID = \''.$row->ID.'\'');
		}
	}


	// Get the GMT offset, we'll use that later on
	$all_options = get_alloptions_110();

	$time_difference = $all_options->time_difference;

	$server_time = time()+date('Z');
	$weblogger_time = $server_time + $time_difference*3600;
	$gmt_time = time();

	$diff_gmt_server = ($gmt_time - $server_time) / 3600;
	$diff_weblogger_server = ($weblogger_time - $server_time) / 3600;
	$diff_gmt_weblogger = $diff_gmt_server - $diff_weblogger_server;
	$gmt_offset = -$diff_gmt_weblogger;

	// Add a gmt_offset option, with value $gmt_offset
	add_option('gmt_offset', $gmt_offset);

	// Check if we already set the GMT fields (if we did, then
	// MAX(post_date_gmt) can't be '0000-00-00 00:00:00'
	// <michel_v> I just slapped myself silly for not thinking about it earlier
	$got_gmt_fields = ($wpdb->get_var("SELECT MAX(post_date_gmt) FROM $wpdb->posts") == '0000-00-00 00:00:00') ? false : true;

	if (!$got_gmt_fields) {

		// Add or substract time to all dates, to get GMT dates
		$add_hours = intval($diff_gmt_weblogger);
		$add_minutes = intval(60 * ($diff_gmt_weblogger - $add_hours));
		$wpdb->query("UPDATE $wpdb->posts SET post_date_gmt = DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)");
		$wpdb->query("UPDATE $wpdb->posts SET post_modified = post_date");
		$wpdb->query("UPDATE $wpdb->posts SET post_modified_gmt = DATE_ADD(post_modified, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE) WHERE post_modified != '0000-00-00 00:00:00'");
		$wpdb->query("UPDATE $wpdb->comments SET comment_date_gmt = DATE_ADD(comment_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)");
		$wpdb->query("UPDATE $wpdb->users SET user_registered = DATE_ADD(user_registered, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)");
	}

}

function upgrade_130() {
	global $wpdb;

	// Remove extraneous backslashes.
	$posts = $wpdb->get_results("SELECT ID, post_title, post_content, post_excerpt, guid, post_date, post_name, post_status, post_author FROM $wpdb->posts");
	if ($posts) {
		foreach($posts as $post) {
			$post_content = addslashes(deslash($post->post_content));
			$post_title = addslashes(deslash($post->post_title));
			$post_excerpt = addslashes(deslash($post->post_excerpt));
			if ( empty($post->guid) )
				$guid = get_permalink($post->ID);
			else
				$guid = $post->guid;

			$wpdb->query("UPDATE $wpdb->posts SET post_title = '$post_title', post_content = '$post_content', post_excerpt = '$post_excerpt', guid = '$guid' WHERE ID = '$post->ID'");
		}
	}

	// Remove extraneous backslashes.
	$comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_content FROM $wpdb->comments");
	if ($comments) {
		foreach($comments as $comment) {
			$comment_content = addslashes(deslash($comment->comment_content));
			$comment_author = addslashes(deslash($comment->comment_author));
			$wpdb->query("UPDATE $wpdb->comments SET comment_content = '$comment_content', comment_author = '$comment_author' WHERE comment_ID = '$comment->comment_ID'");
		}
	}

	// Remove extraneous backslashes.
	$links = $wpdb->get_results("SELECT link_id, link_name, link_description FROM $wpdb->links");
	if ($links) {
		foreach($links as $link) {
			$link_name = addslashes(deslash($link->link_name));
			$link_description = addslashes(deslash($link->link_description));
			$wpdb->query("UPDATE $wpdb->links SET link_name = '$link_name', link_description = '$link_description' WHERE link_id = '$link->link_id'");
		}
	}

	// The "paged" option for what_to_show is no more.
	if ($wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = 'what_to_show'") == 'paged') {
		$wpdb->query("UPDATE $wpdb->options SET option_value = 'posts' WHERE option_name = 'what_to_show'");
	}

	$active_plugins = __get_option('active_plugins');

	// If plugins are not stored in an array, they're stored in the old
	// newline separated format.  Convert to new format.
	if ( !is_array( $active_plugins ) ) {
		$active_plugins = explode("\n", trim($active_plugins));
		update_option('active_plugins', $active_plugins);
	}

	// Obsolete tables
	$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optionvalues');
	$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiontypes');
	$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiongroups');
	$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'optiongroup_options');

	// Update comments table to use comment_type
	$wpdb->query("UPDATE $wpdb->comments SET comment_type='trackback', comment_content = REPLACE(comment_content, '<trackback />', '') WHERE comment_content LIKE '<trackback />%'");
	$wpdb->query("UPDATE $wpdb->comments SET comment_type='pingback', comment_content = REPLACE(comment_content, '<pingback />', '') WHERE comment_content LIKE '<pingback />%'");

	// Some versions have multiple duplicate option_name rows with the same values
	$options = $wpdb->get_results("SELECT option_name, COUNT(option_name) AS dupes FROM `$wpdb->options` GROUP BY option_name");
	foreach ( $options as $option ) {
		if ( 1 != $option->dupes ) { // Could this be done in the query?
			$limit = $option->dupes - 1;
			$dupe_ids = $wpdb->get_col( $wpdb->prepare("SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit) );
			$dupe_ids = join($dupe_ids, ',');
			$wpdb->query("DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)");
		}
	}

	make_site_theme();
}

function upgrade_160() {
	global $wpdb, $wp_current_db_version;

	populate_roles_160();

	$users = $wpdb->get_results("SELECT * FROM $wpdb->users");
	foreach ( $users as $user ) :
		if ( !empty( $user->user_firstname ) )
			update_usermeta( $user->ID, 'first_name', $wpdb->escape($user->user_firstname) );
		if ( !empty( $user->user_lastname ) )
			update_usermeta( $user->ID, 'last_name', $wpdb->escape($user->user_lastname) );
		if ( !empty( $user->user_nickname ) )
			update_usermeta( $user->ID, 'nickname', $wpdb->escape($user->user_nickname) );
		if ( !empty( $user->user_level ) )
			update_usermeta( $user->ID, $wpdb->prefix . 'user_level', $user->user_level );
		if ( !empty( $user->user_icq ) )
			update_usermeta( $user->ID, 'icq', $wpdb->escape($user->user_icq) );
		if ( !empty( $user->user_aim ) )
			update_usermeta( $user->ID, 'aim', $wpdb->escape($user->user_aim) );
		if ( !empty( $user->user_msn ) )
			update_usermeta( $user->ID, 'msn', $wpdb->escape($user->user_msn) );
		if ( !empty( $user->user_yim ) )
			update_usermeta( $user->ID, 'yim', $wpdb->escape($user->user_icq) );
		if ( !empty( $user->user_description ) )
			update_usermeta( $user->ID, 'description', $wpdb->escape($user->user_description) );

		if ( isset( $user->user_idmode ) ):
			$idmode = $user->user_idmode;
			if ($idmode == 'nickname') $id = $user->user_nickname;
			if ($idmode == 'login') $id = $user->user_login;
			if ($idmode == 'firstname') $id = $user->user_firstname;
			if ($idmode == 'lastname') $id = $user->user_lastname;
			if ($idmode == 'namefl') $id = $user->user_firstname.' '.$user->user_lastname;
			if ($idmode == 'namelf') $id = $user->user_lastname.' '.$user->user_firstname;
			if (!$idmode) $id = $user->user_nickname;
			$wpdb->query( $wpdb->prepare("UPDATE $wpdb->users SET display_name = %s WHERE ID = %d", $id, $user->ID) );
		endif;

		// FIXME: RESET_CAPS is temporary code to reset roles and caps if flag is set.
		$caps = get_usermeta( $user->ID, $wpdb->prefix . 'capabilities');
		if ( empty($caps) || defined('RESET_CAPS') ) {
			$level = get_usermeta($user->ID, $wpdb->prefix . 'user_level');
			$role = translate_level_to_role($level);
			update_usermeta( $user->ID, $wpdb->prefix . 'capabilities', array($role => true) );
		}

	endforeach;
	$old_user_fields = array( 'user_firstname', 'user_lastname', 'user_icq', 'user_aim', 'user_msn', 'user_yim', 'user_idmode', 'user_ip', 'user_domain', 'user_browser', 'user_description', 'user_nickname', 'user_level' );
	$wpdb->hide_errors();
	foreach ( $old_user_fields as $old )
		$wpdb->query("ALTER TABLE $wpdb->users DROP $old");
	$wpdb->show_errors();

	// populate comment_count field of posts table
	$comments = $wpdb->get_results( "SELECT comment_post_ID, COUNT(*) as c FROM $wpdb->comments WHERE comment_approved = '1' GROUP BY comment_post_ID" );
	if( is_array( $comments ) ) {
		foreach ($comments as $comment) {
			$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET comment_count = %d WHERE ID = %d", $comment->c, $comment->comment_post_ID) );
		}
	}

	// Some alpha versions used a post status of object instead of attachment and put
	// the mime type in post_type instead of post_mime_type.
	if ( $wp_current_db_version > 2541 && $wp_current_db_version <= 3091 ) {
		$objects = $wpdb->get_results("SELECT ID, post_type FROM $wpdb->posts WHERE post_status = 'object'");
		foreach ($objects as $object) {
			$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_status = 'attachment',
			post_mime_type = %s,
			post_type = ''
			WHERE ID = %d", $object->post_type, $object->ID) );

			$meta = get_post_meta($object->ID, 'imagedata', true);
			if ( ! empty($meta['file']) )
				update_attached_file( $object->ID, $meta['file'] );
		}
	}
}

function upgrade_210() {
	global $wpdb, $wp_current_db_version;

	if ( $wp_current_db_version < 3506 ) {
		// Update status and type.
		$posts = $wpdb->get_results("SELECT ID, post_status FROM $wpdb->posts");

		if ( ! empty($posts) ) foreach ($posts as $post) {
			$status = $post->post_status;
			$type = 'post';

			if ( 'static' == $status ) {
				$status = 'publish';
				$type = 'page';
			} else if ( 'attachment' == $status ) {
				$status = 'inherit';
				$type = 'attachment';
			}

			$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_status = %s, post_type = %s WHERE ID = %d", $status, $type, $post->ID) );
		}
	}

	if ( $wp_current_db_version < 3845 ) {
		populate_roles_210();
	}

	if ( $wp_current_db_version < 3531 ) {
		// Give future posts a post_status of future.
		$now = gmdate('Y-m-d H:i:59');
		$wpdb->query ("UPDATE $wpdb->posts SET post_status = 'future' WHERE post_status = 'publish' AND post_date_gmt > '$now'");

		$posts = $wpdb->get_results("SELECT ID, post_date FROM $wpdb->posts WHERE post_status ='future'");
		if ( !empty($posts) )
			foreach ( $posts as $post )
				wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', array($post->ID));
	}
}

function upgrade_230() {
	global $wp_current_db_version, $wpdb;

	if ( $wp_current_db_version < 5200 ) {
		populate_roles_230();
	}

	// Convert categories to terms.
	$tt_ids = array();
	$have_tags = false;
	$categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_ID");
	foreach ($categories as $category) {
		$term_id = (int) $category->cat_ID;
		$name = $category->cat_name;
		$description = $category->category_description;
		$slug = $category->category_nicename;
		$parent = $category->category_parent;
		$term_group = 0;

		// Associate terms with the same slug in a term group and make slugs unique.
		if ( $exists = $wpdb->get_results( $wpdb->prepare("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug) ) ) {
			$term_group = $exists[0]->term_group;
			$id = $exists[0]->term_id;
			$num = 2;
			do {
				$alt_slug = $slug . "-$num";
				$num++;
				$slug_check = $wpdb->get_var( $wpdb->prepare("SELECT slug FROM $wpdb->terms WHERE slug = %s", $alt_slug) );
			} while ( $slug_check );

			$slug = $alt_slug;

			if ( empty( $term_group ) ) {
				$term_group = $wpdb->get_var("SELECT MAX(term_group) FROM $wpdb->terms GROUP BY term_group") + 1;
				$wpdb->query( $wpdb->prepare("UPDATE $wpdb->terms SET term_group = %d WHERE term_id = %d", $term_group, $id) );
			}
		}

		$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES 
		(%d, %s, %s, %d)", $term_id, $name, $slug, $term_group) );

		$count = 0;
		if ( !empty($category->category_count) ) {
			$count = (int) $category->category_count;
			$taxonomy = 'category';
			$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) );
			$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
		}

		if ( !empty($category->link_count) ) {
			$count = (int) $category->link_count;
			$taxonomy = 'link_category';
			$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) );
			$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
		}

		if ( !empty($category->tag_count) ) {
			$have_tags = true;
			$count = (int) $category->tag_count;
			$taxonomy = 'post_tag';
			$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) );
			$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
		}

		if ( empty($count) ) {
			$count = 0;
			$taxonomy = 'category';
			$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES ( %d, %s, %s, %d, %d)", $term_id, $taxonomy, $description, $parent, $count) );
			$tt_ids[$term_id][$taxonomy] = (int) $wpdb->insert_id;
		}
	}

	$select = 'post_id, category_id';
	if ( $have_tags )
		$select .= ', rel_type';

	$posts = $wpdb->get_results("SELECT $select FROM $wpdb->post2cat GROUP BY post_id, category_id");
	foreach ( $posts as $post ) {
		$post_id = (int) $post->post_id;
		$term_id = (int) $post->category_id;
		$taxonomy = 'category';
		if ( !empty($post->rel_type) && 'tag' == $post->rel_type)
			$taxonomy = 'tag';
		$tt_id = $tt_ids[$term_id][$taxonomy];
		if ( empty($tt_id) )
			continue;

		$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ( %d, %d)", $post_id, $tt_id) );
	}

	// < 3570 we used linkcategories.  >= 3570 we used categories and link2cat.
	if ( $wp_current_db_version < 3570 ) {
		// Create link_category terms for link categories.  Create a map of link cat IDs
		// to link_category terms.
		$link_cat_id_map = array();
		$default_link_cat = 0;
		$tt_ids = array();
		$link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM " . $wpdb->prefix . 'linkcategories');
		foreach ( $link_cats as $category) {
			$cat_id = (int) $category->cat_id;
			$term_id = 0;
			$name = $wpdb->escape($category->cat_name);
			$slug = sanitize_title($name);
			$term_group = 0;

			// Associate terms with the same slug in a term group and make slugs unique.
			if ( $exists = $wpdb->get_results( $wpdb->prepare("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = %s", $slug) ) ) {
				$term_group = $exists[0]->term_group;
				$term_id = $exists[0]->term_id;
			}

			if ( empty($term_id) ) {
				$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->terms (name, slug, term_group) VALUES (%s, %s, %d)", $name, $slug, $term_group) );
				$term_id = (int) $wpdb->insert_id;
			}

			$link_cat_id_map[$cat_id] = $term_id;
			$default_link_cat = $term_id;

			$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_taxonomy (term_id, taxonomy, description, parent, count) VALUES (%d, 'link_category', '', '0', '0')", $term_id) );
			$tt_ids[$term_id] = (int) $wpdb->insert_id;
		}

		// Associate links to cats.
		$links = $wpdb->get_results("SELECT link_id, link_category FROM $wpdb->links");
		if ( !empty($links) ) foreach ( $links as $link ) {
			if ( 0 == $link->link_category )
				continue;
			if ( ! isset($link_cat_id_map[$link->link_category]) )
				continue;
			$term_id = $link_cat_id_map[$link->link_category];
			$tt_id = $tt_ids[$term_id];
			if ( empty($tt_id) )
				continue;

			$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ( %d, %d)", $link->link_id, $tt_id) );
		}

		// Set default to the last category we grabbed during the upgrade loop.
		update_option('default_link_category', $default_link_cat);
	} else {
		$links = $wpdb->get_results("SELECT link_id, category_id FROM $wpdb->link2cat GROUP BY link_id, category_id");
		foreach ( $links as $link ) {
			$link_id = (int) $link->link_id;
			$term_id = (int) $link->category_id;
			$taxonomy = 'link_category';
			$tt_id = $tt_ids[$term_id][$taxonomy];
			if ( empty($tt_id) )
				continue;

			$wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id) VALUES ( %d, %d)", $link_id, $tt_id) );
		}
	}

	if ( $wp_current_db_version < 4772 ) {
		// Obsolete linkcategories table
		$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'linkcategories');
	}

	// Recalculate all counts
	$terms = $wpdb->get_results("SELECT term_taxonomy_id, taxonomy FROM $wpdb->term_taxonomy");
	foreach ( (array) $terms as $term ) {
		if ( ('post_tag' == $term->taxonomy) || ('category' == $term->taxonomy) )
			$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status = 'publish' AND post_type = 'post' AND term_taxonomy_id = %d", $term->term_taxonomy_id) );
		else
			$count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $term->term_taxonomy_id) );
		$wpdb->query( $wpdb->prepare("UPDATE $wpdb->term_taxonomy SET count = %d WHERE term_taxonomy_id = %d", $count, $term->term_taxonomy_id) );
	}
}

function upgrade_230_options_table() {
	global $wpdb;
	$old_options_fields = array( 'option_can_override', 'option_type', 'option_width', 'option_height', 'option_description', 'option_admin_level' );
	$wpdb->hide_errors();
	foreach ( $old_options_fields as $old )
		$wpdb->query("ALTER TABLE $wpdb->options DROP $old");
	$wpdb->show_errors();
}

function upgrade_230_old_tables() {
	global $wpdb;
	$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'categories');
	$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'link2cat');
	$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . 'post2cat');
}

function upgrade_old_slugs() {
	// upgrade people who were using the Redirect Old Slugs plugin
	global $wpdb;
	$wpdb->query("UPDATE $wpdb->postmeta SET meta_key = '_wp_old_slug' WHERE meta_key = 'old_slug'");
}


function upgrade_250() {
	global $wp_current_db_version;

	if ( $wp_current_db_version < 6689 ) {
		populate_roles_250();
	}
	
}

function upgrade_251() {
	global $wp_current_db_version;

	// Make the secret longer
	update_option('secret', wp_generate_password(64));
}

function upgrade_252() {
	global $wpdb;

	$wpdb->query("UPDATE $wpdb->users SET user_activation_key = ''");
}

function upgrade_260() {
	if ( $wp_current_db_version < 8000 )
		populate_roles_260();

	if ( $wp_current_db_version < 8201 ) {
		update_option('enable_app', 1);
		update_option('enable_xmlrpc', 1);
	}
}

// The functions we use to actually do stuff

// General
function maybe_create_table($table_name, $create_ddl) {
	global $wpdb;
	foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
		if ($table == $table_name) {
			return true;
		}
	}
	//didn't find it try to create it.
	$q = $wpdb->query($create_ddl);
	// we cannot directly tell that whether this succeeded!
	foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
		if ($table == $table_name) {
			return true;
		}
	}
	return false;
}

function drop_index($table, $index) {
	global $wpdb;
	$wpdb->hide_errors();
	$wpdb->query("ALTER TABLE `$table` DROP INDEX `$index`");
	// Now we need to take out all the extra ones we may have created
	for ($i = 0; $i < 25; $i++) {
		$wpdb->query("ALTER TABLE `$table` DROP INDEX `{$index}_$i`");
	}
	$wpdb->show_errors();
	return true;
}

function add_clean_index($table, $index) {
	global $wpdb;
	drop_index($table, $index);
	$wpdb->query("ALTER TABLE `$table` ADD INDEX ( `$index` )");
	return true;
}

/**
 ** maybe_add_column()
 ** Add column to db table if it doesn't exist.
 ** Returns:  true if already exists or on successful completion
 **           false on error
 */
function maybe_add_column($table_name, $column_name, $create_ddl) {
	global $wpdb, $debug;
	foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) {
		if ($debug) echo("checking $column == $column_name<br />");
		if ($column == $column_name) {
			return true;
		}
	}
	//didn't find it try to create it.
	$q = $wpdb->query($create_ddl);
	// we cannot directly tell that whether this succeeded!
	foreach ($wpdb->get_col("DESC $table_name", 0) as $column ) {
		if ($column == $column_name) {
			return true;
		}
	}
	return false;
}


// get_alloptions as it was for 1.2.
function get_alloptions_110() {
	global $wpdb;
	if ($options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options")) {
		foreach ($options as $option) {
			// "When trying to design a foolproof system,
			//  never underestimate the ingenuity of the fools :)" -- Dougal
			if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
			if ('home' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
			if ('category_base' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
			$all_options->{$option->option_name} = stripslashes($option->option_value);
		}
	}
	return $all_options;
}

// Version of get_option that is private to install/upgrade.
function __get_option($setting) {
	global $wpdb;

	if ( $setting == 'home' && defined( 'WP_HOME' ) ) {
		return preg_replace( '|/+$|', '', constant( 'WP_HOME' ) );
	}

	if ( $setting == 'siteurl' && defined( 'WP_SITEURL' ) ) {
		return preg_replace( '|/+$|', '', constant( 'WP_SITEURL' ) );
	}

	$option = $wpdb->get_var( $wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = %s", $setting) );

	if ( 'home' == $setting && '' == $option )
		return __get_option('siteurl');

	if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting )
		$option = preg_replace('|/+$|', '', $option);

	@ $kellogs = unserialize($option);
	if ($kellogs !== FALSE)
		return $kellogs;
	else
		return $option;
}

function deslash($content) {
	// Note: \\\ inside a regex denotes a single backslash.

	// Replace one or more backslashes followed by a single quote with
	// a single quote.
	$content = preg_replace("/\\\+'/", "'", $content);

	// Replace one or more backslashes followed by a double quote with
	// a double quote.
	$content = preg_replace('/\\\+"/', '"', $content);

	// Replace one or more backslashes with one backslash.
	$content = preg_replace("/\\\+/", "\\", $content);

	return $content;
}

function dbDelta($queries, $execute = true) {
	global $wpdb;

	// Separate individual queries into an array
	if( !is_array($queries) ) {
		$queries = explode( ';', $queries );
		if('' == $queries[count($queries) - 1]) array_pop($queries);
	}

	$cqueries = array(); // Creation Queries
	$iqueries = array(); // Insertion Queries
	$for_update = array();

	// Create a tablename index for an array ($cqueries) of queries
	foreach($queries as $qry) {
		if(preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) {
			$cqueries[strtolower($matches[1])] = $qry;
			$for_update[$matches[1]] = 'Created table '.$matches[1];
		}
		else if(preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) {
			array_unshift($cqueries, $qry);
		}
		else if(preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) {
			$iqueries[] = $qry;
		}
		else if(preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) {
			$iqueries[] = $qry;
		}
		else {
			// Unrecognized query type
		}
	}

	// Check to see which tables and fields exist
	if($tables = $wpdb->get_col('SHOW TABLES;')) {
		// For every table in the database
		foreach($tables as $table) {
			// If a table query exists for the database table...
			if( array_key_exists(strtolower($table), $cqueries) ) {
				// Clear the field and index arrays
				unset($cfields);
				unset($indices);
				// Get all of the field names in the query from between the parens
				preg_match("|\((.*)\)|ms", $cqueries[strtolower($table)], $match2);
				$qryline = trim($match2[1]);

				// Separate field lines into an array
				$flds = explode("\n", $qryline);

				//echo "<hr/><pre>\n".print_r(strtolower($table), true).":\n".print_r($cqueries, true)."</pre><hr/>";

				// For every field line specified in the query
				foreach($flds as $fld) {
					// Extract the field name
					preg_match("|^([^ ]*)|", trim($fld), $fvals);
					$fieldname = $fvals[1];

					// Verify the found field name
					$validfield = true;
					switch(strtolower($fieldname))
					{
					case '':
					case 'primary':
					case 'index':
					case 'fulltext':
					case 'unique':
					case 'key':
						$validfield = false;
						$indices[] = trim(trim($fld), ", \n");
						break;
					}
					$fld = trim($fld);

					// If it's a valid field, add it to the field array
					if($validfield) {
						$cfields[strtolower($fieldname)] = trim($fld, ", \n");
					}
				}

				// Fetch the table column structure from the database
				$tablefields = $wpdb->get_results("DESCRIBE {$table};");

				// For every field in the table
				foreach($tablefields as $tablefield) {
					// If the table field exists in the field array...
					if(array_key_exists(strtolower($tablefield->Field), $cfields)) {
						// Get the field type from the query
						preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches);
						$fieldtype = $matches[1];

						// Is actual field type different from the field type in query?
						if($tablefield->Type != $fieldtype) {
							// Add a query to change the column type
							$cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)];
							$for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}";
						}

						// Get the default value from the array
							//echo "{$cfields[strtolower($tablefield->Field)]}<br>";
						if(preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {
							$default_value = $matches[1];
							if($tablefield->Default != $default_value)
							{
								// Add a query to change the column's default value
								$cqueries[] = "ALTER TABLE {$table} ALTER COLUMN {$tablefield->Field} SET DEFAULT '{$default_value}'";
								$for_update[$table.'.'.$tablefield->Field] = "Changed default value of {$table}.{$tablefield->Field} from {$tablefield->Default} to {$default_value}";
							}
						}

						// Remove the field from the array (so it's not added)
						unset($cfields[strtolower($tablefield->Field)]);
					}
					else {
						// This field exists in the table, but not in the creation queries?
					}
				}

				// For every remaining field specified for the table
				foreach($cfields as $fieldname => $fielddef) {
					// Push a query line into $cqueries that adds the field to that table
					$cqueries[] = "ALTER TABLE {$table} ADD COLUMN $fielddef";
					$for_update[$table.'.'.$fieldname] = 'Added column '.$table.'.'.$fieldname;
				}

				// Index stuff goes here
				// Fetch the table index structure from the database
				$tableindices = $wpdb->get_results("SHOW INDEX FROM {$table};");

				if($tableindices) {
					// Clear the index array
					unset($index_ary);

					// For every index in the table
					foreach($tableindices as $tableindex) {
						// Add the index to the index data array
						$keyname = $tableindex->Key_name;
						$index_ary[$keyname]['columns'][] = array('fieldname' => $tableindex->Column_name, 'subpart' => $tableindex->Sub_part);
						$index_ary[$keyname]['unique'] = ($tableindex->Non_unique == 0)?true:false;
					}

					// For each actual index in the index array
					foreach($index_ary as $index_name => $index_data) {
						// Build a create string to compare to the query
						$index_string = '';
						if($index_name == 'PRIMARY') {
							$index_string .= 'PRIMARY ';
						}
						else if($index_data['unique']) {
							$index_string .= 'UNIQUE ';
						}
						$index_string .= 'KEY ';
						if($index_name != 'PRIMARY') {
							$index_string .= $index_name;
						}
						$index_columns = '';
						// For each column in the index
						foreach($index_data['columns'] as $column_data) {
							if($index_columns != '') $index_columns .= ',';
							// Add the field to the column list string
							$index_columns .= $column_data['fieldname'];
							if($column_data['subpart'] != '') {
								$index_columns .= '('.$column_data['subpart'].')';
							}
						}
						// Add the column list to the index create string
						$index_string .= ' ('.$index_columns.')';
						if(!(($aindex = array_search($index_string, $indices)) === false)) {
							unset($indices[$aindex]);
							//echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br />Found index:".$index_string."</pre>\n";
						}
						//else echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br /><b>Did not find index:</b>".$index_string."<br />".print_r($indices, true)."</pre>\n";
					}
				}

				// For every remaining index specified for the table
				foreach ( (array) $indices as $index ) {
					// Push a query line into $cqueries that adds the index to that table
					$cqueries[] = "ALTER TABLE {$table} ADD $index";
					$for_update[$table.'.'.$fieldname] = 'Added index '.$table.' '.$index;
				}

				// Remove the original table creation query from processing
				unset($cqueries[strtolower($table)]);
				unset($for_update[strtolower($table)]);
			} else {
				// This table exists in the database, but not in the creation queries?
			}
		}
	}

	$allqueries = array_merge($cqueries, $iqueries);
	if($execute) {
		foreach($allqueries as $query) {
			//echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">".print_r($query, true)."</pre>\n";
			$wpdb->query($query);
		}
	}

	return $for_update;
}

function make_db_current() {
	global $wp_queries;

	$alterations = dbDelta($wp_queries);
	echo "<ol>\n";
	foreach($alterations as $alteration) echo "<li>$alteration</li>\n";
	echo "</ol>\n";
}

function make_db_current_silent() {
	global $wp_queries;

	$alterations = dbDelta($wp_queries);
}

function make_site_theme_from_oldschool($theme_name, $template) {
	$home_path = get_home_path();
	$site_dir = WP_CONTENT_DIR . "/themes/$template";

	if (! file_exists("$home_path/index.php"))
		return false;

	// Copy files from the old locations to the site theme.
	// TODO: This does not copy arbitarary include dependencies.  Only the
	// standard WP files are copied.
	$files = array('index.php' => 'index.php', 'wp-layout.css' => 'style.css', 'wp-comments.php' => 'comments.php', 'wp-comments-popup.php' => 'comments-popup.php');

	foreach ($files as $oldfile => $newfile) {
		if ($oldfile == 'index.php')
			$oldpath = $home_path;
		else
			$oldpath = ABSPATH;

		if ($oldfile == 'index.php') { // Check to make sure it's not a new index
			$index = implode('', file("$oldpath/$oldfile"));
			if (strpos($index, 'WP_USE_THEMES') !== false) {
				if (! @copy(WP_CONTENT_DIR . '/themes/default/index.php', "$site_dir/$newfile"))
					return false;
				continue; // Don't copy anything
				}
		}

		if (! @copy("$oldpath/$oldfile", "$site_dir/$newfile"))
			return false;

		chmod("$site_dir/$newfile", 0777);

		// Update the blog header include in each file.
		$lines = explode("\n", implode('', file("$site_dir/$newfile")));
		if ($lines) {
			$f = fopen("$site_dir/$newfile", 'w');

			foreach ($lines as $line) {
				if (preg_match('/require.*wp-blog-header/', $line))
					$line = '//' . $line;

				// Update stylesheet references.
				$line = str_replace("<?php echo __get_option('siteurl'); ?>/wp-layout.css", "<?php bloginfo('stylesheet_url'); ?>", $line);

				// Update comments template inclusion.
				$line = str_replace("<?php include(ABSPATH . 'wp-comments.php'); ?>", "<?php comments_template(); ?>", $line);

				fwrite($f, "{$line}\n");
			}
			fclose($f);
		}
	}

	// Add a theme header.
	$header = "/*\nTheme Name: $theme_name\nTheme URI: " . __get_option('siteurl') . "\nDescription: A theme automatically created by the upgrade.\nVersion: 1.0\nAuthor: Moi\n*/\n";

	$stylelines = file_get_contents("$site_dir/style.css");
	if ($stylelines) {
		$f = fopen("$site_dir/style.css", 'w');

		fwrite($f, $header);
		fwrite($f, $stylelines);
		fclose($f);
	}

	return true;
}

function make_site_theme_from_default($theme_name, $template) {
	$site_dir = WP_CONTENT_DIR . "/themes/$template";
	$default_dir = WP_CONTENT_DIR . '/themes/default';

	// Copy files from the default theme to the site theme.
	//$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css');

	$theme_dir = @ opendir("$default_dir");
	if ($theme_dir) {
		while(($theme_file = readdir( $theme_dir )) !== false) {
			if (is_dir("$default_dir/$theme_file"))
				continue;
			if (! @copy("$default_dir/$theme_file", "$site_dir/$theme_file"))
				return;
			chmod("$site_dir/$theme_file", 0777);
		}
	}
	@closedir($theme_dir);

	// Rewrite the theme header.
	$stylelines = explode("\n", implode('', file("$site_dir/style.css")));
	if ($stylelines) {
		$f = fopen("$site_dir/style.css", 'w');

		foreach ($stylelines as $line) {
			if (strpos($line, 'Theme Name:') !== false) $line = 'Theme Name: ' . $theme_name;
			elseif (strpos($line, 'Theme URI:') !== false) $line = 'Theme URI: ' . __get_option('url');
			elseif (strpos($line, 'Description:') !== false) $line = 'Description: Your theme.';
			elseif (strpos($line, 'Version:') !== false) $line = 'Version: 1';
			elseif (strpos($line, 'Author:') !== false) $line = 'Author: You';
			fwrite($f, $line . "\n");
		}
		fclose($f);
	}

	// Copy the images.
	umask(0);
	if (! mkdir("$site_dir/images", 0777)) {
		return false;
	}

	$images_dir = @ opendir("$default_dir/images");
	if ($images_dir) {
		while(($image = readdir($images_dir)) !== false) {
			if (is_dir("$default_dir/images/$image"))
				continue;
			if (! @copy("$default_dir/images/$image", "$site_dir/images/$image"))
				return;
			chmod("$site_dir/images/$image", 0777);
		}
	}
	@closedir($images_dir);
}

// Create a site theme from the default theme.
function make_site_theme() {
	// Name the theme after the blog.
	$theme_name = __get_option('blogname');
	$template = sanitize_title($theme_name);
	$site_dir = WP_CONTENT_DIR . "/themes/$template";

	// If the theme already exists, nothing to do.
	if ( is_dir($site_dir)) {
		return false;
	}

	// We must be able to write to the themes dir.
	if (! is_writable(WP_CONTENT_DIR . "/themes")) {
		return false;
	}

	umask(0);
	if (! mkdir($site_dir, 0777)) {
		return false;
	}

	if (file_exists(ABSPATH . 'wp-layout.css')) {
		if (! make_site_theme_from_oldschool($theme_name, $template)) {
			// TODO:  rm -rf the site theme directory.
			return false;
		}
	} else {
		if (! make_site_theme_from_default($theme_name, $template))
			// TODO:  rm -rf the site theme directory.
			return false;
	}

	// Make the new site theme active.
	$current_template = __get_option('template');
	if ($current_template == 'default') {
		update_option('template', $template);
		update_option('stylesheet', $template);
	}
	return $template;
}

function translate_level_to_role($level) {
	switch ($level) {
	case 10:
	case 9:
	case 8:
		return 'administrator';
	case 7:
	case 6:
	case 5:
		return 'editor';
	case 4:
	case 3:
	case 2:
		return 'author';
	case 1:
		return 'contributor';
	case 0:
		return 'subscriber';
	}
}

function wp_check_mysql_version() {
	global $wpdb;
	$result = $wpdb->check_database_version();
	if ( is_wp_error( $result ) )
		die( $result->get_error_message() );
}

function maybe_disable_automattic_widgets() {
	$plugins = __get_option( 'active_plugins' );

	foreach ( (array) $plugins as $plugin ) {
		if ( basename( $plugin ) == 'widgets.php' ) {
			array_splice( $plugins, array_search( $plugin, $plugins ), 1 );
			update_option( 'active_plugins', $plugins );
			break;
		}
	}
}

?>
                                                                                                                                                                                                                                                                                                            blog/wp-admin/includes/user.php                                                                     0000755 0023433 0004734 00000031566 11060470747 016406  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

// Creates a new user from the "Users" form using $_POST information.
function add_user() {
	if ( func_num_args() ) { // The hackiest hack that ever did hack
		global $current_user, $wp_roles;
		$user_id = (int) func_get_arg( 0 );

		if ( isset( $_POST['role'] ) ) {
			if( $user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap( 'edit_users' ) ) {
				$user = new WP_User( $user_id );
				$user->set_role( $_POST['role'] );
			}
		}
	} else {
		add_action( 'user_register', 'add_user' ); // See above
		return edit_user();
	}
}

function edit_user( $user_id = 0 ) {
	global $current_user, $wp_roles, $wpdb;
	if ( $user_id != 0 ) {
		$update = true;
		$user->ID = (int) $user_id;
		$userdata = get_userdata( $user_id );
		$user->user_login = $wpdb->escape( $userdata->user_login );
	} else {
		$update = false;
		$user = '';
	}

	if ( isset( $_POST['user_login'] ))
		$user->user_login = wp_specialchars( trim( $_POST['user_login'] ));

	$pass1 = $pass2 = '';
	if ( isset( $_POST['pass1'] ))
		$pass1 = $_POST['pass1'];
	if ( isset( $_POST['pass2'] ))
		$pass2 = $_POST['pass2'];

	if ( isset( $_POST['role'] ) && current_user_can( 'edit_users' ) ) {
		if( $user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap( 'edit_users' ))
			$user->role = $_POST['role'];
	}

	if ( isset( $_POST['email'] ))
		$user->user_email = wp_specialchars( trim( $_POST['email'] ));
	if ( isset( $_POST['url'] ) ) {
		$user->user_url = clean_url( trim( $_POST['url'] ));
		$user->user_url = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url;
	}
	if ( isset( $_POST['first_name'] ))
		$user->first_name = wp_specialchars( trim( $_POST['first_name'] ));
	if ( isset( $_POST['last_name'] ))
		$user->last_name = wp_specialchars( trim( $_POST['last_name'] ));
	if ( isset( $_POST['nickname'] ))
		$user->nickname = wp_specialchars( trim( $_POST['nickname'] ));
	if ( isset( $_POST['display_name'] ))
		$user->display_name = wp_specialchars( trim( $_POST['display_name'] ));
	if ( isset( $_POST['description'] ))
		$user->description = trim( $_POST['description'] );
	if ( isset( $_POST['jabber'] ))
		$user->jabber = wp_specialchars( trim( $_POST['jabber'] ));
	if ( isset( $_POST['aim'] ))
		$user->aim = wp_specialchars( trim( $_POST['aim'] ));
	if ( isset( $_POST['yim'] ))
		$user->yim = wp_specialchars( trim( $_POST['yim'] ));
	if ( !$update )
		$user->rich_editing = 'true';  // Default to true for new users.
	else if ( isset( $_POST['rich_editing'] ) )
		$user->rich_editing = $_POST['rich_editing'];
	else
		$user->rich_editing = 'false';

	if ( !$update )
		$user->admin_color = 'fresh';  // Default to fresh for new users.
	else if ( isset( $_POST['admin_color'] ) )
		$user->admin_color = $_POST['admin_color'];
	else
		$user->admin_color = 'fresh';

	$errors = new WP_Error();

	/* checking that username has been typed */
	if ( $user->user_login == '' )
		$errors->add( 'user_login', __( '<strong>ERROR</strong>: Please enter a username.' ));

	/* checking the password has been typed twice */
	do_action_ref_array( 'check_passwords', array ( $user->user_login, & $pass1, & $pass2 ));

	if ( $update ) {
		if ( empty($pass1) && !empty($pass2) )
			$errors->add( 'pass', __( '<strong>ERROR</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass1' ) );
		elseif ( !empty($pass1) && empty($pass2) )
			$errors->add( 'pass', __( '<strong>ERROR</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass2' ) );
	} else {
		if ( empty($pass1) )
			$errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter your password.' ), array( 'form-field' => 'pass1' ) );
		elseif ( empty($pass2) )
			$errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter your password twice.' ), array( 'form-field' => 'pass2' ) );
	}

	/* Check for "\" in password */
	if( strpos( " ".$pass1, "\\" ) )
		$errors->add( 'pass', __( '<strong>ERROR</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );

	/* checking the password has been typed twice the same */
	if ( $pass1 != $pass2 )
		$errors->add( 'pass', __( '<strong>ERROR</strong>: Please enter the same password in the two password fields.' ), array( 'form-field' => 'pass1' ) );

	if (!empty ( $pass1 ))
		$user->user_pass = $pass1;

	if ( !$update && !validate_username( $user->user_login ) )
		$errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is invalid. Please enter a valid username.' ));

	if (!$update && username_exists( $user->user_login ))
		$errors->add( 'user_login', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ));

	/* checking e-mail address */
	if ( empty ( $user->user_email ) ) {
		$errors->add( 'user_email', __( '<strong>ERROR</strong>: Please enter an e-mail address.' ), array( 'form-field' => 'email' ) );
	} else
		if (!is_email( $user->user_email ) ) {
			$errors->add( 'user_email', __( "<strong>ERROR</strong>: The e-mail address isn't correct." ), array( 'form-field' => 'email' ) );
		}

	if ( $errors->get_error_codes() )
		return $errors;

	if ( $update ) {
		$user_id = wp_update_user( get_object_vars( $user ));
	} else {
		$user_id = wp_insert_user( get_object_vars( $user ));
		wp_new_user_notification( $user_id );
	}
	return $user_id;
}

function get_author_user_ids() {
	global $wpdb;
	$level_key = $wpdb->prefix . 'user_level';
	return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );
}

function get_editable_authors( $user_id ) {
	global $wpdb;

	$editable = get_editable_user_ids( $user_id );

	if( !$editable ) {
		return false;
	} else {
		$editable = join(',', $editable);
		$authors = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($editable) ORDER BY display_name" );
	}

	return apply_filters('get_editable_authors', $authors);
}

function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
	global $wpdb;

	$user = new WP_User( $user_id );

	if ( ! $user->has_cap('edit_others_posts') ) {
		if ( $user->has_cap('edit_posts') || $exclude_zeros == false )
			return array($user->id);
		else
			return false;
	}

	$level_key = $wpdb->prefix . 'user_level';

	$query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key);
	if ( $exclude_zeros )
		$query .= " AND meta_value != '0'";

	return $wpdb->get_col( $query );
}

function get_nonauthor_user_ids() {
	global $wpdb;
	$level_key = $wpdb->prefix . 'user_level';

	return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) );
}

function get_others_unpublished_posts($user_id, $type='any') {
	global $wpdb;

	$editable = get_editable_user_ids( $user_id );

	if ( in_array($type, array('draft', 'pending')) )
		$type_sql = " post_status = '$type' ";
	else
		$type_sql = " ( post_status = 'draft' OR post_status = 'pending' ) ";

	$dir = ( 'pending' == $type ) ? 'ASC' : 'DESC';

	if( !$editable ) {
		$other_unpubs = '';
	} else {
		$editable = join(',', $editable);
		$other_unpubs = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_title, post_author FROM $wpdb->posts WHERE post_type = 'post' AND $type_sql AND post_author IN ($editable) AND post_author != %d ORDER BY post_modified $dir", $user_id) );
	}

	return apply_filters('get_others_drafts', $other_unpubs);
}

function get_others_drafts($user_id) {
	return get_others_unpublished_posts($user_id, 'draft');
}

function get_others_pending($user_id) {
	return get_others_unpublished_posts($user_id, 'pending');
}

function get_user_to_edit( $user_id ) {
	$user = new WP_User( $user_id );
	$user->user_login   = attribute_escape($user->user_login);
	$user->user_email   = attribute_escape($user->user_email);
	$user->user_url     = clean_url($user->user_url);
	$user->first_name   = attribute_escape($user->first_name);
	$user->last_name    = attribute_escape($user->last_name);
	$user->display_name = attribute_escape($user->display_name);
	$user->nickname     = attribute_escape($user->nickname);
	$user->aim          = attribute_escape($user->aim);
	$user->yim          = attribute_escape($user->yim);
	$user->jabber       = attribute_escape($user->jabber);
	$user->description  =  wp_specialchars($user->description);

	return $user;
}

function get_users_drafts( $user_id ) {
	global $wpdb;
	$query = $wpdb->prepare("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = %d ORDER BY post_modified DESC", $user_id);
	$query = apply_filters('get_users_drafts', $query);
	return $wpdb->get_results( $query );
}

function wp_delete_user($id, $reassign = 'novalue') {
	global $wpdb;

	$id = (int) $id;

	if ($reassign == 'novalue') {
		$post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) );

		if ($post_ids) {
			foreach ($post_ids as $post_id)
				wp_delete_post($post_id);
		}

		// Clean links
		$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->links WHERE link_owner = %d", $id) );
	} else {
		$reassign = (int) $reassign;
		$wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE post_author = %d", $reassign, $id) );
		$wpdb->query( $wpdb->prepare("UPDATE $wpdb->links SET link_owner = %d WHERE link_owner = %d", $reassign, $id) );
	}

	// FINALLY, delete user
	do_action('delete_user', $id);

	$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) );
	$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) );

	wp_cache_delete($id, 'users');
	wp_cache_delete($user->user_login, 'userlogins');
	wp_cache_delete($user->user_email, 'useremail');

	return true;
}

function wp_revoke_user($id) {
	$id = (int) $id;

	$user = new WP_User($id);
	$user->remove_all_caps();
}

// WP_User_Search class
// by Mark Jaquith

if ( !class_exists('WP_User_Search') ) :
class WP_User_Search {
	var $results;
	var $search_term;
	var $page;
	var $role;
	var $raw_page;
	var $users_per_page = 50;
	var $first_user;
	var $last_user;
	var $query_limit;
	var $query_sort;
	var $query_from_where;
	var $total_users_for_query = 0;
	var $too_many_total_users = false;
	var $search_errors;

	function WP_User_Search ($search_term = '', $page = '', $role = '') { // constructor
		$this->search_term = $search_term;
		$this->raw_page = ( '' == $page ) ? false : (int) $page;
		$this->page = (int) ( '' == $page ) ? 1 : $page;
		$this->role = $role;

		$this->prepare_query();
		$this->query();
		$this->prepare_vars_for_template_usage();
		$this->do_paging();
	}

	function prepare_query() {
		global $wpdb;
		$this->first_user = ($this->page - 1) * $this->users_per_page;
		$this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
		$this->query_sort = ' ORDER BY user_login';
		$search_sql = '';
		if ( $this->search_term ) {
			$searches = array();
			$search_sql = 'AND (';
			foreach ( array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col )
				$searches[] = $col . " LIKE '%$this->search_term%'";
			$search_sql .= implode(' OR ', $searches);
			$search_sql .= ')';
		}

		$this->query_from_where = "FROM $wpdb->users";
		if ( $this->role )
			$this->query_from_where .= $wpdb->prepare(" INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%');
		else
			$this->query_from_where .= " WHERE 1=1";
		$this->query_from_where .= " $search_sql";

	}

	function query() {
		global $wpdb;
		$this->results = $wpdb->get_col('SELECT ID ' . $this->query_from_where . $this->query_sort . $this->query_limit);

		if ( $this->results )
			$this->total_users_for_query = $wpdb->get_var('SELECT COUNT(ID) ' . $this->query_from_where); // no limit
		else
			$this->search_errors = new WP_Error('no_matching_users_found', __('No matching users were found!'));
	}

	function prepare_vars_for_template_usage() {
		$this->search_term = stripslashes($this->search_term); // done with DB, from now on we want slashes gone
	}

	function do_paging() {
		if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
			$args = array();
			if( ! empty($this->search_term) )
				$args['usersearch'] = urlencode($this->search_term);
			if( ! empty($this->role) )
				$args['role'] = urlencode($this->role);

			$this->paging_text = paginate_links( array(
				'total' => ceil($this->total_users_for_query / $this->users_per_page),
				'current' => $this->page,
				'base' => 'users.php?%_%',
				'format' => 'userspage=%#%',
				'add_args' => $args
			) );
		}
	}

	function get_results() {
		return (array) $this->results;
	}

	function page_links() {
		echo $this->paging_text;
	}

	function results_are_paged() {
		if ( $this->paging_text )
			return true;
		return false;
	}

	function is_search() {
		if ( $this->search_term )
			return true;
		return false;
	}
}
endif;

?>
                                                                                                                                          blog/wp-admin/includes/widgets.php                                                                  0000755 0023433 0004734 00000023402 11060470750 017056  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

// $_search is unsanitized
function wp_list_widgets( $show = 'all', $_search = false ) {
	global $wp_registered_widgets, $sidebars_widgets, $wp_registered_widget_controls;
	if ( $_search ) {
		// sanitize
		$search = preg_replace( '/[^\w\s]/', '', $_search );
		// array of terms
		$search_terms = preg_split( '/[\s]/', $search, -1, PREG_SPLIT_NO_EMPTY );
	} else {
		$search_terms = array();
	}

	if ( !in_array( $show, array( 'all', 'unused', 'used' ) ) )
		$show = 'all';
?>

	<ul id='widget-list'>
		<?php
		$no_widgets_shown = true;
		$already_shown = array();
		foreach ( $wp_registered_widgets as $name => $widget ) :
			if ( 'all' == $show && in_array( $widget['callback'], $already_shown ) ) // We already showed this multi-widget
				continue;

			if ( $search_terms ) {
				$hit = false;
				// Simple case-insensitive search.  Boolean OR.
				$search_text = preg_replace( '/[^\w]/', '', $widget['name'] );
				if ( isset($widget['description']) )
					$search_text .= preg_replace( '/[^\w]/', '', $widget['description'] );

				foreach ( $search_terms as $search_term ) {
					if ( stristr( $search_text, $search_term ) ) {
						$hit = true;
						break;
					}
				}
				if ( !$hit )
					continue;
			}

			$sidebar = is_active_widget( $widget['callback'], $widget['id'] );

			if ( ( 'unused' == $show && $sidebar ) || ( 'used' == $show && !$sidebar ) )
				continue;

			ob_start();
				$args = wp_list_widget_controls_dynamic_sidebar( array( 0 => array( 'widget_id' => $widget['id'], 'widget_name' => $widget['name'], '_display' => 'template', '_show' => $show ), 1 => $widget['params'][0] ) );
				$sidebar_args = call_user_func_array( 'wp_widget_control', $args );
			$widget_control_template = ob_get_contents();
			ob_end_clean();

			$widget_id = $widget['id']; // save this for later in case we mess with $widget['id']

			$is_multi = false !== strpos( $widget_control_template, '%i%' );
			if ( !$sidebar || $is_multi ) {
				$add_query = array(
					'sidebar' => $sidebar,
					'key' => false,
					'edit' => false
				);
				if ( 'all' == $show && $is_multi ) {
					// it's a multi-widget.  We only need to show it in the list once.
					$already_shown[] = $widget['callback'];
					$num = (int) array_pop( $ids = explode( '-', $widget['id'] ) );
					$id_base = $wp_registered_widget_controls[$widget['id']]['id_base'];
					// so that we always add a new one when clicking "add"
					while ( isset($wp_registered_widgets["$id_base-$num"]) )
						$num++;
					$widget['id'] = "$id_base-$num";
					$add_query['base'] = $id_base;
					$add_query['key'] = $num;
					$add_query['sidebar'] = $GLOBALS['sidebar'];
				}
				$add_query['add'] = $widget['id'];
				$action = 'add';
				$add_url = clean_url( wp_nonce_url( add_query_arg( $add_query ), "add-widget_$widget[id]" ) );
			} else {
				$action = 'edit';
				$edit_url = clean_url( add_query_arg( array(
					'sidebar' => $sidebar,
					'edit' => $widget['id'],
					'key' => array_search( $widget['id'], $sidebars_widgets[$sidebar] ),
				) ) );
				
				$widget_control_template = '<textarea rows="1" cols="1">' . htmlspecialchars( $widget_control_template ) . '</textarea>';
			}

			$widget_control_template = $sidebar_args['before_widget'] . $widget_control_template . $sidebar_args['after_widget'];

			$no_widgets_shown = false;


			if ( 'all' != $show && $sidebar_args['_widget_title'] )
				$widget_title = $sidebar_args['_widget_title'];
			else
				$widget_title = $widget['name'];
		?>

		<li id="widget-list-item-<?php echo attribute_escape( $widget['id'] ); ?>" class="widget-list-item">
			<h4 class="widget-title widget-draggable">

				<span><?php echo $widget_title; ?></span>

				<?php if ( 'add' == $action ) : ?>

				<a class="widget-action widget-control-add" href="<?php echo $add_url; ?>"><?php _e( 'Add' ); ?></a>

				<?php elseif ( 'edit' == $action ) :
					// We echo a hidden edit link for the sake of the JS.  Edit links are shown (needlessly?) after a widget is added.
				?>

				<a class="widget-action widget-control-edit" href="<?php echo $edit_url; ?>" style="display: none;"><?php _e( 'Edit' ); ?></a>

				<?php endif; ?>

				<br class="clear" />

			</h4>


			<ul id="widget-control-info-<?php echo $widget['id']; ?>" class="widget-control-info">

				<?php echo $widget_control_template; ?>

			</ul>

			<?php if ( 'add' == $action ) : ?>
			<?php endif; ?>

			<div class="widget-description">
				<?php echo ( $widget_description = wp_widget_description( $widget_id ) ) ? $widget_description : '&nbsp;'; ?>
			</div>

			<br class="clear" />

		</li>

		<?php endforeach; if ( $no_widgets_shown ) : ?>

		<li><?php _e( 'No matching widgets' ); ?></li>

		<?php endif; ?>

	</ul>
<?php
}



function wp_list_widget_controls( $sidebar ) {
	add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' );
?>

	<ul class="widget-control-list">

		<?php if ( !dynamic_sidebar( $sidebar ) ) echo "<li />"; ?>

	</ul>

<?php
}


function wp_list_widget_controls_dynamic_sidebar( $params ) {
	global $wp_registered_widgets;
	static $i = 0;
	$i++;

	$widget_id = $params[0]['widget_id'];

	$params[0]['before_widget'] = "<li id='widget-list-control-item-$i-$widget_id' class='widget-list-control-item widget-sortable'>\n";
	$params[0]['after_widget'] = "</li>";
	$params[0]['before_title'] = "%BEG_OF_TITLE%";
	$params[0]['after_title'] = "%END_OF_TITLE%";
	if ( is_callable( $wp_registered_widgets[$widget_id]['callback'] ) ) {
		$wp_registered_widgets[$widget_id]['_callback'] = $wp_registered_widgets[$widget_id]['callback'];
		$wp_registered_widgets[$widget_id]['callback'] = 'wp_widget_control';
	}
	return $params;
}

/*
 * Meta widget used to display the control form for a widget.  Called from dynamic_sidebar()
 */
function wp_widget_control( $sidebar_args ) {
	global $wp_registered_widgets, $wp_registered_widget_controls, $sidebars_widgets, $edit_widget;
	$widget_id = $sidebar_args['widget_id'];
	$sidebar_id = isset($sidebar_args['id']) ? $sidebar_args['id'] : false;

	$control = $wp_registered_widget_controls[$widget_id];
	$widget  = $wp_registered_widgets[$widget_id];

	$key = $sidebar_id ? array_search( $widget_id, $sidebars_widgets[$sidebar_id] ) : 'no-key'; // position of widget in sidebar

	$edit = -1 <  $edit_widget && is_numeric($key) && $edit_widget === $key; // (bool) are we currently editing this widget

	$id_format = $widget['id'];
	// We aren't showing a widget control, we're outputing a template for a mult-widget control
	if ( 'all' == $sidebar_args['_show'] && 'template' == $sidebar_args['_display'] && isset($control['params'][0]['number']) ) {
		// number == -1 implies a template where id numbers are replaced by a generic '%i%'
		$control['params'][0]['number'] = -1;
		// if given, id_base means widget id's should be constructed like {$id_base}-{$id_number}
		if ( isset($control['id_base']) )
			$id_format = $control['id_base'] . '-%i%';
	}

	$widget_title = '';
	// We grab the normal widget output to find the widget's title
	if ( ( 'all' != $sidebar_args['_show'] || 'template' != $sidebar_args['_display'] ) && is_callable( $widget['_callback'] ) ) {
		ob_start();
		$args = func_get_args();
		call_user_func_array( $widget['_callback'], $args );
		$widget_title = ob_get_clean();
		$widget_title = wp_widget_control_ob_filter( $widget_title );
	}
	$wp_registered_widgets[$widget_id]['callback'] = $wp_registered_widgets[$widget_id]['_callback'];
	unset($wp_registered_widgets[$widget_id]['_callback']);

	if ( $widget_title && $widget_title != $sidebar_args['widget_name'] )
		$widget_title = sprintf( _c('%1$s: %2$s|1: widget name, 2: widget title' ), $sidebar_args['widget_name'], $widget_title );
	else
		$widget_title = wp_specialchars( strip_tags( $sidebar_args['widget_name'] ) );

	$sidebar_args['_widget_title'] = $widget_title;

	if ( empty($sidebar_args['_display']) || 'template' != $sidebar_args['_display'] )
		echo $sidebar_args['before_widget'];
?>
		<div class="widget-top">
		<h4 class="widget-title"><span><?php echo $widget_title ?></span>

			<?php if ( $edit ) : ?>

			<a class="widget-action widget-control-edit" href="<?php echo clean_url( remove_query_arg( array( 'edit', 'key' ) ) ); ?>"><?php _e('Cancel'); ?></a>

			<?php else : ?>

			<a class="widget-action widget-control-edit" href="<?php echo clean_url( add_query_arg( array( 'edit' => $id_format, 'key' => $key ) ) ); ?>"><?php _e('Edit'); ?></a>

			<?php endif; ?>

			<br class="clear" />

		</h4></div>

		<div class="widget-control"<?php if ( $edit ) echo ' style="display: block;"'; ?>>

			<?php
			if ( $control )
				call_user_func_array( $control['callback'], $control['params'] );
			else
				echo '<p>' . __('There are no options for this widget.') . '</p>';
			?>

			<input type="hidden" name="widget-id[]" value="<?php echo $id_format; ?>" />
			<input type="hidden" class="widget-width" value="<?php echo $control['width']; ?>" />

			<div class="widget-control-actions">

				<?php if ( $control ) : ?>

				<a class="widget-action widget-control-save wp-no-js-hidden edit alignleft" href="#save:<?php echo $id_format; ?>"><?php _e('Change'); ?></a>

				<?php endif; ?>

				<a class="widget-action widget-control-remove delete alignright" href="<?php echo clean_url( wp_nonce_url( add_query_arg( array( 'remove' => $id_format, 'key' => $key ) ), "remove-widget_$widget[id]" ) ); ?>"><?php _e('Remove'); ?></a>
				<br class="clear" />
			</div>
		</div>
<?php
	if ( empty($sidebar_args['_display']) || 'template' != $sidebar_args['_display'] )
		echo $sidebar_args['after_widget'];
	return $sidebar_args;
}

function wp_widget_control_ob_filter( $string ) {
	if ( false === $beg = strpos( $string, '%BEG_OF_TITLE%' ) )
		return '';
	if ( false === $end = strpos( $string, '%END_OF_TITLE%' ) )
		return '';
	$string = substr( $string, $beg + 14 , $end - $beg - 14);
	$string = str_replace( '&nbsp;', ' ', $string );
	return trim( wp_specialchars( strip_tags( $string ) ) );
}

?>
                                                                                                                                                                                                                                                              blog/wp-admin/js/                                                                                   0000755 0023433 0004734 00000000000 11060470777 013512  5                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 blog/wp-admin/js/cat.js                                                                             0000755 0023433 0004734 00000001054 11060470756 014617  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 jQuery( function($) {
	var myConfirm = function() { return '' !== $('#newcat').val(); };
	$('#jaxcat').prepend('<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" class="add:categorychecklist:jaxcat" id="catadd" value="' + catL10n.add + '"/><input type="hidden"/><input type="hidden"/><span id="howto">' + catL10n.how + '</span></span><span id="cat-ajax-response"></span>')
	$('#categorychecklist').wpList( { alt: '', response: 'cat-ajax-response', confirm: myConfirm } );
} );
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    blog/wp-admin/js/categories.js                                                                      0000755 0023433 0004734 00000001222 11060470757 016173  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 jQuery(function($) {
	var options = false
	if ( document.forms['addcat'].category_parent )
		options = document.forms['addcat'].category_parent.options;

	var addAfter = function( r, settings ) {
		var name = $("<span>" + $('name', r).text() + "</span>").html();
		var id = $('cat', r).attr('id');
		options[options.length] = new Option(name, id);
	}

	var delAfter = function( r, settings ) {
		var id = $('cat', r).attr('id');
		for ( var o = 0; o < options.length; o++ )
			if ( id == options[o].value )
				options[o] = null;
	}

	if ( options )
		$('#the-list').wpList( { addAfter: addAfter, delAfter: delAfter } );
	else
		$('#the-list').wpList();
});
                                                                                                                                                                                                                                                                                                                                                                              blog/wp-admin/js/comment.js                                                                         0000755 0023433 0004734 00000001601 11060470760 015503  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 jQuery(document).ready( function() {
	add_postbox_toggles('comment');

	// close postboxes that should be closed
	jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');

	// show things that should be visible, hide what should be hidden
	jQuery('.hide-if-no-js').show();
	jQuery('.hide-if-js').hide();

	jQuery('.edit-timestamp').click(function () {
		if (jQuery('#timestampdiv').is(":hidden")) {
			jQuery('#timestampdiv').slideDown("normal");
			jQuery('.edit-timestamp').text(commentL10n.cancel);
		} else {
			jQuery('#timestampdiv').hide();
			jQuery('#mm').val(jQuery('#hidden_mm').val());
			jQuery('#jj').val(jQuery('#hidden_jj').val());
			jQuery('#aa').val(jQuery('#hidden_aa').val());
			jQuery('#hh').val(jQuery('#hidden_hh').val());
			jQuery('#mn').val(jQuery('#hidden_mn').val());
			jQuery('.edit-timestamp').text(commentL10n.edit);
		}
		return false;
    });
});                                                                                                                               blog/wp-admin/js/common.js                                                                          0000755 0023433 0004734 00000002406 11060470760 015335  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 jQuery(document).ready( function() {
	// pulse
	jQuery('.fade').animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300).animate( { backgroundColor: '#ffffe0' }, 300).animate( { backgroundColor: '#fffbcc' }, 300);

	// Reveal
	jQuery('.wp-no-js-hidden').removeClass( 'wp-no-js-hidden' );

	// Basic form validation
	if ( ( 'undefined' != typeof wpAjax ) && jQuery.isFunction( wpAjax.validateForm ) ) {
		jQuery('form.validate').submit( function() { return wpAjax.validateForm( jQuery(this) ); } );
	}
});

(function(JQ) {
	JQ.fn.tTips = function() {

		JQ('body').append('<div id="tTips"><p id="tTips_inside"></p></div>');
		var TT = JQ('#tTips');

		this.each(function() {
			var el = JQ(this), txt;
			
			if ( txt = el.attr('title') ) el.attr('tip', txt).removeAttr('title');
			else return;
			el.find('img').removeAttr('alt');

			el.mouseover(function(e) {
				txt = el.attr('tip'), o = el.offset();;

				clearTimeout(TT.sD);
				TT.find('p').html(txt);

				TT.css({'top': o.top - 43, 'left': o.left - 5});
				TT.sD = setTimeout(function(){TT.fadeIn(150);}, 100);
			});

			el.mouseout(function() {
				clearTimeout(TT.sD);
				TT.css({display : 'none'});
			})
		});
	}
}(jQuery));

jQuery(function(){jQuery('#media-buttons a').tTips();});
                                                                                                                                                                                                                                                          blog/wp-admin/js/custom-fields.js                                                                   0000755 0023433 0004734 00000001710 11060470761 016621  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 jQuery( function($) {
	var before = function() {
		var nonce = $('#newmeta [@name=_ajax_nonce]').val();
		var postId = $('#post_ID').val();
		if ( !nonce || !postId ) { return false; }
		return [nonce,postId];
	}

	var addBefore = function( s ) {
		var b = before();
		if ( !b ) { return false; }
		s.data = s.data.replace(/_ajax_nonce=[a-f0-9]+/, '_ajax_nonce=' + b[0]) + '&post_id=' + b[1];
		return s;
	};

	var addAfter = function( r, s ) {
		var postId = $('postid', r).text();
		if ( !postId ) { return; }
		$('#post_ID').attr( 'name', 'post_ID' ).val( postId );
		var h = $('#hiddenaction');
		if ( 'post' == h.val() ) { h.val( 'postajaxpost' ); }
	};

	var delBefore = function( s ) {
		var b = before(); if ( !b ) return false;
		s.data._ajax_nonce = b[0]; s.data.post_id = b[1];
		return s;
	}

	$('#the-list')
		.wpList( { addBefore: addBefore, addAfter: addAfter, delBefore: delBefore } )
		.find('.updatemeta, .deletemeta').attr( 'type', 'button' );
} );
                                                        blog/wp-admin/js/edit-comments.js                                                                   0000755 0023433 0004734 00000005036 11060470762 016621  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 var theList; var theExtraList;
jQuery(function($) {

var dimAfter = function( r, settings ) {
	$('li span.comment-count').each( function() {
		var a = $(this);
		var n = parseInt(a.html(),10);
		n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
		if ( n < 0 ) { n = 0; }
		a.html( n.toString() );
		$('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
	});
	$('.post-com-count span.comment-count').each( function() {
		var a = $(this);
		var n = parseInt(a.html(),10);
		var t = parseInt(a.parent().attr('title'), 10);
		if ( $('#' + settings.element).is('.unapproved') ) { // we unapproved a formerly approved comment
			n = n - 1;
			t = t + 1;
		} else { // we approved a formerly unapproved comment
			n = n + 1;
			t = t - 1;
		}
		if ( n < 0 ) { n = 0; }
		if ( t < 0 ) { t = 0; }
		if ( t >= 0 ) { a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) ); }
		if ( 0 === t ) { a.parents('strong:first').replaceWith( a.parents('strong:first').html() ); }
		a.html( n.toString() );
	});
}

var delAfter = function( r, settings ) {
	$('li span.comment-count').each( function() {
		var a = $(this);
		var n = parseInt(a.html(),10);
		if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment
			n = n - 1;
		} else if ( $(settings.target).parents( 'span.unapprove' ).size() ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove"
			n = n + 1;
		}
		if ( n < 0 ) { n = 0; }
		a.html( n.toString() );
		$('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
	});
	$('.post-com-count span.comment-count').each( function() {
		var a = $(this);
		if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment
			var t = parseInt(a.parent().attr('title'), 10);
			if ( t < 1 ) { return; }
			t = t - 1;
			a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) );
			if ( 0 === t ) { a.parents('strong:first').replaceWith( a.parents('strong:first').html() ); }
			return;
		}
		var n = parseInt(a.html(),10) - 1;
		a.html( n.toString() );
	});

	if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 ) {
		return;
	}

	theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() );
	$('#get-extra-comments').submit();
}

theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
theList = $('#the-comment-list').wpList( { alt: '', dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } );

} );
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  blog/wp-admin/js/editor.js                                                                          0000755 0023433 0004734 00000016706 11060470762 015345  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 wpEditorInit = function() {
    // Activate tinyMCE if it's the user's default editor
    if ( ( 'undefined' == typeof wpTinyMCEConfig ) || 'tinymce' == wpTinyMCEConfig.defaultEditor ) {
        document.getElementById('editorcontainer').style.padding = '0px';
        tinyMCE.execCommand("mceAddControl", false, "content");
	} else {
        var H;
        if ( H = tinymce.util.Cookie.getHash("TinyMCE_content_size") )
            document.getElementById('content').style.height = H.ch - 30 + 'px';
    }
};

switchEditors = {

    saveCallback : function(el, content, body) {

        document.getElementById(el).style.color = '#fff';
        if ( tinyMCE.activeEditor.isHidden() ) 
            content = document.getElementById(el).value;
        else
            content = this.pre_wpautop(content);

        return content;
    },

    pre_wpautop : function(content) {
        // We have a TON of cleanup to do. Line breaks are already stripped.

        // Protect pre|script tags
        content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
            a = a.replace(/<br ?\/?>[\r\n]*/g, '<wp_temp>');
            return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '<wp_temp>');
        });

        // Pretty it up for the source editor
        var blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6]|p';
        content = content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*', 'mg'), '</$1>\n');
        content = content.replace(new RegExp('\\s*<(('+blocklist1+')[^>]*)>', 'mg'), '\n<$1>');

        // Mark </p> if it has any attributes.
        content = content.replace(new RegExp('(<p [^>]+>.*?)</p>', 'mg'), '$1</p#>');

        // Sepatate <div> containing <p>
        content = content.replace(new RegExp('<div([^>]*)>\\s*<p>', 'mgi'), '<div$1>\n\n');

        // Remove <p> and <br />
        content = content.replace(new RegExp('\\s*<p>', 'mgi'), '');
        content = content.replace(new RegExp('\\s*</p>\\s*', 'mgi'), '\n\n');
        content = content.replace(new RegExp('\\n\\s*\\n', 'mgi'), '\n\n');
        content = content.replace(new RegExp('\\s*<br ?/?>\\s*', 'gi'), '\n');

        // Fix some block element newline issues
        content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div');
        content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n');
		content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
		content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');

        var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre';
        content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
        content = content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*', 'mg'), '</$1>\n');
        content = content.replace(new RegExp('<li([^>]*)>', 'g'), '\t<li$1>');

        if ( content.indexOf('<object') != -1 ) {
            content = content.replace(new RegExp('\\s*<param([^>]*)>\\s*', 'mg'), "<param$1>");
            content = content.replace(new RegExp('\\s*</embed>\\s*', 'mg'), '</embed>');
        }

        // Unmark special paragraph closing tags
        content = content.replace(new RegExp('</p#>', 'g'), '</p>\n');
        content = content.replace(new RegExp('\\s*(<p [^>]+>.*</p>)', 'mg'), '\n$1');

        // Trim whitespace
        content = content.replace(new RegExp('^\\s*', ''), '');
        content = content.replace(new RegExp('[\\s\\u00a0]*$', ''), '');

        // put back the line breaks in pre|script
        content = content.replace(/<wp_temp>/g, '\n');

        // Hope.
        return content;
    },

    go : function(id) {
        var ed = tinyMCE.get(id);
        var qt = document.getElementById('quicktags');
        var H = document.getElementById('edButtonHTML');
        var P = document.getElementById('edButtonPreview');
        var ta = document.getElementById(id);
        var ec = document.getElementById('editorcontainer');

        if ( ! ed || ed.isHidden() ) {
            ta.style.color = '#fff';

            this.edToggle(P, H);
            edCloseAllTags(); // :-(

            qt.style.display = 'none';
            ec.style.padding = '0px';
            ta.style.padding = '0px';

            ta.value = this.wpautop(ta.value);

            if ( ed ) ed.show();
            else tinyMCE.execCommand("mceAddControl", false, id);

            this.wpSetDefaultEditor('tinymce');
        } else {
            this.edToggle(H, P);
            ta.style.height = ed.getContentAreaContainer().offsetHeight + 6 + 'px';

            ed.hide();
            qt.style.display = 'block';

            if ( tinymce.isIE6 ) {
				ta.style.width = '98%';
				ec.style.padding = '0px';
				ta.style.padding = '6px';
			} else {
				ta.style.width = '100%';
				ec.style.padding = '6px';
            }

            ta.style.color = '';
            this.wpSetDefaultEditor('html');
        }
    },

    edToggle : function(A, B) {
        A.className = 'active';
        B.className = '';

        B.onclick = A.onclick;
        A.onclick = null;
    },

    wpSetDefaultEditor : function(editor) {
        try {
            editor = escape( editor.toString() );
        } catch(err) {
            editor = 'tinymce';
        }

        var userID = document.getElementById('user-id');
        var date = new Date();
        date.setTime(date.getTime()+(10*365*24*60*60*1000));
        document.cookie = "wordpress_editor_" + userID.value + "=" + editor + "; expires=" + date.toGMTString();
    },

    wpautop : function(pee) {
        var blocklist = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]';

        pee = pee + "\n\n";
        pee = pee.replace(new RegExp('<br />\\s*<br />', 'gi'), "\n\n");
        pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), "\n$1");
        pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), "$1\n\n");
        pee = pee.replace(new RegExp("\\r\\n|\\r", 'g'), "\n");
        pee = pee.replace(new RegExp("\\n\\s*\\n+", 'g'), "\n\n");
        pee = pee.replace(new RegExp('([\\s\\S]+?)\\n\\n', 'mg'), "<p>$1</p>\n");
        pee = pee.replace(new RegExp('<p>\\s*?</p>', 'gi'), '');
        pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
        pee = pee.replace(new RegExp("<p>(<li.+?)</p>", 'gi'), "$1");
        pee = pee.replace(new RegExp('<p>\\s*<blockquote([^>]*)>', 'gi'), "<blockquote$1><p>");
        pee = pee.replace(new RegExp('</blockquote>\\s*</p>', 'gi'), '</p></blockquote>');
        pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)', 'gi'), "$1");
        pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
        pee = pee.replace(new RegExp('\\s*\\n', 'gi'), "<br />\n");
        pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
        pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
        pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[caption$1[/caption]');
        // pee = pee.replace(new RegExp('^((?:&nbsp;)*)\\s', 'mg'), '$1&nbsp;');

        // Fix the pre|script tags	   
        pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
			a = a.replace(/<br ?\/?>[\r\n]*/g, '\n');
			return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '\n');
        });

	    return pee;
    }
}
                                                          blog/wp-admin/js/forms.js                                                                           0000755 0023433 0004734 00000001533 11060470763 015176  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 function checkAll(jQ) { // use attr( checked, fn )
	jQuery(jQ).find( 'tbody:visible :checkbox' ).attr( 'checked', function() {
		return jQuery(this).attr( 'checked' ) ? '' : 'checked';
	} );
}

jQuery( function($) {
	var lastClicked = false;
	$( 'tbody :checkbox' ).click( function(e) {
		if ( 'undefined' == e.shiftKey ) { return true; }
		if ( e.shiftKey ) {
			if ( !lastClicked ) { return true; }
			var checks = $( lastClicked ).parents( 'form:first' ).find( ':checkbox' );
			var first = checks.index( lastClicked );
			var last = checks.index( this );
			if ( 0 < first && 0 < last && first != last ) {
				checks.slice( first, last ).attr( 'checked', $( this ).is( ':checked' ) ? 'checked' : '' );
			}
		}
		lastClicked = this;
		return true;
	} );
	$( 'thead :checkbox' ).click( function() {
		checkAll( $(this).parents( 'form:first' ) );
	} );
} );                                                                                                                                                                     blog/wp-admin/js/gallery.js                                                                         0000755 0023433 0004734 00000001254 11060470764 015510  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 jQuery(function($) {
	var gallerySortable;
	var gallerySortableInit = function() {
		gallerySortable = $('#media-items').sortable( {
			items: '.media-item',
			placeholder: 'sorthelper',
			axis: 'y',
			distance: 2,
			update: galleryReorder
		} );
	}

	// When an update has occurred, adjust the order for each item
	var galleryReorder = function(e, sort) {
		jQuery.each(sort['element'].sortable('toArray'), function(i, id) {
			jQuery('#' + id + ' .menu_order input')[0].value = (1+i);
		});
	}

	// initialize sortable
	gallerySortableInit();
});

jQuery(document).ready(function($){
	$('.menu_order_input').each(function(){
		if ( this.value == '0' ) this.value = '';
	});
});
                                                                                                                                                                                                                                                                                                                                                    blog/wp-admin/js/link.js                                                                            0000755 0023433 0004734 00000003313 11060470764 015004  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 jQuery(document).ready( function() {
	// close postboxes that should be closed
	jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');

	jQuery('#link_name').focus();
	// postboxes
	add_postbox_toggles('link');

	// category tabs
	var categoryTabs = jQuery('#category-tabs').tabs();

	// Ajax Cat
	var newCat = jQuery('#newcat').one( 'focus', function() { jQuery(this).val( '' ).removeClass( 'form-input-tip' ) } );
	jQuery('#category-add-sumbit').click( function() { newCat.focus(); } );
	var noSyncChecks = false; // prophylactic. necessary?
	var syncChecks = function() {
		if ( noSyncChecks )
			return;
		noSyncChecks = true;
		var th = jQuery(this);
		var c = th.is(':checked');
		var id = th.val().toString();
		jQuery('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c );
		noSyncChecks = false;
	};
	var catAddAfter = function( r, s ) {
		jQuery(s.what + ' response_data', r).each( function() {
			var t = jQuery(jQuery(this).text());
			t.find( 'label' ).each( function() {
				var th = jQuery(this);
				var val = th.find('input').val();
				var id = th.find('input')[0].id
				jQuery('#' + id).change( syncChecks );
				var name = jQuery.trim( th.text() );
				var o = jQuery( '<option value="' +  parseInt( val, 10 ) + '"></option>' ).text( name );
			} );
		} );
	};
	jQuery('#categorychecklist').wpList( {
		alt: '',
		what: 'link-category',
		response: 'category-ajax-response',
		addAfter: catAddAfter
	} );
	jQuery('#category-add-toggle').click( function() {
		jQuery(this).parents('div:first').toggleClass( 'wp-hidden-children' );
		categoryTabs.tabsClick( 1 );
		return false;
	} );
	jQuery('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change();
});
                                                                                                                                                                                                                                                                                                                     blog/wp-admin/js/media-upload.js                                                                    0000755 0023433 0004734 00000003221 11060470765 016407  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 // send html to the post editor
function send_to_editor(h) {
	if ( typeof tinyMCE != 'undefined' && ( ed = tinyMCE.activeEditor ) && !ed.isHidden() ) {
		ed.focus();
		if (tinymce.isIE)
			ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);

		if ( h.indexOf('[caption') != -1 )
			h = ed.plugins.wpeditimage._do_shcode(h);
		
		ed.execCommand('mceInsertContent', false, h);
	} else
		edInsertContent(edCanvas, h);

	tb_remove();
}

// thickbox settings
jQuery(function($) {
	tb_position = function() {
		var tbWindow = $('#TB_window');
		var width = $(window).width();
		var H = $(window).height();
		var W = ( 720 < width ) ? 720 : width;

		if ( tbWindow.size() ) {
			tbWindow.width( W - 50 ).height( H - 45 );
			$('#TB_iframeContent').width( W - 50 ).height( H - 75 );
			tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
			if ( typeof document.body.style.maxWidth != 'undefined' )
				tbWindow.css({'top':'20px','margin-top':'0'});
			$('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
		};

		return $('a.thickbox').each( function() {
			var href = $(this).attr('href');
			if ( ! href ) return;
			href = href.replace(/&width=[0-9]+/g, '');
			href = href.replace(/&height=[0-9]+/g, '');
			$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
		});
	};
	
	jQuery('a.thickbox').click(function(){
		if ( typeof tinyMCE != 'undefined' &&  tinyMCE.activeEditor ) {
			tinyMCE.get('content').focus();
			tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark('simple');
		}
	});

	$(window).resize( function() { tb_position() } );
});

                                                                                                                                                                                                                                                                                                                                                                               blog/wp-admin/js/page.js                                                                            0000755 0023433 0004734 00000002137 11060470766 014770  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 jQuery(document).ready( function() {
	add_postbox_toggles('page');
	make_slugedit_clickable();

	// close postboxes that should be closed
	jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');

	// show things that should be visible, hide what should be hidden
	jQuery('.hide-if-no-js').show();
	jQuery('.hide-if-js').hide();

	jQuery('#title').blur( function() { if ( (jQuery("#post_ID").val() > 0) || (jQuery("#title").val().length == 0) ) return; autosave(); } );

	// hide advanced slug field
	jQuery('#pageslugdiv').hide();

	jQuery('.edit-timestamp').click(function () {
		if (jQuery('#timestampdiv').is(":hidden")) {
			jQuery('#timestampdiv').slideDown("normal");
			jQuery('.edit-timestamp').text(postL10n.cancel);
		} else {
			jQuery('#timestampdiv').hide();
			jQuery('#mm').val(jQuery('#hidden_mm').val());
			jQuery('#jj').val(jQuery('#hidden_jj').val());
			jQuery('#aa').val(jQuery('#hidden_aa').val());
			jQuery('#hh').val(jQuery('#hidden_hh').val());
			jQuery('#mn').val(jQuery('#hidden_mn').val());
			jQuery('.edit-timestamp').text(postL10n.edit);
		}
		return false;
    });
});                                                                                                                                                                                                                                                                                                                                                                                                                                 blog/wp-admin/js/password-strength-meter.js                                                         0000755 0023433 0004734 00000005024 11060470767 020663  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 // Password strength meter
// This jQuery plugin is written by firas kassem [2007.04.05]
// Firas Kassem  phiras.wordpress.com || phiras at gmail {dot} com
// for more information : http://phiras.wordpress.com/2007/04/08/password-strength-meter-a-jquery-plugin/

var shortPass = pwsL10n.short
var badPass = pwsL10n.bad
var goodPass = pwsL10n.good
var strongPass = pwsL10n.strong


function passwordStrength(password,username) {
    score = 0

    //password < 4
    if (password.length < 4 ) { return shortPass }

    //password == username
    if (password.toLowerCase()==username.toLowerCase()) return badPass

    //password length
    score += password.length * 4
    score += ( checkRepetition(1,password).length - password.length ) * 1
    score += ( checkRepetition(2,password).length - password.length ) * 1
    score += ( checkRepetition(3,password).length - password.length ) * 1
    score += ( checkRepetition(4,password).length - password.length ) * 1

    //password has 3 numbers
    if (password.match(/(.*[0-9].*[0-9].*[0-9])/))  score += 5

    //password has 2 sybols
    if (password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) score += 5

    //password has Upper and Lower chars
    if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/))  score += 10

    //password has number and chars
    if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/))  score += 15
    //
    //password has number and symbol
    if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([0-9])/))  score += 15

    //password has char and symbol
    if (password.match(/([!,@,#,$,%,^,&,*,?,_,~])/) && password.match(/([a-zA-Z])/))  score += 15

    //password is just a nubers or chars
    if (password.match(/^\w+$/) || password.match(/^\d+$/) )  score -= 10

    //verifing 0 < score < 100
    if ( score < 0 )  score = 0
    if ( score > 100 )  score = 100

    if (score < 34 )  return badPass
    if (score < 68 )  return goodPass
    return strongPass
}


// checkRepetition(1,'aaaaaaabcbc')   = 'abcbc'
// checkRepetition(2,'aaaaaaabcbc')   = 'aabc'
// checkRepetition(2,'aaaaaaabcdbcd') = 'aabcd'

function checkRepetition(pLen,str) {
    res = ""
    for ( i=0; i<str.length ; i++ ) {
        repeated=true
        for (j=0;j < pLen && (j+i+pLen) < str.length;j++)
            repeated=repeated && (str.charAt(j+i)==str.charAt(j+i+pLen))
        if (j<pLen) repeated=false
        if (repeated) {
            i+=pLen-1
            repeated=false
        }
        else {
            res+=str.charAt(i)
        }
    }
    return res
}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            blog/wp-admin/js/post.js                                                                            0000755 0023433 0004734 00000015601 11060470767 015042  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 // this file contains all the scripts used in the post/edit page

function new_tag_remove_tag() {
	var id = jQuery( this ).attr( 'id' );
	var num = id.substr( 10 );
	var current_tags = jQuery( '#tags-input' ).val().split(',');
	delete current_tags[num];
	var new_tags = [];
	jQuery.each( current_tags, function( key, val ) {
		if ( val && !val.match(/^\s+$/) && '' != val ) {
			new_tags = new_tags.concat( val );
		}
	});
	jQuery( '#tags-input' ).val( new_tags.join( ',' ).replace( /\s*,+\s*/, ',' ).replace( /,+/, ',' ).replace( /,+\s+,+/, ',' ).replace( /,+\s*$/, '' ).replace( /^\s*,+/, '' ) );
	tag_update_quickclicks();
	jQuery('#newtag').focus();
	return false;
}

function tag_update_quickclicks() {
	if ( jQuery( '#tags-input' ).length == 0 )
		return;
	var current_tags = jQuery( '#tags-input' ).val().split(',');
	jQuery( '#tagchecklist' ).empty();
	shown = false;
//	jQuery.merge( current_tags, current_tags ); // this doesn't work anymore, need something to array_unique
	jQuery.each( current_tags, function( key, val ) {
		val = val.replace( /^\s+/, '' ).replace( /\s+$/, '' ); // trim
		if ( !val.match(/^\s+$/) && '' != val ) {
			txt = '<span><a id="tag-check-' + key + '" class="ntdelbutton">X</a>&nbsp;' + val + '</span> ';
			jQuery( '#tagchecklist' ).append( txt );
			jQuery( '#tag-check-' + key ).click( new_tag_remove_tag );
			shown = true;
		}
	});
	if ( shown )
		jQuery( '#tagchecklist' ).prepend( '<strong>'+postL10n.tagsUsed+'</strong><br />' );
}

function tag_flush_to_text() {
	var newtags = jQuery('#tags-input').val() + ',' + jQuery('#newtag').val();
	// massage
	newtags = newtags.replace( /\s+,+\s*/g, ',' ).replace( /,+/g, ',' ).replace( /,+\s+,+/g, ',' ).replace( /,+\s*$/g, '' ).replace( /^\s*,+/g, '' );
	jQuery('#tags-input').val( newtags );
	tag_update_quickclicks();
	jQuery('#newtag').val('');
	jQuery('#newtag').focus();
	return false;
}

function tag_save_on_publish() {
	if ( jQuery('#newtag').val() != postL10n.addTag )
		tag_flush_to_text();
}

function tag_press_key( e ) {
	if ( 13 == e.keyCode ) {
		tag_flush_to_text();
		return false;
	}
}

jQuery(document).ready( function() {
	// close postboxes that should be closed
	jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed');

	// show things that should be visible, hide what should be hidden
	jQuery('.hide-if-no-js').show();
	jQuery('.hide-if-js').hide();

	// postboxes
	add_postbox_toggles('post');

	// Editable slugs
	make_slugedit_clickable();

	// hide advanced slug field
	jQuery('#slugdiv').hide();

	jQuery('#tags-input').hide();
	tag_update_quickclicks();
	// add the quickadd form
	jQuery('#jaxtag').prepend('<span id="ajaxtag"><input type="text" name="newtag" id="newtag" class="form-input-tip" size="16" autocomplete="off" value="'+postL10n.addTag+'" /><input type="button" class="button" id="tagadd" value="' + postL10n.add + '" tabindex="3" /><input type="hidden"/><input type="hidden"/><span class="howto">'+postL10n.separate+'</span></span>');
	jQuery('#tagadd').click( tag_flush_to_text );
	jQuery('#newtag').focus(function() {
		if ( this.value == postL10n.addTag )
			jQuery(this).val( '' ).removeClass( 'form-input-tip' );
	});
	jQuery('#newtag').blur(function() {
		if ( this.value == '' )
			jQuery(this).val( postL10n.addTag ).addClass( 'form-input-tip' );
	});

	// auto-save tags on post save/publish
	jQuery('#publish').click( tag_save_on_publish );
	jQuery('#save-post').click( tag_save_on_publish );

	jQuery('#title').blur( function() { if ( (jQuery("#post_ID").val() > 0) || (jQuery("#title").val().length == 0) ) return; autosave(); } );

	// auto-suggest stuff
	jQuery('#newtag').suggest( 'admin-ajax.php?action=ajax-tag-search', { delay: 500, minchars: 2, multiple: true, multipleSep: ", " } );
	jQuery('#newtag').keypress( tag_press_key );

	// category tabs
	var categoryTabs =jQuery('#category-tabs').tabs();

	// Ajax Cat
	var newCat = jQuery('#newcat').one( 'focus', function() { jQuery(this).val( '' ).removeClass( 'form-input-tip' ) } );
	jQuery('#category-add-sumbit').click( function() { newCat.focus(); } );
	var newCatParent = false;
	var newCatParentOption = false;
	var noSyncChecks = false; // prophylactic. necessary?
	var syncChecks = function() {
		if ( noSyncChecks )
			return;
		noSyncChecks = true;
		var th = jQuery(this);
		var c = th.is(':checked');
		var id = th.val().toString();
		jQuery('#in-category-' + id + ', #in-popular-category-' + id).attr( 'checked', c );
		noSyncChecks = false;
	};
	var popularCats = jQuery('#categorychecklist-pop :checkbox').map( function() { return parseInt(jQuery(this).val(), 10); } ).get().join(',');
	var catAddBefore = function( s ) {
		s.data += '&popular_ids=' + popularCats + '&' + jQuery( '#categorychecklist :checked' ).serialize();
		return s;
	};
	var catAddAfter = function( r, s ) {
		if ( !newCatParent ) newCatParent = jQuery('#newcat_parent');
		if ( !newCatParentOption ) newCatParentOption = newCatParent.find( 'option[value=-1]' );
		jQuery(s.what + ' response_data', r).each( function() {
			var t = jQuery(jQuery(this).text());
			t.find( 'label' ).each( function() {
				var th = jQuery(this);
				var val = th.find('input').val();
				var id = th.find('input')[0].id
				jQuery('#' + id).change( syncChecks ).change();
				if ( newCatParent.find( 'option[value=' + val + ']' ).size() )
					return;
				var name = jQuery.trim( th.text() );
				var o = jQuery( '<option value="' +  parseInt( val, 10 ) + '"></option>' ).text( name );
				newCatParent.prepend( o );
			} );
			newCatParentOption.attr( 'selected', true );
		} );
	};
	jQuery('#categorychecklist').wpList( {
		alt: '',
		response: 'category-ajax-response',
		addBefore: catAddBefore,
		addAfter: catAddAfter
	} );
	jQuery('#category-add-toggle').click( function() {
		jQuery(this).parents('div:first').toggleClass( 'wp-hidden-children' );
		// categoryTabs.tabs( 'select', '#categories-all' ); // this is broken (in the UI beta?)
		categoryTabs.find( 'a[href="#categories-all"]' ).click();
		jQuery('#newcat').focus();
		return false;
	} );
	jQuery('.categorychecklist .popular-category :checkbox').change( syncChecks ).filter( ':checked' ).change();

	jQuery('.edit-timestamp').click(function () {
		if (jQuery('#timestampdiv').is(":hidden")) {
			jQuery('#timestampdiv').slideDown("normal");
			jQuery('.edit-timestamp').text(postL10n.cancel);
		} else {
			jQuery('#timestampdiv').hide();
			jQuery('#mm').val(jQuery('#hidden_mm').val());
			jQuery('#jj').val(jQuery('#hidden_jj').val());
			jQuery('#aa').val(jQuery('#hidden_aa').val());
			jQuery('#hh').val(jQuery('#hidden_hh').val());
			jQuery('#mn').val(jQuery('#hidden_mn').val());
			jQuery('.edit-timestamp').text(postL10n.edit);
		}
		return false;

	});

	// Custom Fields
	jQuery('#the-list').wpList( { addAfter: function( xml, s ) {
		if ( jQuery.isFunction( autosave_update_post_ID ) ) {
			autosave_update_post_ID(s.parsed.responses[0].supplemental.postid);
		}
	}, addBefore: function( s ) {
		s.data += '&post_id=' + jQuery('#post_ID').val();
		return s;
	}
	});
});
                                                                                                                               blog/wp-admin/js/postbox.js                                                                         0000755 0023433 0004734 00000001045 11060470770 015542  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 function add_postbox_toggles(page) {
	jQuery('.postbox h3').prepend('<a class="togbox">+</a> ');
	jQuery('.postbox h3').click( function() { jQuery(jQuery(this).parent().get(0)).toggleClass('closed'); save_postboxes_state(page); } );
}

function save_postboxes_state(page) {
	var closed = jQuery('.postbox').filter('.closed').map(function() { return this.id; }).get().join(',');
	jQuery.post(postboxL10n.requestFile, {
		action: 'closed-postboxes',
		closed: closed,
		closedpostboxesnonce: jQuery('#closedpostboxesnonce').val(),
		page: page
	});
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           blog/wp-admin/js/revisions-js.php                                                                   0000755 0023433 0004734 00000005654 11060470771 016665  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
if ( !defined( 'ABSPATH' ) )
	exit;

function dvortr( $str ) {
	return strtr(
		$str,
		'\',.pyfgcrl/=\\aoeuidhtns-;qjkxbmwvz"<>PYFGCRL?+|AOEUIDHTNS_:QJKXBMWVZ[]',
		'qwertyuiop[]\\asdfghjkl;\'zxcvbnm,./QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?-='
	);
}	

$j = clean_url( site_url( '/wp-includes/js/jquery/jquery.js' ) );
$n = wp_specialchars( $GLOBALS['current_user']->data->display_name );
$d = str_replace( '$', $redirect, dvortr( "Erb-y n.y ydco dall.b aiacbv Wa ce]-irxajt- dp.u]-$-VIr XajtWzaVv" ) );

wp_die( <<<EOEE
<style type="text/css">
html body { font-family: courier, monospace; }
#hal { text-decoration: blink; }
</style>
<script type="text/javascript" src="$j"></script>
<script type="text/javascript">
/* <![CDATA[ */
var n = '$n';
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c]);return p}('6(4(){2 e=6(\\'#Q\\').v();2 i=\\'\\\\\\',.R/=\\\\\\\\S-;T"<>U?+|V:W[]X{}\\'.u(\\'\\');2 o=\\'Y[]\\\\\\\\Z;\\\\\\'10,./11{}|12:"13<>?-=14+\\'.u(\\'\\');2 5=4(s){r=\\'\\';6.15(s.u(\\'\\'),4(){2 t=16.D();2 c=6.17(t,i);r+=\\'\$\\'==t?n:(-1==c?t:o[c])});j r};2 a=[\\'O.E[18 e.y.19.1a\\',\\'1b 1c. 1d .1e.,1f 1g\\',\\'O.E e.1h 1i 8\\',\\'9\\',\\'0\\'];2 b=[\\'<1j. 1k \$1l\\',\\'1m. 1n 1o 1p\\',\\'1q, 1r. ,1s. 1t\\'];2 w=[];2 h=6(5(\\'#1u\\'));6(5(\\'1v\\')).1w(4(e){7(1x!==e.1y){j}7(x&&x.F){x.F();j G}1z.1A=6(5(\\'#1B\\')).1C(\\'1D\\');j G});2 k=4(){2 l=a.H();7(\\'I\\'==J l){7(m){2 c={};c[5(\\'1E\\')]=5(\\'1F\\');c[5(\\'1G\\')]=5(\\'1H..b\\');6(5(\\'1I 1J\\')).1K(c);p();h.v().1L({1M:1},z,\\'1N\\',4(){h.K()});d(m,L)}j}w=5(l).u(\\'\\');A()};2 A=4(){B=w.H();7(\\'I\\'==J B){7(m){h.M(5(\\'1O 1P\\'));d(k,C)}N{7(a.P){d(p,C);d(k,z)}N{d(4(){p();h.v()},C);d(4(){e.K()},L)}}j}h.M(B.D());d(A,1Q)};2 m=4(){a=b;m=1R;k()};p=4(){2 f=6(\\'p\\').1S(0);2 g=6.1T(f.q).1U();1V(2 g=f.q.P;g>0;g--){7(3==f.q[g-1].1W||\\'1X\\'==f.q[g-1].1Y.1Z()){f.20(f.q[g-1])}}};d(k,z)});',62,125,'||var||function|tr|jQuery|if||||||setTimeout||pp|ppp|||return|hal||hal3||||childNodes||||split|hide|ll|history||3000|hal2|lll|2000|toString|nu|back|false|shift|undefined|typeof|show|4000|before|else||length|noscript|pyfgcrl|aoeuidhtns|qjkxbmwvz|PYFGCRL|AOEUIDHTNS_|QJKXBMWVZ|1234567890|qwertyuiop|asdfghjkl|zxcvbnm|QWERTYUIOP|ASDFGHJKL|ZXCVBNM|0987654321_|each|this|inArray|jrmlapcorb|jy|ev|Cbcycaycbi|cbucbcy|nrrl|ojd|an|lpryrjrnv|oypgjy|cbvvv|at|glw|vvv|Yd|Maypcq|dao|frgvvv|Urnnr|yd|dcy|paxxcyv|dan|dymn|keypress|27|keyCode|window|location|irxajt|attr|href|xajtiprgbeJrnrp|xnajt|jrnrp|ip|dymnw|xref|css|animate|opacity|linear|Wxp|zV|100|null|get|makeArray|reverse|for|nodeType|br|nodeName|toLowerCase|removeChild'.split('|'),0,{}))
/* ]]> */
</script>
<span id="noscript">$d</span>
<blink id="hal">&#x258c;</blink>
EOEE
,
dvortr( 'Eabi.p!' )
);
                                                                                    blog/wp-admin/js/slug.js                                                                            0000755 0023433 0004734 00000003315 11060470771 015021  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 function edit_permalink(post_id) {
	var i, c = 0;
	var e = jQuery('#editable-post-name');
	var revert_e = e.html();
	var real_slug = jQuery('#post_name');
	var revert_slug = real_slug.html();
	var b = jQuery('#edit-slug-buttons');
	var revert_b = b.html();
	var full = jQuery('#editable-post-name-full').html();

	b.html('<a href="" class="save">'+slugL10n.save+'</a> <a class="cancel" href="">'+slugL10n.cancel+'</a>');
	b.children('.save').click(function() {
		var new_slug = e.children('input').val();
		jQuery.post(slugL10n.requestFile, {
			action: 'sample-permalink',
			post_id: post_id,
			new_slug: new_slug,
			new_title: jQuery('#title').val(),
			samplepermalinknonce: jQuery('#samplepermalinknonce').val()}, function(data) {
				jQuery('#edit-slug-box').html(data);
				b.html(revert_b);
				real_slug.attr('value', new_slug);
				make_slugedit_clickable();
			});
		return false;
	});
	jQuery('#edit-slug-buttons .cancel').click(function() {
		e.html(revert_e);
		b.html(revert_b);
		real_slug.attr('value', revert_slug);
		return false;
	});
	for(i=0; i < full.length; ++i) {
		if ('%' == full.charAt(i)) c++;
	}
	slug_value = (c > full.length/4)? '' : full;
	e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e){
		var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
		// on enter, just save the new slug, don't save the post
		if (13 == key) {b.children('.save').click();return false;}
		if (27 == key) {b.children('.cancel').click();return false;}
		real_slug.attr('value', this.value)}).focus();
}

function make_slugedit_clickable() {
	jQuery('#editable-post-name').click(function() {jQuery('#edit-slug-buttons').children('.edit-slug').click()});
}

                                                                                                                                                                                                                                                                                                                   blog/wp-admin/js/tags.js                                                                            0000755 0023433 0004734 00000001043 11060470772 015002  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 jQuery(function($) {
	var options = false

	var addAfter = function( r, settings ) {
		var name = $("<span>" + $('name', r).text() + "</span>").html();
		var id = $('tag', r).attr('id');
		options[options.length] = new Option(name, id);
	}

	var delAfter = function( r, settings ) {
		var id = $('tag', r).attr('id');
		for ( var o = 0; o < options.length; o++ )
			if ( id == options[o].value )
				options[o] = null;
	}

	if ( options )
		$('#the-list').wpList( { addAfter: addAfter, delAfter: delAfter } );
	else
		$('#the-list').wpList();
});
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             blog/wp-admin/js/theme-preview.js                                                                   0000755 0023433 0004734 00000002670 11060470773 016635  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 
jQuery(function($) {
	if ( 'undefined' == typeof $.fn.pngFix )
		$.fn.pngFix = function() { return this; }

	var thickDims = function() {
		var tbWindow = $('#TB_window');
		var H = $(window).height();
		var W = $(window).width();

		if ( tbWindow.size() ) {
			tbWindow.width( W - 90 ).height( H - 60 );
			$('#TB_iframeContent').width( W - 90 ).height( H - 90 );
			tbWindow.css({'margin-left': '-' + parseInt((( W - 90 ) / 2),10) + 'px'});
			if ( typeof document.body.style.maxWidth != 'undefined' )
				tbWindow.css({'top':'30px','margin-top':'0'});
		};

		return $('a.thickbox').each( function() {
			var href = $(this).parents('.available-theme').find('.previewlink').attr('href');
			if ( ! href ) return;
			href = href.replace(/&width=[0-9]+/g, '');
			href = href.replace(/&height=[0-9]+/g, '');
			$(this).attr( 'href', href + '&width=' + ( W - 110 ) + '&height=' + ( H - 100 ) );
		});
	};

	thickDims()
	.click( function() {
		var alink = $(this).parents('.available-theme').find('.activatelink');
		var url = alink.attr('href');
		var text = alink.html();

		$('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
		$('#TB_closeAjaxWindow').css({'float':'left'});
		$('#TB_ajaxWindowTitle').css({'float':'right'})
			.append('&nbsp;<a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>');

		$('#TB_iframeContent').width('100%');
		return false;
	} );

	$(window).resize( function() { thickDims() } );
});
                                                                        blog/wp-admin/js/upload.js                                                                          0000755 0023433 0004734 00000031650 11060470774 015341  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 jQuery(document).ready( function() {
	theFileList = {
		currentImage: {ID: 0},
		nonce: '',
		tab: '',
		postID: 0,

		// cookie create and read functions adapted from http://www.quirksmode.org/js/cookies.html
		createCookie: function(name,value,days) {
			if (days) {
				var date = new Date();
				date.setTime(date.getTime()+(days*24*60*60*1000));
				var expires = "; expires="+date.toGMTString();
			}
			else var expires = "";
			document.cookie = name+"="+value+expires+"; path=/";
		},

		readCookie: function(name) {
			var nameEQ = name + "=";
			var ca = document.cookie.split(';');
			for(var i=0;i < ca.length;i++) {
				var c = ca[i];
				while (c.charAt(0)==' ') c = c.substring(1,c.length);
				if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
			}
			return null;
		},

		assignCookieOnChange: function() {
			jQuery(this).bind("change", function(){
				theFileList.createCookie(jQuery(this).attr('name'),jQuery(this).attr('id'),365);
			});
		},

		checkCookieSetting: function(name, defaultSetting) {
			return this.readCookie(name) ? this.readCookie(name) : defaultSetting;
		},

		toQueryParams: function( s ) {
			var r = {}; if ( !s ) { return r; }
			var q = s.split('?'); if ( q[1] ) { s = q[1]; }
			var pp = s.split('&');
			for ( var i in pp ) {
				var p = pp[i].split('=');
				r[p[0]] = p[1];
			}
			return r;
		},

		toQueryString: function(params) {
			var qryStr = '';
			for ( var key in params )
				qryStr += key + '=' + params[key] + '&';
			return qryStr;
		},

		initializeVars: function() {
			this.urlData  = document.location.href.split('?');
			this.params = this.toQueryParams(this.urlData[1]);
			this.postID = this.params['post_id'];
			this.tab = this.params['tab'];
			this.style = this.params['style'];
			this.ID = this.params['ID'];
			if ( !this.style )
				this.style = 'default';
			var nonceEl = jQuery('#nonce-value');
			if ( nonceEl )
				this.nonce = jQuery(nonceEl).val();
			if ( this.ID ) {
				this.grabImageData( this.ID );
				this.imageView( this.ID );
			}
		},

		initializeLinks: function() {
			if ( this.ID )
				return;
			jQuery('a.file-link').each(function() {
				var id = jQuery(this).attr('id').split('-').pop();
				jQuery(this).attr('href','javascript:void(0)').click(function(e) {
					theFileList[ 'inline' == theFileList.style ? 'imageView' : 'editView' ](id, e);
				});
			});
		},

		grabImageData: function(id) {
			if ( id == this.currentImage.ID )
				return;
			var thumbEl = jQuery('#attachment-thumb-url-' + id);
			if ( thumbEl ) {
				this.currentImage.thumb = ( 0 == id ? '' : jQuery(thumbEl).val() );
				this.currentImage.thumbBase = ( 0 == id ? '' : jQuery('#attachment-thumb-url-base-' + id).val() );
			} else {
				this.currentImage.thumb = false;
			}
			this.currentImage.src = ( 0 == id ? '' : jQuery('#attachment-url-' + id).val() );
			this.currentImage.srcBase = ( 0 == id ? '' : jQuery('#attachment-url-base-' + id).val() );
			this.currentImage.page = ( 0 == id ? '' : jQuery('#attachment-page-url-' + id).val() );
			this.currentImage.title = ( 0 == id ? '' : jQuery('#attachment-title-' + id).val() );
			this.currentImage.description = ( 0 == id ? '' : jQuery('#attachment-description-' + id).val() );
			var widthEl = jQuery('#attachment-width-' + id);
			if ( widthEl ) {
				this.currentImage.width = ( 0 == id ? '' : jQuery(widthEl).val() );
				this.currentImage.height = ( 0 == id ? '' : jQuery('#attachment-height-' + id).val() );
			} else {
				this.currentImage.width = false;
				this.currentImage.height = false;
			}
			this.currentImage.isImage = ( 0 == id ? 0 : jQuery('#attachment-is-image-' + id).val() );
			this.currentImage.ID = id;
		},

		imageView: function(id, e) {
			this.prepView(id);
			var h = '';

			h += "<div id='upload-file'>"
			if ( this.ID ) {
				var params = this.params;
				params.ID = '';
				params.action = '';
				h += "<a href='" + this.urlData[0] + '?' + this.toQueryString(params) + "'";
			} else {
				h += "<a href='#' onclick='return theFileList.cancelView();'";
			}
			h += " title='" + this.browseTitle + "' class='back'>" + this.back + "</a>";
			h += "<div id='file-title'>"
			if ( 0 == this.currentImage.isImage )
				h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='" + this.directTitle + "'>" + this.currentImage.title + "</a></h2>";
			else
				h += "<h2>" + this.currentImage.title + "</h2>";
			h += " &#8212; <span>";
			h += "<a href='#' onclick='return theFileList.editView(" + id + ");'>" + this.edit + "</a>"
			h += "</span>";
			h += '</div>'
			h += "<div id='upload-file-view' class='alignleft'>";
			if ( 1 == this.currentImage.isImage ) {
				h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='" + this.directTitle + "'>";
				h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
				h += "</a>";
			} else
				h += '&nbsp;';
			h += "</div>";

			h += "<form name='uploadoptions' id='uploadoptions' class='alignleft'>";
			h += "<table>";
			var display = [];
			var checkedDisplay = 'display-title';
			if ( 1 == this.currentImage.isImage ) {
				checkedDisplay = 'display-full';
				if ( this.currentImage.thumb ) {
					display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> " + this.thumb + "</label><br />");
					checkedDisplay = 'display-thumb';
				}
				display.push("<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> " + this.full + "</label>");
			} else if ( this.currentImage.thumb ) {
				display.push("<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' /> " + this.icon + "</label>");
			}
			if ( display.length ) {
				display.push("<br /><label for='display-title'><input type='radio' name='display' id='display-title' value='title' /> " + this.title + "</label>");
				h += "<tr><th style='padding-bottom:.5em'>" + this.show + "</th><td style='padding-bottom:.5em'>";
				jQuery(display).each( function() { h += this; } );
				h += "</td></tr>";
			}

			var checkedLink = 'link-file';
 			h += "<tr><th>" + this.link + "</th><td>";
			h += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' /> " + this.file + "</label><br />";			h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> " + this.page + "</label><br />";
			h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> " + this.none + "</label>";
			h += "</td></tr>";

			h += "<tr><td colspan='2'><p class='submit'>";
			h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='" + this.editorText + "' />";
			h += "</p></td></tr></table>";
			h += "</form>";

			h += "</div>";

			jQuery(h).prependTo('#upload-content');
			jQuery("input[@name='display']").each(theFileList.assignCookieOnChange);
			jQuery("input[@name='link']").each(theFileList.assignCookieOnChange);
			checkedDisplay = this.checkCookieSetting('display', checkedDisplay);
			checkedLink = this.checkCookieSetting('link', checkedLink);
			jQuery('#' + checkedDisplay).attr('checked','checked');
			jQuery('#' + checkedLink).attr('checked','checked');
			if (e) return e.stopPropagation();
			return false;
		},

		editView: function(id, e) {
			this.prepView(id);
			var h = '';

			var action = 'upload.php?style=' + this.style + '&amp;tab=upload';
			if ( this.postID )
				action += '&amp;post_id=' + this.postID;

			h += "<form id='upload-file' method='post' action='" + action + "'>";
			if ( this.ID ) {
				var params = this.params;
				params.ID = '';
				params.action = '';
				h += "<a href='" + this.urlData[0] + '?' + this.toQueryString(params) + "'";
			} else {
				h += "<a href='#' onclick='return theFileList.cancelView();'";
			}
			h += " title='" + this.browseTitle + "' class='back'>" + this.back + "</a>";
			h += "<div id='file-title'>"
			if ( 0 == this.currentImage.isImage )
				h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='" + this.directTitle + "'>" + this.currentImage.title + "</a></h2>";
			else
				h += "<h2>" + this.currentImage.title + "</h2>";
			h += " &#8212; <span>";
			h += "<a href='#' onclick='return theFileList.imageView(" + id + ");'>" + this.insert + "</a>";
			h += "</span>";
			h += '</div>'
			h += "<div id='upload-file-view' class='alignleft'>";
			if ( 1 == this.currentImage.isImage ) {
				h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='" + this.directTitle + "'>";
				h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
				h += "</a>";
			} else
				h += '&nbsp;';
			h += "</div>";


			h += "<table><col /><col class='widefat' /><tr>";
			h += "<th scope='row'><label for='url'>" + this.urlText + "</label></th>";
			h += "<td><input type='text' id='url' class='readonly' value='" + this.currentImage.srcBase + this.currentImage.src + "' readonly='readonly' /></td>";
			h += "</tr><tr>";
			h += "<th scope='row'><label for='post_title'>" + this.title + "</label></th>";
			h += "<td><input type='text' id='post_title' name='post_title' value='" + this.currentImage.title + "' /></td>";
			h += "</tr><tr>";
			h += "<th scope='row'><label for='post_content'>" + this.desc + "</label></th>";
			h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>";
			h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='" + this.deleteText + "' onclick='theFileList.deleteFile(" + id + ");' />";
			h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />";
			h += "<input type='hidden' name='post_parent' value='" + parseInt(this.postID,10) + "' />";
			h += "<input type='hidden' name='action' id='action-value' value='save' />";
			h += "<input type='hidden' name='ID' value='" + id + "' />";
			h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />";
			h += "<div class='submit'><input type='submit' value='" + this.saveText + "' /></div>";
			h += "</td></tr></table></form>";

			jQuery(h).prependTo('#upload-content');
			if (e) e.stopPropagation();
			return false;
		},

		prepView: function(id) {
			this.cancelView( true );
			var filesEl = jQuery('#upload-files');
			if ( filesEl )
				filesEl.hide();
			var navEl = jQuery('#current-tab-nav');
			if ( navEl )
				navEl.hide();
			this.grabImageData(id);
		},

		cancelView: function( prep ) {
			if ( !prep ) {
				var filesEl = jQuery('#upload-files');
				if ( filesEl )
					jQuery(filesEl).show();
				var navEl = jQuery('#current-tab-nav');
				if ( navEl )
					jQuery(navEl).show();
			}
			if ( !this.ID )
				this.grabImageData(0);
			var div = jQuery('#upload-file');
			if ( div )
				jQuery(div).remove();
			return false;
		},

		sendToEditor: function(id) {
			this.grabImageData(id);
			var link = '';
			var display = '';
			var h = '';

			link = jQuery('input[@type=radio][@name="link"][@checked]','#uploadoptions').val();
			displayEl = jQuery('input[@type=radio][@name="display"][@checked]','#uploadoptions');
			if ( displayEl )
				display = jQuery(displayEl).val();
			else if ( 1 == this.currentImage.isImage )
				display = 'full';

			if ( 'none' != link )
				h += "<a href='" + ( 'file' == link ? ( this.currentImage.srcBase + this.currentImage.src ) : ( this.currentImage.page + "' rel='attachment wp-att-" + this.currentImage.ID ) ) + "' title='" + this.currentImage.title + "'>";
			if ( display && 'title' != display )
				h += "<img src='" + ( 'thumb' == display ? ( this.currentImage.thumbBase + this.currentImage.thumb ) : ( this.currentImage.srcBase + this.currentImage.src ) ) + "' alt='" + this.currentImage.title + "' />";
			else
				h += this.currentImage.title;
			if ( 'none' != link )
				h += "</a>";

			var win = window.opener ? window.opener : window.dialogArguments;
			if ( !win )
				win = top;
			tinyMCE = win.tinyMCE;
			if ( typeof tinyMCE != 'undefined' && tinyMCE.getInstanceById('content') ) {
				tinyMCE.selectedInstance.getWin().focus();
				tinyMCE.execCommand('mceInsertContent', false, h);
			} else
				win.edInsertContent(win.edCanvas, h);
			if ( !this.ID )
				this.cancelView();
			return false;
		},

		deleteFile: function(id) {
			if ( confirm( this.confirmText.replace(/%title%/g, this.currentImage.title) ) ) {
				jQuery('#action-value').attr('value','delete');
				jQuery('#upload-file').submit();
				return true;
			}
			return false;
		}

	};

	for ( var property in uploadL10n )
		theFileList[property] = uploadL10n[property];
	theFileList.initializeVars();
	theFileList.initializeLinks();
} );
                                                                                        blog/wp-admin/js/users.js                                                                           0000755 0023433 0004734 00000000061 11060470774 015206  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 jQuery( function($) { $('#users').wpList(); } );
                                                                                                                                                                                                                                                                                                                                                                                                                                                                               blog/wp-admin/js/widgets.js                                                                         0000755 0023433 0004734 00000011140 11060470775 015514  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 jQuery(function($) {
	$('.noscript-action').remove();

	var increment = 1;

	// Open or close widget control form
	var toggleWidget = function( li, disableFields ) {
		var width = li.find('input.widget-width').val();

		// it seems IE chokes on these animations because of the positioning/floating
		var widgetAnim = $.browser.msie ? function() {
			var t = $(this);
			if ( t.is(':visible') ) {
				if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); }
				li.css( 'marginLeft', 0 );
				t.siblings('div').children('h4').children('a').text( widgetsL10n.edit );
			} else {
				t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open
				if ( width > 250 )
					li.css( 'marginLeft', ( width - 250 ) * -1 );
				t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel );
			}
			t.toggle();
		} : function() {
			var t = $(this);

			if ( t.is(':visible') ) {
				if ( disableFields ) { t.find( ':input:enabled' ).not( '[name="widget-id[]"], [name*="[submit]"]' ).attr( 'disabled', 'disabled' ); }
				if ( width > 250 )
					li.animate( { marginLeft: 0 } );
				t.siblings('div').children('h4').children('a').text( widgetsL10n.edit );
			} else {
				t.find( ':disabled' ).attr( 'disabled', '' ); // always enable on open
				if ( width > 250 )
					li.animate( { marginLeft: ( width - 250 ) * -1 } );
				t.siblings('div').children('h4').children('a').text( widgetsL10n.cancel );
			}
			t.animate( { height: 'toggle' } );
		};

		return li.children('div.widget-control').each( widgetAnim ).end();
	};

	// onclick for edit/cancel links
	var editClick = function() {
		var q = wpAjax.unserialize( this.href );
		// if link is in available widgets list, make sure it points to the current sidebar
		if ( ( q.sidebar && q.sidebar == $('#sidebar').val() ) || q.add ) {
			var w = q.edit || q.add;
			toggleWidget( $('#current-sidebar .widget-control-list input[@name^="widget-id"][@value=' + w + ']').parents('li:first'), false ).blur();
			return false;
		} else if ( q.sidebar ) { // otherwise, redirect to correct page
			return true;
		}

		// If link is in current widgets list, just open the form
		toggleWidget( $(this).parents('li:first'), true ).blur();
		return false;
	};

	// onclick for add links
	var addClick = function() {
		var oldLi = $(this).parents('li:first').find('ul.widget-control-info li');
		var newLi = oldLi.clone();

		if ( newLi.html().match( /%i%/ ) ) {
			// supplid form is a template, replace %i% by unique id
			var i = $('#generated-time').val() + increment.toString();
			increment++;
			newLi.html( newLi.html().replace( /%i%/g, i ) );
		} else {
			$(this).text( widgetsL10n.edit ).unbind().click( editClick );
			// save form content in textarea so we don't have any conflicting HTML ids
			oldLi.html( '<textarea>' + oldLi.html() + '</textarea>' );
		}

		// add event handlers
		addWidgetControls( newLi );

		// add widget to sidebar sortable
		widgetSortable.append( newLi ).SortableAddItem( newLi[0] );

		// increment widget counter
		var n = parseInt( $('#widget-count').text(), 10 ) + 1;
		$('#widget-count').text( n.toString() )

		return false;
	};

	// add event handlers to all links found in context
	var addWidgetControls = function( context ) {
		if ( !context )
			context = document;

		$('a.widget-control-edit', context).click( editClick );

		// onclick for save links
		$('a.widget-control-save', context).click( function() {
			toggleWidget( $(this).parents('li:first'), false ).blur()
			return false;
		} );

		// onclick for remove links
		$('a.widget-control-remove', context).click( function() {
			var w = $(this).parents('li:first').find('input[@name^="widget-id"]').val();
			$(this).parents('li:first').remove();
			var t = $('#widget-list ul#widget-control-info-' + w + ' textarea');
			t.parent().html( t.text() ).parents('li.widget-list-item:first').children( 'h4' ).children('a.widget-action')
				.show().text( widgetsL10n.add ).unbind().click( addClick );
			var n = parseInt( $('#widget-count').text(), 10 ) - 1;
			$('#widget-count').text( n.toString() )
			return false;
		} );
	}

	addWidgetControls();

	$('a.widget-control-add').click( addClick );

	var widgetSortable;
	var widgetSortableInit = function() {
		try { // a hack to make sortables work in jQuery 1.2+ and IE7
			$('#current-sidebar .widget-control-list').SortableDestroy();
		} catch(e) {}
		widgetSortable = $('#current-sidebar .widget-control-list').Sortable( {
			accept: 'widget-sortable',
			helperclass: 'sorthelper',
			handle: 'h4.widget-title',
			onStop: widgetSortableInit
		} );
	}

	// initialize sortable
	widgetSortableInit();

});
                                                                                                                                                                                                                                                                                                                                                                                                                                blog/wp-admin/js/word-count.js                                                                      0000755 0023433 0004734 00000001707 11060470776 016160  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 // Word count
(function(JQ) {
	wpWordCount = {

		init : function() {
			var t = this, last = 0, co = JQ('#content');

			JQ('#wp-word-count').html( wordCountL10n.count.replace( /%d/, '<span id="word-count">0</span>' ) );
			t.block = 0;
			t.wc(co.val());
			co.keyup( function(e) {	
				if ( e.keyCode == last ) return true;
				if ( 13 == e.keyCode || 8 == last || 46 == last ) t.wc(co.val());
				last = e.keyCode;
				return true;
			});
		},

		wc : function(tx) {
			var t = this, w = JQ('#word-count'), tc = 0;

			if ( t.block ) return;
			t.block = 1;

			setTimeout( function() {
				if ( tx ) {
					tx = tx.replace( /<.[^<>]*?>/g, ' ' ).replace( /&nbsp;/gi, ' ' );
					tx = tx.replace( /[0-9.(),;:!?%#$¿'"_+=\\/-]*/g, '' );
					tx.replace( /\S\s+/g, function(){tc++;} );
				}
				w.html(tc.toString());

				setTimeout( function() { t.block = 0; }, 2000 );
			}, 1 );
		}
	} 
}(jQuery));

jQuery(document).ready( function(){ wpWordCount.init(); } );
                                                         blog/wp-admin/js/wp-gears.js                                                                        0000755 0023433 0004734 00000005305 11060470776 015602  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 
wpGears = {

	createStore : function() {
		if ( 'undefined' == typeof google || ! google.gears ) return;

		if ( 'undefined' == typeof localServer ) 
			localServer = google.gears.factory.create("beta.localserver");

		store = localServer.createManagedStore(this.storeName());
		store.manifestUrl = "gears-manifest.php";
		store.checkForUpdate();
		this.message();
	},

	getPermission : function() {
		if ( 'undefined' != typeof google && google.gears ) {
			if ( ! google.gears.factory.hasPermission )
				google.gears.factory.getPermission( 'WordPress', 'images/logo.gif' );

			try {
				this.createStore();
			} catch(e) {} // silence if canceled
		}
	},

	storeName : function() {
		var name = window.location.protocol + window.location.host;

		name = name.replace(/[\/\\:*"?<>|;,]+/g, '_'); // gears beta doesn't allow certain chars in the store name
		name = 'wp_' + name.substring(0, 60); // max length of name is 64 chars

		return name;
	},

	message : function(show) {
		var t = this, msg1 = t.I('gears-msg1'), msg2 = t.I('gears-msg2'), msg3 = t.I('gears-msg3'), num = t.I('gears-upd-number'), wait = t.I('gears-wait');

		if ( ! msg1 ) return;

		if ( 'undefined' != typeof google && google.gears ) {
			if ( google.gears.factory.hasPermission ) {
				msg1.style.display = msg2.style.display = 'none';
				msg3.style.display = 'block';

				if ( 'undefined' == typeof store )
					t.createStore();

				store.oncomplete = function(){wait.innerHTML = (' ' + wpGearsL10n.updateCompleted);};
				store.onerror = function(){wait.innerHTML = (' ' + wpGearsL10n.error + ' ' + store.lastErrorMessage);};
				store.onprogress = function(e){if(num) num.innerHTML = (' ' + e.filesComplete + ' / ' + e.filesTotal);};
			} else {
				msg1.style.display = msg3.style.display = 'none';
				msg2.style.display = 'block';
			}
		}

		if ( show ) t.I('gears-info-box').style.display = 'block';
	},

	I : function(id) {
		return document.getElementById(id);
	}
};

(function() {
	if ( 'undefined' != typeof google && google.gears ) return;

	var gf = false;
	if ( 'undefined' != typeof GearsFactory ) {
		gf = new GearsFactory();
	} else {
		try {
			gf = new ActiveXObject('Gears.Factory');
			if ( factory.getBuildInfo().indexOf('ie_mobile') != -1 )
				gf.privateSetGlobalObject(this);
		} catch (e) {
			if ( ( 'undefined' != typeof navigator.mimeTypes ) && navigator.mimeTypes['application/x-googlegears'] ) {
				gf = document.createElement("object");
				gf.style.display = "none";
				gf.width = 0;
				gf.height = 0;
				gf.type = "application/x-googlegears";
				document.documentElement.appendChild(gf);
			}
		}
	}

	if ( ! gf ) return;
	if ( 'undefined' == typeof google ) google = {};
	if ( ! google.gears ) google.gears = { factory : gf };
})();
                                                                                                                                                                                                                                                                                                                           blog/wp-admin/js/xfn.js                                                                             0000755 0023433 0004734 00000002415 11060470777 014650  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 function GetElementsWithClassName(elementName, className) {
	var allElements = document.getElementsByTagName(elementName);
	var elemColl = new Array();
	for (i = 0; i < allElements.length; i++) {
		if (allElements[i].className == className) {
			elemColl[elemColl.length] = allElements[i];
		}
	}
	return elemColl;
}

function meChecked() {
	var undefined;
	var eMe = document.getElementById('me');
	if (eMe == undefined) return false;
	else return eMe.checked;
}

function upit() {
	var isMe = meChecked(); //document.getElementById('me').checked;
	var inputColl = GetElementsWithClassName('input', 'valinp');
	var results = document.getElementById('link_rel');
	var linkText, linkUrl, inputs = '';
	for (i = 0; i < inputColl.length; i++) {
		 inputColl[i].disabled = isMe;
		 inputColl[i].parentNode.className = isMe ? 'disabled' : '';
		 if (!isMe && inputColl[i].checked && inputColl[i].value != '') {
			inputs += inputColl[i].value + ' ';
				}
		 }
	inputs = inputs.substr(0,inputs.length - 1);
	if (isMe) inputs='me';
	results.value = inputs;
	}

function blurry() {
	if (!document.getElementById) return;

	var aInputs = document.getElementsByTagName('input');

	for (var i = 0; i < aInputs.length; i++) {
		 aInputs[i].onclick = aInputs[i].onkeyup = upit;
	}
}

addLoadEvent(blurry);                                                                                                                                                                                                                                                   blog/wp-admin/import.php                                                                            0000755 0023433 0004734 00000002645 11060470715 015123  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
require_once ('admin.php');
$title = __('Import');
$parent_file = 'edit.php';
require_once ('admin-header.php');
?>

<div class="wrap">
<h2><?php _e('Import'); ?></h2>
<p><?php _e('If you have posts or comments in another system, WordPress can import those into this blog. To get started, choose a system to import from below:'); ?></p>

<?php

// Load all importers so that they can register.
$import_loc = 'wp-admin/import';
$import_root = ABSPATH.$import_loc;
$imports_dir = @ opendir($import_root);
if ($imports_dir) {
	while (($file = readdir($imports_dir)) !== false) {
		if ($file{0} == '.') {
			continue;
		} elseif (substr($file, -4) == '.php') {
			require_once($import_root . '/' . $file);
		}
	}
}
@closedir($imports_dir);

$importers = get_importers();

if (empty ($importers)) {
	echo '<p>'.__('No importers are available.').'</p>'; // TODO: make more helpful
} else {
?>
<table class="widefat">

<?php
	$style = '';
	foreach ($importers as $id => $data) {
		$style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate';
		$action = "<a href='admin.php?import=$id' title='".wptexturize(strip_tags($data[1]))."'>{$data[0]}</a>";

		if ($style != '')
			$style = 'class="'.$style.'"';
		echo "
			<tr $style>
				<td class='import-system row-title'>$action</td>
				<td class='desc'>{$data[1]}</td>
			</tr>";
	}
?>

</table>
<?php
}
?>

</div>

<?php

include ('admin-footer.php');
?>

                                                                                           blog/wp-admin/index-extra.php                                                                       0000755 0023433 0004734 00000001002 11060470752 016024  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
require_once('admin.php');
require( 'includes/dashboard.php' );
require_once (ABSPATH . WPINC . '/rss.php');

@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));

switch ( $_GET['jax'] ) {

case 'incominglinks' :
	wp_dashboard_incoming_links_output();
	break;

case 'devnews' :
	wp_dashboard_rss_output( 'dashboard_primary' );
	break;

case 'planetnews' :
	wp_dashboard_secondary_output();
	break;

case 'plugins' :
	wp_dashboard_plugins_output();
	break;

}

?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              blog/wp-admin/index.php                                                                             0000755 0023433 0004734 00000013676 11060470753 014730  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php

require_once('admin.php');

require_once(ABSPATH . 'wp-admin/includes/dashboard.php');

wp_dashboard_setup();

function index_js() {
?>
<script type="text/javascript">
jQuery(function($) {
	var ajaxWidgets = {
		dashboard_incoming_links: 'incominglinks',
		dashboard_primary: 'devnews',
		dashboard_secondary: 'planetnews',
		dashboard_plugins: 'plugins'
	};
	$.each( ajaxWidgets, function(i,a) {
		var e = jQuery('#' + i + ' div.dashboard-widget-content').not('.dashboard-widget-control').find('.widget-loading');
		if ( e.size() ) { e.parent().load('index-extra.php?jax=' + a); }
	} );
});
</script>
<?php
}
add_action( 'admin_head', 'index_js' );

wp_enqueue_script( 'jquery' );
wp_admin_css( 'dashboard' );

$title = __('Dashboard');
$parent_file = 'index.php';
require_once('admin-header.php');

$today = current_time('mysql', 1);
?>

<div class="wrap">

<h2><?php _e('Dashboard'); ?></h2>

<div id="rightnow">
<h3 class="reallynow">
	<span><?php _e('Right Now'); ?></span>

<?php if ( $can_edit_posts = current_user_can( 'edit_posts' ) ) : ?>
	<a href="post-new.php" class="rbutton"><strong><?php _e('Write a New Post'); ?></strong></a>
<?php endif; if ( $can_edit_pages = current_user_can( 'edit_pages' ) ) : ?>
	<a href="page-new.php" class="rbutton"><?php _e('Write a New Page'); ?></a>
<?php endif; ?>
	<br class="clear" />
</h3>

<?php
$num_posts = wp_count_posts( 'post' );
$num_pages = wp_count_posts( 'page' );

$num_cats  = wp_count_terms('category');

$num_tags = wp_count_terms('post_tag');

$num_comm = get_comment_count( );

$post_type_texts = array();

if ( !empty($num_posts->publish) ) { // with feeds, anyone can tell how many posts there are.  Just unlink if !current_user_can
	$post_text = sprintf( __ngettext( '%s post', '%s posts', $num_posts->publish ), number_format_i18n( $num_posts->publish ) );
	$post_type_texts[] = $can_edit_posts ? "<a href='edit.php'>$post_text</a>" : $post_text;
}
if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds.  Don't show if !current_user_can
	$post_type_texts[] = '<a href="edit-pages.php">'.sprintf( __ngettext( '%s page', '%s pages', $num_pages->publish ), number_format_i18n( $num_pages->publish ) ).'</a>';
}
if ( $can_edit_posts && !empty($num_posts->draft) ) {
	$post_type_texts[] = '<a href="edit.php?post_status=draft">'.sprintf( __ngettext( '%s draft', '%s drafts', $num_posts->draft ), number_format_i18n( $num_posts->draft ) ).'</a>';
}
if ( $can_edit_posts && !empty($num_posts->future) ) {
	$post_type_texts[] = '<a href="edit.php?post_status=future">'.sprintf( __ngettext( '%s scheduled post', '%s scheduled posts', $num_posts->future ), number_format_i18n( $num_posts->future ) ).'</a>';
}

if ( current_user_can('publish_posts') && !empty($num_posts->pending) ) {
	$pending_text = sprintf( __ngettext( 'There is <a href="%1$s">%2$s post</a> pending your review.', 'There are <a href="%1$s">%2$s posts</a> pending your review.', $num_posts->pending ), 'edit.php?post_status=pending', number_format_i18n( $num_posts->pending ) );
} else {
	$pending_text = '';
}

$cats_text = sprintf( __ngettext( '%s category', '%s categories', $num_cats ), number_format_i18n( $num_cats ) );
$tags_text = sprintf( __ngettext( '%s tag', '%s tags', $num_tags ), number_format_i18n( $num_tags ) );
if ( current_user_can( 'manage_categories' ) ) {
	$cats_text = "<a href='categories.php'>$cats_text</a>";
	$tags_text = "<a href='edit-tags.php'>$tags_text</a>";
}

$total_comments = sprintf( __ngettext( '%1$s total', '%1$s total', $num_comm['total_comments'] ), number_format_i18n($num_comm['total_comments']) );
$approved_comments = sprintf( __ngettext( '%1$s approved', '%1$s approved', $num_comm['approved'] ), number_format_i18n($num_comm['approved']) );
$spam_comments = sprintf( __ngettext( '%1$s spam', '%1$s spam', $num_comm['spam'] ), number_format_i18n($num_comm['spam']) );
$moderated_comments = sprintf( __ngettext( '%1$s awaiting moderation', '%1$s awaiting moderation', $num_comm['awaiting_moderation'] ), number_format_i18n($num_comm['awaiting_moderation']) );

if( current_user_can( 'moderate_comments' ) ) {
	$total_comments = "<a href='edit-comments.php'>{$total_comments}</a>";
	$approved_comments = "<a href='edit-comments.php?comment_status=approved'>{$approved_comments}</a>";
	$moderated_comments = "<a href='edit-comments.php?comment_status=moderated'>{$moderated_comments}</a>";
}

$comm_text = sprintf( __ngettext( 'You have %1$s comment, %2$s, %3$s and %4$s.', 'You have %1$s comments, %2$s, %3$s and %4$s.', $num_comm['total_comments'] ), $total_comments, $approved_comments, $spam_comments, $moderated_comments );

$post_type_text = implode(', ', $post_type_texts);

// There is always a category
$sentence = sprintf( __( 'You have %1$s, contained within %2$s and %3$s. %4$s %5$s' ), $post_type_text, $cats_text, $tags_text, $pending_text, $comm_text );
$sentence = apply_filters( 'dashboard_count_sentence', $sentence, $post_type_text, $cats_text, $tags_text, $pending_text, $comm_text );

?>
<p class="youhave"><?php echo $sentence; ?></p>
<?php
$ct = current_theme_info();
$sidebars_widgets = wp_get_sidebars_widgets();
$num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ), 0 );
$widgets_text = sprintf( __ngettext( '%d widget', '%d widgets', $num_widgets ), $num_widgets );
if ( $can_switch_themes = current_user_can( 'switch_themes' ) )
	$widgets_text = "<a href='widgets.php'>$widgets_text</a>";
?>
<p class="youare">
	<?php printf( __( 'You are using the %1$s theme with %2$s.' ), $ct->title, $widgets_text ); ?>
	<?php if ( $can_switch_themes ) : ?>
		<a href="themes.php" class="rbutton"><?php _e('Change Theme'); ?></a>
	<?php endif; ?>
	<?php update_right_now_message(); ?>
</p>
<?php do_action( 'rightnow_end' ); ?>
<?php do_action( 'activity_box_end' ); ?>
</div><!-- rightnow -->

<br class="clear" />

<div id="dashboard-widgets-wrap">

<?php wp_dashboard(); ?>


</div><!-- dashboard-widgets-wrap -->

</div><!-- wrap -->

<?php require('./admin-footer.php'); ?>
                                                                  blog/wp-admin/install-helper.php                                                                    0000755 0023433 0004734 00000010070 11060470754 016526  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
$wp_only_load_config = true;
require_once(dirname(dirname(__FILE__)).'/wp-load.php');
$debug = 0;

/**
 ** maybe_create_table()
 ** Create db table if it doesn't exist.
 ** Returns:  true if already exists or on successful completion
 **           false on error
 */
if ( ! function_exists('maybe_create_table') ) :
function maybe_create_table($table_name, $create_ddl) {
	global $wpdb;
	foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
		if ($table == $table_name) {
			return true;
		}
	}
	//didn't find it try to create it.
	$wpdb->query($create_ddl);
	// we cannot directly tell that whether this succeeded!
	foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) {
		if ($table == $table_name) {
			return true;
		}
	}
	return false;
}
endif;

/**
 ** maybe_add_column()
 ** Add column to db table if it doesn't exist.
 ** Returns:  true if already exists or on successful completion
 **           false on error
 */
if ( ! function_exists('maybe_add_column') ) :
function maybe_add_column($table_name, $column_name, $create_ddl) {
	global $wpdb, $debug;
	foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
		if ($debug) echo("checking $column == $column_name<br />");
			if ($column == $column_name) {
				return true;
			}
	}
	//didn't find it try to create it.
	$wpdb->query($create_ddl);
	// we cannot directly tell that whether this succeeded!
	foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
		if ($column == $column_name) {
			return true;
		}
	}
	return false;
}
endif;

/**
 ** maybe_drop_column()
 ** Drop column from db table if it exists.
 ** Returns:  true if it doesn't already exist or on successful drop
 **           false on error
 */
function maybe_drop_column($table_name, $column_name, $drop_ddl) {
	global $wpdb;
	foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
		if ($column == $column_name) {
			//found it try to drop it.
			$wpdb->query($drop_ddl);
			// we cannot directly tell that whether this succeeded!
			foreach ($wpdb->get_col("DESC $table_name",0) as $column ) {
				if ($column == $column_name) {
					return false;
				}
			}
		}
	}
	// else didn't find it
	return true;
}


/**
 ** check_column()
 ** Check column matches passed in criteria.
 ** Pass in null to skip checking that criteria
 ** Returns:  true if it matches
 **           false otherwise
 ** (case sensitive) Column names returned from DESC table are:
 **      Field
 **      Type
 **      Null
 **      Key
 **      Default
 **      Extra
 */
function check_column($table_name, $col_name, $col_type, $is_null = null, $key = null, $default = null, $extra = null) {
	global $wpdb, $debug;
	$diffs = 0;
	$results = $wpdb->get_results("DESC $table_name");

	foreach ($results as $row ) {
		if ($debug > 1) print_r($row);
			if ($row->Field == $col_name) {
				// got our column, check the params
				if ($debug) echo ("checking $row->Type against $col_type\n");
				if (($col_type != null) && ($row->Type != $col_type)) {
					++$diffs;
				}
				if (($is_null != null) && ($row->Null != $is_null)) {
					++$diffs;
				}
				if (($key != null) && ($row->Key  != $key)) {
					++$diffs;
				}
				if (($default != null) && ($row->Default != $default)) {
					++$diffs;
				}
				if (($extra != null) && ($row->Extra != $extra)) {
					++$diffs;
				}
				if ($diffs > 0) {
					if ($debug) echo ("diffs = $diffs returning false\n");
					return false;
				}
				return true;
			} // end if found our column
	}
	return false;
}

/*
echo "<p>testing</p>";
echo "<pre>";

//check_column('wp_links', 'link_description', 'mediumtext');
//if (check_column($wpdb->comments, 'comment_author', 'tinytext'))
//    echo "ok\n";
$error_count = 0;
$tablename = $wpdb->links;
// check the column
if (!check_column($wpdb->links, 'link_description', 'varchar(255)'))
{
	$ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' ";
	$q = $wpdb->query($ddl);
}
if (check_column($wpdb->links, 'link_description', 'varchar(255)')) {
	$res .= $tablename . ' - ok <br />';
} else {
	$res .= 'There was a problem with ' . $tablename . '<br />';
	++$error_count;
}
echo "</pre>";
*/
?>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        blog/wp-admin/install.php                                                                           0000755 0023433 0004734 00000010260 11060470754 015252  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
define('WP_INSTALLING', true);

require_once('../wp-load.php');
require_once('./includes/upgrade.php');

if (isset($_GET['step']))
	$step = $_GET['step'];
else
	$step = 0;
function display_header(){
header( 'Content-Type: text/html; charset=utf-8' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title><?php _e('WordPress &rsaquo; Installation'); ?></title>
	<?php wp_admin_css( 'install', true ); ?>
</head>
<body>
<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>

<?php
}//end function display_header();

// Let's check to make sure WP isn't already installed.
if ( is_blog_installed() ) {display_header(); die('<h1>'.__('Already Installed').'</h1><p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p></body></html>');}

switch($step) {
	case 0:
	case 1: // in case people are directly linking to this
	  display_header();
?>
<h1><?php _e('Welcome'); ?></h1>
<p><?php printf(__('Welcome to the famous five minute WordPress installation process! You may want to browse the <a href="%s">ReadMe documentation</a> at your leisure.  Otherwise, just fill in the information below and you\'ll be on your way to using the most extendable and powerful personal publishing platform in the world.'), '../readme.html'); ?></p>
<!--<h2 class="step"><a href="install.php?step=1"><?php _e('First Step'); ?></a></h2>-->

<h1><?php _e('Information needed'); ?></h1>
<p><?php _e("Please provide the following information.  Don't worry, you can always change these settings later."); ?></p>

<form id="setup" method="post" action="install.php?step=2">
	<table class="form-table">
		<tr>
			<th scope="row"><label for="weblog_title"><?php _e('Blog Title'); ?></label></th>
			<td><input name="weblog_title" type="text" id="weblog_title" size="25" /></td>
		</tr>
		<tr>
			<th scope="row"><label for="admin_email"><?php _e('Your E-mail'); ?></label></th>
			<td><input name="admin_email" type="text" id="admin_email" size="25" /><br />
			<?php _e('Double-check your email address before continuing.'); ?>
		</tr>
		<tr>
			<td colspan="2"><label><input type="checkbox" name="blog_public" value="1" checked="checked" /> <?php _e('Allow my blog to appear in search engines like Google and Technorati.'); ?></label></td>
		</tr>
	</table>
	<p class="step"><input type="submit" name="Submit" value="<?php _e('Install WordPress'); ?>" class="button" /></p>
</form>

<?php
		break;
	case 2:
		if ( !empty($wpdb->error) )
			wp_die($wpdb->error->get_error_message());

		display_header();
		// Fill in the data we gathered
		$weblog_title = stripslashes($_POST['weblog_title']);
		$admin_email = stripslashes($_POST['admin_email']);
		$public = (int) $_POST['blog_public'];
		// check e-mail address
		if (empty($admin_email)) {
			// TODO: poka-yoke
			die('<p>'.__("<strong>ERROR</strong>: you must provide an e-mail address.").'</p>');
		} else if (!is_email($admin_email)) {
			// TODO: poka-yoke
			die('<p>'.__('<strong>ERROR</strong>: that isn&#8217;t a valid e-mail address.  E-mail addresses look like: <code>username@example.com</code>').'</p>');
		}

		$wpdb->show_errors();
		$result = wp_install($weblog_title, 'admin', $admin_email, $public);
		extract($result, EXTR_SKIP);
?>

<h1><?php _e('Success!'); ?></h1>

<p><?php printf(__('WordPress has been installed. Were you expecting more steps? Sorry to disappoint.'), ''); ?></p>

<table class="form-table">
	<tr>
		<th><?php _e('Username'); ?></th>
		<td><code>admin</code></td>
	</tr>
	<tr>
		<th><?php _e('Password'); ?></th>
		<td><code><?php echo $password; ?></code><br />
			<?php echo '<p>'.__('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.').'</p>'; ?></td>
	</tr>
</table>

<p class="step"><a href="../wp-login.php" class="button"><?php _e('Log In'); ?></a></p>

<?php
		break;
}
?>
<script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script>
</body>
</html>
                                                                                                                                                                                                                                                                                                                                                blog/wp-admin/link-add.php                                                                          0000755 0023433 0004734 00000001263 11060471001 015254  0                                                                                                    ustar   xemion                          psacln                                                                                                                                                                                                                 <?php
require_once('admin.php');

$title = __('Add Link');
$this_file = 'link-manager.php';
$parent_file = 'post-new.php';


wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image',
	'description', 'visible', 'target', 'category', 'link_id',
	'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel',
	'notes', 'linkcheck[]'));

wp_enqueue_script('link');
wp_enqueue_script('x
