code stringlengths 1 2.01M | language stringclasses 1 value |
|---|---|
<?php
function sitemap_after_process() {
if (isset ( $_GET ['p'] ) && $_GET ['p'] == 'sitemap.xml') {
global $main_menu;
$out = '<?xml version="1.0" encoding="UTF-8"?>';
$out .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
foreach ( $main_menu->items as $item ) {
$out.="<url>";
$out.="<loc>".$item->link."</loc>";
$out.="<changefreq>weekly</changefreq>";
$out.='<priority>1</priority>';
$out.="</url>";
}
$out .= '</urlset>';
header ( "Content-Type: application/xml" );
echo $out;
exit ();
}
} | PHP |
<li class="<?php if ($this->active) echo "active" ?>">
<a href="<?php echo $this->link?>"><?php echo $this->title ?></a>
</li> | PHP |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<title>Gelsheet: The opensource web spreadsheet</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="PHP Spreadsheet, Web spreadsheet, Online spreadsheet, Worpress spreadsheet, Opengoo spreadsheet, Gelsheet, AJAX Spreadsheet, Opensorce web spreadsheet, Opensource spreadsheet, Opensource google docs" />
<meta name="description" content="GelSheet is a free and open source web spreadsheet that allow users to create, edit and export in many formats your everyday work. It's intended to run either standalone or integrated within another web tool. It was born as a part of Opengoo web office" />
<link rel="stylesheet" href="<?php echo TEMPLATE_PATH ?>style.css" type="text/css" media="screen">
<?php $page->css();?>
<script src="<?php echo TEMPLATE_PATH ?>js/jquery-1.4.2.min.js"></script>
<script src="<?php echo TEMPLATE_PATH ?>js/jquery.cycle.all.min.js"></script>
<script src="<?php echo TEMPLATE_PATH ?>js/gelsheet.js"></script>
<?php $page->js() ?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-20197577-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<meta name="google-site-verification" content="hVHPQY0v01fGvaOHBGhZSIvNWNeYWPlXgKfUQeONoMc" />
</head>
<body class="home page page-id-1052 page-template page-template-page-home-2-php">
<div id="page" class="fix">
<div id="header" class="fix">
<div class="content">
<ul id="nav" class="fix">
<?php $main_menu->output() ?>
</ul>
</div>
</div>
<div class="clear"></div>
<div id="main_content" class="fix" >
<div class="content fix"> | PHP |
<?php include_once 'header.php' ?>
<div id="main_content" class="fix" >
<div class="content fix">
<?php $page->output() ;?>
</div> <!-- end .content -->
</div>
<?php include_once 'footer.php' ?> | PHP |
<li>
<a class="wintrolink wanchorLink <?php if ($this->active) echo "active" ?>" href="<?php echo $this->link?>"><?php echo $this->title ?></a>
</li>
| PHP |
<!DOCTYPE html>
<html lang="en">
<head>
<title>Zero query - No Database CMS</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" href="ie7.css" type="text/css" media="screen" />
<![endif]-->
<link rel="stylesheet" href="<?php echo TEMPLATE_PATH ?>style.css" type="text/css" media="screen" />
<?php $page->css();?> <!-- Include page specific css -->
<script src="<?php echo TEMPLATE_PATH ?>js/jquery.min.js" type="text/javascript"></script>
<?php $page->js() ?> <!-- include page specific js -->
</head>
<body>
<header> <!-- HTML5 header tag -->
<div id="headercontainer">
<h1><a class="introlink anchorLink" href="">Zero Query - NO Database CMS</a></h1>
<nav> <!-- HTML5 navigation tag -->
<ul>
<?php get_menu() ?>
</ul>
</nav>
</div>
</header>
<section id="contentcontainer"> <!-- HTML5 section tag for the content 'section' -->
<section id="<?php get_page_id();?>">
| PHP |
<?php get_header()?>
<h2>Not found</h2>
<?php get_footer()?> | PHP |
<?php get_header() ?>
<?php get_page() ?>
<?php get_footer() ?>
| PHP |
<header>
Zero query Mobile
</header>
<?php get_page() ?>
<footer>
<?php get_footer() ?>
</footer> | PHP |
<?php
/**
* Mobile Detect
* $Id: Mobile_Detect.php 44 2012-05-03 21:45:00Z serbanghita@gmail.com $
*
* @usage require_once 'Mobile_Detect.php';
* $detect = new Mobile_Detect();
* $detect->isMobile() or $detect->isTablet()
*
* For more specific usage see the documentation navigate to:
* http://code.google.com/p/php-mobile-detect/wiki/Mobile_Detect
*
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
class Mobile_Detect {
protected $detectionRules;
protected $userAgent = null;
protected $accept = null;
// Assume the visitor has a desktop environment.
protected $isMobile = false;
protected $isTablet = false;
protected $phoneDeviceName = null;
protected $tabletDevicename = null;
protected $operatingSystemName = null;
protected $userAgentName = null;
// List of mobile devices (phones)
protected $phoneDevices = array(
'iPhone' => '(iPhone.*Mobile|iPod|iTunes)',
'BlackBerry' => 'BlackBerry|rim[0-9]+',
'HTC' => 'HTC|HTC.*(6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090',
'Nexus' => 'Nexus One|Nexus S',
'DellStreak' => 'Dell Streak',
'Motorola' => '\bDroid\b.*Build|HRI39|MOT\-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT909|XT910|XT912|XT928',
'Samsung' => 'Samsung|GT-I9100|GT-I9000|GT-I9020|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-LC11|SCH-N150|SCH-N300|SCH-R300|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-C207|SGH-C225|SGH-C417|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D807|SGH-E105|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E635|SGH-E715|SGH-I577|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I717|SGH-I727|SGH-I777|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-N105|SGH-N625|SGH-P107|SGH-P207|SGH-P735|SGH-P777|SGH-Q105|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T919|SGH-T929|SGH-T939|SGH-T939|SGH-T959|SGH-T989|SGH-V205|SGH-V206|SGH-X105|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-ZX10|SGH-ZX20|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500I|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100',
'Sony' => 'E10i|SonyEricsson|SonyEricssonLT15iv',
'Asus' => 'Asus.*Galaxy',
'Palm' => 'PalmSource|Palm', // avantgo|blazer|elaine|hiptop|plucker|xiino
'GenericPhone' => '(mmp|pocket|psp|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|wap|nokia|Series40|Series60|S60|SonyEricsson|N900|PPC;|MAUI.*WAP.*Browser|LG-P500)'
);
// List of tablet devices.
protected $tabletDevices = array(
'BlackBerryTablet' => 'PlayBook|RIM Tablet',
'iPad' => 'iPad|iPad.*Mobile', // @todo: check for mobile friendly emails topic.
'Kindle' => 'Kindle|Silk.*Accelerated',
'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|GT-P1000|GT-P1010|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I777|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SGH-T989|SPH-D710|SPH-P100',
'HTCtablet' => 'HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200',
'MotorolaTablet' => 'xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617',
'AsusTablet' => 'Transformer|TF101',
'NookTablet' => 'NookColor|nook browser|BNTV250A|LogicPD Zoom2',
'AcerTablet' => 'Android.*(A100|A101|A200|A500|A501|A510|W500|W500P|W501|W501P)',
'YarvikTablet' => 'Android.*(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468)',
'GenericTablet' => 'Tablet(?!.*PC)|ViewPad7|LG-V909|MID7015|BNTV250A|LogicPD Zoom2|\bA7EB\b|CatNova8|A1_07|CT704|CT1002|\bM721\b',
);
// List of mobile Operating Systems.
protected $operatingSystems = array(
'AndroidOS' => '(android.*mobile|android(?!.*mobile))',
'BlackBerryOS' => '(blackberry|rim tablet os)',
'PalmOS' => '(avantgo|blazer|elaine|hiptop|palm|plucker|xiino)',
'SymbianOS' => 'Symbian|SymbOS|Series60|Series40|\bS60\b',
'WindowsMobileOS' => 'IEMobile|Windows Phone|Windows CE.*(PPC|Smartphone)|MSIEMobile|Window Mobile|XBLWP7',
'iOS' => '(iphone|ipod|ipad)',
'FlashLiteOS' => '',
'JavaOS' => '',
'NokiaOS' => '',
'webOS' => '',
'badaOS' => '\bBada\b',
'BREWOS' => '',
);
// List of mobile User Agents.
protected $userAgents = array(
'Chrome' => '\bCrMo\b|Chrome\/[.0-9]* Mobile',
'Dolfin' => '\bDolfin\b',
'Opera' => 'Opera.*Mini|Opera.*Mobi',
'Skyfire' => 'skyfire',
'IE' => 'IEMobile',
'Firefox' => 'fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile',
'Bolt' => 'bolt',
'TeaShark' => 'teashark',
'Blazer' => 'Blazer',
'Safari' => 'Mobile.*Safari|Safari.*Mobile',
'Midori' => 'midori',
'GenericBrowser' => 'NokiaBrowser|OviBrowser|SEMC.*Browser'
);
function __construct(){
// Merge all rules together.
$this->detectionRules = array_merge(
$this->phoneDevices,
$this->tabletDevices,
$this->operatingSystems,
$this->userAgents
);
$this->userAgent = $_SERVER['HTTP_USER_AGENT'];
$this->accept = $_SERVER['HTTP_ACCEPT'];
if (
isset($_SERVER['HTTP_X_WAP_PROFILE']) ||
isset($_SERVER['HTTP_X_WAP_CLIENTID']) ||
isset($_SERVER['HTTP_WAP_CONNECTION']) ||
isset($_SERVER['HTTP_PROFILE']) ||
isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']) || // Reported by Nokia devices (eg. C3)
isset($_SERVER['HTTP_X_NOKIA_IPADDRESS']) ||
isset($_SERVER['HTTP_X_NOKIA_GATEWAY_ID']) ||
isset($_SERVER['HTTP_X_ORANGE_ID']) ||
isset($_SERVER['HTTP_X_VODAFONE_3GPDPCONTEXT']) ||
isset($_SERVER['HTTP_X_HUAWEI_USERID']) ||
isset($_SERVER['HTTP_UA_OS']) || // Reported by Windows Smartphones
(isset($_SERVER['HTTP_UA_CPU']) && $_SERVER['HTTP_UA_CPU'] == 'ARM') // Seen this on a HTC
) {
$this->isMobile = true;
} elseif (!empty($this->accept) && (strpos($this->accept, 'text/vnd.wap.wml') !== false || strpos($this->accept, 'application/vnd.wap.xhtml+xml') !== false)) {
$this->isMobile = true;
} else {
$this->_detect();
}
}
public function getRules()
{
return $this->detectionRules;
}
/**
* Magic overloading method.
*
* @method boolean is[...]()
* @param string $name
* @param array $arguments
* @return mixed
*/
public function __call($name, $arguments)
{
$key = substr($name, 2);
return $this->_detect($key);
}
/**
* Private method that does the detection of the
* mobile devices.
*
* @param type $key
* @return boolean|null
*/
private function _detect($key='')
{
if(empty($key)){
// Begin general search.
foreach($this->detectionRules as $_regex){
if(empty($_regex)){ continue; }
if(preg_match('/'.$_regex.'/is', $this->userAgent)){
$this->isMobile = true;
return true;
}
}
return false;
} else {
// Search for a certain key.
// Make the keys lowecase so we can match: isIphone(), isiPhone(), isiphone(), etc.
$key = strtolower($key);
$_rules = array_change_key_case($this->detectionRules);
if(array_key_exists($key, $_rules)){
if(empty($_rules[$key])){ return null; }
if(preg_match('/'.$_rules[$key].'/is', $this->userAgent)){
$this->isMobile = true;
return true;
} else {
return false;
}
} else {
trigger_error("Method $key is not defined", E_USER_WARNING);
}
return false;
}
}
/**
* Check if the device is mobile.
* Returns true if any type of mobile device detected, including special ones
* @return bool
*/
public function isMobile()
{
return $this->isMobile;
}
/**
* Check if the device is a tablet.
* Return true if any type of tablet device is detected.
* @return boolean
*/
public function isTablet()
{
foreach($this->tabletDevices as $_regex){
if(preg_match('/'.$_regex.'/is', $this->userAgent)){
$this->isTablet = true;
return true;
}
}
return false;
}
} | PHP |
<?php
// TODO Move all core functions to here and deprecate plugin_engine
function baseurl() {
$protocol = ! empty ( $_SERVER ['HTTPS'] ) ? "https" : "http";
return rtrim ( $protocol . "://" . $_SERVER ['HTTP_HOST'] . dirname ( $_SERVER ['SCRIPT_NAME'] ), "/" );
}
function load_libraries() {
global $CONF;
if (! empty ( $CONF ['libraries'] )) {
foreach ( $CONF ['libraries'] as $library ) {
$file = ROOT . "/libraries/$library.php";
if (file_exists ( $file )) {
include_once $file;
}
}
}
}
function is_mobile() {
static $is_mobile = null ;
if ( $is_mobile === null ) {
if (isset($_REQUEST['nomobile'])){
$_SESSION['nomobile'] = true;
header("Location:". BASE_URL );
}else if ( isset($_SESSION['nomobile']) ){
return false ;
}else{
if ( class_exists("Mobile_Detect") ) {
$detect = new Mobile_Detect();
$is_mobile = $detect->isMobile() ;
}else{
$is_mobile = false ;
}
}
}
return $is_mobile ;
}
function url($path) {
echo (!empty($_SERVER['FRIENDLY_URLS'])) ? BASE_URL."/".strtolower($path) : BASE_URL."?p=".$path ;
} | PHP |
<?php
function get_header() {
global $page ;
if ( file_exists(TEMPLATE_PATH."header.php") ){
include_once TEMPLATE_PATH."header.php";
}
}
function get_footer() {
global $page ;
if ( file_exists(TEMPLATE_PATH."footer.php") ){
include_once TEMPLATE_PATH."footer.php";
}
}
function get_sidebar(){}
function get_search_form(){}
function get_page(){
global $page ;
$page->output() ;
}
function get_menu() {
global $main_menu ;
$main_menu->output() ;
}
function get_page_id() {
global $page ;
echo $page->id ;
} | PHP |
<?php
function fire($event){
global $CONF ;
if (!empty($CONF['plugins'])){
foreach ($CONF['plugins'] as $plgname) {
include_once ROOT."/plugins/".$plgname.".php";
$functionName = $plgname."_".$event;
if ( function_exists($functionName) ) {
return call_user_func($functionName);
}
}
}
} | PHP |
<?php
session_start();
global $CONF ;
global $page ;
define ('TEMPLATES_PATH',"templates/") ;
define ('TEMPLATE_PATH', TEMPLATES_PATH."/".$CONF['template']."/") ;
define ('BASE_URL', baseurl());
load_libraries();
fire('before_process');
$pages_dir = "content/pages/" ;
$content = new Content ();
$main_menu = new Menu();
$main_menu->name = "mainMenu" ;
// Scan pages files
$first = true ; // If some elem needs special code
if ($handle = opendir ( $pages_dir )) {
while ( false !== ($file = readdir ( $handle )) ) {
if (is_dir($pages_dir.$file) && $file != "." && $file != ".." && substr($file,0,1) != "." ) {
$title = trim(substr(strstr($file,'.'),1));
$alias = strtolower($title);
$order = (int)substr($file,0,strpos($file,"."));
$link = (!empty($_SERVER['FRIENDLY_URLS'])) ? BASE_URL."/".strtolower($alias) : BASE_URL."?p=".$alias ;
if ( strtolower($alias) == $CONF['home'] ) {
$link = BASE_URL ;
};
$item = new MenuItem ($file, $title, $link, $alias , 0 , $order );
$main_menu->addItem( $item );
$first = false;
}
}
closedir ( $handle );
}
fire('after_process');
// Load Template
$menu_item = $main_menu->getItem($content->getCurrentPage());
$menu_item->active = true;
if ($menu_item) {
$page = $menu_item->getPage() ;
if (is_mobile() && file_exists( TEMPLATE_PATH."/index.mobile.php" )){
include_once TEMPLATE_PATH."/index.mobile.php" ;
}else{
include_once TEMPLATE_PATH."/index.php" ;
}
}else {
$page = new Page();
include_once TEMPLATE_PATH."/404.php" ;
}
| PHP |
<?php
/**
*
* Enter description here ...
* @author pepe
*
*/
class Content {
/**
*
* Enter description here ...
* @var Page
*/
var $current_page = null ;
/**
*
* Enter description here ...
* @var unknown_type
*/
var $home = null ;
/**
*
* Enter description here ...
* @var Menu
*/
var $main_menu ;
/**
* @return the $current_page
*/
public function getCurrentPage() {
global $CONF ;
if ($this->current_page) {
return $this->current_page ;
}elseif ($CONF['home']){
return $CONF['home'];
}else {
return "home" ;
}
}
/**
* @return the $home
*/
public function getHome() {
return $this->home;
}
/**
* @return the $main_menu
*/
public function getMainMenu() {
return $this->main_menu;
}
/**
* @param Page $current_page
*/
public function setCurrentPage($current_page) {
$this->current_page = $current_page;
}
/**
* @param unknown_type $home
*/
public function setHome($home) {
$this->home = $home;
}
/**
* @param Menu $main_menu
*/
public function setMainMenu($main_menu) {
$this->main_menu = $main_menu;
}
function __construct() {
if(!isset($_GET['p'])) return ;
$args = explode("/", $_GET['p'] ) ;
if ( count($args) ){
$this->current_page = $args[0] ;
}
}
} | PHP |
<?php
class Page {
var $path ;
var $alias ;
var $id ;
var $css = null ;
var $content ;
function __construct($path = null , $alias = null, $id = null ) {
$this->alias = $alias ;
$this->path = "content/pages/$path/";
$this->id = ($id) ? $id : $alias ;
}
function output() {
if (is_mobile() && file_exists($this->path."index.mobile.php")) {
include_once $this->path."index.mobile.php" ;
}else{
include_once $this->path."index.php" ;
}
}
function css() {
$dir = $this->path."css";
if (is_dir($dir)) {
if ($handle = opendir ( $dir )) {
while ( false !== ($file = readdir ( $handle )) ) {
$parts = explode(".", $file) ;
if ( $file != "." && $file != ".." && end($parts) == "css") {
echo '<link rel="stylesheet" href="'.$dir."/".$file .'" type="text/css" media="screen">';
}
}
closedir ( $handle );
}
}
}
function js() {
$dir = $this->path."js";
if (is_dir($dir)) {
if ($handle = opendir ( $dir )) {
while ( false !== ($file = readdir ( $handle )) ) {
$parts = explode(".", $file) ;
if ( $file != "." && $file != ".." && end($parts) == "js") {
echo '<script src="'.$dir.'/'.$file.'"></script> ';
}
}
closedir ( $handle );
}
}
}
}
| PHP |
<?php
class Menu {
var $output ;
/**
*
* Enter description here ...
* @var unknown_type
*/
var $items = array ();
/**
* Identifier of the menu
*/
var $name = null ;
private $_items_index = array ();
function output() {
if ($this->output)
return $this->output;
usort($this->items, "MenuItem::compare") ;
foreach ( $this->items as $item ) {
if ($item->order !== false ){
$this->output .= $item->buildOutput ();
}
}
return $this->output;
}
/**
*
* Enter description here ...
* @param $i
* @return MenuItem
*/
function getItem($i) {
if (isset($this->items[$i])){
return $this->items[$i];
}else{
return null;
}
}
/**
*
* Enter description here ...
* @param $item MenuItem
*/
function addItem(&$item) {
global $CONF ;
$this->items [$item->alias] = $item;
$item->menu = $this ;
}
} | PHP |
<?php
class MenuItem {
/**
*
* Enter description here ...
* @param MenuItem $a
* @param MenuItem $b
*/
static function compare($a, $b ) {
if ($a->order == $b->order) {
return 0;
}
return ($a->order < $b->order) ? -1 : 1;
}
/**
* Identifier like 'home' , 'about'
* @var string
*/
var $title;
/**
*
* Url to be linked. Can be absolute or relative.
* @var string
*/
var $link;
/**
*
* If is the current page, active = true
* @var unknown_type
*/
var $active;
/**
*
* Enter description here ...
* @var unknown_type
*/
var $order = null ;
/**
*
* Pointer to corresponding Page object
* @var Page
*/
var $page;
/**
* Pointer to parent menu
*/
var $menu ;
function getPage() {
return $this->page;
}
function __construct($file , $title, $link, $alias , $active = false, $order = null ) {
global $CONF ;
$this->file = $file ;
$this->title = $title;
$this->link = $link;
$this->alias = $alias;
$this->active = $active;
$this->order = $order ;
/**
*
* Pointer to corresponding Page object
* @var Page
*/
$this->page = new Page ( $file, $alias );
}
function buildOutput() {
include TEMPLATE_PATH . "menu-item.php";
}
} | PHP |
<?php
$CONF['home']= "home" ;
$CONF['cleanurls'] = true ;
$CONF['template'] = 'portfolio' ;
$CONF['plugins'] = array('sitemap');
$CONF['libraries'] = array('Mobile_Detect'); | PHP |
<?php
/*
* @author Ignacio Vazquez - ivazquez at adooxen.com
* @version 1.4 Beta
*
*/
define ('ROOT',dirname(__FILE__));
include_once "config.php" ;
include_once 'core/functions.php';
include_once 'core/classes/Content.class.php';
include_once "core/classes/MenuItem.class.php" ;
include_once "core/classes/Menu.class.php" ;
include_once "core/classes/Page.class.php" ;
include_once "core/template_engine.php";
include_once "core/plugin_engine.php";
include_once "core/bootstrap.php";
| PHP |
<?php
function sitemap_after_process() {
if (isset ( $_GET ['p'] ) && $_GET ['p'] == 'sitemap.xml') {
global $main_menu;
$out = '<?xml version="1.0" encoding="UTF-8"?>';
$out .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
foreach ( $main_menu->items as $item ) {
$out.="<url>";
$out.="<loc>".$item->link."</loc>";
$out.="<changefreq>weekly</changefreq>";
$out.='<priority>1</priority>';
$out.="</url>";
}
$out .= '</urlset>';
header ( "Content-Type: application/xml" );
echo $out;
exit ();
}
} | PHP |
<li class="<?php if ($this->active) echo "active" ?>">
<a href="<?php echo $this->link?>"><?php echo $this->title ?></a>
</li> | PHP |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<title>Gelsheet: The opensource web spreadsheet</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="PHP Spreadsheet, Web spreadsheet, Online spreadsheet, Worpress spreadsheet, Opengoo spreadsheet, Gelsheet, AJAX Spreadsheet, Opensorce web spreadsheet, Opensource spreadsheet, Opensource google docs" />
<meta name="description" content="GelSheet is a free and open source web spreadsheet that allow users to create, edit and export in many formats your everyday work. It's intended to run either standalone or integrated within another web tool. It was born as a part of Opengoo web office" />
<link rel="stylesheet" href="<?php echo TEMPLATE_PATH ?>style.css" type="text/css" media="screen">
<?php $page->css();?>
<script src="<?php echo TEMPLATE_PATH ?>js/jquery-1.4.2.min.js"></script>
<script src="<?php echo TEMPLATE_PATH ?>js/jquery.cycle.all.min.js"></script>
<script src="<?php echo TEMPLATE_PATH ?>js/gelsheet.js"></script>
<?php $page->js() ?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-20197577-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<meta name="google-site-verification" content="hVHPQY0v01fGvaOHBGhZSIvNWNeYWPlXgKfUQeONoMc" />
</head>
<body class="home page page-id-1052 page-template page-template-page-home-2-php">
<div id="page" class="fix">
<div id="header" class="fix">
<div class="content">
<ul id="nav" class="fix">
<?php $main_menu->output() ?>
</ul>
</div>
</div>
<div class="clear"></div>
<div id="main_content" class="fix" >
<div class="content fix"> | PHP |
<?php include_once 'header.php' ?>
<div id="main_content" class="fix" >
<div class="content fix">
<?php $page->output() ;?>
</div> <!-- end .content -->
</div>
<?php include_once 'footer.php' ?> | PHP |
<li>
<a class="wintrolink wanchorLink <?php if ($this->active) echo "active" ?>" href="<?php echo $this->link?>"><?php echo $this->title ?></a>
</li>
| PHP |
<!DOCTYPE html>
<html lang="en">
<head>
<title>MinCMS - The easyest way to build your site</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" href="ie7.css" type="text/css" media="screen" />
<![endif]-->
<link rel="stylesheet" href="<?php echo TEMPLATE_PATH ?>style.css" type="text/css" media="screen" />
<?php $page->css();?> <!-- Include page specific css -->
<script src="<?php echo TEMPLATE_PATH ?>js/jquery.min.js" type="text/javascript"></script>
<?php $page->js() ?> <!-- include page specific js -->
</head>
<body>
<header> <!-- HTML5 header tag -->
<div id="headercontainer">
<h1><a class="introlink anchorLink" href="">MINCMS - Min Is Not CMS</a></h1>
<nav> <!-- HTML5 navigation tag -->
<ul>
<?php get_menu() ?>
</ul>
</nav>
</div>
</header>
<section id="contentcontainer"> <!-- HTML5 section tag for the content 'section' -->
<section id="<?php get_page_id();?>">
| PHP |
<?php get_header()?>
<h2>Not found</h2>
<?php get_footer()?> | PHP |
<?php get_header() ?>
<?php get_page() ?>
<?php get_footer() ?>
| PHP |
<?php
function baseurl() {
$protocol = !empty($_SERVER ['HTTPS']) ? "https" : "http";
return rtrim($protocol . "://" . $_SERVER ['HTTP_HOST'] .dirname($_SERVER ['SCRIPT_NAME']),"/");
} | PHP |
<?php
function get_header() {
global $page ;
if ( file_exists(TEMPLATE_PATH."header.php") ){
include_once TEMPLATE_PATH."header.php";
}
}
function get_footer() {
global $page ;
if ( file_exists(TEMPLATE_PATH."footer.php") ){
include_once TEMPLATE_PATH."footer.php";
}
}
function get_sidebar(){}
function get_search_form(){}
function get_page(){
global $page ;
$page->output() ;
}
function get_menu() {
global $main_menu ;
$main_menu->output() ;
}
function get_page_id() {
global $page ;
echo $page->id ;
} | PHP |
<?php
function fire($event){
global $CONF ;
if (!empty($CONF['plugins'])){
foreach ($CONF['plugins'] as $plgname) {
include_once ROOT."/plugins/".$plgname.".php";
$functionName = $plgname."_".$event;
if ( function_exists($functionName) ) {
return call_user_func($functionName);
}
}
}
} | PHP |
<?php
global $CONF ;
global $page ;
define ('TEMPLATES_PATH',"templates/") ;
define ('TEMPLATE_PATH', TEMPLATES_PATH."/".$CONF['template']."/") ;
define ('BASE_URL', baseurl());
fire('before_process');
$pages_dir = "content/pages/" ;
$content = new Content ();
$main_menu = new Menu();
$main_menu->name = "mainMenu" ;
// Scan pages files
$first = true ; // If some elem needs special code
if ($handle = opendir ( $pages_dir )) {
while ( false !== ($file = readdir ( $handle )) ) {
if (is_dir($pages_dir.$file) && $file != "." && $file != ".." && substr($file,0,1) != "." ) {
$title = trim(substr(strstr($file,'.'),1));
$alias = strtolower($title);
$order = (int)substr($file,0,strpos($file,"."));
$link = (!empty($_SERVER['FRIENDLY_URLS'])) ? BASE_URL."/".strtolower($alias) : BASE_URL."?p=".$alias ;
if ( strtolower($alias) == $CONF['home'] ) {
$link = BASE_URL ;
};
$item = new MenuItem ($file, $title, $link, $alias , 0 , $order );
$main_menu->addItem( $item );
$first = false;
}
}
closedir ( $handle );
}
fire('after_process');
// Load Template
$menu_item = $main_menu->getItem($content->getCurrentPage());
$menu_item->active = true;
if ($menu_item) {
$page = $menu_item->getPage() ;
include_once TEMPLATE_PATH."/index.php" ;
}else {
$page = new Page();
include_once TEMPLATE_PATH."/404.php" ;
}
| PHP |
<?php
/**
*
* Enter description here ...
* @author pepe
*
*/
class Content {
/**
*
* Enter description here ...
* @var Page
*/
var $current_page = null ;
/**
*
* Enter description here ...
* @var unknown_type
*/
var $home = null ;
/**
*
* Enter description here ...
* @var Menu
*/
var $main_menu ;
/**
* @return the $current_page
*/
public function getCurrentPage() {
global $CONF ;
if ($this->current_page) {
return $this->current_page ;
}elseif ($CONF['home']){
return $CONF['home'];
}else {
return "home" ;
}
}
/**
* @return the $home
*/
public function getHome() {
return $this->home;
}
/**
* @return the $main_menu
*/
public function getMainMenu() {
return $this->main_menu;
}
/**
* @param Page $current_page
*/
public function setCurrentPage($current_page) {
$this->current_page = $current_page;
}
/**
* @param unknown_type $home
*/
public function setHome($home) {
$this->home = $home;
}
/**
* @param Menu $main_menu
*/
public function setMainMenu($main_menu) {
$this->main_menu = $main_menu;
}
function __construct() {
if(!isset($_GET['p'])) return ;
$args = explode("/", $_GET['p'] ) ;
if ( count($args) ){
$this->current_page = $args[0] ;
}
}
} | PHP |
<?php
class Page {
var $path ;
var $alias ;
var $id ;
var $css = null ;
var $content ;
function __construct($path = null , $alias = null, $id = null ) {
$this->alias = $alias ;
$this->path = "content/pages/$path/";
$this->id = ($id) ? $id : $alias ;
}
function output() {
include_once $this->path."index.php" ;
}
function css() {
$dir = $this->path."css";
if (is_dir($dir)) {
if ($handle = opendir ( $dir )) {
while ( false !== ($file = readdir ( $handle )) ) {
$parts = explode(".", $file) ;
if ( $file != "." && $file != ".." && end($parts) == "css") {
echo '<link rel="stylesheet" href="'.$dir."/".$file .'" type="text/css" media="screen">';
}
}
closedir ( $handle );
}
}
}
function js() {
$dir = $this->path."js";
if (is_dir($dir)) {
if ($handle = opendir ( $dir )) {
while ( false !== ($file = readdir ( $handle )) ) {
$parts = explode(".", $file) ;
if ( $file != "." && $file != ".." && end($parts) == "js") {
echo '<script src="'.$dir.'/'.$file.'"></script> ';
}
}
closedir ( $handle );
}
}
}
}
| PHP |
<?php
class Menu {
var $output ;
/**
*
* Enter description here ...
* @var unknown_type
*/
var $items = array ();
/**
* Identifier of the menu
*/
var $name = null ;
private $_items_index = array ();
function output() {
if ($this->output)
return $this->output;
usort($this->items, "MenuItem::compare") ;
foreach ( $this->items as $item ) {
if ($item->order !== false ){
$this->output .= $item->buildOutput ();
}
}
return $this->output;
}
/**
*
* Enter description here ...
* @param $i
* @return MenuItem
*/
function getItem($i) {
if (isset($this->items[$i])){
return $this->items[$i];
}else{
return null;
}
}
/**
*
* Enter description here ...
* @param $item MenuItem
*/
function addItem(&$item) {
global $CONF ;
$this->items [$item->alias] = $item;
$item->menu = $this ;
}
} | PHP |
<?php
class MenuItem {
/**
*
* Enter description here ...
* @param MenuItem $a
* @param MenuItem $b
*/
static function compare($a, $b ) {
if ($a->order == $b->order) {
return 0;
}
return ($a->order < $b->order) ? -1 : 1;
}
/**
* Identifier like 'home' , 'about'
* @var string
*/
var $title;
/**
*
* Url to be linked. Can be absolute or relative.
* @var string
*/
var $link;
/**
*
* If is the current page, active = true
* @var unknown_type
*/
var $active;
/**
*
* Enter description here ...
* @var unknown_type
*/
var $order = null ;
/**
*
* Pointer to corresponding Page object
* @var Page
*/
var $page;
/**
* Pointer to parent menu
*/
var $menu ;
function getPage() {
return $this->page;
}
function __construct($file , $title, $link, $alias , $active = false, $order = null ) {
global $CONF ;
$this->file = $file ;
$this->title = $title;
$this->link = $link;
$this->alias = $alias;
$this->active = $active;
$this->order = $order ;
/**
*
* Pointer to corresponding Page object
* @var Page
*/
$this->page = new Page ( $file, $alias );
}
function buildOutput() {
include TEMPLATE_PATH . "menu-item.php";
}
} | PHP |
<?php
$CONF['home']= "home" ;
$CONF['cleanurls'] = true ;
$CONF['template'] = 'portfolio' ;
$CONF['plugins'] = array('sitemap');
| PHP |
<?php
/*
* @author Ignacio Vazquez - ivazquez at adooxen.com
* @version 1.4 Beta
*
*/
define ('ROOT',dirname(__FILE__));
include_once "config.php" ;
include_once 'core/functions.php';
include_once 'core/classes/Content.class.php';
include_once "core/classes/MenuItem.class.php" ;
include_once "core/classes/Menu.class.php" ;
include_once "core/classes/Page.class.php" ;
include_once "core/template_engine.php";
include_once "core/plugin_engine.php";
include_once "core/bootstrap.php";
| PHP |
<li class="<?php if ($this->active) echo "active" ?>">
<a href="<?php echo $this->link?>"><?php echo $this->title ?></a>
</li> | PHP |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<title>Gelsheet: The opensource web spreadsheet</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="PHP Spreadsheet, Web spreadsheet, Online spreadsheet, Worpress spreadsheet, Opengoo spreadsheet, Gelsheet, AJAX Spreadsheet, Opensorce web spreadsheet, Opensource spreadsheet, Opensource google docs" />
<meta name="description" content="GelSheet is a free and open source web spreadsheet that allow users to create, edit and export in many formats your everyday work. It's intended to run either standalone or integrated within another web tool. It was born as a part of Opengoo web office" />
<link rel="stylesheet" href="<?php echo TEMPLATE_PATH ?>style.css" type="text/css" media="screen">
<?php $page->css();?>
<script src="<?php echo TEMPLATE_PATH ?>js/jquery-1.4.2.min.js"></script>
<script src="<?php echo TEMPLATE_PATH ?>js/jquery.cycle.all.min.js"></script>
<script src="<?php echo TEMPLATE_PATH ?>js/gelsheet.js"></script>
<?php $page->js() ?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-20197577-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<meta name="google-site-verification" content="hVHPQY0v01fGvaOHBGhZSIvNWNeYWPlXgKfUQeONoMc" />
</head>
<body class="home page page-id-1052 page-template page-template-page-home-2-php">
<div id="page" class="fix">
<div id="header" class="fix">
<div class="content">
<ul id="nav" class="fix">
<?php $main_menu->output() ?>
</ul>
</div>
</div>
<div class="clear"></div>
<div id="main_content" class="fix" >
<div class="content fix"> | PHP |
<?php include_once 'header.php' ?>
<div id="main_content" class="fix" >
<div class="content fix">
<?php $page->output() ;?>
</div> <!-- end .content -->
</div>
<?php include_once 'footer.php' ?> | PHP |
<li>
<a class="wintrolink wanchorLink <?php if ($this->active) echo "active" ?>" href="<?php echo $this->link?>"><?php echo $this->title ?></a>
</li>
| PHP |
<!DOCTYPE html>
<html lang="en">
<head>
<title>MinCMS - The easyest way to build your site</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" href="ie7.css" type="text/css" media="screen" />
<![endif]-->
<link rel="stylesheet" href="<?php echo TEMPLATE_PATH ?>style.css" type="text/css" media="screen" />
<?php $page->css();?> <!-- Include page specific css -->
<script src="<?php echo TEMPLATE_PATH ?>js/jquery.min.js" type="text/javascript"></script>
<?php $page->js() ?> <!-- include page specific js -->
</head>
<body>
<header> <!-- HTML5 header tag -->
<div id="headercontainer">
<h1><a class="introlink anchorLink" href="">MINCMS - Min Is Not CMS</a></h1>
<nav> <!-- HTML5 navigation tag -->
<ul>
<?php get_menu() ?>
</ul>
</nav>
</div>
</header>
<section id="contentcontainer"> <!-- HTML5 section tag for the content 'section' -->
<section id="<?php get_page_id();?>">
| PHP |
<?php get_header()?>
<h2>Not found</h2>
<?php get_footer()?> | PHP |
<?php get_header() ?>
<?php get_page() ?>
<?php get_footer() ?>
| PHP |
<?php
function get_header() {
global $page ;
if ( file_exists(TEMPLATE_PATH."header.php") ){
include_once TEMPLATE_PATH."header.php";
}
}
function get_footer() {
global $page ;
if ( file_exists(TEMPLATE_PATH."footer.php") ){
include_once TEMPLATE_PATH."footer.php";
}
}
function get_sidebar(){}
function get_search_form(){}
function get_page(){
global $page ;
$page->output() ;
}
function get_menu() {
global $main_menu ;
$main_menu->output() ;
}
function get_page_id() {
global $page ;
echo $page->id ;
} | PHP |
<?php
global $CONF ;
global $page ;
define ('TEMPLATES_PATH',"templates/") ;
define ('TEMPLATE_PATH', TEMPLATES_PATH."/".$CONF['template']."/") ;
$pages_dir = "content/pages/" ;
$content = new Content ();
$main_menu = new Menu();
$main_menu->name = "mainMenu" ;
// Scan pages files
$first = true ; // If some elem needs special code
if ($handle = opendir ( $pages_dir )) {
while ( false !== ($file = readdir ( $handle )) ) {
if (is_dir($pages_dir.$file) && $file != "." && $file != "..") {
$title = trim(substr(strstr($file,'.'),1));
$alias = strtolower($title);
$order = (int)substr($file,0,strpos($file,"."));
$link = ($CONF['cleanurls']) ? strtolower($alias) : "?p=".$alias ;
$item = new MenuItem ($file, $title, $link, $alias , 0 , $order );
$main_menu->addItem( $item );
$first = false;
}
}
closedir ( $handle );
}
// Load Template
$menu_item = $main_menu->getItem($content->getCurrentPage());
if ($menu_item) {
$page = $menu_item->getPage() ;
include_once TEMPLATE_PATH."/index.php" ;
}else {
$page = new Page();
include_once TEMPLATE_PATH."/404.php" ;
}
| PHP |
<?php
/**
*
* Enter description here ...
* @author pepe
*
*/
class Content {
/**
*
* Enter description here ...
* @var Page
*/
var $current_page = null ;
/**
*
* Enter description here ...
* @var unknown_type
*/
var $home = null ;
/**
*
* Enter description here ...
* @var Menu
*/
var $main_menu ;
/**
* @return the $current_page
*/
public function getCurrentPage() {
global $CONF ;
if ($this->current_page) {
return $this->current_page ;
}elseif ($CONF['home']){
return $CONF['home'];
}else {
return "home" ;
}
}
/**
* @return the $home
*/
public function getHome() {
return $this->home;
}
/**
* @return the $main_menu
*/
public function getMainMenu() {
return $this->main_menu;
}
/**
* @param Page $current_page
*/
public function setCurrentPage($current_page) {
$this->current_page = $current_page;
}
/**
* @param unknown_type $home
*/
public function setHome($home) {
$this->home = $home;
}
/**
* @param Menu $main_menu
*/
public function setMainMenu($main_menu) {
$this->main_menu = $main_menu;
}
function __construct() {
if(!isset($_GET['p'])) return ;
$args = explode("/", $_GET['p'] ) ;
if ( count($args) ){
$this->current_page = $args[0] ;
}
}
} | PHP |
<?php
class Page {
var $path ;
var $alias ;
var $id ;
var $css = null ;
var $content ;
function __construct($path = null , $alias = null, $id = null ) {
$this->alias = $alias ;
$this->path = "content/pages/$path/";
$this->id = ($id) ? $id : $alias ;
}
function output() {
include_once $this->path."index.php" ;
}
function css() {
$dir = $this->path."css";
if (is_dir($dir)) {
if ($handle = opendir ( $dir )) {
while ( false !== ($file = readdir ( $handle )) ) {
$parts = explode(".", $file) ;
if ( $file != "." && $file != ".." && end($parts) == "css") {
echo '<link rel="stylesheet" href="'.$dir."/".$file .'" type="text/css" media="screen">';
}
}
closedir ( $handle );
}
}
}
function js() {
$dir = $this->path."js";
if (is_dir($dir)) {
if ($handle = opendir ( $dir )) {
while ( false !== ($file = readdir ( $handle )) ) {
$parts = explode(".", $file) ;
if ( $file != "." && $file != ".." && end($parts) == "js") {
echo '<script src="'.$dir.'/'.$file.'"></script> ';
}
}
closedir ( $handle );
}
}
}
}
| PHP |
<?php
class Menu {
var $output ;
/**
*
* Enter description here ...
* @var unknown_type
*/
var $items = array ();
/**
* Identifier of the menu
*/
var $name = null ;
private $_items_index = array ();
function output() {
if ($this->output)
return $this->output;
usort($this->items, "MenuItem::compare") ;
foreach ( $this->items as $item ) {
if ($item->order !== false ){
$this->output .= $item->buildOutput ();
}
}
return $this->output;
}
/**
*
* Enter description here ...
* @param $i
* @return MenuItem
*/
function getItem($i) {
if (isset($this->items[$i])){
return $this->items[$i];
}else{
return null;
}
}
/**
*
* Enter description here ...
* @param $item MenuItem
*/
function addItem(&$item) {
global $CONF ;
$this->items [$item->alias] = $item;
$item->menu = $this ;
}
} | PHP |
<?php
class MenuItem {
/**
*
* Enter description here ...
* @param MenuItem $a
* @param MenuItem $b
*/
static function compare($a, $b ) {
if ($a->order == $b->order) {
return 0;
}
return ($a->order < $b->order) ? -1 : 1;
}
/**
* Identifier like 'home' , 'about'
* @var string
*/
var $title;
/**
*
* Url to be linked. Can be absolute or relative.
* @var string
*/
var $link;
/**
*
* If is the current page, active = true
* @var unknown_type
*/
var $active;
/**
*
* Enter description here ...
* @var unknown_type
*/
var $order = null ;
/**
*
* Pointer to corresponding Page object
* @var Page
*/
var $page;
/**
* Pointer to parent menu
*/
var $menu ;
function getPage() {
return $this->page;
}
function __construct($file , $title, $link, $alias , $active = false, $order = null ) {
global $CONF ;
$this->file = $file ;
$this->title = $title;
$this->link = $link;
$this->alias = $alias;
$this->active = $active;
$this->order = $order ;
/**
*
* Pointer to corresponding Page object
* @var Page
*/
$this->page = new Page ( $file, $alias );
}
function buildOutput() {
include TEMPLATE_PATH . "menu-item.php";
}
} | PHP |
<?php
$CONF['home']= "home" ;
$CONF['cleanurls'] = true ;
$CONF['template'] = 'portfolio' ;
$CONF['autoSitemap'] = true ; //TODO will be available on future versions | PHP |
<?php
/*
* @author Pepe - pepe at phpepe.com
*/
include_once "config.php" ;
include_once 'core/classes/Content.class.php';
include_once "core/classes/MenuItem.class.php" ;
include_once "core/classes/Menu.class.php" ;
include_once "core/classes/Page.class.php" ;
include_once "core/template_engine.php";
include_once "core/bootstrap.php";
| PHP |
<?php
$dbhost = 'localhost:3306';
$dbuser = 'root';
$dbpw = 'root';
$dbname = 'china100';
$database = 'mysql';
$pconnect = '0';
$charset = 'utf8';
?>
<?php
//$dbhost = '121.15.221.95:3306';
//$dbuser = 's510437db0';
//$dbpw = 'g53vzqta';
//$dbname = 's510437db0';
//$database = 'mysql';
//$pconnect = '0';
//$charset = 'utf8';
?> | PHP |
<?php
return array (
'sys_name'=>'中国百分百网',
'fr_theme' => 'simple',
'cookpifix'=>'100china_'
); | PHP |
<?php
define('DR', dirname(__FILE__));
require 'include/front.php';
?>
| PHP |
<?php
class Welcome extends AdminAction{
function index(){
$sysinfo = loadData('sysinfo.php');
$this->data['title'] = $sysinfo['sys_name'].' - 登入';
template('welcome',$this->data);
}
function login(){
$db = $this->getDB();
$username = P('username');
$userpass = P('userpass');
$rember = P('rember');
$user = $db->get_assoc("select id,login_name,login_pass from sys_user where login_name = '$username'");
if(empty($user)){
$this->ajaxMsg('error','用户名不存在!');
}else{
if($user['login_pass'] == $userpass){
unset($user['login_pass']);
//用户登入成功
if($rember == 1){
setCk('adminlogin',$user['id'].','.$user['login_name'].','.$user['login_pass'],time()+3600*24*30);
}
print_r($user);
setSession('adminlogin', $user);
$this->ajaxMsg('success','用户名登入成功!');
}else{
//密码错误
$this->ajaxMsg('error','密码输入错误!');
}
}
}
function console(){
$user = getSession('adminlogin');
if(!empty($user)){
//进入控制台
$this->data['selectitem'] = 'control';
template('console',$this->data);
}else{
//弹出
header('location:/admin.php');
}
}
} | PHP |
<?php
class Article extends AdminAction{
function alist(){
$this->data['selectitem'] = 'article';
template('art_alist',$this->data);
}
} | PHP |
<?php include incTemplate('panel_top.php'); ?>
<?php print_r($HTTP_COOKIE_VARS);?>
<?php include incTemplate('panel_bottom.php'); ?> | PHP |
<?php include incTemplate('header.php'); ?>
<script type="text/javascript">
$(function(){
$(".sp_btn").button();
$(".sp_btn").click(function(){
var username = getVal("username");
var userpass = getVal("userpass");
var rember = getAttr("rember","checked")=="checked"?1:0;
$.post('admin.php/welcome/login',{username:username,userpass:userpass,rember:rember},function(data){
if(data.type == 'error'){
$(".tip").show();
$("#msg").html(data.msg);
$("#form").effect( 'shake', null, 500 );
}else{
$(".tip").hide();
window.location.href="admin.php/welcome/console";
}
},'json');
});
});
</script>
<style>
#login {
margin: 7em auto;
width: 320px;
}
form {
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #E5E5E5;
border-radius: 3px 3px 3px 3px;
box-shadow: 0 4px 10px -1px rgba(200, 200, 200, 0.7);
font-weight: normal;
padding: 26px 24px 46px;
}
.f_12{font-size:12px;}
.f_14{font-size:14px;}
.f_13{font-size:13px;}
.input{
background: none repeat scroll 0 0 #FBFBFB;
border: 1px solid #E5E5E5;
box-shadow: 1px 1px 2px rgba(200, 200, 200, 0.2) inset;
font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;
font-size: 24px;
font-weight: 200;
margin-bottom: 16px;
margin-right: 6px;
margin-top: 2px;
outline: medium none;
padding: 3px;
width: 97%;
}
label {
color: #777777;
font-size: 14px;
}
.tar{text-align:right;}
.fl{float:left;}
.tip{margin-bottom:20px;}
.hidden{display:none;}
</style>
</head>
<body>
<div id="login">
<div class="ui-state-error ui-corner-all tip hidden">
<p class="f_14">
<span style="float: left; margin-left: 20px;margin-right:10px;" class="ui-icon ui-icon-alert "></span>
<span id="msg"></span>
</p>
</div>
<form action="" id="form">
<p>
<label>
用户名
<br>
<input type="text" class="input" id="username"/>
</label>
</p>
<p>
<label>
密码
<br>
<input type="password" class="input" id="userpass"/>
</label>
</p>
<p class="tar">
<span class="fl">
<label class="f_12">
<input type="checkbox" checked="checked" id="rember" />记住我的登入信息
</label>
</span>
<span class="sp_btn">登入</span>
</p>
</form>
</div>
</body>
</html>
| PHP |
<div class="menulist">
<div class="menu">
<ul>
<li <?php if($selectitem == 'control'){?>class="top"<?php }?>>
<div class="menu-img control "></div>
<div class="toggle" id="tg_control"></div>
<?php
if($selectitem == 'control'){
?>
<div class="menu-arrow"><div></div></div>
<a class="itemselect">控制板</a>
<?php
}else{
?>
<a href="admin.php?welcome-console">控制版</a>
<?php
}
?>
<div class="itemlist" >
<ul>
<li><a href="admin.php?welcome-console">首页</a></li>
</ul>
</div>
</li>
<li class="menu-separator"><div class="separator"></div></li>
<li <?php if($selectitem == 'article'){?>class="top"<?php }?>>
<div class="menu-img article item"></div>
<div class="toggle" id="tg_article"></div>
<?php
if($selectitem == 'article'){
?>
<div class="menu-arrow"><div></div></div>
<a class="itemselect">文章</a>
<?php
}else{
?>
<a>文章</a>
<?php
}
?>
<div class="itemlist">
<ul>
<li><a href="admin.php?article-alist">所有文章</a></li>
<li>写文章</li>
<li>分类目录</li>
<li>文章标签</li>
</ul>
</div>
</li>
<li>
<div class="menu-img notice item"></div>
公告</li>
<li>
<div class="menu-img radio item"></div>
<div class="toggle" id="tg_radio"></div>
媒体
<div class="itemlist">
<ul>
<li>媒体库</li>
<li>添加</li>
</ul>
</div>
</li>
<li>
<div class="menu-img link item"></div>
<div class="toggle" id="tg_link"></div>
链接
<div class="itemlist">
<ul>
<li>所有链接</li>
<li>添加</li>
<li>链接分类目录</li>
</ul>
</div>
</li>
<li>
<div class="menu-img page item"></div>
<div class="toggle" id="tg_page"></div>
页面
<div class="itemlist">
<ul>
<li>所有页面</li>
<li>新建页面</li>
</ul>
</div>
</li>
<li>
<div class="menu-img comment item"></div>
评论</li>
<li class="menu-separator"><div class="separator"></div></li>
<li>
<div class="menu-img control item"></div>
<div class="toggle" id="tg_aspect"></div>
外观
<div class="itemlist">
<ul>
<li>主题</li>
</ul>
</div>
</li>
<li>
<div class="menu-img plug item"></div>
<div class="toggle" id="tg_plug"></div>
插件
<div class="itemlist">
<ul>
<li>已安装的插件</li>
<li>安装插件</li>
<li>编辑</li>
</ul>
</div>
</li>
<li>
<div class="menu-img user item"></div>
<div class="toggle" id="tg_user"></div>
用户
<div class="itemlist">
<ul>
<li>所有用户</li>
<li>添加用户</li>
<li>我的个人资料</li>
</ul>
</div>
</li>
<li>
<div class="menu-img tool item"></div>
<div class="toggle"id="tg_tool" ></div>
工具
<div class="itemlist">
<ul>
<li>导入</li>
<li>导出</li>
</ul>
</div>
</li>
<li>
<div class="menu-img config item"></div>
<div class="toggle" id="tg_config"></div>
设置
<div class="itemlist">
<ul>
<li>常规</li>
<li>撰写</li>
<li>阅读</li>
<li>讨论</li>
<li>媒体</li>
<li>隐私</li>
<li>固定链接</li>
</ul>
</div>
</li>
</ul>
</div>
</div>
<div class="shadow"></div> | PHP |
<?php include incTemplate('header.php'); ?>
<script type="text/javascript">
var menuarray ='<?php echo $menulist;?>';
var menuadds = '<?php echo $menulist;?>';
var cookpifix = '<?php echo $sysinfo['cookpifix'];?>';
var menulist = '<?php echo $menulist;?>';
$(function(){
$(".menu ul li").hover(
function () {
$(this).find(".toggle").show();
$(this).css("color","#D54E21");
var fdiv = $(this).find("div.item")[0];
if(fdiv==undefined){
return;
}
var icon = $(fdiv).attr("class");
icon = icon.replace("menu-img","");
icon = icon.replace("item","")
icon = icon.replace(/(^\s*)|(\s*$)/g,"");
var defaultPoint = [];
var p = $(this).find("."+icon).css("background-position");
if (typeof (p) == "undefined") {
defaultPoint[0] = $(this).find("."+icon).css("background-position-x");
var x = defaultPoint[0];
$(this).find("."+icon).css("background-position",""+x+" 0px");
} else {
defaultPoint = p.split(" ");
var x = defaultPoint[0];
$(this).find("."+icon).css("background-position",x+" 0px");
}
},
function () {
$(this).find(".toggle").hide();
$(this).css("color","#21759B");
var fdiv = $(this).find("div.item")[0];
if(fdiv==undefined){
return;
}
var icon = $(fdiv).attr("class");
icon = icon.replace("menu-img","");
icon = icon.replace("item","")
icon = icon.replace(/(^\s*)|(\s*$)/g,"");
var defaultPoint = [];
var p = $(this).find("."+icon).css("background-position");
if (typeof (p) == "undefined") {
defaultPoint[0] = $(this).find("."+icon).css("background-position-x");
var x = defaultPoint[0];
$(this).find("."+icon).css("background-position",""+x+" -33px");
} else {
defaultPoint = p.split(" ");
var x = defaultPoint[0];
$(this).find("."+icon).css("background-position",x+" -33px");
}
}
);
$(".toggle").click(function(dt){
var itemlist = $(this).parent("li").find(".itemlist");
var display = itemlist.css("display");
var tg = $(this).attr("id");
var temparray = [];
if(display == 'none'){
$(this).show();
var exist = false;
if(menuadds.length>=1){
for(var i=0;i<menuadds.length;i++){
if(menuadds[i]==tg){
exist = true;
}
}
}
if(!exist){
if(menuadds!=""){
menuadds = menuadds+","+tg;
}else{
menuadds = tg;
}
}
itemlist.css('display','block');
}else{
$(this).hide();
if(menuadds!=""){
var newmenulist = "";
menuadds = menuadds.replace(tg,"");
var itemlists = menuadds.split(',');
for(var i=0;i<itemlists.length;i++){
if(itemlists[i]!=""){
if(newmenulist == ""){
newmenulist +=itemlists[i];
}else{
newmenulist +=","+itemlists[i];
}
}
}
menuadds = newmenulist;
}else{
menuadds = "";
}
itemlist.css('display','none');
}
//设置cookie
var cookstr = menuadds;
var today = new Date();
var expireDay = new Date();
var msPerMonth = 24*60*60*1000*31;
expireDay.setTime( today.getTime() + msPerMonth );
var expdate = new Date();
expdate.setTime(expdate.getTime() - (86400 * 1000 * 1));
setCookie(cookpifix+"menulist", "", expdate);
deleteCookie(cookpifix+"menulist");
document.cookie = cookpifix+"menulist="+cookstr+";domain=localhost;expires=" + expireDay.toGMTString();
//alert(cookpifix+"menulist="+cookstr+";expires=" + expireDay.toGMTString()+";path=/");
});
$(".itemlist ul li").hover(
function () {
$(this).addClass("itemhover");
$(this).css("color","#000");
},
function () {
$(this).removeClass("itemhover");
$(this).css("color","#21759B");
}
);
//找到第一个menu-arrow,设置icon的样式
var fdiv = $(".menu-arrow").parent("li").find("div.menu-img");
if(fdiv!=undefined){
var icon = fdiv.attr("class");
icon = icon.replace("menu-img","");
icon = icon.replace("item","")
icon = icon.replace(/(^\s*)|(\s*$)/g,"");
var defaultPoint = [];
var p = fdiv.parent("li").find("."+icon).css("background-position");
if (typeof (p) == "undefined") {
defaultPoint[0] = fdiv.parent("li").find("."+icon).css("background-position-x");
var x = defaultPoint[0];
fdiv.parent("li").find("."+icon).css("background-position",""+x+" 0px");
} else {
defaultPoint = p.split(" ");
var x = defaultPoint[0];
fdiv.parent("li").find("."+icon).css("background-position",x+" 0px");
}
}
//设置显示的菜单
if(menulist!=""){
var menuarray = menulist.split(',');
if(menuarray.length>=1){
for(var i=0;i<menuarray.length;i++){
$("#"+menuarray[i]).parent("li").find("div.itemlist").css('display','block');
$("#"+menuarray[i]).parent("li").find(".toggle").show();
}
}
}
});
</script>
</head>
<body>
<div class="console">
<?php include incTemplate('menulist.php'); ?>
<div class="content">
<div class="bk_head">
<span class="fl webname"><?php echo $sysinfo['sys_name'];?></span>
<span class="fr">您好:<?php echo $_SESSION['adminlogin']['login_name'];?></span>
</div>
<div class="bk_body"> | PHP |
<?php include incTemplate('panel_top.php'); ?>
<?php print_r($_COOKIE);?>
<?php include incTemplate('console_panel.php'); ?>
<?php include incTemplate('panel_bottom.php'); ?> | PHP |
<!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>
<base href="<?php echo HH;?>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title;?></title>
<link rel="STYLESHEET" href="js/jquery/green/jquery-ui.css" type="text/css">
<script type="text/javascript" src="js/jquery/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/admin/admin.js"></script>
<link rel="STYLESHEET" href="<?php echo HT;?>/css/style.css" type="text/css">
| PHP |
<?php
print_r($_COOKIE);
//phpinfo(); | PHP |
<?php
define('DR', dirname(__FILE__));
require 'include/admin.php';
| PHP |
<?php
class Welcome extends FrontAction{
function index(){
template('index',$this->data);
}
} | PHP |
<?php
function loadAdmin($action){
require 'admin/'.$action.'.php';
$action = ucfirst($action);
$act = new $action();;
return $act;
}
function template($page,$data=null){
if(sizeof($data)>=1){
extract($data);
}
if(is_array($page)){
foreach($page as $p){
require 'admin/template/'.$p.'.php';
}
}else{
require 'admin/template/'.$page.'.php';
}
}
function incTemplate($page){
return 'admin/template/'.$page;
}
function message($message,$url){
require 'admin/template/message.php';
exit();
}
function setMessage($result,$msg,$message){
$message['success'] = $result;
$message['message'] = $msg;
return $message;
}
function saveDataFile($prefix,$lang,$filestr){
$fp = fopen('data/'.$prefix .'.'. $lang . '.php','w');
fputs($fp, $filestr);
fclose($fp);
}
| PHP |
<script type="text/javascript">
var jumpnum = 1;
function setJumpNum(jump){
jumpnum = jump;
}
</script>
<?php
class PageSplit{
function getPageCount($pagesize,$rownums){
$pagecount = (int)($rownums%$pagesize==0?(int)($rownums/$pagesize):(int)(($rownums/$pagesize)+1));
return $pagecount;
}
function getStart($pagesize,$pagenow){
$start = ((int)($pagenow)-1)*((int)$pagesize);
return $start;
}
function getPageBar($links,$pagenow,$pagesize,$pagecount,$editlang){
if($editlang=='cn'){
if($pagecount>=1){
$pagingbar="";
$pagingbar=$pagingbar."<div class=\"pagingFirstPageClass\"><a href=\"$links/1/$pagesize.html\">首页</a></div>";
if($pagenow>1){
$pagingbar=$pagingbar."<div class=\"pagingFirstPageClass\"><a href=\"$links/".($pagenow-1)."/$pagesize.html\">上一页</a></div>";
}else{
$pagingbar=$pagingbar."<div class=\"pagingFirstPageClass\"><a href=\"$links/1/$pagesize.html\">上一页</a></div>";
}
if($pagecount>5){
if($pagenow>3){
if(($pagenow+2)>$pagecount){
for($i=$pagecount-5;$i<=$pagecount;$i++){
if($i==$pagenow){
$pagingbar=$pagingbar."<font class=\"pagingCurPageClass\">".$i."</font>";
}else{
$pagingbar=$pagingbar."<a href=\"$links/".$pagenow."/$pagesize.html\" ><font class=\"pagingOtherPageClass\">".($i)."</font></a>";
}
}
}else{
for($i=$pagenow-2;$i<=$pagenow+2;$i++){
if($i==$pagenow){
$pagingbar=$pagingbar."<font class=\"pagingCurPageClass\">".$i."</font>";
}else{
$pagingbar=$pagingbar."<a href=\"$links/".$pagenow."/$pagesize.html\" ><font class=\"pagingOtherPageClass\">".($i)."</font></a>";
}
}
}
}else{
for($i=1;$i<=5;$i++){
if($i==$pagenow){
$pagingbar=$pagingbar."<font class=\"pagingCurPageClass\">".$i."</font>";
}else{
$pagingbar=$pagingbar."<a href=\"$links/".$pagenow."/$pagesize.html\" ><font class=\"pagingOtherPageClass\">".$i."</font></a>";
}
}
}
}else{
for($i=1;$i<=$pagecount;$i++){
if($i==$pagenow){
$pagingbar=$pagingbar."<font class=\"pagingCurPageClass\">".$i."</font>";
}else{
$pagingbar=$pagingbar."<a href=\"$links/".$i."/$pagesize.html\" ><font class=\"pagingOtherPageClass\">".$i."</font></a>";
}
}
}
if($pagenow+1>$pagecount){
$pagingbar=$pagingbar."<div class=\"pagingNextPageClass\"><a href=\"$links/".$pagenow."/$pagesize.html\">下一页</a></div>";
}else{
$pagingbar=$pagingbar."<div class=\"pagingNextPageClass\"><a href=\"$links/".($pagenow+1)."/$pagesize.html\">下一页</a></div>";
}
$pagingbar =$pagingbar."<div class=\"pagingLastPageClass\"><a href=\"$links/$pagecount/$pagesize.html\">末页</a></div>";
return $pagingbar;
}else{
return "";
}
}else{
if($pagecount>=1){
$pagingbar="";
$pagingbar=$pagingbar."<div class=\"pagingFirstPageClass\"><a href=\"$links/1/$pagesize.html\">First</a></div>";
if($pagenow>1){
$pagingbar=$pagingbar."<div class=\"pagingFirstPageClass\"><a href=\"$links/".($pagenow-1)."/$pagesize.html\">Previous</a></div>";
}else{
$pagingbar=$pagingbar."<div class=\"pagingFirstPageClass\"><a href=\"$links/1/$pagesize.html\">Previous</a></div>";
}
if($pagecount>5){
if($pagenow>3){
if(($pagenow+2)>$pagecount){
for($i=$pagecount-5;$i<=$pagecount;$i++){
if($i==$pagenow){
$pagingbar=$pagingbar."<font class=\"pagingCurPageClass\">".$i."</font>";
}else{
$pagingbar=$pagingbar."<a href=\"$links/".$pagenow."/$pagesize.html\" ><font class=\"pagingOtherPageClass\">".($i)."</font></a>";
}
}
}else{
for($i=$pagenow-2;$i<=$pagenow+2;$i++){
if($i==$pagenow){
$pagingbar=$pagingbar."<font class=\"pagingCurPageClass\">".$i."</font>";
}else{
$pagingbar=$pagingbar."<a href=\"$links/".$pagenow."/$pagesize.html\" ><font class=\"pagingOtherPageClass\">".($i)."</font></a>";
}
}
}
}else{
for($i=1;$i<=5;$i++){
if($i==$pagenow){
$pagingbar=$pagingbar."<font class=\"pagingCurPageClass\">".$i."</font>";
}else{
$pagingbar=$pagingbar."<a href=\"$links/".$pagenow."/$pagesize.html\" ><font class=\"pagingOtherPageClass\">".$i."</font></a>";
}
}
}
}else{
for($i=1;$i<=$pagecount;$i++){
if($i==$pagenow){
$pagingbar=$pagingbar."<font class=\"pagingCurPageClass\">".$i."</font>";
}else{
$pagingbar=$pagingbar."<a href=\"$links/".$i."/$pagesize.html\" ><font class=\"pagingOtherPageClass\">".$i."</font></a>";
}
}
}
if($pagenow+1>$pagecount){
$pagingbar=$pagingbar."<div class=\"pagingNextPageClass\"><a href=\"$links/".$pagenow."/$pagesize.html\">Next</a></div>";
}else{
$pagingbar=$pagingbar."<div class=\"pagingNextPageClass\"><a href=\"$links/".($pagenow+1)."/$pagesize.html\">Next</a></div>";
}
$pagingbar =$pagingbar."<div class=\"pagingLastPageClass\"><a href=\"$links/$pagecount/$pagesize.html\">Last</a></div>";
return $pagingbar;
}else{
return "";
}
}
}
}
?>
| PHP |
<?php
class AdminAction{
public $data;
public $lang;
function __construct(){
$this->loadData();
$this->init();
}
function init(){
$this->getMenuList();
}
function loadData(){
global $sysinfo;
$this->data = array();
$this->data['sysinfo'] = $sysinfo;
}
function getMenuList(){
$menustr = getCk('menulist');
$this->data['menulist'] = $menustr;
}
function getDB(){
require 'config/database.php';
require 'include/mysql.php';
return $db = new mysql($dbhost, $dbuser, $dbpw, $dbname, $pconnect,$charset);
}
function loadLib($lib){
require 'include/lib/'.$lib.'.php';
$lib = ucfirst($lib);
return $lb = new $lib();
}
function ajaxMsg($type,$msg){
$message = array();
$message['type'] = $type;
$message['msg'] = $msg;
echo json_encode($message);
}
} | PHP |
<?php
class FrontAction{
public $data;
function __construct(){
$this->data = array();
}
function getDB(){
require 'config/db.php';
require 'inc/mysql.php';
return $db = new mysql($dbhost, $dbuser, $dbpw, $dbname, $pconnect,$charset);
}
} | PHP |
<?php
!defined('HH') && exit('Forbidden');
class mysql{
private $db_host; //数据库主机
private $db_user; //数据库用户名
private $db_pwd; //数据库用户名密码
private $db_database; //数据库名
private $conn; //数据库连接标识;
private $result; //执行query命令的结果资源标识
private $sql; //sql执行语句
private $row; //返回的条目数
private $coding; //数据库编码,GBK,UTF8,gb2312
private $bulletin = true; //是否开启错误记录
private $show_error = true; //测试阶段,显示所有错误,具有安全隐患,默认关闭
private $is_error = false; //发现错误是否立即终止,默认true,建议不启用,因为当有问题时用户什么也看不到是很苦恼的
/**
* 初始化MySql实例
* @param $db_host IP地址
* @param $db_user 用户名
* @param $db_pwd 密码
* @param $db_database 数据库
* @param $conn 是否是持久连接
* @param $coding 数据库编码
*/
public function __construct($db_host,$db_user,$db_pwd,$db_database,$conn,$coding){
$this->db_host=$db_host;
$this->db_user=$db_user;
$this->db_pwd = $db_pwd;
$this->db_database=$db_database;
$this->conn=$conn;
$this->coding=$coding;
$this->connect();
}
/*数据库连接*/
public function connect()
{
if($this->conn=="pconn"){
//永久链接
$this->conn=@mysql_pconnect($this->db_host,$this->db_user,$this->db_pwd);
}else{
//即使链接
$this->conn=@mysql_connect($this->db_host,$this->db_user,$this->db_pwd);
}
if (!@mysql_ping ($this->conn)) {
@mysql_close($this->conn);
$this->connect();
}
if(!mysql_select_db($this->db_database,$this->conn)){
if($this->show_error){
$this->show_error("数据库不可用:",$this->db_database);
}
}
mysql_query("SET NAMES $this->coding");
}
/*数据库执行语句,可执行查询添加修改删除等任何sql语句*/
public function query($sql)
{
if($sql == ""){
$this->show_error("sql语句错误:","sql查询语句为空");}
$this->sql = $sql;
$result = mysql_query($this->sql,$this->conn);
if(!$result){
//调试中使用,sql语句出错时会自动打印出来
if($this->show_error){
$this->show_error("错误sql语句:",$this->sql);
}
}else{
$this->result = $result;
}
return $this->result;
}
public function query_array($sql){
if($sql == ""){
$this->show_error("sql语句错误:","sql查询语句为空");}
$this->sql = $sql;
$result = mysql_query($this->sql,$this->conn);
if(!$result){
//调试中使用,sql语句出错时会自动打印出来
if($this->show_error){
$this->show_error("错误sql语句:",$this->sql);
}
}else{
$this->result = $result;
}
return $this->fetch_toarray();
}
public function query_object($sql){
if($sql == ""){
$this->show_error("sql语句错误:","sql查询语句为空");}
$this->sql = $sql;
$result = mysql_query($this->sql,$this->conn);
if(!$result){
//调试中使用,sql语句出错时会自动打印出来
if($this->show_error){
$this->show_error("错误sql语句:",$this->sql);
}
}else{
$this->result = $result;
}
return $this->fetch_toobject();
}
public function query_assoc($sql){
if($sql == ""){
$this->show_error("sql语句错误:","sql查询语句为空");}
$this->sql = $sql;
$result = mysql_query($this->sql,$this->conn);
if(!$result){
//调试中使用,sql语句出错时会自动打印出来
if($this->show_error){
$this->show_error("错误sql语句:",$this->sql);
}
}else{
$this->result = $result;
}
return $this->fetch_toassoc();
}
public function query_assoc_key($sql,$key){
if($sql == ""){
$this->show_error("sql语句错误:","sql查询语句为空");}
$this->sql = $sql;
$result = mysql_query($this->sql,$this->conn);
if(!$result){
//调试中使用,sql语句出错时会自动打印出来
if($this->show_error){
$this->show_error("错误sql语句:",$this->sql);
}
}else{
$this->result = $result;
}
return $this->fetch_toassoc_key($key);
}
public function get_assoc($sql){
if($sql == ""){
$this->show_error("sql语句错误:","sql查询语句为空");
}
$this->sql = $sql;
$result = mysql_query($this->sql,$this->conn);
if(!$result){
//调试中使用,sql语句出错时会自动打印出来
if($this->show_error){
$this->show_error("错误sql语句:",$this->sql);
}
}else{
$this->result = $result;
}
return mysql_fetch_assoc($this->result);
}
/*
mysql_fetch_row() array $row[0],$row[1],$row[2]
mysql_fetch_array() array $row[0] 或 $row[id]
mysql_fetch_assoc() array 用$row->content 字段大小写敏感
mysql_fetch_object() object 用$row[id],$row[content] 字段大小写敏感
mysql_fetch_object() 函数从结果集(记录集)中取得一行作为对象。
mysql_fetch_assoc() 函数从结果集中取得一行作为关联数组。
*/
/*取得结果数据*/
public function mysql_result_li()
{
return mysql_result($str);
}
/*将结果集转化为集合 array $row[0] 或 $row[id] */
public function fetch_toarray(){
$arrylist = array();
while($row = mysql_fetch_array($this->result)){
array_push($arrylist, $row);
}
return $arrylist;
}
/*将结果集转化为对象 object 用$row->id,$row->content 字段大小写敏感 */
public function fetch_toobject(){
$arrylist = array();
while($row = mysql_fetch_object($this->result)){
array_push($arrylist, $row);
}
return $arrylist;
}
/*将结果集转化为对象 array $row[0],$row[1],$row[2] */
public function fetch_torow(){
$arrylist = array();
while($row = mysql_fetch_row($this->result)){
array_push($arrylist, $row);
}
return $arrylist;
}
/*将结果集转化为对象 array $row[0],$row[1],$row[2] */
public function fetch_toassoc(){
$arrylist = array();
while($row = mysql_fetch_assoc($this->result)){
array_push($arrylist, $row);
}
return $arrylist;
}
public function fetch_toassoc_key($key){
$arrylist = array();
while($row = mysql_fetch_assoc($this->result)){
$arrylist[$row[$key]] = $row;
}
return $arrylist;
}
/*创建添加新的数据库*/
public function create_database($database_name){
$database=$database_name;
$sqlDatabase = 'create database '.$database;
$this->query($sqlDatabase);
}
/*查询服务器所有数据库*/
//将系统数据库与用户数据库分开,更直观的显示?
public function show_databases(){
$this->query("show databases");
echo "现有数据库:".$amount =$this->db_num_rows($rs);
echo "<br />";
$i=1;
while($row = $this->fetch_array($rs)){
echo "$i $row[Database]";
echo "<br />";
$i++;
}
}
//以数组形式返回主机中所有数据库名
public function databases()
{
$rsPtr=mysql_list_dbs($this->conn);
$i=0;
$cnt=mysql_num_rows($rsPtr);
while($i<$cnt)
{
$rs[]=mysql_db_name($rsPtr,$i);
$i++;
}
return $rs;
}
/*查询数据库下所有的表*/
function show_tables($database_name){
$this->query("show tables");
echo "现有数据库:".$amount = $this->db_num_rows($rs);
echo "<br />";
$i=1;
while($row = $this->fetch_array($rs)){
$columnName="Tables_in_".$database_name;
echo "$i $row[$columnName]";
echo "<br />";
$i++;
}
}
//简化查询select
public function findall($table)
{
$this->query("SELECT * FROM $table");
}
//简化查询select
public function select($table,$columnName,$condition)
{
if($columnName==""){
$columnName="*";
}
$this->query("SELECT $columnName FROM $table $condition");
}
//简化删除del
public function delete($table,$condition){
$this->query("DELETE FROM $table WHERE $condition");
}
//简化插入insert
public function insert($table,$columnName,$value){
$this->query("INSERT INTO $table ($columnName) VALUES ($value)");
}
//简化修改update
public function update($table,$mod_content,$condition){
$this->query("UPDATE $table SET $mod_content WHERE $condition");
}
/*取得上一步 INSERT 操作产生的 ID*/
public function insert_id(){
return mysql_insert_id();
}
//指向确定的一条数据记录
public function db_data_seek($id){
if($id>0){
$id=$id-1;
}
if(!@mysql_data_seek($this->result,$id)){
$this->show_error("sql语句有误:", "指定的数据为空");
}
return $this->result;
}
// 根据select查询结果计算结果集条数
public function db_num_rows(){
if($this->result==null){
if($this->show_error){
$this->show_error("sql语句错误","暂时为空,没有任何内容!");
}
}else{
return mysql_num_rows($this->result);
}
}
// 根据insert,update,delete执行结果取得影响行数
public function db_affected_rows(){
return mysql_affected_rows();
}
//输出显示sql语句
public function show_error($message="",$sql=""){
header("Content-Type:text/html; charset=utf-8");
if(!$sql){
echo "<font color='red'>".$message."</font>";
echo "<br />";
}else{
echo "<fieldset>";
echo "<legend>错误信息提示:</legend><br />";
echo "<div style='font-size:14px; clear:both; font-family:Verdana, Arial, Helvetica, sans-serif;'>";
echo "<div style='height:20px; background:#000000; border:1px #000000 solid'>";
echo "<font color='white'>错误号:12142</font>";
echo "</div><br />";
echo "错误原因:".mysql_error()."<br /><br />";
echo "<div style='height:20px; background:#FF0000; border:1px #FF0000 solid'>";
echo "<font color='white'>".$message."</font>";
echo "</div>";
echo "<font color='red'><pre>".$sql."</pre></font>";
$ip=$this->getip();
if($this->bulletin){
$time = date("Y-m-d H:i:s");
$message=$message."\r\n$this->sql"."\r\n客户IP:$ip"."\r\n时间 :$time"."\r\n\r\n";
$server_date=date("Y-m-d");
$filename=$server_date.".txt";
$file_path="error/".$filename;
$error_content=$message;
//$error_content="错误的数据库,不可以链接";
$file = "error"; //设置文件保存目录
//建立文件夹
if(!file_exists($file)){
if(!mkdir($file,0777)){
//默认的 mode 是 0777,意味着最大可能的访问权
die("upload files directory does not exist and creation failed");
}
}
//建立txt日期文件
if(!file_exists($file_path)){
//echo "建立日期文件";
fopen($file_path,"w+");
//首先要确定文件存在并且可写
if (is_writable($file_path))
{
//使用添加模式打开$filename,文件指针将会在文件的开头
if (!$handle = fopen($file_path, 'a'))
{
echo "不能打开文件 $filename";
exit;
}
//将$somecontent写入到我们打开的文件中。
if (!fwrite($handle, $error_content))
{
echo "不能写入到文件 $filename";
exit;
}
//echo "文件 $filename 写入成功";
echo "——错误记录被保存!";
//关闭文件
fclose($handle);
} else {
echo "文件 $filename 不可写";
}
}else{
//首先要确定文件存在并且可写
if (is_writable($file_path))
{
//使用添加模式打开$filename,文件指针将会在文件的开头
if (!$handle = fopen($file_path, 'a'))
{
echo "不能打开文件 $filename";
exit;
}
//将$somecontent写入到我们打开的文件中。
if (!fwrite($handle, $error_content))
{
echo "不能写入到文件 $filename";
exit;
}
//echo "文件 $filename 写入成功";
echo "——错误记录被保存!";
//关闭文件
fclose($handle);
} else {
echo "文件 $filename 不可写";
}
}
}
echo "<br />";
if($this->is_error){
exit;
}
}
echo "</div>";
echo "</fieldset>";
echo "<br />";
}
//释放结果集
public function free(){
@mysql_free_result($this->result);
}
//数据库选择
public function select_db($db_database){
return mysql_select_db($db_database);
}
//查询字段数量
public function num_fields($table_name){
//return mysql_num_fields($this->result);
$this->query("select * from $table_name");
echo "<br />";
echo "字段数:".$total = mysql_num_fields($this->result);
echo "<pre>";
for ($i=0; $i<$total; $i++){
print_r(mysql_fetch_field($this->result,$i) );
}
echo "</pre>";
echo "<br />";
}
//取得 MySQL 服务器信息
public function mysql_server($num=''){
switch ($num){
case 1 :
return mysql_get_server_info(); //MySQL 服务器信息
break;
case 2 :
return mysql_get_host_info(); //取得 MySQL 主机信息
break;
case 3 :
return mysql_get_client_info(); //取得 MySQL 客户端信息
break;
case 4 :
return mysql_get_proto_info(); //取得 MySQL 协议信息
break;
default:
return mysql_get_client_info(); //默认取得mysql版本信息
}
}
//析构函数,自动关闭数据库,垃圾回收机制
public function __destruct()
{
if(!empty($this->result)){
$this->free();
}
mysql_close($this->conn);
}
/*获得客户端真实的IP地址*/
function getip(){
if(getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown"))
{
$ip = getenv("HTTP_CLIENT_IP");
}
else if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown")){
$ip = getenv("HTTP_X_FORWARDED_FOR");
}
else if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown"))
{
$ip = getenv("REMOTE_ADDR");
}
else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown")){
$ip = $_SERVER['REMOTE_ADDR'];
}
else{
$ip = "unknown";
}
return($ip);
}
function getParam($parm){
return $this->$parm;
}
}
?> | PHP |
<?php
session_start();
function P($key){
return $_POST["$key"];
}
function G($key){
return $_GET["$key"];
}
function getSession($key){
return $_SESSION[$key];
}
function setSession($key,$value){
$_SESSION[$key] = $value;
}
function setCk($name,$value,$expire){
global $sysinfo;
setcookie($sysinfo['cookpifix'].$name, $value, $expire);
}
function getCk($name){
global $sysinfo;
return $_COOKIE[$sysinfo['cookpifix'].$name];
}
function cut_str($string, $sublen, $start = 0, $code = 'UTF-8')
{
if($code == 'UTF-8')
{
$pa = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|\xe0[\xa0-\xbf][\x80-\xbf]|[\xe1-\xef][\x80-\xbf][\x80-\xbf]|\xf0[\x90-\xbf][\x80-\xbf][\x80-\xbf]|[\xf1-\xf7][\x80-\xbf][\x80-\xbf][\x80-\xbf]/";
preg_match_all($pa, $string, $t_string);
if(count($t_string[0]) - $start > $sublen) return join('', array_slice($t_string[0], $start, $sublen))."...";
return join('', array_slice($t_string[0], $start, $sublen));
}
else
{
$start = $start*2;
$sublen = $sublen*2;
$strlen = strlen($string);
$tmpstr = '';
for($i=0; $i< $strlen; $i++)
{
if($i>=$start && $i< ($start+$sublen))
{
if(ord(substr($string, $i, 1))>129)
{
$tmpstr.= substr($string, $i, 2);
}
else
{
$tmpstr.= substr($string, $i, 1);
}
}
if(ord(substr($string, $i, 1))>129) $i++;
}
if(strlen($tmpstr)< $strlen ) $tmpstr.= "...";
return $tmpstr;
}
}
function uuid($prefix = '')
{
$chars = md5(uniqid(mt_rand(), true));
$uuid = substr($chars,0,8) . '-';
$uuid .= substr($chars,8,4) . '-';
$uuid .= substr($chars,12,4) . '-';
$uuid .= substr($chars,16,4) . '-';
$uuid .= substr($chars,20,12);
return $prefix . $uuid;
}
function uuid2(){
$chars = md5(uniqid(mt_rand(), true));
$uuid = substr($chars,0,8);
$uuid .= substr($chars,8,4);
$uuid .= substr($chars,12,4);
$uuid .= substr($chars,16,4);
$uuid .= substr($chars,20,12);
return $uuid;
}
function getSuffix($name){
return substr($name,strrpos($name,'.'));
}
function loadData($file){
return require('data/'.$file);
} | PHP |
<?php
session_start();
define('HH','http://'.$_SERVER['HTTP_HOST'].'/');
define('HT',HH.'admin/template/');
require 'include/fun.php';
require 'include/admin_fun.php';
require 'include/admin_action.php';
$sysinfo = loadData('sysinfo.php');
$nav=$_SERVER['REQUEST_URI'];
$script=$_SERVER['SCRIPT_NAME'];
$nav=str_replace($script,'',$nav);
$vars=explode("-",substr($nav,1));
if(!empty($vars[0])&&!empty($vars[1])){
$action = $vars[0];
$method = $vars[1];
$act = loadAdmin($action);
$param = '';
for($i=2;$i<sizeof($vars);$i++){
$param .=',$vars['.$i.']';
}
$param = substr($param,1);
eval('$act->$method('.$param.');');
}else{
$welcome = loadAdmin('welcome');
$welcome->index();
} | PHP |
<?php
session_start();
define('HH','http://'.$_SERVER['HTTP_HOST'].'/');
require DR.'/include/fun.php';
require DR.'/include/front_fun.php';
require DR.'/include/front_action.php';
/*加载必要的系统信息*/
$sysinfo = loadData('sysinfo.php');
$nav=$_SERVER['REQUEST_URI'];
$nav=str_replace('.html','',$nav);
$script=$_SERVER['SCRIPT_NAME'];
$nav=str_replace($script,'',$nav);
$vars=explode("/",substr($nav,1));
if(!empty($vars[0])&&!empty($vars[1])){
$action = $vars[0];
$method = $vars[1];
$act = loadAction($action);
$param = '';
for($i=2;$i<sizeof($vars);$i++){
$param .=',$vars['.$i.']';
}
$param = substr($param,1);
eval('$act->$method('.$param.');');
}else{
$welcome = loadAction('Welcome');
$welcome->index();
}
| PHP |
<?php
/*前台方法*/
/**
* 加载ACTION文件
* @param $action
* @return 加载ACTION的实例
*/
function loadAction($action){
require DR.'/require/'.$action.'.php';
$action = ucfirst($action);
if (class_exists($action)) {
$act = new $action();;
return $act;
}
}
function template($page,$data=null){
global $sysinfo;
if(sizeof($data)>=1){
extract($data);
}
//设置默认的模版地址
define('HT','http://'.$_SERVER['HTTP_HOST'].'/themes/'.$sysinfo['fr_theme'].'/');
if(is_array($page)){
foreach($page as $p){
require DR.'/themes/'.$sysinfo['fr_theme'].'/'.$p.'.php';
}
}else{
require DR.'/themes/'.$sysinfo['fr_theme'].'/'.$page.'.php';
}
}
function getSys($key){
require DR.'/config/sys.php';
return $$key;
}
function incTemplate($page){
$c_lang = getLang();
return DR.'/template/default/'.$page.'.php';
}
function loadinc($inc){
return DR."/inc/".$inc.".php";
}
| PHP |
<?php
session_start();
$_SESSION['re_code']='';
$type = 'gif';
$width= 38;
$height= 18;
header("Content-type: image/".$type);
srand((double)microtime()*1000000);
$randval = randStr(4,"ALL");
if($type!='gif' && function_exists('imagecreatetruecolor')){
$im = @imagecreatetruecolor($width,$height);
}else{
$im = @imagecreate($width,$height);
}
$r = Array(225,211,255,223);
$g = Array(225,236,237,215);
$b = Array(225,236,166,125);
$key = rand(0,3);
$backColor = ImageColorAllocate($im,$r[$key],$g[$key],$b[$key]);//背景色(随机)
$borderColor = ImageColorAllocate($im, 20, 66, 111);//边框色
$pointColor = ImageColorAllocate($im, 255, 170, 255);//点颜色
@imagefilledrectangle($im, 0, 0, $width - 1, $height - 1, $backColor);//背景位置
@imagerectangle($im, 0, 0, $width-1, $height-1, $borderColor); //边框位置
$stringColor = ImageColorAllocate($im, 0,0,0);
for($i=0;$i<=100;$i++){
$pointX = rand(2,$width-2);
$pointY = rand(2,$height-2);
@imagesetpixel($im, $pointX, $pointY, $pointColor);
}
@imagestring($im, 3, 5, 1, $randval, $stringColor);
$ImageFun='Image'.$type;
$ImageFun($im);
@ImageDestroy($im);
$_SESSION['re_code'] = $randval;
//产生随机字符串
function randStr($len=6,$format='ALL') {
switch($format) {
case 'ALL':
$chars='ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz23456789'; break;
case 'CHAR':
$chars='ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz'; break;
case 'NUMBER':
$chars='123456789'; break;
default :
$chars='ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz23456789';
break;
}
$string="";
while(strlen($string)<$len)
$string.=substr($chars,(mt_rand()%strlen($chars)),1);
return $string;
}
?> | PHP |
<?php
class File{
function uploadfile($filename,$loacation){
$ftype = getSuffix($_FILES[$filename]["name"]);
$attachid = uuid2();
$fname = $attachid.$ftype;
$datestr = date('Y-m-d');
if(!file_exists(DR.'/'.$loacation.'/'.$datestr)){
mkdir(DR.'/'.$loacation.'/'.$datestr);
}
$floc = DR.'/'.$loacation.'/'.$datestr.'/'.$fname;
move_uploaded_file( $_FILES[$filename]['tmp_name'],$floc);
return $loacation.'/'.$datestr.'/'.$fname;
}
function unlink($location){
$droot = dirname(__FILE__);
$file = $droot.'../../../'.$location;
if(file_exists($location)){
unlink($file);
}
}
} | PHP |
<!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>Keep It Simple</title>
<base href="<?php echo HT;?>" />
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
</head>
<body>
<!-- header starts-->
<div id="header-wrap"><div id="header" class="container_16">
<h1 id="logo-text"><a href="index.html" title="">100-china.com</a></h1>
<p id="intro">总有一种力量使我们继续下去</p>
<!-- navigation -->
<div id="nav">
<ul>
<li id="current"><a href="index.html">门户</a></li>
<li><a href="style.html">论坛</a></li>
<li><a href="blog.html">群组</a></li>
<li><a href="index.html">文章</a></li>
<li><a href="index.html">个人中心</a></li>
</ul>
</div>
<div id="header-image"></div>
<form id="quick-search" action="index.html" method="get" >
<p>
<label for="qsearch">Search:</label>
<input class="tbox" id="qsearch" type="text" name="qsearch" value="Search..." title="Start typing and hit ENTER" />
<input class="btn" alt="Search" type="image" name="searchsubmit" title="Search" src="images/search.gif" />
</p>
</form>
<!-- header ends here -->
</div></div>
<!-- content starts -->
<div id="content-outer"><div id="content-wrapper" class="container_16">
<!-- main -->
<div id="main" class="grid_8">
<a name="TemplateInfo"></a>
<h2><a href="index.html">Template Info</a></h2>
<p class="post-info">Posted by <a href="index.html">erwin</a> | Filed under <a href="index.html">templates</a>, <a href="index.html">internet</a></p>
<p><strong>Keep It Simple</strong> is a free, W3C-compliant, CSS-based website template
by <a href="http://www.styleshout.com/">styleshout.com</a>. This work is
distributed under the <a rel="license" href="http://creativecommons.org/licenses/by/2.5/">
Creative Commons Attribution 2.5 License</a>, which means that you are free to
use and modify it for any purpose. All I ask is that you give me credit by including a <strong>link back</strong> to
<a href="http://www.styleshout.com/">my website</a>.
</p>
<p>
You can find more of my free template designs at <a href="http://www.styleshout.com/">my website</a>.
For premium commercial designs, you can check out
<a href="http://themeforest.net?ref=ealigam" title="Site Templates">Themeforest.net</a>.
</p>
<p class="postmeta">
<a href="index.html" class="readmore">Read more</a> |
<a href="index.html" class="comments">Comments (7)</a> |
<span class="date">April 17, 2011</span>
</p>
<h2><a href="index.html">Lorem Ipsum Dolor Sit Amet</a></h2>
<p><a href="http://getfirefox.com/"><img src="images/firefox-gray.jpg" width="100" height="120" alt="firefox" class="float-left" /></a>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.
Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu
posuere nunc justo tempus leo. Donec mattis, purus nec placerat bibendum, dui pede condimentum
odio, ac blandit ante orci ut diam. Cras fringilla magna. Phasellus suscipit, leo a pharetra
condimentum, lorem tellus eleifend magna, eget fringilla velit magna id neque. Curabitur vel urna.
In tristique orci porttitor ipsum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.
Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu
posuere nunc justo tempus leo.
</p>
<div class="clear"> </div>
<div class="grid_4 alpha">
<h3>Lorem Ipsum Dolor Sit Amet</h3>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.
Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu
posuere nunc justo tempus leo. Donec mattis, purus nec placerat bibendum, dui pede condimentum
odio, ac blandit ante orci ut diam. Cras fringilla magna. Phasellus suscipit, leo a pharetra
condimentum, lorem tellus eleifend magna, eget fringilla velit magna id neque. Curabitur vel urna.
In tristique orci porttitor ipsum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.
Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu
posuere nunc justo tempus leo.
</p>
<p><a class="more-link" href="index.html">continue reading</a></p>
</div>
<div class="grid_4 omega">
<h3>Lorem Ipsum Dolor Sit Amet</h3>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.
Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu
posuere nunc justo tempus leo. Donec mattis, purus nec placerat bibendum, dui pede condimentum
odio, ac blandit ante orci ut diam. Cras fringilla magna. Phasellus suscipit, leo a pharetra
condimentum, lorem tellus eleifend magna, eget fringilla velit magna id neque. Curabitur vel urna.
In tristique orci porttitor ipsum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.
Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu
posuere nunc justo tempus leo.
</p>
<p><a class="more-link" href="index.html">continue reading</a></p>
</div>
<!-- main ends -->
</div>
<!-- left-columns starts -->
<div id="left-columns" class="grid_8">
<div class="grid_4 alpha">
<div class="sidemenu">
<h3>Sidebar Menu</h3>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="index.html#TemplateInfo">TemplateInfo</a></li>
<li><a href="style.html">Style Demo</a></li>
<li><a href="blog.html">Blog</a></li>
</ul>
</div>
<div class="sidemenu">
<h3>Links</h3>
<ul>
<li><a href="http://www.PDPhoto.org/">PDPhoto</a></li>
<li><a href="http://www.alistapart.com">Alistapart</a></li>
<li><a href="http://960.gs/">960 Grid System</a></li>
<li><a href="http://www.freephotos.se/">FreePhotos.se</a></li>
</ul>
</div>
<div class="sidemenu">
<h3>Sponsors</h3>
<ul>
<li><a href="http://themeforest.net?ref=ealigam" title="Site Templates">Themeforest <br />
<span>Your Choice for Site Templates</span></a>
</li>
<li><a href="http://www.4templates.com/?go=228858961" title="Website Templates">4Templates <br />
<span>Low Cost High-Quality Templates</span></a>
</li>
<li><a href="http://store.templatemonster.com?aff=ealigam" title="Web Templates">TemplateMonster <br />
<span>Delivering the Best Templates on the Net!</span>
</a></li>
<li><a href="http://graphicriver.net?ref=ealigam" title="Stock Graphics">GraphicRiver <br />
<span>Awesome Stock Graphics</span></a>
</li>
<li><a href="http://www.dreamhost.com/r.cgi?287326|SSHOUT" title="Web Hosting">Dreamhost <br />
<span>Premium Webhosting. Use the promocode <strong>sshout</strong> and save <strong>50 USD</strong>.</span></a>
</li>
</ul>
</div>
<h3>Wise Words</h3>
<p>
"Beauty of style and harmony and grace and good rhythm
depends on simplicity." </p>
<p class="align-right"> - Plato</p>
<h3>Support Styleshout</h3>
<p>
If you are interested in supporting my work and would like to contribute, you are
welcome to make a small donation through the
<a href="http://www.styleshout.com/">donate link</a> on my website - it will
be a great help and will surely be appreciated.</p>
</div>
<div class="grid_4 omega">
<h3>Featured</h3>
<div class="featured-post">
<h4><a href="index.html">Lorem ipsum dolor sit</a></h4>
<p class="post-info">Posted by <a href="index.html">erwin</a> on 09/26/08 </p>
<p>
<a href="http://getfirefox.com/"><img src="images/image.gif" width="160" height="100" alt="firefox" class="float-left" /></a>
Vestibulum venenatis. Nulla vel ipsum. Proin rutrum, urna sit amet bibendum
pellentesque, ante sapien varius turpis, eu nonummy nunc urna scelerisque ante.
Nunc sed leo at dolor pharetra facilisis. Sed sed lectus at justo dapibus tristique.
Morbi molestie pulvinar elit. Donec dictum nibh nec est. Aliquam sagittis, lacus
a pharetra tempor, enim justo tempor nisi, at aliquet nulla metus sed augue.
</p>
<p><a class="more-link" href="index.html">continue reading</a></p>
</div>
<div class="featured-post">
<h4><a href="index.html">Lorem ipsum dolor sit</a></h4>
<p class="post-info">Posted by <a href="index.html">erwin</a> on 09/26/08 </p>
<p>
Vestibulum venenatis. Nulla vel ipsum. Proin rutrum, urna sit amet bibendum
pellentesque, ante sapien varius turpis, eu nonummy nunc urna scelerisque ante.
Nunc sed leo at dolor pharetra facilisis. Sed sed lectus at justo dapibus tristique.
Morbi molestie pulvinar elit. Donec dictum nibh nec est. Aliquam sagittis, lacus
a pharetra tempor, enim justo tempor nisi, at aliquet nulla metus sed augue.
</p>
<p><a class="more-link" href="index.html">continue reading</a></p>
</div>
<div class="featured-post">
<h4><a href="index.html">Lorem ipsum dolor sit</a></h4>
<p class="post-info">Posted by <a href="index.html">erwin</a> on 09/26/08 </p>
<p>
Vestibulum venenatis. Nulla vel ipsum. Proin rutrum, urna sit amet bibendum
pellentesque, ante sapien varius turpis, eu nonummy nunc urna scelerisque ante.
Nunc sed leo at dolor pharetra facilisis. Sed sed lectus at justo dapibus tristique.
Morbi molestie pulvinar elit. Donec dictum nibh nec est. Aliquam sagittis, lacus
a pharetra tempor, enim justo tempor nisi, at aliquet nulla metus sed augue.
</p>
<p><a class="more-link" href="index.html">continue reading</a></p>
</div>
</div>
<!-- end left-columns -->
</div>
<!-- contents end here -->
</div></div>
<!-- footer starts here -->
<div id="footer-wrapper" class="container_16">
<div id="footer-content">
<div class="grid_8">
<h3>Resource Links</h3>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.
Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu
posuere nunc justo tempus leo. Donec mattis, purus nec placerat bibendum, dui pede condimentum
odio, ac blandit ante orci ut diam. <a href="index.html">Read more...</a>
</p>
<ul class="footer-list">
<li><a href="http://themeforest.net?ref=ealigam" title="Site Templates">Themeforest -
<span>Site Templates, Web & CMS Themes</span></a>
</li>
<li><a href="http://www.4templates.com/?go=228858961" title="Website Templates">4Templates -
<span>Low Cost High-Quality Templates</span></a>
</li>
<li><a href="http://store.templatemonster.com?aff=ealigam" title="Web Templates">TemplateMonster -
<span>Delivering the Best Templates on the Net!</span></a>
</li>
<li><a href="http://graphicriver.net?ref=ealigam" title="Stock Graphics">GraphicRiver -
<span>Awesome Stock Graphics</span></a>
</li>
<li><a href="http://www.dreamhost.com/r.cgi?287326|SSHOUT" title="Web Hosting">DreamHost -
<span>Premium Webhosting. Use the promocode <strong>sshout</strong> and save <strong>50 USD</strong>.</span></a>
</li>
</ul>
</div>
<div class="grid_8">
<h3>Image Gallery </h3>
<p class="thumbs">
<a href="index.html"><img src="images/thumb.jpg" width="40" height="40" alt="thumbnail" /></a>
<a href="index.html"><img src="images/thumb.jpg" width="40" height="40" alt="thumbnail" /></a>
<a href="index.html"><img src="images/thumb.jpg" width="40" height="40" alt="thumbnail" /></a>
<a href="index.html"><img src="images/thumb.jpg" width="40" height="40" alt="thumbnail" /></a>
<a href="index.html"><img src="images/thumb.jpg" width="40" height="40" alt="thumbnail" /></a>
<a href="index.html"><img src="images/thumb.jpg" width="40" height="40" alt="thumbnail" /></a>
<a href="index.html"><img src="images/thumb.jpg" width="40" height="40" alt="thumbnail" /></a>
<a href="index.html"><img src="images/thumb.jpg" width="40" height="40" alt="thumbnail" /></a>
<a href="index.html"><img src="images/thumb.jpg" width="40" height="40" alt="thumbnail" /></a>
<a href="index.html"><img src="images/thumb.jpg" width="40" height="40" alt="thumbnail" /></a>
<a href="index.html"><img src="images/thumb.jpg" width="40" height="40" alt="thumbnail" /></a>
<a href="index.html"><img src="images/thumb.jpg" width="40" height="40" alt="thumbnail" /></a>
</p>
<h3>About</h3>
<p>
<a href="http://getfirefox.com/"><img src="images/gravatar.jpg" width="40" height="40" alt="firefox" class="float-left" /></a>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.
Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu
posuere nunc justo tempus leo. Donec mattis, purus nec placerat bibendum, dui pede condimentum
odio, ac blandit ante orci ut diam.</p>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.
Cras id urna. <a href="index.html">Learn more...</a></p>
</div>
</div>
<div id="footer-bottom">
<p class="bottom-left">
©2011 All your copyright info here
Design by <a href="http://www.styleshout.com/">styleshout</a>
</p>
<p class="bottom-right" >
<a href="index.html">Home</a> |
<a href="index.html">Sitemap</a> |
<a href="index.html">RSS Feed</a> |
<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> |
<a href="http://validator.w3.org/check/referer">XHTML</a>
</p>
</div>
</div>
<!-- footer ends here -->
</body>
</html>
| PHP |
<?php
include 'configure.php';
$func = $_POST['func'];
if($func == "addNum") {
$id = $_POST['id'];
$result = mysql_query("select * from components where uid = $id");
if($row = mysql_fetch_array($result)) {
$num = $row["num"];
$num++;
$query = "update components set num = $num where uid = $id";
if(mysql_query($query)) echo "$num";
else echo "0|操作失败";
}
}
else if($func == "minNum") {
$id = $_POST['id'];
$result = mysql_query("select * from components where uid = $id");
if($row = mysql_fetch_array($result)) {
$num = $row["num"];
$num--;
if($num == 0) $query = "delete from components where uid = $id";
else $query = "update components set num = $num where uid = $id";
if(mysql_query($query)) echo "$num";
else echo "0|操作失败";
}
}
?> | PHP |
<?php
include "configure.php";
htmlhead("添加元件");
htmlheadend();
?>
<?php
if(isset($_GET['posted'])) {
if($_GET['posted'] == "insert") {
if($_GET['type'] == "new") {
$query = "insert into comptype (name) values ('$_GET[newcomptype]')";
if(!mysql_query($query)) die("dabiaozi,database 出错!!!");
else {
$query = "select * from comptype where name='$_GET[newcomptype]'";
$result = mysql_query($query);
if($row = mysql_fetch_array($result)) {
$type = $row['uid'];
}
else die("<span class=\"error\">dabiaozi,database 出错!!!</span>");
}
}
else $type = $_GET['type'];
$sql = "insert into components (name, type, value, unit, description, num, position) values ('$_GET[name]','$type','$_GET[value]','$_GET[unit]','$_GET[description]','$_GET[num]','$_GET[position]')";
//echo $sql;
if(!mysql_query($sql)) die("<span class=\"error\">dabiaozi,database 出错!!!</span>");
else echo "添加成功";
}
else if($_GET['posted'] == "update") {
if($_GET['type'] == "new") {
$query = "insert into comptype (name) values ('$_GET[newcomptype]')";
if(!mysql_query($query)) die("dabiaozi,database 出错!!!");
else {
$query = "select * from comptype where name='$_GET[newcomptype]'";
$result = mysql_query($query);
if($row = mysql_fetch_array($result)) {
$type = $row['uid'];
}
else die("<span class=\"error\">dabiaozi,database 出错!!!</span>");
}
}
else $type = $_GET['type'];
$sql = "update components set name = $_GET[name], type = $type, value = $_GET[value], unit = $_GET[unit], description = $_GET[description], num = $_GET[num], position = $_GET[position] where uid = $_GET[uid]";
//echo $sql;
if(!mysql_query($sql)) die("<span class=\"error\">dabiaozi,database 出错!!!</span>");
else echo "添加成功";
}
}
?>
<a class="index" href="index.php">主页</a>
<div id="mainform">
<form action="" method="get">
<div>
<?php
if(isset($_GET['posted']) && $_GET['posted'] == "update") {
// TODO 修改元件信息
}
?>
<label for="name">元件名:</label>
<input name="name" id="name" type="text" value="<?php if(isset($_GET["name"])) echo $_GET["name"]; ?>" />
</div>
<div>
<label for="type">元件类型:</label>
<select name="type" id="type">
<option value="new">新建</option>
<?php
$sql = "select * from comptype";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
if(isset($_GET["type"])) {
if($_GET["type"] == $row["uid"]) echo "<option value=\"$row[uid]\" selected=\"selected\" >$row[name]</option>";
}
else echo "<option value=\"$row[uid]\">$row[name]</option>";
}
?>
</select>
<input type="text" name="newcomptype" />
</div>
<div>
<label for="value">值:</label>
<input type="text" name="value" id="value" value="<?php if(isset($_GET["value"])) echo $_GET["value"]; ?>" />
</div>
<div>
<label for="num">数量:</label>
<input type="text" name="num" id="num" value="<?php if(isset($_GET["num"])) echo $_GET["num"]; ?>" />
</div>
<div>
<label for="unit">单位:</label>
<input type="text" name="unit" id="unit" value="<?php if(isset($_GET["unit"])) echo $_GET["unit"]; ?>" />
</div>
<div>
<label for="position">位置(保管人):</label>
<input type="text" name="position" id="position" value="<?php if(isset($_GET["position"])) echo $_GET["position"]; ?>" />
</div>
<div>
<label for="description">描述:</label>
<textarea name="description" rows="10" cols="50"></textarea>
</div>
<input type="hidden" name="posted" value="insert" />
<input type="submit" value="添加" class="yage_button" />
</form>
</div>
<?php
htmltail();
?> | PHP |
<?php
define('ABSPATH', dirname(dirname(__FILE__)) . '\\');
$domain = "";
$jquerylib = $domain . "jQuerylib/jquery-1.4.4.min.js";
$jqueryui = $domain . "jQuerylib/jquery-ui-1.8.9.custom.min.js";
$jslib = $domain . "js";
$jqueryuitheme = $domain . "css/custom-theme3/jquery-ui-1.8.10.custom.css";
$sql_server = "127.0.0.1"; //sqlserver name
$sql_username = "root"; //sqlserver root username
$sql_password = ""; //sqlserver root password
$sql_database = "117com"; //database name
$calendar = CAL_GREGORIAN;
/*
* connect sqlserver
*/
if (!($sql_handle = mysql_connect($sql_server,$sql_username,$sql_password)))
{
//sql_linkerror();
die("connect error");
}
else
{
mysql_select_db($sql_database);
mysql_query("SET NAMES UTF8");
}
/*********************************
*/
function sql_link()
{
if (!mysql_connect($sql_server,$sql_username,$sql_password))
{
sql_linkerror();
//die();
return false;
}
else
{
mysql_select_db($sql_database);
mysql_query("SET NAMES UTF8");
}
return true;
}
/************************************
whenever sql link error,call this fuction
*************************************/
function sql_linkerror()
{
jumphtml('htmls/sqllink_error.html');
}
include 'common.php';
session_start();
?> | PHP |
<?php
include "configure.php";
htmlhead("117元件管理系统");
addjs("control.js");
htmlheadend();
?>
<img src="css/pic/logo.jpg" /><br>
<a href='addcomp.php' title='添加元件' class='yage_button'>添加</a>
<a href='inport.php' title='导入csv文件' class='yage_button'>导入</a>
<a href="export.php" title="导出csv文件" class="yage_button">导出</a>
<?php
$query = "select components.uid,components.name,value,unit,num,position,description,comptype.name as type from components,comptype where components.type = comptype.uid";
$result = mysql_query($query);
echo "<div><table>";
echo "<tr>";
echo "<td>元件名</td><td>元件类型</td><td>值</td><td>单位</td><td>数量</td><td>保管位置(保管人)</td><td>描述</td>";
echo "</tr>";
while ($row=mysql_fetch_array($result)) {
echo "<tr class=\"component\" value=\"$row[uid]\" title=\"$row[description]\">";
echo "<td class=\"name\">$row[name]</td><td class=\"type\">$row[type]</td><td class=\"value\">$row[value]</td><td class=\"unit\">$row[unit]</td><td class=\"num\">$row[num]<input type=\"button\" class=\"comPlus yage_button\" value=\"+\" /><input type=\"button\" class=\"yage_button comMinus\" value=\"-\" /></td><td class=\"position\">$row[position]</td><td class=\"description\">$row[description]</td>";
echo "</tr>";
}
echo "</table></div>";
?>
<?php
$chars = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
echo "<div id=\"comboxtable\"><table>";
for($i=0;$i<15;$i++) {
echo "<tr>";
for($j=0;$j<15;$j++) {
echo "<td class=\"box\" id=\"" . $chars[$j] . (15-$i) . "\">" . $chars[$j] . (15-$i) . "</td>";
}
echo "</tr>";
}
echo "</table></div>";
?>
<?php
htmltail();
?> | PHP |
<?php
/********************************
* function: jumphtml
* paraments: html location
* return none
*/
function jumphtml($location)
{
echo "<script type='text/javascript'>window.location.replace('" . $domain . $location . "');</script>";
}
function htmlhead($title="undefined",$ui="nui")
{
global $jquerylib,$jslib,$jqueryui,$jqueryuitheme;
echo <<< htmlhead
<!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" />
<link type="text/css" href="css/all.css" rel="stylesheet" />
<script type="text/javascript" src="$jquerylib"></script>
<script type="text/javascript" src="$jslib/conf.js"></script>
htmlhead;
if ($ui=="ui")
{
echo "<script type='text/javascript' src='$jqueryui'></script>";
echo "<link type='text/css' href='$jqueryuitheme' rel='stylesheet' />";
}
echo "<title>$title</title>";
}
function htmlheadend()
{
echo <<< head
</head>
<body>
head;
}
function mapbar($location) {
echo "<div class='mapbar' id='mapbar'>";
include $location;
echo "</div>";
}
function htmltail()
{
echo <<< htmltail
</body>
</html>
htmltail;
}
function addjs($jsname)
{
global $jslib;
echo "<script type='text/javascript' src='$jslib/$jsname'></script>";
}
//要过滤的非法字符
$ArrFiltrate=array("'",";","\"","<",">");
//出错后要跳转的url,不填则默认前一页
$StrGoUrl="";
//是否存在数组中的值
function FunStringExist($StrFiltrate,$ArrFiltrate){
foreach ($ArrFiltrate as $key=>$value)
if (strstr($StrFiltrate,$value)) return true;
return false;
}
//合并$_POST 和 $_GET
if(function_exists("array_merge"))
{
$ArrPostAndGet=array_merge($_POST,$_GET);
}
else
{
foreach($HTTP_POST_VARS as $key=>$value) $ArrPostAndGet[]=$value;
foreach($HTTP_GET_VARS as $key=>$value) $ArrPostAndGet[]=$value;
}
//验证开始
foreach($ArrPostAndGet as $key=>$value){
if (FunStringExist($value,$ArrFiltrate)){
die("<script language=\"javascript\">alert(\"非法字符\");</script>");
/*if (emptyempty($StrGoUrl))
echo "<script language=\"javascript\">history.go(-1);</script>";
else
echo "<script language=\"javascript\">window.location=\"".$StrGoUrl."\";</script>";
exit;*/
}
}
?> | PHP |
<?php
include "configure.php";
$Date = date("Y-m-d");
$Filename = $Date.".csv";
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=".$Filename);
$query = "select * from comptype";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result))
$type[$row['uid']] = $row['name'];
$query = "select * from components";
$result = mysql_query($query);
echo "元件名,元件类型,值,数量,保管位置(保管人),描述\n";
while ($row=mysql_fetch_array($result))
echo "$row[name]," . $type[$row['type']] . ",$row[value],$row[num],$row[position],$row[description]\n";
?>
| PHP |
<?php
/*
* Load sample data
*/
include 'data.php';
/*
* Results array
*/
$results = array();
/*
* Autocomplete formatter
*/
function autocomplete_format($results) {
foreach ($results as $result) {
echo $result[0] . '|' . $result[1] . "\n";
}
}
/*
* Search for term if it is given
*/
if (isset($_GET['q'])) {
$q = strtolower($_GET['q']);
if ($q) {
foreach ($data as $key => $value) {
if (strpos(strtolower($key), $q) !== false) {
$results[] = array($key, $value);
}
}
}
}
/*
* Output format
*/
$output = 'autocomplete';
if (isset($_GET['output'])) {
$output = strtolower($_GET['output']);
}
/*
* Output results
*/
if ($output === 'json') {
echo json_encode($results);
} else {
echo autocomplete_format($results);
}
| PHP |
<?php
$data = array(
"Great Bittern" => "Botaurus stellaris",
"Little Grebe" => "Tachybaptus ruficollis",
"Black-necked Grebe" => "Podiceps nigricollis",
"Little Bittern" => "Ixobrychus minutus",
"Black-crowned Night Heron" => "Nycticorax nycticorax",
"Purple Heron" => "Ardea purpurea",
"White Stork" => "Ciconia ciconia",
"Spoonbill" => "Platalea leucorodia",
"Red-crested Pochard" => "Netta rufina",
"Common Eider" => "Somateria mollissima",
"Red Kite" => "Milvus milvus",
"Hen Harrier" => "Circus cyaneus",
"Montagu's Harrier" => "Circus pygargus",
"Black Grouse" => "Tetrao tetrix",
"Grey Partridge" => "Perdix perdix",
"Spotted Crake" => "Porzana porzana",
"Corncrake" => "Crex crex",
"Common Crane" => "Grus grus",
"Avocet" => "Recurvirostra avosetta",
"Stone Curlew" => "Burhinus oedicnemus",
"Common Ringed Plover" => "Charadrius hiaticula",
"Kentish Plover" => "Charadrius alexandrinus",
"Ruff" => "Philomachus pugnax",
"Common Snipe" => "Gallinago gallinago",
"Black-tailed Godwit" => "Limosa limosa",
"Common Redshank" => "Tringa totanus",
"Sandwich Tern" => "Sterna sandvicensis",
"Common Tern" => "Sterna hirundo",
"Arctic Tern" => "Sterna paradisaea",
"Little Tern" => "Sternula albifrons",
"Black Tern" => "Chlidonias niger",
"Barn Owl" => "Tyto alba",
"Little Owl" => "Athene noctua",
"Short-eared Owl" => "Asio flammeus",
"European Nightjar" => "Caprimulgus europaeus",
"Common Kingfisher" => "Alcedo atthis",
"Eurasian Hoopoe" => "Upupa epops",
"Eurasian Wryneck" => "Jynx torquilla",
"European Green Woodpecker" => "Picus viridis",
"Crested Lark" => "Galerida cristata",
"White-headed Duck" => "Oxyura leucocephala",
"Pale-bellied Brent Goose" => "Branta hrota",
"Tawny Pipit" => "Anthus campestris",
"Whinchat" => "Saxicola rubetra",
"European Stonechat" => "Saxicola rubicola",
"Northern Wheatear" => "Oenanthe oenanthe",
"Savi's Warbler" => "Locustella luscinioides",
"Sedge Warbler" => "Acrocephalus schoenobaenus",
"Great Reed Warbler" => "Acrocephalus arundinaceus",
"Bearded Reedling" => "Panurus biarmicus",
"Red-backed Shrike" => "Lanius collurio",
"Great Grey Shrike" => "Lanius excubitor",
"Woodchat Shrike" => "Lanius senator",
"Common Raven" => "Corvus corax",
"Yellowhammer" => "Emberiza citrinella",
"Ortolan Bunting" => "Emberiza hortulana",
"Corn Bunting" => "Emberiza calandra",
"Great Cormorant" => "Phalacrocorax carbo",
"Hawfinch" => "Coccothraustes coccothraustes",
"Common Shelduck" => "Tadorna tadorna",
"Bluethroat" => "Luscinia svecica",
"Grey Heron" => "Ardea cinerea",
"Barn Swallow" => "Hirundo rustica",
"Hooded Crow" => "Corvus cornix",
"Dunlin" => "Calidris alpina",
"Eurasian Pied Flycatcher" => "Ficedula hypoleuca",
"Eurasian Nuthatch" => "Sitta europaea",
"Short-toed Tree Creeper" => "Certhia brachydactyla",
"Wood Lark" => "Lullula arborea",
"Tree Pipit" => "Anthus trivialis",
"Eurasian Hobby" => "Falco subbuteo",
"Marsh Warbler" => "Acrocephalus palustris",
"Wood Sandpiper" => "Tringa glareola",
"Tawny Owl" => "Strix aluco",
"Lesser Whitethroat" => "Sylvia curruca",
"Barnacle Goose" => "Branta leucopsis",
"Common Goldeneye" => "Bucephala clangula",
"Western Marsh Harrier" => "Circus aeruginosus",
"Common Buzzard" => "Buteo buteo",
"Sanderling" => "Calidris alba",
"Little Gull" => "Larus minutus",
"Eurasian Magpie" => "Pica pica",
"Willow Warbler" => "Phylloscopus trochilus",
"Wood Warbler" => "Phylloscopus sibilatrix",
"Great Crested Grebe" => "Podiceps cristatus",
"Eurasian Jay" => "Garrulus glandarius",
"Common Redstart" => "Phoenicurus phoenicurus",
"Blue-headed Wagtail" => "Motacilla flava",
"Common Swift" => "Apus apus",
"Marsh Tit" => "Poecile palustris",
"Goldcrest" => "Regulus regulus",
"European Golden Plover" => "Pluvialis apricaria",
"Eurasian Bullfinch" => "Pyrrhula pyrrhula",
"Common Whitethroat" => "Sylvia communis",
"Meadow Pipit" => "Anthus pratensis",
"Greylag Goose" => "Anser anser",
"Spotted Flycatcher" => "Muscicapa striata",
"European Greenfinch" => "Carduelis chloris",
"Common Greenshank" => "Tringa nebularia",
"Great Spotted Woodpecker" => "Dendrocopos major",
"Greater Canada Goose" => "Branta canadensis",
"Mistle Thrush" => "Turdus viscivorus",
"Great Black-backed Gull" => "Larus marinus",
"Goosander" => "Mergus merganser",
"Great Egret" => "Casmerodius albus",
"Northern Goshawk" => "Accipiter gentilis",
"Dunnock" => "Prunella modularis",
"Stock Dove" => "Columba oenas",
"Common Wood Pigeon" => "Columba palumbus",
"Eurasian Woodcock" => "Scolopax rusticola",
"House Sparrow" => "Passer domesticus",
"Common House Martin" => "Delichon urbicum",
"Red Knot" => "Calidris canutus",
"Western Jackdaw" => "Corvus monedula",
"Brambling" => "Fringilla montifringilla",
"Northern Lapwing" => "Vanellus vanellus",
"European Reed Warbler" => "Acrocephalus scirpaceus",
"Lesser Black-backed Gull" => "Larus fuscus",
"Little Egret" => "Egretta garzetta",
"Little Stint" => "Calidris minuta",
"Common Linnet" => "Carduelis cannabina",
"Mute Swan" => "Cygnus olor",
"Common Cuckoo" => "Cuculus canorus",
"Black-headed Gull" => "Larus ridibundus",
"Greater White-fronted Goose" => "Anser albifrons",
"Great Tit" => "Parus major",
"Redwing" => "Turdus iliacus",
"Gadwall" => "Anas strepera",
"Fieldfare" => "Turdus pilaris",
"Tufted Duck" => "Aythya fuligula",
"Crested Tit" => "Lophophanes cristatus",
"Willow Tit" => "Poecile montanus",
"Eurasian Coot" => "Fulica atra",
"Common Blackbird" => "Turdus merula",
"Smew" => "Mergus albellus",
"Common Sandpiper" => "Actitis hypoleucos",
"Sand Martin" => "Riparia riparia",
"Purple Sandpiper" => "Calidris maritima",
"Northern Pintail" => "Anas acuta",
"Blue Tit" => "Cyanistes caeruleus",
"European Goldfinch" => "Carduelis carduelis",
"Eurasian Whimbrel" => "Numenius phaeopus",
"Common Reed Bunting" => "Emberiza schoeniclus",
"Eurasian Tree Sparrow" => "Passer montanus",
"Rook" => "Corvus frugilegus",
"European Robin" => "Erithacus rubecula",
"Bar-tailed Godwit" => "Limosa lapponica",
"Dark-bellied Brent Goose" => "Branta bernicla",
"Eurasian Oystercatcher" => "Haematopus ostralegus",
"Eurasian Siskin" => "Carduelis spinus",
"Northern Shoveler" => "Anas clypeata",
"Eurasian Wigeon" => "Anas penelope",
"Eurasian Sparrow Hawk" => "Accipiter nisus",
"Icterine Warbler" => "Hippolais icterina",
"Common Starling" => "Sturnus vulgaris",
"Long-tailed Tit" => "Aegithalos caudatus",
"Ruddy Turnstone" => "Arenaria interpres",
"Mew Gull" => "Larus canus",
"Common Pochard" => "Aythya ferina",
"Common Chiffchaff" => "Phylloscopus collybita",
"Greater Scaup" => "Aythya marila",
"Common Kestrel" => "Falco tinnunculus",
"Garden Warbler" => "Sylvia borin",
"Eurasian Collared Dove" => "Streptopelia decaocto",
"Eurasian Skylark" => "Alauda arvensis",
"Common Chaffinch" => "Fringilla coelebs",
"Common Moorhen" => "Gallinula chloropus",
"Water Pipit" => "Anthus spinoletta",
"Mallard" => "Anas platyrhynchos",
"Winter Wren" => "Troglodytes troglodytes",
"Common Teal" => "Anas crecca",
"Green Sandpiper" => "Tringa ochropus",
"White Wagtail" => "Motacilla alba",
"Eurasian Curlew" => "Numenius arquata",
"Song Thrush" => "Turdus philomelos",
"European Herring Gull" => "Larus argentatus",
"Grey Plover" => "Pluvialis squatarola",
"Carrion Crow" => "Corvus corone",
"Coal Tit" => "Periparus ater",
"Spotted Redshank" => "Tringa erythropus",
"Blackcap" => "Sylvia atricapilla",
"Egyptian Vulture" => "Neophron percnopterus",
"Razorbill" => "Alca torda",
"Alpine Swift" => "Apus melba",
"Long-legged Buzzard" => "Buteo rufinus",
"Audouin's Gull" => "Larus audouinii",
"Balearic Shearwater" => "Puffinus mauretanicus",
"Upland Sandpiper" => "Bartramia longicauda",
"Greater Spotted Eagle" => "Aquila clanga",
"Ring Ouzel" => "Turdus torquatus",
"Yellow-browed Warbler" => "Phylloscopus inornatus",
"Blue Rock Thrush" => "Monticola solitarius",
"Buff-breasted Sandpiper" => "Tryngites subruficollis",
"Jack Snipe" => "Lymnocryptes minimus",
"White-rumped Sandpiper" => "Calidris fuscicollis",
"Ruddy Shelduck" => "Tadorna ferruginea",
"Cetti's Warbler" => "Cettia cetti",
"Citrine Wagtail" => "Motacilla citreola",
"Roseate Tern" => "Sterna dougallii",
"Black-legged Kittiwake" => "Rissa tridactyla",
"Pygmy Cormorant" => "Phalacrocorax pygmeus",
"Booted Eagle" => "Aquila pennata",
"Lesser White-fronted Goose" => "Anser erythropus",
"Little Bunting" => "Emberiza pusilla",
"Eleonora's Falcon" => "Falco eleonorae",
"European Serin" => "Serinus serinus",
"Twite" => "Carduelis flavirostris",
"Yellow-legged Gull" => "Larus michahellis",
"Gyr Falcon" => "Falco rusticolus",
"Greenish Warbler" => "Phylloscopus trochiloides",
"Red-necked Phalarope" => "Phalaropus lobatus",
"Mealy Redpoll" => "Carduelis flammea",
"Glaucous Gull" => "Larus hyperboreus",
"Great Skua" => "Stercorarius skua",
"Great Bustard" => "Otis tarda",
"Velvet Scoter" => "Melanitta fusca",
"Pine Grosbeak" => "Pinicola enucleator",
"House Crow" => "Corvus splendens",
"Hume's Leaf Warbler" => "Phylloscopus humei",
"Great Northern Loon" => "Gavia immer",
"Long-tailed Duck" => "Clangula hyemalis",
"Lapland Longspur" => "Calcarius lapponicus",
"Northern Gannet" => "Morus bassanus",
"Eastern Imperial Eagle" => "Aquila heliaca",
"Little Auk" => "Alle alle",
"Lesser Spotted Woodpecker" => "Dendrocopos minor",
"Iceland Gull" => "Larus glaucoides",
"Parasitic Jaeger" => "Stercorarius parasiticus",
"Bewick's Swan" => "Cygnus bewickii",
"Little Bustard" => "Tetrax tetrax",
"Little Crake" => "Porzana parva",
"Baillon's Crake" => "Porzana pusilla",
"Long-tailed Jaeger" => "Stercorarius longicaudus",
"King Eider" => "Somateria spectabilis",
"Greater Short-toed Lark" => "Calandrella brachydactyla",
"Houbara Bustard" => "Chlamydotis undulata",
"Curlew Sandpiper" => "Calidris ferruginea",
"Common Crossbill" => "Loxia curvirostra",
"European Shag" => "Phalacrocorax aristotelis",
"Horned Grebe" => "Podiceps auritus",
"Common Quail" => "Coturnix coturnix",
"Bearded Vulture" => "Gypaetus barbatus",
"Lanner Falcon" => "Falco biarmicus",
"Middle Spotted Woodpecker" => "Dendrocopos medius",
"Pomarine Jaeger" => "Stercorarius pomarinus",
"Red-breasted Merganser" => "Mergus serrator",
"Eurasian Black Vulture" => "Aegypius monachus",
"Eurasian Dotterel" => "Charadrius morinellus",
"Common Nightingale" => "Luscinia megarhynchos",
"Northern willow warbler" => "Phylloscopus trochilus acredula",
"Manx Shearwater" => "Puffinus puffinus",
"Northern Fulmar" => "Fulmarus glacialis",
"Eurasian Eagle Owl" => "Bubo bubo",
"Orphean Warbler" => "Sylvia hortensis",
"Melodious Warbler" => "Hippolais polyglotta",
"Pallas's Leaf Warbler" => "Phylloscopus proregulus",
"Atlantic Puffin" => "Fratercula arctica",
"Black-throated Loon" => "Gavia arctica",
"Bohemian Waxwing" => "Bombycilla garrulus",
"Marsh Sandpiper" => "Tringa stagnatilis",
"Great Snipe" => "Gallinago media",
"Squacco Heron" => "Ardeola ralloides",
"Long-eared Owl" => "Asio otus",
"Caspian Tern" => "Hydroprogne caspia",
"Red-breasted Goose" => "Branta ruficollis",
"Red-throated Loon" => "Gavia stellata",
"Common Rosefinch" => "Carpodacus erythrinus",
"Red-footed Falcon" => "Falco vespertinus",
"Ross's Goose" => "Anser rossii",
"Red Phalarope" => "Phalaropus fulicarius",
"Pied Wagtail" => "Motacilla yarrellii",
"Rose-coloured Starling" => "Sturnus roseus",
"Rough-legged Buzzard" => "Buteo lagopus",
"Saker Falcon" => "Falco cherrug",
"European Roller" => "Coracias garrulus",
"Short-toed Eagle" => "Circaetus gallicus",
"Peregrine Falcon" => "Falco peregrinus",
"Merlin" => "Falco columbarius",
"Snow Goose" => "Anser caerulescens",
"Snowy Owl" => "Bubo scandiacus",
"Snow Bunting" => "Plectrophenax nivalis",
"Common Grasshopper Warbler" => "Locustella naevia",
"Golden Eagle" => "Aquila chrysaetos",
"Black-winged Stilt" => "Himantopus himantopus",
"Steppe Eagle" => "Aquila nipalensis",
"Pallid Harrier" => "Circus macrourus",
"European Storm-petrel" => "Hydrobates pelagicus",
"Horned Lark" => "Eremophila alpestris",
"Eurasian Treecreeper" => "Certhia familiaris",
"Taiga Bean Goose" => "Anser fabalis",
"Temminck's Stint" => "Calidris temminckii",
"Terek Sandpiper" => "Xenus cinereus",
"Tundra Bean Goose" => "Anser serrirostris",
"European Turtle Dove" => "Streptopelia turtur",
"Leach's Storm-petrel" => "Oceanodroma leucorhoa",
"Eurasian Griffon Vulture" => "Gyps fulvus",
"Paddyfield Warbler" => "Acrocephalus agricola",
"Osprey" => "Pandion haliaetus",
"Firecrest" => "Regulus ignicapilla",
"Water Rail" => "Rallus aquaticus",
"European Honey Buzzard" => "Pernis apivorus",
"Eurasian Golden Oriole" => "Oriolus oriolus",
"Whooper Swan" => "Cygnus cygnus",
"Two-barred Crossbill" => "Loxia leucoptera",
"White-tailed Eagle" => "Haliaeetus albicilla",
"Atlantic Murre" => "Uria aalge",
"Garganey" => "Anas querquedula",
"Black Redstart" => "Phoenicurus ochruros",
"Common Scoter" => "Melanitta nigra",
"Rock Pipit" => "Anthus petrosus",
"Lesser Spotted Eagle" => "Aquila pomarina",
"Cattle Egret" => "Bubulcus ibis",
"White-winged Black Tern" => "Chlidonias leucopterus",
"Black Stork" => "Ciconia nigra",
"Mediterranean Gull" => "Larus melanocephalus",
"Black Kite" => "Milvus migrans",
"Yellow Wagtail" => "Motacilla flavissima",
"Red-necked Grebe" => "Podiceps grisegena",
"Gull-billed Tern" => "Gelochelidon nilotica",
"Pectoral Sandpiper" => "Calidris melanotos",
"Barred Warbler" => "Sylvia nisoria",
"Red-throated Pipit" => "Anthus cervinus",
"Grey Wagtail" => "Motacilla cinerea",
"Richard's Pipit" => "Anthus richardi",
"Black Woodpecker" => "Dryocopus martius",
"Little Ringed Plover" => "Charadrius dubius",
"Whiskered Tern" => "Chlidonias hybrida",
"Lesser Redpoll" => "Carduelis cabaret",
"Pallas's Bunting" => "Emberiza pallasi",
"Ferruginous Duck" => "Aythya nyroca",
"Whistling Swan" => "Cygnus columbianus",
"Black Brant" => "Branta nigricans",
"Marbled Teal" => "Marmaronetta angustirostris",
"Canvasback" => "Aythya valisineria",
"Redhead" => "Aythya americana",
"Lesser Scaup" => "Aythya affinis",
"Steller's Eider" => "Polysticta stelleri",
"Spectacled Eider" => "Somateria fischeri",
"Harlequin Duck" => "Histronicus histrionicus",
"Black Scoter" => "Melanitta americana",
"Surf Scoter" => "Melanitta perspicillata",
"Barrow's Goldeneye" => "Bucephala islandica",
"Falcated Duck" => "Anas falcata",
"American Wigeon" => "Anas americana",
"Blue-winged Teal" => "Anas discors",
"American Black Duck" => "Anas rubripes",
"Baikal Teal" => "Anas formosa",
"Green-Winged Teal" => "Anas carolinensis",
"Hazel Grouse" => "Bonasa bonasia",
"Rock Partridge" => "Alectoris graeca",
"Red-legged Partridge" => "Alectoris rufa",
"Yellow-billed Loon" => "Gavia adamsii",
"Cory's Shearwater" => "Calonectris borealis",
"Madeiran Storm-Petrel" => "Oceanodroma castro",
"Great White Pelican" => "Pelecanus onocrotalus",
"Dalmatian Pelican" => "Pelecanus crispus",
"American Bittern" => "Botaurus lentiginosus",
"Glossy Ibis" => "Plegadis falcinellus",
"Spanish Imperial Eagle" => "Aquila adalberti",
"Lesser Kestrel" => "Falco naumanni",
"Houbara Bustard" => "Chlamydotis undulata",
"Crab-Plover" => "Dromas ardeola",
"Cream-coloured Courser" => "Cursorius cursor",
"Collared Pratincole" => "Glareola pratincola",
"Black-winged Pratincole" => "Glareola nordmanni",
"Killdeer" => "Charadrius vociferus",
"Lesser Sand Plover" => "Charadrius mongolus",
"Greater Sand Plover" => "Charadrius leschenaultii",
"Caspian Plover" => "Charadrius asiaticus",
"American Golden Plover" => "Pluvialis dominica",
"Pacific Golden Plover" => "Pluvialis fulva",
"Sharp-tailed Sandpiper" => "Calidris acuminata",
"Broad-billed Sandpiper" => "Limicola falcinellus",
"Spoon-Billed Sandpiper" => "Eurynorhynchus pygmaeus",
"Short-Billed Dowitcher" => "Limnodromus griseus",
"Long-billed Dowitcher" => "Limnodromus scolopaceus",
"Hudsonian Godwit" => "Limosa haemastica",
"Little Curlew" => "Numenius minutus",
"Lesser Yellowlegs" => "Tringa flavipes",
"Wilson's Phalarope" => "Phalaropus tricolor",
"Pallas's Gull" => "Larus ichthyaetus",
"Laughing Gull" => "Larus atricilla",
"Franklin's Gull" => "Larus pipixcan",
"Bonaparte's Gull" => "Larus philadelphia",
"Ring-billed Gull" => "Larus delawarensis",
"American Herring Gull" => "Larus smithsonianus",
"Caspian Gull" => "Larus cachinnans",
"Ivory Gull" => "Pagophila eburnea",
"Royal Tern" => "Sterna maxima",
"Br¸nnich's Murre" => "Uria lomvia",
"Crested Auklet" => "Aethia cristatella",
"Parakeet Auklet" => "Cyclorrhynchus psittacula",
"Tufted Puffin" => "Lunda cirrhata",
"Laughing Dove" => "Streptopelia senegalensis",
"Great Spotted Cuckoo" => "Clamator glandarius",
"Great Grey Owl" => "Strix nebulosa",
"Tengmalm's Owl" => "Aegolius funereus",
"Red-Necked Nightjar" => "Caprimulgus ruficollis",
"Chimney Swift" => "Chaetura pelagica",
"Green Bea-Eater" => "Merops orientalis",
"Grey-headed Woodpecker" => "Picus canus",
"Lesser Short-Toed Lark" => "Calandrella rufescens",
"Eurasian Crag Martin" => "Hirundo rupestris",
"Red-rumped Swallow" => "Cecropis daurica",
"Blyth's Pipit" => "Anthus godlewskii",
"Pechora Pipit" => "Anthus gustavi",
"Grey-headed Wagtail" => "Motacilla thunbergi",
"Yellow-Headed Wagtail" => "Motacilla lutea",
"White-throated Dipper" => "Cinclus cinclus",
"Rufous-Tailed Scrub Robin" => "Cercotrichas galactotes",
"Thrush Nightingale" => "Luscinia luscinia",
"White-throated Robin" => "Irania gutturalis",
"Caspian Stonechat" => "Saxicola maura variegata",
"Western Black-eared Wheatear" => "Oenanthe hispanica",
"Rufous-tailed Rock Thrush" => "Monticola saxatilis",
"Red-throated Thrush/Black-throated" => "Turdus ruficollis",
"American Robin" => "Turdus migratorius",
"Zitting Cisticola" => "Cisticola juncidis",
"Lanceolated Warbler" => "Locustella lanceolata",
"River Warbler" => "Locustella fluviatilis",
"Blyth's Reed Warbler" => "Acrocephalus dumetorum",
"Caspian Reed Warbler" => "Acrocephalus fuscus",
"Aquatic Warbler" => "Acrocephalus paludicola",
"Booted Warbler" => "Acrocephalus caligatus",
"Marmora's Warbler" => "Sylvia sarda",
"Dartford Warbler" => "Sylvia undata",
"Subalpine Warbler" => "Sylvia cantillans",
"MÈnÈtries's Warbler" => "Sylvia mystacea",
"R¸ppel's Warbler" => "Sylvia rueppelli",
"Asian Desert Warbler" => "Sylvia nana",
"Western Orphean Warbler" => "Sylvia hortensis hortensis",
"Arctic Warbler" => "Phylloscopus borealis",
"Radde's Warbler" => "Phylloscopus schwarzi",
"Western Bonelli's Warbler" => "Phylloscopus bonelli",
"Red-breasted Flycatcher" => "Ficedula parva",
"Eurasian Penduline Tit" => "Remiz pendulinus",
"Daurian Shrike" => "Lanius isabellinus",
"Long-Tailed Shrike" => "Lanius schach",
"Lesser Grey Shrike" => "Lanius minor",
"Southern Grey Shrike" => "Lanius meridionalis",
"Masked Shrike" => "Lanius nubicus",
"Spotted Nutcracker" => "Nucifraga caryocatactes",
"Daurian Jackdaw" => "Corvus dauuricus",
"Purple-Backed Starling" => "Sturnus sturninus",
"Red-Fronted Serin" => "Serinus pusillus",
"Arctic Redpoll" => "Carduelis hornemanni",
"Scottish Crossbill" => "Loxia scotica",
"Parrot Crossbill" => "Loxia pytyopsittacus",
"Black-faced Bunting" => "Emberiza spodocephala",
"Pink-footed Goose" => "Anser brachyrhynchus",
"Black-winged Kite" => "Elanus caeruleus",
"European Bee-eater" => "Merops apiaster",
"Sabine's Gull" => "Larus sabini",
"Sooty Shearwater" => "Puffinus griseus",
"Lesser Canada Goose" => "Branta hutchinsii",
"Ring-necked Duck" => "Aythya collaris",
"Greater Flamingo" => "Phoenicopterus roseus",
"Iberian Chiffchaff" => "Phylloscopus ibericus",
"Ashy-headed Wagtail" => "Motacilla cinereocapilla",
"Stilt Sandpiper" => "Calidris himantopus",
"Siberian Stonechat" => "Saxicola maurus",
"Greater Yellowlegs" => "Tringa melanoleuca",
"Forster's Tern" => "Sterna forsteri",
"Dusky Warbler" => "Phylloscopus fuscatus",
"Cirl Bunting" => "Emberiza cirlus",
"Olive-backed Pipit" => "Anthus hodgsoni",
"Sociable Lapwing" => "Vanellus gregarius",
"Spotted Sandpiper" => "Actitis macularius",
"Baird's Sandpiper" => "Calidris bairdii",
"Rustic Bunting" => "Emberiza rustica",
"Yellow-browed Bunting" => "Emberiza chrysophrys",
"Great Shearwater" => "Puffinus gravis",
"Bonelli's Eagle" => "Aquila fasciata",
"Calandra Lark" => "Melanocorypha calandra",
"Sardinian Warbler" => "Sylvia melanocephala",
"Ross's Gull" => "Larus roseus",
"Yellow-Breasted Bunting" => "Emberiza aureola",
"Pine Bunting" => "Emberiza leucocephalos",
"Black Guillemot" => "Cepphus grylle",
"Pied-billed Grebe" => "Podilymbus podiceps",
"Soft-plumaged Petrel" => "Pterodroma mollis",
"Bulwer's Petrel" => "Bulweria bulwerii",
"White-Faced Storm-Petrel" => "Pelagodroma marina",
"Pallas's Fish Eagle" => "Haliaeetus leucoryphus",
"Sandhill Crane" => "Grus canadensis",
"Macqueenís Bustard" => "Chlamydotis macqueenii",
"White-tailed Lapwing" => "Vanellus leucurus",
"Great Knot" => "Calidris tenuirostris",
"Semipalmated Sandpiper" => "Calidris pusilla",
"Red-necked Stint" => "Calidris ruficollis",
"Slender-billed Curlew" => "Numenius tenuirostris",
"Bridled Tern" => "Onychoprion anaethetus",
"Pallas's Sandgrouse" => "Syrrhaptes paradoxus",
"European Scops Owl" => "Otus scops",
"Northern Hawk Owl" => "Surnia ulula",
"White-Throated Needletail" => "Hirundapus caudacutus",
"Belted Kingfisher" => "Ceryle alcyon",
"Blue-cheeked Bee-eater" => "Merops persicus",
"Black-headed Wagtail" => "Motacilla feldegg",
"Northern Mockingbird" => "Mimus polyglottos",
"Alpine Accentor" => "Prunella collaris",
"Red-flanked Bluetail" => "Tarsiger cyanurus",
"Isabelline Wheatear" => "Oenanthe isabellina",
"Pied Wheatear" => "Oenanthe pleschanka",
"Eastern Black-eared Wheatear" => "Oenanthe melanoleuca",
"Desert Wheatear" => "Oenanthe deserti",
"White's Thrush" => "Zoothera aurea",
"Siberian Thrush" => "Zoothera sibirica",
"Eyebrowed Thrush" => "Turdus obscurus",
"Dusky Thrush" => "Turdus eunomus",
"Black-throated Thrush" => "Turdus atrogularis",
"Pallas's Grasshopper Warbler" => "Locustella certhiola",
"Spectacled Warbler" => "Sylvia conspicillata",
"Two-barred Warbler" => "Phylloscopus plumbeitarsus",
"Eastern Bonelli's Warbler" => "Phylloscopus orientalis",
"Collared Flycatcher" => "Ficedula albicollis",
"Wallcreeper" => "Tichodroma muraria",
"Turkestan Shrike" => "Lanius phoenicuroides",
"Steppe Grey Shrike" => "Lanius pallidirostris",
"Spanish Sparrow" => "Passer hispaniolensis",
"Red-eyed Vireo" => "Vireo olivaceus",
"Myrtle Warbler" => "Dendroica coronata",
"White-crowned Sparrow" => "Zonotrichia leucophrys",
"White-throated Sparrow" => "Zonotrichia albicollis",
"Cretzschmar's Bunting" => "Emberiza caesia",
"Chestnut Bunting" => "Emberiza rutila",
"Red-headed Bunting" => "Emberiza bruniceps",
"Black-headed Bunting" => "Emberiza melanocephala",
"Indigo Bunting" => "Passerina cyanea",
"Balearic Woodchat Shrike" => "Lanius senator badius",
"Demoiselle Crane" => "Grus virgo",
"Chough" => "Pyrrhocorax pyrrhocorax",
"Red-Billed Chough" => "Pyrrhocorax graculus",
"Elegant Tern" => "Sterna elegans",
"Chukar" => "Alectoris chukar",
"Yellow-Billed Cuckoo" => "Coccyzus americanus",
"American Sandwich Tern" => "Sterna sandvicensis acuflavida",
"Olive-Tree Warbler" => "Hippolais olivetorum",
"Eastern Olivaceous Warbler" => "Acrocephalus pallidus",
"Indian Cormorant" => "Phalacrocorax fuscicollis",
"Spur-Winged Lapwing" => "Vanellus spinosus",
"Yelkouan Shearwater" => "Puffinus yelkouan",
"Trumpeter Finch" => "Bucanetes githagineus",
"Red Grouse" => "Lagopus scoticus",
"Rock Ptarmigan" => "Lagopus mutus",
"Long-Tailed Cormorant" => "Phalacrocorax africanus",
"Double-crested Cormorant" => "Phalacrocorax auritus",
"Magnificent Frigatebird" => "Fregata magnificens",
"Naumann's Thrush" => "Turdus naumanni",
"Oriental Pratincole" => "Glareola maldivarum",
"Bufflehead" => "Bucephala albeola",
"Snowfinch" => "Montifrigilla nivalis",
"Ural owl" => "Strix uralensis",
"Spanish Wagtail" => "Motacilla iberiae",
"Song Sparrow" => "Melospiza melodia",
"Rock Bunting" => "Emberiza cia",
"Siberian Rubythroat" => "Luscinia calliope",
"Pallid Swift" => "Apus pallidus",
"Eurasian Pygmy Owl" => "Glaucidium passerinum",
"Madeira Little Shearwater" => "Puffinus baroli",
"House Finch" => "Carpodacus mexicanus",
"Green Heron" => "Butorides virescens",
"Solitary Sandpiper" => "Tringa solitaria",
"Heuglin's Gull" => "Larus heuglini"
);
| PHP |
<?php
require_once('include/header.php');
require_once('dao/ImagenesDAO.php');
require_once('logic/ImagenesLogic.php');
require_once('search/ImagenesSearchCriteria.php');
$logic = new ImagenesLogic($_POST);
// obtener action
$action = $_GET['action'];
if ($action == null){
$action = $_POST['action'];
}
// obtengo ID del registro
$iditem = $_GET[iditem];
if ($iditem == "")
$iditem = $_POST[iditem];
// obtengo table
$table = $_GET[t];
if ($table == "")
$table = $_POST[t];
switch ($action) {
case "add":
$result = $logic->save($_POST, $_FILES);
if ($result == 'error') {
$result = "error";
} else {
$result = "ok";
}
header( 'Location: imagenes.php?iditem=' . $iditem . '&t=' . $table );
break;
case "update":
$result = $logic->update($_POST);
if ($result == 'error') {
$result = "error";
} else {
$result = "ok";
}
header( 'Location: imagenes.php?iditem=' . $iditem . '&t=' . $table );
break;
case "delete":
$result = $logic->delete($_POST);
if ($result == 'error'){$smarty->assign('error', "Error al borrar la imagen");}
header( 'Location: imagenes.php?iditem=' . $iditem . '&t=' . $table );
break;
}
// obtengo todas las imagenes
$imageSearchCriteria = new ImagenesSearchCriteria();
$imageSearchCriteria->setIditem($iditem);
$imageSearchCriteria->setTable($table);
$images = $logic->find($imageSearchCriteria);
$entidad = $logic->getEntidad($table, $iditem);
$smarty->assign('iditem',$iditem);
$smarty->assign('t',$table);
$smarty->assign('images',$images);
$smarty->assign('entidad',$entidad);
$smarty->assign("detailPage", "imagenes.tpl");
$smarty->display("admin_generic.tpl");
| PHP |
<?php
require_once('search/SearchCriteria.php');
Class ImageSearchCriteria extends SearchCriteria{
private $idItem;
private $fecha;
private $table;
function getIdItem() { return $this->idItem; }
function getFecha() { return $this->fecha; }
function getTable() { return $this->table; }
function setIdItem($x) { $this->idItem = $x; }
function setFecha($x) { $this->fecha = $x; }
function setTable($x) { $this->table = $x; }
}
?> | PHP |
<?php
require_once('search/SearchCriteria.php');
Class AvisosSearchCriteria extends SearchCriteria{
private $fecha = null;
private $search = null;
public function getFecha(){
return $this->fecha;
}
public function setFecha($fecha){
$this->fecha = $fecha;
}
public function getSearch(){
return $this->search;
}
public function setSearch($search){
$this->search = $search;
}
}
?> | PHP |
<?php
Class SearchCriteria{
private $id;
private $inicio = 1;
private $fin;
private $activo;
private $borrado = 0;
private $orderby;
private $order;
function getId(){
return $this->id;
}
function setId($id){
$this->id = $id;
}
function getInicio(){
return $this->inicio;
}
function setInicio($inicio){
$this->inicio = $inicio;
}
function getFin(){
return $this->fin;
}
function setFin($fin){
$this->fin = $fin;
}
function getActivo(){
return $this->activo;
}
function setActivo($activo){
$this->activo = $activo;
}
function getBorrado(){
if ($this->borrado == null || $this->borrado == "" ){
return 0;
}
return $this->borrado;
}
function setBorrado($borrado){
$this->borrado = $borrado;
}
function getOrderby(){
return $this->orderby;
}
function setOrderby($orderby){
$this->orderby = $orderby;
}
function getOrder(){
return $this->order;
}
function setOrder($order){
$this->order = $order;
}
}
?> | PHP |
<?php
require_once('search/SearchCriteria.php');
require_once('plugin/UtilsPlugin.php');
class NoticiasSearchCriteria extends SearchCriteria {
private $titulo = null;
private $tags = null;
private $fechaFrom = null;
private $fechaTo = null;
private $categoria = null;
private $seccion = null;
private $orden = null;
private $visitas = null;
public function getTitulo(){
return $this->titulo;
}
public function setTitulo($titulo){
$this->titulo = $titulo;
}
public function getTags(){
return $this->tags;
}
public function setTags($tags){
$this->tags = $tags;
}
public function getFechaFrom(){
return $this->fechaFrom;
}
public function setFechaFrom($fechaFrom){
$this->fechaFrom = Utils::getDateForDB($fechaFrom);
}
public function getFechaTo(){
return $this->fechaTo;
}
public function setFechaTo($fechaTo){
$this->fechaTo = Utils::getDateForDB($fechaTo);
}
public function getCategoria(){
return $this->categoria;
}
public function setCategoria($categoria){
$this->categoria = $categoria;
}
public function getSeccion(){
return $this->seccion;
}
public function setSeccion($seccion){
$this->seccion = $seccion;
}
public function getOrden(){
return $this->orden;
}
public function setOrden($seccion){
$this->order = $orden;
}
public function getVisitas(){
return $this->visitas;
}
public function setVisitas($visitas){
$this->visitas = $visitas;
}
}
?> | PHP |
<?php
require_once('search/SearchCriteria.php');
Class ClientesSearchCriteria extends SearchCriteria{
private $nombre = null;
private $ciudad = null;
private $active = null;
private $fecha = null;
private $search = null;
public function getNombre(){
return $this->nombre;
}
public function setNombre($nombre){
$this->nombre = $nombre;
}
public function getCiudad(){
return $this->ciudad;
}
public function setCiudad($ciudad){
$this->ciudad = $ciudad;
}
public function getActive(){
return $this->active;
}
public function setActive($active){
$this->active = $active;
}
public function getFecha(){
return $this->fecha;
}
public function setFecha($fecha){
$this->fecha = $fecha;
}
public function getSearch(){
return $this->search;
}
public function setSearch($search){
$this->search = $search;
}
}
| PHP |
<?php
require_once('search/SearchCriteria.php');
Class UsuarioSearchCriteria extends SearchCriteria{
private $username = null;
private $rol = null;
public function getUsername(){
return $this->username;
}
public function setUsername($username){
$this->username = $username;
}
public function getRol(){
return $this->rol;
}
public function setRol($rol){
$this->rol = $rol;
}
}
?> | PHP |
<?php
require_once('search/SearchCriteria.php');
Class ImagenesSearchCriteria extends SearchCriteria{
private $idItem;
private $fecha;
private $table;
function getIdItem() { return $this->idItem; }
function getFecha() { return $this->fecha; }
function getTable() { return $this->table; }
function setIdItem($x) { $this->idItem = $x; }
function setFecha($x) { $this->fecha = $x; }
function setTable($x) { $this->table = $x; }
}
?> | PHP |
<?php
require_once('search/SearchCriteria.php');
Class ContenidoSearchCriteria extends SearchCriteria{
private $search = null;
private $titulo = null;
public function getTitulo(){
return $this->titulo;
}
public function setTitulo($titulo){
$this->titulo = $titulo;
}
public function getSearch(){
return $this->search;
}
public function setSearch($search){
$this->search = $search;
}
}
| PHP |
<?php
require_once('search/SearchCriteria.php');
Class ContactoSearchCriteria extends SearchCriteria{
private $empresa = null;
private $nombre = null;
public function getEmpresa(){
return $this->empresa;
}
public function setEmpresa($empresa){
$this->empresa = $empresa;
}
public function getNombre(){
return $this->nombre;
}
public function setNombre($nombre){
$this->nombre = $nombre;
}
}
| PHP |
<?php
require_once('include/header.php');
require_once('vo/ContenidoVO.php');
require_once('search/ContenidoSearchCriteria.php');
require_once('logic/ContenidoLogic.php');
require_once('logic/ImagenesLogic.php');
require('conf/configuration.php');
$logic = new ContenidoLogic($_POST);
$imagenesLogic = new ImagenesLogic($_POST);
// Ordenamiento
if($_GET[order] == "asc")
$order= "desc";
else if($_GET[order] == "desc")
$order= "asc";
else
$order= "desc";
if (!isset($_GET["orderby"]))
$orderby = "Id";
else
$orderby = $_GET["orderby"];
$smarty->assign("orderby", $orderby);
$smarty->assign("order", $order);
// Seteo el searchcriteria para mostrar la tabla con todos los resultados segun el filtro. (sin paginacion)
$contenidoSearchCriteria = new ContenidoSearchCriteria();
$contenidoSearchCriteria->setOrderby($orderby);
$contenidoSearchCriteria->setOrder($order);
$contenidoSearchCriteria->setSearch($_GET["search"]);
$contenidoSearchCriteria->setInicio(1);
$contenidoSearchCriteria->setFin(null);
// Controller
$action = $_GET["action"];
if ($action == null){
$action = $_POST["action"];
}
switch ($action){
case "save":
$result = $logic->save($_POST);
if ($result == "error")
$smarty->assign("error", "Ha ocurrido un error al guardar los cambios del Registro de Contenido");
else
$smarty->assign("message", "El Registro de Contenidoha sido actualizado");
break;
case "add":
$smarty->assign("detailPage","contenidoForm.tpl");
$smarty->display("admin_generic.tpl");
exit;break;
case "update":
$id = $_GET["id"];
if ($id != null){
$contenido = $logic->get($id);
$smarty->assign("contenido", $contenido);
}
$smarty->assign("detailPage","contenidoForm.tpl");
$smarty->display("admin_generic.tpl");
exit;break;
case "detail":
$id = $_GET["id"];
if ($id != null){
$contenido = $logic->get($id);
$smarty->assign("contenido", $contenido);
}
// obtengo todas las imagenes
$imageSearchCriteria = new ImagenesSearchCriteria();
$imageSearchCriteria->setIditem($id);
$imageSearchCriteria->setTable('contenido');
$images = $imagenesLogic->find($imageSearchCriteria);
$smarty->assign('images',$images);
$smarty->assign('t','contenido');
$smarty->assign("detailPage","contenidoDetail.tpl");
$smarty->display("admin_generic.tpl");
exit;
break;
case "delete":
$result = $logic->delete($_POST["id"]);
if ($result == "error")
$smarty->assign("error", "Ha ocurrido un error al eliminar el Registro de ");
else
$smarty->assign("message", "Se ha eliminado el Registro de ");
break;
}
// Paginador
$cantidad = $logic->count($contenidoSearchCriteria);
$totalItemsPerPage=10;
if (isset($_GET["entradas"]))
$totalItemsPerPage=$_GET["entradas"];
$totalPages = ceil($cantidad / $totalItemsPerPage);
$smarty->assign("totalPages", $totalPages);
$smarty->assign("totalItemsPerPage", $totalItemsPerPage);
$page = $_GET[page];
if (!$page) {
$start = 0;
$page = 1;
$smarty->assign("page", $page);
}
else
$start = ($page - 1) * $totalItemsPerPage;
$smarty->assign("page", $page);
// Obtengo solo los registros de la pagina actual.
$contenidoSearchCriteria->setInicio($start);
$contenidoSearchCriteria->setOrderby($orderby);
$contenidoSearchCriteria->setOrder($order);
$contenidoSearchCriteria->setFin($totalItemsPerPage);
$contenido = $logic->find($contenidoSearchCriteria);
$smarty->assign("allParams", CommonPlugin::getParamsAsString($_GET));
$smarty->assign("cantidad", $cantidad);
$smarty->assign("contenido", $contenido);
$smarty->assign("search", $_GET["search"]);
$smarty->assign("detailPage", "contenido.tpl");
$smarty->display("admin_generic.tpl");
?> | PHP |
<?php
// Include
include_once('plugin/LoginPlugin.php');
// Chequea si el usuario ya esta logueado
if (LoginPlugin::isLogged()) {
LoginPlugin::logout();
}
header( 'Location: index.php' );
exit; | PHP |
<?php
include_once('plugin/LoginPlugin.php');
include_once('plugin/AppConfigPlugin.php');
include_once('plugin/CommonPlugin.php');
$rol = LoginPlugin::getRol();
$menuItems = AppConfigPlugin::getMenuItems($rol);
$scriptPhp = $menuItems[0][script];
header('Location: contenido.php');
?> | PHP |
PHP-Code-Large
PHP-Code-Large is a large-scale corpus of PHP source code comprising more than 12 million lines of PHP code. The dataset is designed to support research in large language model (LLM) pretraining, code intelligence, software engineering automation, and static program analysis for the PHP ecosystem.
By providing a high-volume, language-specific corpus, PHP-Code-Large enables systematic experimentation in PHP-focused model training, domain adaptation, and downstream code understanding tasks.
PHP-Code-Large addresses the need for a dedicated PHP-only dataset at substantial scale, enabling focused research across backend systems, CMS platforms, APIs, and full-stack PHP environments.
1. Dataset Composition
Programming Language: PHP Total Size: 12M+ lines of PHP code File Format: .jsonl Primary Content: PHP source code files
Each JSONL entry contains structured information about a single PHP code.
Content Types
The dataset includes a wide variety of PHP constructs and paradigms, such as:
Functions (declarations, anonymous functions, arrow functions)
Object-Oriented Programming (classes, traits, interfaces)
Namespaces and autoloading patterns
Composer-based dependency structures
MVC architecture patterns
REST API implementations
Database interaction (PDO, MySQLi)
Form handling and validation
Session and cookie management
Middleware patterns
Error and exception handling
Legacy PHP (5.x style) and modern PHP (7.x / 8.x) features
Type declarations and strict typing
Templating integrations
Security-related patterns (sanitization, hashing, authentication logic)
PHPDoc comments
CMS and framework-style architecture patterns
2. Intended Research Applications
2.1 Pretraining
Training PHP code foundation models from scratch
Continued pretraining of existing LLMs
PHP-specialized language modeling
Tokenizer training for PHP ecosystems
Domain adaptation for backend-focused models
2.2 Fine-Tuning and Adaptation
Code completion systems
Intelligent IDE assistants
Automated refactoring tools
Conversational programming agents
PHP-specific copilots
Framework-aware coding assistants
2.3 Code Intelligence Tasks
Code summarization
Code-to-text generation
Documentation generation
Bug detection
Security vulnerability detection
Clone detection
Code similarity modeling
Dead code detection
Static and structural analysis
Legacy-to-modern PHP migration modeling
2.4 Software Engineering Research
Empirical studies of PHP coding patterns
Analysis of backend architecture styles
Framework usage studies
Dependency and autoloading modeling
AST-based experimentation
Cross-version PHP evolution analysis
Security practice analysis in web applications
3. Ecosystem Coverage
PHP-Code-Large spans a broad range of PHP application domains, including:
Backend web applications
RESTful APIs
CMS-based architectures
E-commerce platforms
CLI tools
Microservices
Full-stack PHP projects
The dataset captures both legacy monolithic architectures.
Thanks to open source community for all the guidance & support!!
- Downloads last month
- 29