Category Archives: URL Management

GentleSource Short URL allows PHP Scripts

GentleSource Short URL allows you to have a URL shortening service under your own domain. The script can create shorter URLs to be used in e-mails or on microblogging platforms. As a site owner, you can use the script for managing downloads, masking URLs, and keeping track of how many times a link has been clicked.Visitors can enter a URL and create a short URL that redirects to the original URL,Visitors can enter an individual ID instead of the randomly created string,Spam and phishing protection,Direct redirect, meta refresh redirect with delay, or top bar frame,Simple API to let third party tools create short URLs,Captcha (optional),Bookmarklet to create short URLs with one click,Twitter bookmarklet that redirects the short URL directly to Twitter, URL length statistics: tells you how long the URL was before the shortening and how long it is after.

 

<?php

/**
* GentleSource - Comment Script
*
* (C) Ralf Stadtaus http://www.gentlesource.com/
*/



define('C5T_ROOT', '../');


// Settings
$c5t_detail_template                = 'admin_comment_list.tpl.html';
$message                            = array();

define('C5T_ALTERNATIVE_TEMPLATE', 'admin');
define('C5T_LOGIN_LEVEL', 1);


// Include
require C5T_ROOT . 'include/core.inc.php';


// Handle and validate form
require_once 'HTML/QuickForm.php';


// Start form handler
$identifier_form = new HTML_QuickForm('commentlist', 'POST');

$identifier_form->setDefaults(array('do' => 'rename'));


// Get form configuration
require 'identifier_form.inc.php';


// Start output handling
$out = new c5t_output($c5t_detail_template);


// Get identifier data from table
require 'identifier.class.inc.php';
$identifier = new c5t_identifier;
if ($identifier_id = c5t_gpc_vars('i')
and $identifier_data = $identifier->get($identifier_id)) {
$out->assign('identifier_data', $identifier_data);
$identifier_form->setDefaults($identifier_data);
$identifier_form->setDefaults(array('i' => $identifier_id));
}


// Delete comment
$delete_confirmation = array('dialogue' => 0);
if ($comment_id = c5t_gpc_vars('c')
and c5t_gpc_vars('do') == 'd') {
$delete_confirmation = array(
'dialogue'      => 1,
'identifier_id' => $identifier_id,
'comment_id'    => $comment_id,
'anchor'        => c5t_gpc_vars('p')
);
}
$out->assign('delete_confirmation', $delete_confirmation);
if ($comment_id = c5t_gpc_vars('c')
and c5t_gpc_vars('do') == 'dc') {
require 'comment.class.inc.php';
if (c5t_comment::delete($comment_id)) {
$c5t['message'][] = $c5t['text']['txt_delete_comment_successful'];
}
}

// Delete comment list
$delete_confirmation = array('dialogue' => 0);
if (c5t_gpc_vars('submit_delete_comments')) {
$delete_confirmation = array(
'dialogue'      => 1,
'list'   =>     c5t_gpc_vars('delete_comment'),
);
}
$out->assign('delete_list_confirmation', $delete_confirmation);
if (c5t_gpc_vars('submit_delete_comments_c')) {
require 'comment.class.inc.php';
if (c5t_comment::delete_list(c5t_gpc_vars('delete_comment'))) {
$c5t['message'][] = $c5t['text']['txt_delete_comments_successful'];
}
}

// Approve/disapprove comment
if ($comment_id = c5t_gpc_vars('c')
and c5t_gpc_vars('do') == 'a') {
require 'comment.class.inc.php';
if (c5t_comment::status($comment_id, $c5t['comment_status']['approved'])) {
}
}
if ($comment_id = c5t_gpc_vars('c')
and c5t_gpc_vars('do') == 'da') {
require 'comment.class.inc.php';
if (c5t_comment::status($comment_id, $c5t['comment_status']['unapproved'])) {
}
}


// Get comment data
require 'commentlistadmin.class.inc.php';
$comment = new c5t_comment_list(true, array('identifier' => 'commentlistadmin'));
if ($identifier_id = c5t_gpc_vars('i')
and $comment_data = $comment->get_list($identifier_id)) {
$out->assign('comment_list', $comment_data);
}
$out->assign($comment->values());




// Validate form
$show_form = 'yes';
if (c5t_gpc_vars('save')
and $identifier_id = c5t_gpc_vars('i')
and $identifier_form->validate()) {
$show_form = 'no';
// Write data
if ($identifier->put($identifier_id)) {
$c5t['message'][] = $c5t['text']['txt_update_data_successful'];
}
}

$show_rename_form = 'false';
if (c5t_gpc_vars('do') == 'rename') {
$show_rename_form = 'yes';
$show_form = 'no';
}
if (c5t_gpc_vars('do') == 'rename'
and c5t_gpc_vars('rename')) {

if ($identifier->change(c5t_gpc_vars('i'))) {
$c5t['message'][] = $c5t['text']['txt_update_data_successful'];
}
}
$out->assign('show_rename_form', $show_rename_form);
$out->assign('show_form', $show_form);




require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
$identifier_renderer =&amp; new HTML_QuickForm_Renderer_ArraySmarty($out->get_object, true);

$identifier_form->accept($identifier_renderer);


// Assign array with form data
$out->assign('identifier_form', $identifier_renderer->toArray());



// Search form
require_once 'HTML/QuickForm.php';


// Start form handler
$form = new HTML_QuickForm('form', 'POST');


// Get list form elements (grouping, sorting, searching)
$search_field_list  = $comment->search_field_list();


// Get form configuration
require 'list_form.inc.php';
$form->addElement('hidden', 'i');
$form->setConstants(array('i' => c5t_gpc_vars('i')));
$form->setDefaults($comment->default_values());


require_once 'HTML/QuickForm/Renderer/ArraySmarty.php';
$renderer =&amp; new HTML_QuickForm_Renderer_ArraySmarty($out->get_object, true);

$form->accept($renderer);


// Assign array with form data
$out->assign('form', $renderer->toArray());







// Output
$out->assign('status_approved', $c5t['comment_status']['approved']);
$out->finish();






?>



&amp;nbsp;

 

 

Booby is based on a generic MVC design php

Booby is a multiuser, multilanguage, fully themeable web-based application which provides online management for bookmarks, contacts, todo’s, notes and newsfeeds (RSS/RDF). Booby is written in PHP and is database independant (sort of) by using the database abstraction layer ‘ADOdb’. Booby is fully themeable (phpSavant or Smarty.) Booby is based on a generic MVC design pattern/framework that uses items with a potential hierarchical relationship as its base. More functionalities (calendar, webmail) are foreseen in the near future.

 

<?
//####################################################################
// Active PHP Bookmarks - lbstone.com/apb/
//
// Filename: daily_browser.php
// Authors:  Nathanial P. Hendler (retards.org)
//
// 2002-03-02 03:35     Created
//
//####################################################################

include_once('apb.php');
$APB_SETTINGS['allow_edit_mode'] = 1;
$APB_SETTINGS['allow_search_box'] = 1;
apb_head();


?>

<p>

<table border='0' width='100%' cellpadding='0' cellspacing='0'>
<tr>
<td valign='top'>

<?

if ($APB_SETTINGS['daily_browsing_public'] == 1 OR $APB_SETTINGS['auth_user_id']) {

$today =  date("Y-m-d");

if ($date) {
$now       = $date;
$weekday   = date("l",  strtotime($now));
$tomorrow  = date("Y-m-d", strtotime("+1 day", strtotime($now)));
$yesterday = date("Y-m-d", strtotime("-1 day", strtotime($now)));
} else {
$now       = date("Y-m-d");
$weekday   = date("l");
$tomorrow  = date("Y-m-d", strtotime("+1 day"));
$yesterday = date("Y-m-d", strtotime("-1 day"));
}

$now_full = "<h2>$now</h2><b>$weekday</b>";

?>

<table align='center' width='100%'>
<tr>
<td align='left' valign='bottom'>&amp;lt;-- <a href='?date=<?= $yesterday ?><? if ($edit_mode) print "&amp;edit_mode=$edit_mode" ?>'><?= $yesterday ?></a></td>
<td align='center' valign='center'><center><?= $now_full ?></center></td>
<td align='right' valign='bottom'>


<?
if (strtotime($tomorrow) <= strtotime($today)) {
print "<a href='?date=$today";
if ($edit_mode) {
print "&amp;edit_mode=$edit_mode";
}
print "'>today</a> --&amp;gt;<br>";
print "<a href='?date=$tomorrow";
if ($edit_mode) {
print "&amp;edit_mode=$edit_mode";
}
print "'>$tomorrow</a> --&amp;gt;";
} else {
print "$tomorrow --&amp;gt;";
}
?>

</td>
</tr>
</table>
<br><p>

</td>
</tr>

<tr>
<td valign='top'>

<?

if ($APB_SETTINGS['auth_user_id']) {
$private_sql = "";
} else {
$private_sql = "AND b.bookmark_private = 0";
}

/* Display The Days Bookmarks */

print "<b>Bookmarked Sites</b><p>\n\n";

$query = "
SELECT b.*, g.*, DATE_FORMAT(b.bookmark_creation_date, '%H:%i:%s') as creation_date
FROM apb_bookmarks b
NATURAL JOIN apb_groups g
WHERE DATE_FORMAT(b.bookmark_creation_date, '%Y-%m-%d') = '$now'
AND b.user_id = $APB_SETTINGS[user_id]
AND b.bookmark_deleted = 0
$private_sql
ORDER BY b.bookmark_creation_date
"
;
#print "<p><pre>$query</pre><p>\n\n";
$result = mysql_query($query);

if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
$b = apb_bookmark($row);
$g = apb_group($row);
print $row[creation_date] . " - " . $b->link() . " <font size='1'>(" . $g->link() . ")</font><br>\n";
}
} else {
print "No sites bookmarked";
}


/* Display The Days Browsing */

print "<p>\n";
print "<b>Bookmarks Used by " . return_username($APB_SETTINGS['user_id']) . "</b><p>\n";

$query = "
SELECT b.*, g.*, DATE_FORMAT(h.hit_date, '%H:%i:%s') as hit_date
FROM apb_hits h
NATURAL JOIN apb_bookmarks b
NATURAL JOIN apb_groups g
WHERE DATE_FORMAT(h.hit_date, '%Y-%m-%d') = '$now'
AND b.user_id = $APB_SETTINGS[user_id]
AND b.bookmark_deleted = 0
$private_sql
ORDER BY h.hit_date
"
;
#print "<p><pre>$query</pre><p>\n\n";
$result = mysql_query($query);

if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
$b = apb_bookmark($row);
$g = apb_group($row);
print $row[hit_date] . " - " . $b->link() . " <font size='1'>(" . $g->link() . ")</font><br>\n";
}
} else {
print "No bookmarks used";
}


/* Display The Days Browsing by Visitors*/

print "<p>\n";
print "<b>Bookmarks Used by Visitors</b><p>\n";

$query = "
SELECT b.*, g.*, DATE_FORMAT(h.hit_date, '%H:%i:%s') as hit_date, h.hit_ip
FROM apb_hits h, apb_bookmarks b, apb_groups g
WHERE DATE_FORMAT(h.hit_date, '%Y-%m-%d') = '$now'
AND h.user_id != $APB_SETTINGS[user_id]
AND b.bookmark_id = h.bookmark_id
AND b.group_id = g.group_id
AND b.bookmark_deleted = 0
$private_sql
ORDER BY h.hit_date
"
;
#print "<p><pre>$query</pre><p>\n\n";
$result = mysql_query($query);

if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
$b = apb_bookmark($row);
$g = apb_group($row);
#print $row[hit_date] . " &amp;nbsp;&amp;nbsp; " . $row[hit_ip] . " &amp;nbsp;&amp;nbsp; " . $b->link() . " <font size='1'>(" . $g->link() . ")</font><br>\n";
print $row[hit_date] . " - " . $b->link() . " <font size='1'>(" . $g->link() . ")</font> - <font color='#999999'>" . $row[hit_ip] . "</font><br>\n";
}
} else {
print "No bookmarks used";
}

echo "<br>";

} else {

?>

<center><p>Daily bookmark browsing is not enabled for non-authenticated users.</center>

<?
}
?>

</td>
</tr>
</table>

<?
apb_foot();
?>

&amp;nbsp;

PHP ShoutBox scripts

phShoutBox is a simple, yet full featured shout box. It has BB Code, automatic URL and email phrasing, IP banning, custom word filters, display direction, clickable similes, and most things other shout box’s have, minus all the junk.

<?
error_reporting(7);
/*
//================================================================================
* phphq.Net Custom PHP Scripts *
//================================================================================
:- Script Name: phShoutBox
:- Version: 1.5.1
:- Release Date: April 6th 2004
:- Last Updated: Jan 21th 2010
:- Author: Scott Lucht<scott@phphq.net> http://www.phphq.net
:- Copyright (c) 2010 All Rights Reserved
:-
:- This script is free software; you can redistribute it and/or modify
:- it under the terms of the GNU General Public License as published by
:- the Free Software Foundation; either version 2 of the License, or
:- (at your option) any later version.
:-
:- This script is distributed in the hope that it will be useful,
:- but WITHOUT ANY WARRANTY; without even the implied warranty of
:- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
:- GNU General Public License for more details.
:-http://www.gnu.org/licenses/gpl.txt
:-
//================================================================================
* Description
//================================================================================
:- phShoutBox is a simple, yet full featured shoutbox. It has bb code, automatic url and email phrasing, ip banning, your own
:- word filters, display direction, clickable smilies, and most things other shoutbox's have, minus all the junk.
//================================================================================
* Install
//================================================================================
:- To install this script, first you need to create a database, if you do not know how to do this ask your host, I do not know how to
:- setup a database on every host, therefore I cannot help you on that part. Then open config.php in a text editor like notepad
:- and edit the MySql values. Again ask your host if you do not know your MySql information, you need the database name,
:- database user name and password. Edit config.php again and change the admin password. If you do not change this anyone
:- will be able to get into the admin! Then run install.php from your browser. If you need help with editing the values, please
:- read on. Values are easy to edit and I will try to explain it the best I can. $value = "1"; this is a value. Where you see the 1
:- between the 2 quotes is the actual value that will need to be changed. To change a value, edit the value between the 2 quotes,
:- in this example you would be editing the 1 to something else. Got it? Good :).
//================================================================================
* Usage
//================================================================================
:- You can use this script on your site in a few ways, I will explain 1 of the most common. You can show the shoutbox
:- directly on your page by using an "iframe". I will give you an example.
:- This is an iframe: <iframe src="/path/to/phShoutBox.php" width="100" height="350" frameborder="0">No Frames</iframe>
:- There are many more options to iframes and I don't feel the need to explain all of them, those are the basics.
:- I would check out w3schools.com if you need more help on iframes.
:- You can also change the looks of this script, by editing the color values in config.php and phshoutbox.css. You may
:- want to look up on css if you do not know how to edit this. Again: w3schools.com is your friend here. Unless of course
:- you know someone that knows how ;).
//================================================================================
*/


class phdb {

function connect($host="localhost",$user,$pass,$data,$persistency=False) {
$this->host = $host;
$this->user = $user;
$this->pass = $pass;
$this->data = $data;
$this->persistency = $persistency;

If($this->persistency) {
$this->link=@mysql_pconnect($this->host,$this->user,$this->pass);
} Else {
$this->link=@mysql_connect($this->host,$this->user,$this->pass);
}

If(($this->link) AND ($this->data)) {
If(@mysql_select_db($this->data,$this->link)) {
return True;
}
}
return False;
}

function fetch($query="") {
$query=mysql_fetch_array($query);
return($query);
}

function query($query="",$sup="") {
If($sup) {
$query=mysql_query($query,$this->link);
} Else {
$query=mysql_query($query,$this->link);
}
return($query);
}

function rows($query="") {
$query=@mysql_num_rows($query);
return($query);
}
function free($query="") {
@mysql_free_result($query);
}
function result($query="",$sup="") {
$query=$this->query($query,$sup);
$result=$this->fetch($query);
$this->free($query);
return($result);
}
function getrows($querystring="") {
$query=$this->query($querystring);
$result=$this->rows($query);
$this->free($query);
return($result);
}
function disconnect() {
@mysql_close($this->link);
}
}


function isurl($key) {

If(!$url=@parse_url($key)) {
return False;
} Elseif(($url[scheme]!="http") AND ($url[scheme]!="https")) {
return False;
} Elseif(!eregi("^[0-9a-z]([-.]?[0-9a-z])*\.[a-z]{2,8}$", $url[host])) {
return False;
} Elseif(!eregi("^[0-9a-z/_\.@~\-]*$", $url[path])) {
return False;
}
return True;

}


function phrase($key) {
global $ph, $use_filter, $tbl_prefix, $wordwrap,$smilies_find,$smilies_replace;

$domains=array("com","net","org","tk","us","biz","info","uk");
$search=explode(" ",$key);

for($word=0;$word<count($search);$word++) {
If(eregi("^(([a-z0-9_]|\-|\.)+@([^[:space:]]*)([[:alnum:]-]))+$",$search[$word])){
$search[$word]="[email]".$search[$word]."[/email]";
}     Elseif((substr($search[$word],0,4)=="www.") OR (@in_array(substr(strrchr(strtolower($search[$word]), "."), 1),$domains)) AND (!eregi("://",$search[$word]))){
$search[$word]="[url]http://".$search[$word]."[/url]";
}
}

$key=implode(" ",$search);

If($use_filter) {
$query=$ph->query("SELECT * FROM ".$tbl_prefix."_filter");
while($result=$ph->fetch($query)) {

If(!$result[replacewith]) {
$result[replacewith]="**";
}

$key=str_replace($result[find],$result[replacewith],$key);

}
}

$key=eregi_replace("(^|[>[:space:]\n])([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&amp;=])([<[:space:]\n]|$)","\\1[url]\\2://\\3\\4[/url]\\5", $key);

$search = array(
"/(\[)(color)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/color)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
"/(\[)(b)(])(.*)(\[\/b\])/siU",
"/(\[)(i)(])(.*)(\[\/i\])/siU",
"/(\[)(u)(])(.*)(\[\/u\])/siU",
"/(\[)(s)(])(.*)(\[\/s\])/siU",
"/(\[)(move)(])(.*)(\[\/move\])/siU",
);
$replace = array(
"<font color=\"\\5\">\\7</font>",
"<b>\\4</b>",
"<i>\\4</i>",
"<u>\\4</u>",
"<s>\\4</s>",
"<marquee>\\4</marquee>",
);

$i=0;
foreach ($smilies_find as $smiley){
$key=str_replace($smiley, "<img src=\"".$smilies_replace[$i]."\" alt=\"".$smiley."\" />", $key);
$i++;
}

$key=preg_replace($search, $replace, $key);
$key=str_replace("\'", "'", $key);
$key=preg_replace("#\[url\]([a-z]+?://){1}(.*?)\[/url\]#si", "<a href=\"\\1\\2\" target=\"_blank\">\\1\\2</a>", $key);
$key=preg_replace("#\[url\](.*?)\[/url\]#si", "<a href=\"http://\\1\" target=\"_blank\">\\1</a>", $key);
$key=preg_replace("#\[url=([a-z]+?://){1}(.*?)\](.*?)\[/url\]#si", "<a href=\"\\1\\2\" target=\"_blank\">\\3</a>", $key);
$key=preg_replace("#\[url=(.*?)\](.*?)\[/url\]#si", "<a href=\"http://\\1\" target=\"_blank\">\\2</a>", $key);
$key=preg_replace("#\[email\](.*?)\[/email\]#si", "<a href=\"mailto:\\1\">\\1</a>", $key);
$key=preg_replace("#\[email=(.*?){1}(.*?)\](.*?)\[/email\]#si", "<a href=\"mailto:\\1\\2\">\\3</a>", $key);
$key=str_replace("{", "&#123;", $key);

$key=preg_replace('%(\s*)([^>]{'.$wordwrap.',})(<|$)%e',"'\\1'.wordwrap('\\2', '".$wordwrap."', '\n', 1).'\\3'", $key);

return(stripslashes($key));
}

 

PHP Photo Badge Creator-URL Management

Use Photo Badge Creator to let your visitors upload media content directly to your website. Photo Badge Creator is for managing files, through the browser. Your visitors will upload files directly to your website, where they can share and comment on them. It includes PHP scripts and a web installer. You just need to unzip, upload and run the installer.

<?php

// Please include automatic loading of classes for proper on-demand-loading of
// necessary DataForm classes
function __autoload($class)
{
 $class = strtolower($class);
 if(eregi("df_", $class) == true)
 {
 include("classes/".$class.".php");
 }
}

// Create Main instance of DataForm
$DataForm = new df_main();

// Output your desired preset design this will automaticly add the responding
// classes to your bounded elements in addition to your eventually preset ones
$DataForm->setDesign("beach");

// Create our first Form add self as action if you want the target to be the page itself
$mainform = new df_form("mainform", "output.php", false, NULL, "POST", "myform", "My first Form");

// Binding the Form to the main DataForm instance
$DataForm->bindForm($mainform);

// We will add here an extra css class which combines with the design preset class
// Creating an instance of an Element
// Way 1:
$elem = new df_textbox("prim_txt", NULL, "A simple Value", "First:", "my_special_textbox");

// Setting HTML right before that element
$elem->setHTMLBefore('<br />');

// Binding Elements to existing forms.
// Way 1:
$mainform->bindElement($elem);

// By default all bounded elements will be drawn, when the master-form is beeing drawn.
// If you want to output it manually, like we will see later in this file
// you can avoid bounded_draw like follows, or simply dont bind it to any form :-)
$newelem = new df_textbox("exotic", NULL, "I'm exotic", "Exotic:");
$newelem->setBoundedDraw(false);
$mainform->bindElement($newelem);

// Binding Elements to existing forms
// Way 2:
$mainform->bindElement(new df_textbox("secon_txt", NULL, "Another value", "Secon:"));
$mainform->bindElement(new df_textarea("mytextarea", NULL, "This has <strong>some</strong> <i>bad</i> <b>html</b> inside <badtag>javascript:alert('Im evil');</badtag>", "MyBox:", "mytextareadesign"));

// This way you create and bind dropdowns Options-> 2d-Array -> inner one looks this way:
// 1. Value, 2. Display
// or
// 1. optgroupname with no more params
// dont forget to close the optgroup with a single paramed array with "END"

$dpvalue = array(
 //Optiongroup APPHP
 array("APPHP"),
 array("1", "PHP DataGrid"),
 array("2", "PHP Easy Installer"),
 array("3", "PHP Admin Panel"),
 array("4", "JS Auto From Validator"),
 array("END"),
 //Optiongroup Links
 array("Links"),
 array("php.net", "PHP.NET"),
 array("apphp.com", "APPHP.COM"),
 array("softic.at", "softic.at"),
 array("END"),
 //Define Elements nongrouped
 array("t1", "Ungrouped1"),
 array("t2", "Ungrouped2"),
 array("t3", "Ungrouped3")
);
$mydp = new df_dropdown("mydp", "mydp", $dpvalue, "MyDP:");
$mydp->setHTMLAfter("<br />");
$mainform->bindElement($mydp);

// Now comes a group of radioboxes
$radio1 = new df_radio("male", "male", "m", "Male:", true, "gender");
$radio2 = new df_radio("female", "female", "f", "Female:", false, "gender");
$radio2->setHTMLAfter("<br />");
$mainform->bindElement($radio1);
$mainform->bindElement($radio2);

// Lets add some Checkboxes
$chk1 = new df_checkbox("check1", "check1", "first", "Like PHP?", true);
$chk2 = new df_checkbox("check2", "check2", "secon", "Like ASP?", false);
$mainform->bindElement($chk1);
$mainform->bindElement($chk2);

// Adding now a very secret password field
$mainform->bindElement(new df_password("secret", "secret", NULL, "Secret:"));

// Now a neat little IMAGE Button
$mainform->bindElement(new df_image("./images/php-powered.gif", "phppow", "phppow"));

// We are going to send along with this Form a hidden field
$mainform->bindElement(new df_hidden("ghost", "ghost", "I am a ghost"));

// What about a fileupload element
$file = new df_file("fileup", NULL, NULL, "File:");
$file->setHTMLBefore("<br /><br />");
$file->setHTMLAfter("<br /><br />");
$mainform->bindElement($file);

// Here we are going to define a submit button and a reset button
$mainform->bindElement(new df_submit("Submit", NULL, "Submit"));
$mainform->bindElement(new df_reset("btn_reset", NULL, "Reset"));

// Bound Elements have references to their Forms
$name = $elem->getForm()->getName();

// Create your HTML Header
?>

<html>
<head>
 <title>PHP DataForm :: Sample #1 (demo)</title>
 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
 <meta name='keywords' content='dataform, formview, programming, php, free script, free download, trial soft, datagrid, script, freeware, software, download, MySQL, database, web '/>
 <meta name='description' content='Advanced Power of PHP - best solutions for web developers' />
 <?php

 ## Output the set Designset
echo $DataForm->includeMoo();
 echo $DataForm->getDesign();
 ?>
 <script type="text/javascript" src="./usage.js"></script>
 <style>
 .my_special_textbox
 {
 width: 100px;
 }

 .mytextareadesign
 {
 height: 100px;
 }

 #maincontent
 {
 width: 23em;
 margin-left:auto;
 margin-right:auto;
 }
 </style>
</head>
<body>
 <div id="maincontent">
 <br />
 <h3>This is the bounded-draw output</h3>
 <?php
 // Output the whole creation
 echo $DataForm->output();
 ?>

 <h3>Now comes the handbuild part</h3>

 <?php
 // Output our element, which has deactivated Bound-Draw
 echo $newelem->draw();
 // If the element was'nt instanced on creation
 // you can search the bounded form for that element.
 // Search is done first by ID then by NAME tags
 echo "<br />";
 echo $mainform->getBoundElement("secon_txt")->draw();
 ?>
 </div>
</body>
</html>

<script type="text/javascript">
 var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
 document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
 var pageTracker = _gat._getTracker("UA-678163-10");
 pageTracker._trackPageview();
</script>

&amp;nbsp;


PHP Editor for Visual Studio URL Management

Develop php applications from within Visual Studio.Net 2002 & 2003. This product lets you build, edit and deploy php applications using the familiar interface of the most popular IDE in the market. Contrary to other PHP IDE products, VS.Php leverages the familiar interface of Microsoft Visual Studio.Net allowing PHP developers leverage all the features Visual Studio.Net provides. No need to learn a new IDE interface or tools.

 

 

<?php
abstract class df_element
{
 protected $elm_id           = NULL;
 protected $elm_name         = NULL;
 protected $elm_type         = NULL;
 protected $elm_value        = NULL;
 protected $elm_label        = NULL;
 protected $elm_tabindex     = NULL;
 protected $elm_jscript      = NULL;
 protected $elm_css_class    = NULL;
 public    $elm_bound        = false;
 public    $elm_bound_to     = NULL;
 protected $elm_html_after   = NULL;
 protected $elm_html_before  = NULL;
 protected $elm_bounded_draw = true;

 public function __construct($name, $id=NULL, $value=NULL, $label=NULL, $css_class=NULL, $tabindex=NULL, $jscript=NULL)
 {
 ($id == NULL) ? ($this->elm_id = $name) : ($this->elm_id = $id);
 $this->elm_name      = $name;
 $this->elm_css_class = $css_class;
 $this->elm_label = $label;
 $this->setup($value, $tabindex, $jscript);
 }

 private function __clone()
 {
 }

 /*
 * Freeing the connection to the element counter
 * and the regarding form
 */

 public function __destruct()
 {

 }

 /*
 * Define here the setup of the more complex and element specific parameters
 */

 protected abstract function setup($value = NULL, $tabindex = NULL, $jscript = NULL);
 /*
 * Define here the output created by the Element
 */

 public abstract function draw();

 /*
 * Checking Methods
 */

 protected function isBound()
 {
 if($this->elm_bound_to != NULL)
 {
 return true;
 }
 else
 {
 return false;
 }
 }
 protected function isDesignActive()
 {
 if($this->isBound() == true)
 {
 if($this->getForm()->getMain()->hasDesign())
 {
 return true;
 }
 else
 {
 return false;
 }
 }
 else
 {
 return false;
 }
 }

 /*
 * Getter &amp; Setter
 */

 public function setBoundedDraw($bool)
 {
 $this->elm_bounded_draw = $bool;
 }
 public function isBoundedDraw()
 {
 return $this->elm_bounded_draw;
 }
 public function setHTMLAfter($value)
 {
 $this->elm_html_after = $value;
 }
 public function setHTMLBefore($value)
 {
 $this->elm_html_before = $value;
 }
 public function getType()
 {
 return $this->elm_type;
 }
 public function getName()
 {
 return $this->elm_name;
 }
 public function getCSS()
 {
 return $this->elm_css_class;
 }
 public function setCSS($value)
 {
 $this->elm_css_class = $value;
 }
 public function addCSS($value)
 {
 $this->elm_css_class .= " ".$value;
 }
 public function getTabindex()
 {
 return $this->elm_tabindex;
 }
 public function getId()
 {
 return $this->elm_id;
 }
 public function getForm()
 {
 return $this->elm_bound_to;
 }
}

class df_textbox extends df_element
{
 protected function setup($value = NULL, $tabindex = NULL, $jscript = NULL)
 {
 $this->elm_type = "textbox";
 $this->elm_value = $value;
 }

 public function draw()
 {
 if($this->isDesignActive())
 {
 $this->addCSS("input_text");
 }
 $output = NULL;
 $output .= $this->elm_html_before;

 if($this->elm_label != NULL)
 {
 $output .= "<label for=\"".$this->elm_id."\">".$this->elm_label."</label>";
 }

 $output .= "<input type=\"".$this->elm_type."\" id=\"".$this->elm_id."\" name=\"".$this->elm_name."\" value=\"".$this->elm_value."\" class=\"".$this->elm_css_class."\" />".$this->elm_html_after;
 return $output;
 }
}

class df_password extends df_textbox
{
 protected function setup($value = NULL, $tabindex = NULL, $jscript = NULL)
 {
 $this->elm_type = "password";
 $this->elm_value = $value;
 }
}

class df_file extends df_textbox
{
 protected function setup($value = NULL, $tabindex = NULL, $jscript = NULL)
 {
 $this->elm_type = "file";
 $this->elm_value = $value;
 }
public function draw()
 {
 if($this->isDesignActive())
 {
 $this->addCSS("input_file");
 }
 $output = NULL;
 $output .= $this->elm_html_before;

 if($this->elm_label != NULL)
 {
 $output .= "<label for=\"".$this->elm_id."\">".$this->elm_label."</label>";
 }

 $output .= "<input type=\"".$this->elm_type."\" id=\"".$this->elm_id."\" name=\"".$this->elm_name."\" value=\"".$this->elm_value."\" class=\"".$this->elm_css_class."\" />".$this->elm_html_after;
 return $output;
 }
}

class df_hidden extends df_element
{
 /*
 * this encapsulation is just done for better Intellisense support
 */

 public function __construct($name, $id, $value)
 {
 parent::__construct($name, $id, $value);
 }

 protected function setup($value = NULL, $tabindex = NULL, $jscript = NULL)
 {
 $this->elm_value = $value;
 $this->elm_type = "hidden";
 }

 public function draw()
 {
 $output = NULL;
 $output .= $this->elm_html_before."<input type=\"".$this->elm_type."\" id=\""
 .  $this->elm_id."\" name=\"".$this->elm_name."\" value=\""
 .  $this->elm_value."\" />".$this->elm_html_after;

 return $output;
 }
}

class df_button extends df_element
{
 protected function setup($value = NULL, $tabindex = NULL, $jscript = NULL)
 {
 $this->elm_type = "button";
 $this->elm_value = $value;
 }

 public function draw()
 {
 if($this->isDesignActive())
 {
 $this->elm_css_class .= " input_button";
 }
 $output = NULL;
 $output .= $this->elm_html_before;

 $output .= "<input type=\"".$this->elm_type."\" id=\"".$this->elm_id."\" name=\"".$this->elm_name."\" value=\"".$this->elm_value."\" class=\"".$this->elm_css_class."\" />".$this->elm_html_after;
 return $output;
 }
}

class df_submit extends df_button
{
 protected function setup($value = NULL, $tabindex = NULL, $jscript = NULL)
 {
 $this->elm_type = "submit";
 $this->elm_value = $value;
 }
}

class df_image extends df_element
{
 protected $elm_src = NULL;

 public function __construct($src, $name, $id=NULL, $value=NULL, $label=NULL, $css_class=NULL, $tabindex=NULL, $jscript=NULL)
 {
 parent::__construct($name, $id, $value, $label, $css_class, $tabindex, $jscript);

 $this->elm_src = $src;
 }

 protected function setup($value = NULL, $tabindex = NULL, $jscript = NULL)
 {
 $this->elm_type = "image";
 $this->elm_value = $value;
 }

 public function draw()
 {
 if($this->isDesignActive())
 {
 $this->addCSS("input_image");
 }
 $output = NULL;
 $output .= $this->elm_html_before;

 $output .= "<input type=\"".$this->elm_type."\" src=\"".$this->elm_src."\" id=\"".$this->elm_id."\" name=\"".$this->elm_name."\" class=\"".$this->elm_css_class."\" />".$this->elm_html_after;
 return $output;
 }
}

class df_reset extends df_button
{
 protected function setup($value = NULL, $tabindex = NULL, $jscript = NULL)
 {
 $this->elm_type = "reset";
 $this->elm_value = $value;
 }
}

class df_textarea extends df_element
{
 protected function setup($value = NULL, $tabindex = NULL, $jscript = NULL)
 {
 $this->elm_type = "textarea";
 $this->elm_value = $value;
 }

 public function draw()
 {
 if($this->isDesignActive())
 {
 $this->addCSS("input_textarea");
 }


 $output = NULL;

 $output .= $this->elm_html_before;
 if($this->elm_label != NULL)
 {
 $output .= "<label for=\"".$this->elm_id."\">".$this->elm_label."</label>";
 }

 $output .= "<textarea id=\"".$this->elm_id."\" name=\"".$this->elm_name."\" class=\"".$this->elm_css_class."\" />".$this->elm_value."</textarea>".$this->elm_html_after;
 return $output;
 }
}

class df_checkbox extends df_element
{
 protected $elm_checked = false;

 public function __construct($name, $id=NULL, $value=NULL, $label=NULL, $checked = false, $css_class=NULL, $tabindex=NULL, $jscript=NULL)
 {
 parent::__construct($name, $id, $value, $label, $css_class, $tabindex, $jscript);

 $this->elm_checked = $checked;
 }

 protected function setup($value = NULL, $tabindex = NULL, $jscript = NULL)
 {
 $this->elm_type = "checkbox";
 $this->elm_value = $value;
 }

 public function draw()
 {
 if($this->isDesignActive())
 {
 $this->addCSS("input_checkbox");
 }


 $output = NULL;

 $output .= $this->elm_html_before;
 if($this->elm_label != NULL)
 {
 $output .= "<label for=\"".$this->elm_id."\">".$this->elm_label."</label>";
 }

 ($this->elm_checked == true) ? ($check = "checked") : ($check = "");

 $output .= "<input type=\"checkbox\" ".$check." id=\"".$this->elm_id."\" name=\"".$this->elm_name."\" class=\"".$this->elm_css_class."\" value=\"".$this->elm_value."\" />".$this->elm_html_after;
 return $output;
 }
}

class df_dropdown extends df_element
{
 const VALUE_PARAMS = 2;
 protected function setup($value = NULL, $tabindex = NULL, $jscript = NULL)
 {
 if(gettype($value) != "array")
 {
 throw new ex_unvalidValueParam("Dropdown needs following Array structure as Value: array ( array(value, display ), ... )");
 }
 else
 {
 foreach($value as $item)
 {
 if(count($item) > self::VALUE_PARAMS)
 {
 throw new ex_unvalidValueParam("Dropdowns Array structure may only have 2 params in subarray");
 }
 }
 }

 $this->elm_type = "dropdown";
 $this->elm_value = $value;
 }

 public function draw()
 {
 if($this->isDesignActive())
 {
 $this->addCSS("input_dropdown");
 }


 $output = NULL;

 $output .= $this->elm_html_before;
 if($this->elm_label != NULL)
 {
 $output .= "<label for=\"".$this->elm_id."\">".$this->elm_label."</label>";
 }
 $output .= "<select id=\"".$this->elm_id."\" name=\"".$this->elm_name."\" class=\"".$this->elm_css_class."\">";

 foreach($this->elm_value as $elem)
 {
 if((count($elem) == 1) &amp;&amp; (strtolower($elem[0]) != "end"))
 {
 $output .= "<OPTGROUP LABEL=\"".$elem[0]."\">";
 }
 elseif((count($elem[0]) == 1) &amp;&amp; (strtolower($elem[0]) == "end"))
 {
 $output .= "</OPTGROUP>";
 }
 else
 {
 $output .= "<option value=\"".$elem[0]."\">".$elem[1]."</option>";
 }
 }

 $output .= "</select>".$this->elm_html_after;

 return $output;
 }
}

class df_radio extends df_element
{
 protected $elm_checked   = false;
 protected $elm_groupName = NULL;

 public function __construct($name, $id=NULL, $value=NULL, $label=NULL, $checked = false, $groupName = NULL, $css_class=NULL, $tabindex=NULL, $jscript=NULL)
 {
 parent::__construct($name, $id, $value, $label, $css_class, $tabindex, $jscript);

 $this->elm_groupName = $groupName;
 $this->elm_checked = $checked;
 }

 protected function setup($value = NULL, $tabindex = NULL, $jscript = NULL)
 {
 $this->elm_type = "radio";
 $this->elm_value = $value;
 }


 /*
 * check if there are other existing radioboxes in this group
 * because only one may be checked
 */

 protected function checkRadioGroup()
 {
 if($this->elm_bound_to->checkGroup($this->elm_id, $this->elm_name, $this->elm_groupName) == true)
 {
 $this->elm_checked = false;
 }
 }

 public function getGroupName()
 {
 return $this->elm_groupName;
 }
 public function isChecked()
 {
 return $this->elm_checked;
 }

 public function draw()
 {
 if($this->isDesignActive())
 {
 $this->addCSS("input_radio");
 }
 // look for only one checked radiobox
 $this->checkRadioGroup();

 $output = NULL;
 $output .= $this->elm_html_before;

 if($this->elm_label != NULL)
 {
 $output .= "<label for=\"".$this->elm_id."\">".$this->elm_label."</label>";
 }

 ($this->getGroupName() != NULL) ? ($gpname = $this->getGroupName()) : ($gpname = $this->elm_name);
 ($this->elm_checked == true) ? ($checked = "checked=\"checked\"") : ($checked="");

 $output .= "<input ".$checked." type=\"".$this->elm_type."\" id=\"".$this->elm_id."\" class=\"".$this->elm_css_class."\" name=\"".$gpname."\" value=\"".$this->elm_value."\"> ".$this->elm_html_after;
 return $output;
 }
}

?>

&amp;nbsp;


PHP Creating HTML Forms URL Management

PHP Dataform (PHP DF) script is a simple tool for creating HTML Forms with ease. It was especially designed for web developers, who do not want to spend excessive time on creating Forms in HTML or through PHP, but want to use a first-class OOP backend. Expandable structure, wise usage of common PHP-Patterns and continuous support make this a must for your PHP-swissarmy-knife.

 

 

<?php

/*
 * ArrayList class
 */


class df_ArrayList {

 /*
 * Array, representing the arrayList
 */

 private $arrayList;
 private $listType;
 private $isObject = false;

 /*
 * Pointer variable. used to detect the last element of the list in hasNext() method.
 */

 private $pointer=0;

 /*
 * Constructs a new list. The Parameter $arr is optional. If set an ArrayList
 * with the elements in array is created. Otherwise a empty list is constructed.
 * @param arr - one dimensional array (optional)
 */

 public function __construct($type, $arr="")
 {
 if (is_array($arr) == true)
 {
 $this->arrayList = $arr;
 }
 else
 {
 $this->arrayList = array();
 }
 $this->listType = $type;
 }

 /**
 * Inserts the specified element at the specified position in this list.
 * @return bool
 **/

 public function checkType($obj)
 {
 switch(gettype($obj))
 {
 case "array":
 foreach($arr as $elem)
 {
 if(gettype($elem) != $this->listType)
 {
 return false;
 }
 }
 break;
 case "object":
 if(!is_a($obj, $this->listType))
 {
 throw new ex_wrongType();
 return false;
 }
 break;
 default :
 if(gettype($obj) != $this->listType)
 {
 throw new ex_wrongType("Using the df_ArrayList a type error was raised");
 }
 }
 return true;
 }

 /**
 * Inserts the specified element at the specified position in this list.
 * @param index integer - position in list
 * @param $obj
 **/

 public function addToPos($index, $obj) {
 if ($this->isInteger($index))
 $this->arrayList[$index] = $obj;
 else
 die("ERROR in ArrayList.addToPos <br> Integer value required");
 }

 /**
 * Appends the specified element to the end of this list.
 * @param
 **/

 public function add($obj)
 {
 if($this->checkType($obj) == true)
 {
 array_push($this->arrayList, $obj);
 }
 }

 /**
 * Appends all of the elements in the specified Array to the end of this list
 * @param arr - one dimensional array
 **/

 public function addAll($arr)
 {
 if($this->checkType($arr) == true)
 {
 $this->arrayList = array_merge($this->arrayList, $arr);
 }
 }

 /**
 * Removes all of the elements from this list.
 **/

 function clear() {
 $this->arrayList = array();
 }

 /**
 * Returns true if this list contains the specified element.
 * @param obj
 * @return boolean
 **/

 function contains($obj) {
 return in_array($obj, $this->arrayList);
 }

 /**
 *  Returns the element at the specified position in this list.
 * @param index
 **/

 function get($index) {
 if ($this->isInteger($index))
 return $this->arrayList[$index];
 else
 die("ERROR in ArrayList.get <br> Integer value required");
 }

 /**
 * Searches for the first occurence of the given argument. If the element isn´t found, -1 is returned
 * @param obj
 * @return integer
 **/

 public function indexOf($obj)
 {
 while (list ($key, $val) = each ($this->arrayList))
 if ($obj == $val) return $key;
 return -1;

 }

 /**
 * Returns the first index from the List, if empty returns null
 * @param obj
 * @return integer
 **/

 function first()
 {
 if(!isEmpty())
 {
 return $this->get(0);
 }
 else
 {
 return NULL;
 }
 }

 /**
 * Tests if this list has no elements.
 * @return boolean
 **/

 function isEmpty() {
 if (count($this->arrayList) == 0) return true;
 else return false;
 }
 /**
 * Returns the index of the last occurrence of the specified object in this list.
 * @param obj
 * return integer
 **/

 function lastIndexOf($obj) {
 return array_search($obj, $this->arrayList);
 }

 /**
 * removes the element at the specified position in this list.
 * @param index
 **/

 function remove($index) {
 if ($this->isInteger($index)) {
 $newArrayList = array();

 for ($i=0; $i < $this->size(); $i++)
 if ($index != $i) $newArrayList[] = $this->get($i);

 $this->arrayList = $newArrayList;
 }
 else {
 die("ERROR in ArrayList.remove <br> Integer value required");
 }
 }

 /**
 * Removes from this List all of the elements whose index is between fromIndex, inclusive and toIndex, exclusive.
 **/

 function removeRange($fromIndex, $toIndex) {
 if ($this->isInteger($fromIndex) &amp;&amp; $this->isInteger($toIndex)) {
 $newArrayList = array();

 for ($i=0; $i < $this->size(); $i++)
 if ($i < $fromIndex || $i > $toIndex ) $newArrayList[] = $this->get($i);

 $this->arrayList = $newArrayList;
 }
 else
 die("ERROR in ArrayList.removeRange <br> Integer value required");
 }

 /**
 * Returns the number of elements in this list.
 * return integer
 **/

 function size() {
 return count($this->arrayList);
 }

 /**
 * Sorts the list in alphabetical order. Keys are not kept in position.
 **/

 function sort() {
 sort($this->arrayList);
 }


 /**
 * Returns an array containing all of the elements in this list in the correct order.
 * @return array
 **/

 function toArray() {
 return $this->arrayList;
 }


 /* Iterator Methods */


 /**
 * Returns true if the list has more elements. Advice : excecute reset method before
 * using this method
 * @return boolean
 **/

 function hasNext() {
 $this->pointer++;

 if ($this->pointer == $this->size()) return false;
 else return true;
 }

 /**
 * Set the pointer of the list to the first element
 **/

 function reset() {
 reset($this->arrayList);
 $this->pointer=0;
 }

 /**
 * Set the pointer of the next element of the list
 * @return current element
 **/

 function next()
 {
 $cur = current($this->arrayList);
 next($this->arrayList);
 return $cur;
 }

 /* private Methods */


 /**
 * Returns true if the parameter holds an integer value
 * @return boolean
 **/

 function isInteger($toCheck) {
 return eregi("^-?[0-9]+$", $toCheck);
 }
}
?>

&amp;nbsp;


Twitter Buttons Script For URL Management

The demand is growing each and every day for new Twitter Follow Buttons. Create your own, unique Twitter Buttons website with this script. Created using JavaScript, this script allows your users to type in their twitter username and it will update the HTML output directly!

 

 

<?php

 require ( "config.php" ) ;

 require_once ( "classes/manipulate.php" ) ;

 $data = new DataManipulator ;

 $like_array = array ( ) ;

 $array_to_db = array ( "IsActive" => 1 , "IsPosted" => 1 ) ;
 $page_size = intval ( $app_init_data["RecentAdsMainPage"] ) ;

 if ( ! empty ( $qstring[1] ) )
 {
 $page_size = intval ( $app_init_data["MaxListingsPerPage"] ) ;
 $param = explode ( "|" , $qstring[1] ) ;
 $exp_send = array ( ) ;
 if ( ! empty ( $param ) )
 {
 foreach ( $param as $val )
 {
 if ( $val!= "" )
 {
 $var_t_array = explode ( ":" , $val ) ;
 $exp_send[$var_t_array[0]] = $var_t_array[1] ;
 }
 }
 }
 }

 if ( $exp_send["cat"] != "" )
 {
 $like_array["CategoryStack"] = "z".$exp_send["cat"]."Z" ;
 }
 if ( isset ( $exp_send["q"] ) )
 {
 $like_array["SearchKeywords"] = $exp_send["q"] ;
 }
 if ( $exp_send["typ"] != "" )
 {
 $array_to_db["IsOffer"] = $exp_send["typ"] ;
 }
 $data->set_like ( $like_array ) ;
 $classified = $data->select ( "Classified" ,"*" , $array_to_db , 0 , $page_size , "DateAdded desc" ) ;


 $now = date("D, d M Y H:i:s T");

 $output = "<?xml version=\"1.0\"?>
 <rss version=\"2.0\">
 <channel>
 <title>"
.$app_init_data["SiteName"]." RSS</title>
 <link>"
.base_url."/rss/cat:".$exp_send["cat"]."|typ:".$exp_send["typ"]."/</link>
 <description>RSS by "
.$app_init_data["SiteTitle"]."</description>
 <language>en-us</language>
 <pubDate>$now</pubDate>
 <lastBuildDate>$now</lastBuildDate>
 <docs>"
.SITEURL."</docs>
 <managingEditor>"
.$app_init_data["OwnerEmail"]."</managingEditor>
 <webMaster>fireonmoon@gmail.com</webMaster>
 <image>
 <title>"
.$app_init_data["SiteName"]."</title>
 <url>"
.base_url."media/logo.jpg</url>
 <link>"
.base_url."</link>
 </image>
 "
;

 if ( ! empty ( $classified ) )
 {
 foreach ($classified as $line)
 {
 $desc = htmlentities ( preg_replace ( "@[^A-Za-z0-9\-\s_]+@i" , "" , substr ( strip_tags ( $line['Description'] ) , 0 , 150 ) ) ) ;
 $output .= "<item>
 <title>"
.htmlentities($line['AdTitle'])."</title>
 <link>"
. base_url . get_sef_url ( $line["AdID"] , "Classified" ) ."/</link>
 <description>"
. $desc ."</description>
 </item>"
;


 }
 }

 $output .= "</channel>
 </rss>"
;
 header("Content-Type: application/rss+xml");
 echo $output;
?>

&amp;nbsp;

 

Softbiz Auctions Plus Script URL Management

Start your own auction site  with this amazing PHP script. Members run paid or free auctions. Also supports Dutch auctions, classifieds, fixed priced items. Softbiz Auctions Plus Script 4 offers you UNBELIEVABLE customizability with ability to change Colors, Fonts, Icons, Graphics of your site directly from your script admin panel. It is only auctions portal script to offer this level of customizability in looks as well as features.

 

 

<?php

 session_start ( ) ;

 require ( "config.php" ) ;

 require_once ( "classes/manipulate.php" ) ;

 $data = new DataManipulator ;

 require ( "classes/misc.func.php" ) ;

 $siteSettings = $data->select ( "SiteManager" , "*" , null , 0 , 50 ) ;
 $app_init_data = array ( ) ;
 foreach ( $siteSettings as $site )
 {
 $app_init_data[$site["SiteVariable"]] = $site["SiteValue"] ;
 }

 if ( $_POST )
 {
 if ( intval ( $app_init_data["SignupAuthentication"] ) == 0 )
 $_SESSION["capCode"] = strtolower ( $_POST["capSecurity"] ) ;
 if ( strtolower ( $_POST["capSecurity"] ) == $_SESSION["capCode"] )
 {
 foreach ( $_POST as $key=>$val )
 if ( strchr ( $key , "_Setting_" ) )
 {
 $key = str_replace ( "_Setting_" , "" , $key ) ;
 $postdata[$key] = $val ;
 }
 $rec = $data->select ( "Account" , "*" , array ( "EmailAddress" => $postdata["EmailAddress"] ) ) ;
 if ( empty ( $rec ) )
 {
 $last_id = $data->insert ( "Account" , $postdata ) ;

 if ( $app_init_data["RegistrationEmail"] != "" )
 {

 $body = $app_init_data["RegistrationEmail"] ;
 $body = str_replace ( "{URL}" , $url , $body ) ;
 $body = str_replace ( "{SITE_URL}" , base_url , $body ) ;
 $body = str_replace ( "{SITE_NAME}" , $app_init_data["SiteTitle"] , $body ) ;
 $body = str_replace ( "{SITE_EMAIL}" , $app_init_data["OwnerEmail"] , $body ) ;
 $body = str_replace ( "{Friend_Name}" , $_POST["FName"] , $body ) ;
 $body = str_replace ( "{Friend_Email}" , $_POST["FEmail"] , $body ) ;
 $body = str_replace ( "{Sender_Name}" , $_POST["FullName"] , $body ) ;
 $body = str_replace ( "{Sender_Email}" , $_POST["EmailAddress"] , $body ) ;
 @mail ( $_POST["Email_Setting_Address"] , $app_init_data["SiteTitle"] , $body , "from:".$app_init_data["SiteName"]."<".$app_init_data["OwnerEmail"].">" ) ;
 $_SESSION["str_system_message"] = "Account Created Successfully." ;
 }
 }
 else
 {
 $_SESSION["str_system_message"] = "Email address already exits." ;
 }

 }
 else
 {
 $_SESSION["str_system_message"] = "Security Code not matched." ;
 }

 }


 header ( "location:".base_url ) ;


?>

&amp;nbsp;

Adikit Craigslist Classified Scripts URL Management

Craigslist Clone PHP classifieds script. Run your own distinct classifieds site which is a powerful, feature rich, easy to use classified ads solution.AdiKit CraigsList Classified Clone is a powerful, feature rich, easy to use, turn key classifieds solution. Developed in PHP and MySQL, This classifieds works similar to the most popular sites out there like Craigslist, BackPage, Loquo, Kijiji or GumTree. With quick and easy installation, configurable and streamlined user interface.

 

 

<?php

 if ( intval ( $sel_id ) < 1 )
 {
 header ( "location:".base_url."c-SelectCategory/" ) ;
 exit ( ) ;
 }



 if ( intval ( $app_init_data["AccountRequiredToPost"] ) == 1 &amp;&amp; intval ( $_SESSION["login_account_id"] ) < 1 )
 {
 $_SESSION["str_system_message"] = "You must be Registered and Signed in to post ad." ;
 header ( "location:".base_url ) ;
 exit ( ) ;
 }

 if ( $_POST )
 {
 if ( strtolower ( $_POST["capSecurity"] ) != $_SESSION["posting"]["capCode"] )
 {
 $_SESSION["str_system_message"] = "Invalid security code." ;
 }
 else
 {
 include ( "classes/data_validation.php" ) ;
 if ( validate_empty ( array ( "Category_post_ID" , "Ad_post_Title" , "Email_post_Address" ) ) )
 {
 foreach ( $_POST as $key=>$val )
 if ( strchr ( $key , "_post_") )
 $postdata[str_replace ( "_post_" , "" , $key )] = $val ;

 if ( intval ( $_SESSION["login_account_id"] ) > 0 )
 $postdata["AccountID"] =  intval ( $_SESSION["login_account_id"] ) ;

 $postdata["CategoryStack"] = "" ;
 $postdata["SearchKeywords"] = $_POST["Ad_post_Title"]."," ;
 $category_array = array ( ) ;
 get_category_path ( intval ( $_POST["Category_post_ID"] ) , $category_array , $data ) ;
 if ( ! empty ( $category_array ) )
 {
 foreach ( $category_array as $cate )
 {
 $postdata["CategoryStack"] .= "z".$cate["CategoryID"]."Z" ;
 $postdata["SearchKeywords"] .= $cate["CategoryName"]."," ;
 }
 }

 $postdata["IsPosted"] = "0" ;
 $postdata["IsActive"] = "0" ;
 $last_id = $data->insert ( "Classified" , $postdata ) ;
 if ( intval ( $last_id ) > 0 )
 {
 if ( ! empty ( $_FILES ) )
 {

 for ( $i = 0 ; $i < 8 ; $i++  )
 {
 $extension = substr ( $_FILES["fileImage"]["name"][$i] , -3 ) ;
 $extension = strtolower ( $extension ) ;
 if ( $extension == "jpg" || $extension == "gif" || $extension == "bmp" || $extension == "jpeg" || $extension == "png" )
 {
 if ( $i == 0  )
 $file_name_onsever = "media/cls_".$last_id."_520.".$extension ;
 else
 $file_name_onsever = "media/cls_".$last_id."_".$i."_520.".$extension ;
 if ( $_FILES["fileImage"]["name"][$i] != "" )
 move_uploaded_file ( $_FILES["fileImage"]["tmp_name"][$i] , $file_name_onsever ) ;
 }
 }
 }
 if ( ! empty ( $_POST["Ad_EF_Value"] ) )
 {
 foreach ( $_POST["Ad_EF_Value"] as $key => $valu )
 if ( is_array ( $_POST["Ad_EF_Value"][$key] ) )
 foreach ( $_POST["Ad_EF_Value"][$key] as $val )
 $data->insert ( "AdExtraField" , array ( "CategoryExtraFieldID" => $key , "AdExtraFieldValue" => $val , "AdID" => $last_id ) ) ;
 else
 $data->insert ( "AdExtraField" , array ( "CategoryExtraFieldID" => $key , "AdExtraFieldValue" => $valu , "AdID" => $last_id ) ) ;
 }
 generate_sef_url ( $_POST["Ad_post_Title"] , $last_id , "Classified" ) ;
 $_SESSION["last_ad_id"] = intval ( $last_id ) ;
 $_SESSION["str_system_message"] = "Thank you for your posting." ;

 header ( "location:".base_url."c-FeaturedOptions/" ) ;

 }
 }
 else
 $_SESSION["str_system_message"] = "Required fields are missing." ;
 }

 }

 $cat = $data->select ( "Category" , "*" , array ( "CategoryID"=> intval ( $sel_id ) ) ) ;
 if ( empty ( $cat ) )
 {
 header ( "location:".base_url."c-SelectCategory/" ) ;
 exit ( ) ;
 }


 $sub_cats = $data->select ( "Category" , "*" , array ( "HeadCategoryID"=> intval ( $sel_id ) ) ) ;

 if ( ! empty ( $sub_cats ) )
 {
 header ( "location:".base_url."c-SelectCategory/".$sel_id."/" ) ;
 exit ( ) ;
 }

 if ( intval ( $cat[0]["Price"] ) > 0 &amp;&amp; ! strchr($_SERVER['REQUEST_URI'],"pp-Return") )
 {
 $price = $cat[0]["Price"] ;
 include ( "theme/".$app_init_data["CurrentSkin"]."/catpay.php" ) ;
 exit ( ) ;
 }

 $cat = NULL ;


 $cat_path = array ( ) ;

 get_category_path ( $sel_id , $cat_path , $data ) ;

 $cat_path = array_reverse ( $cat_path ) ;


 $extra_fields = $data->select ( "CategoryExtraField" , "*" , array ( "CategoryID" => null ) , 0 , 500 ) ;

 $extra_fields_category = $data->select ( "CategoryExtraField" , "*" , array ( "CategoryID" => $sel_id ) , 0 , 500 ) ;

 include ( "theme/".$app_init_data["CurrentSkin"]."/post_form.php" ) ;

?>

&amp;nbsp;

Scripts Search Engine Submission URL Management

Our scripts have been empowering webmasters to start their new profitable online ventures (web based businesses) or to transform their existing ventures into profitable ones. We will submit your website to thousands of search engines and directories and email you a detailed report listing the search engines to which your website was submitted. We also offer the option of Free-For-All (FFA) Link Directory submissions.

 

 

<?php

 if ( intval ( $_SESSION["last_ad_id"] ) < 1 )
 {
 header ( "location:".base_url ) ;
 exit ( ) ;
 }


 if ( $_POST )
 {
 include ( "classes/data_validation.php" ) ;
 if ( validate_empty ( array ( "Category_post_ID" , "Ad_post_Title" , "Email_post_Address" ) ) )
 {
 foreach ( $_POST as $key=>$val )
 if ( strchr ( $key , "_post_") )
 $postdata[str_replace ( "_post_" , "" , $key )] = $val ;

 if ( intval ( $_SESSION["login_account_id"] ) > 0 )
 $postdata["AccountID"] =  intval ( $_SESSION["login_account_id"] ) ;

 $postdata["CategoryStack"] = "" ;
 $postdata["SearchKeywords"] = $_POST["Ad_post_Title"]."," ;

 $postdata["IsPosted"] = '0' ;
 $postdata["IsActive"] = '0' ;
 $data->update ( "Classified" , $postdata , array ( "AdID" => intval ( $_SESSION["last_ad_id"] ) ) ) ;
 if ( intval ( $_SESSION["last_ad_id"] ) > 0 )
 {
 $data->delete ( "AdExtraField" , array ( "AdID" => intval ( $_SESSION["last_ad_id"] ) ) , 500 ) ;

 if ( ! empty ( $_POST["Ad_EF_Value"] ) )
 {
 foreach ( $_POST["Ad_EF_Value"] as $key => $valu )
 if ( is_array ( $_POST["Ad_EF_Value"][$key] ) )
 foreach ( $_POST["Ad_EF_Value"][$key] as $val )
 $data->insert ( "AdExtraField" , array ( "CategoryExtraFieldID" => $key , "AdExtraFieldValue" => $val , "AdID" => $_SESSION["last_ad_id"] ) ) ;
 else
 $data->insert ( "AdExtraField" , array ( "CategoryExtraFieldID" => $key , "AdExtraFieldValue" => $valu , "AdID" => $_SESSION["last_ad_id"] ) ) ;
 }
 re_generate_sef_url ( $_POST["Ad_post_Title"] , $_SESSION["last_ad_id"] , "Classified" ) ;

 header ( "location:".base_url."c-FeaturedOptions/" ) ;
 exit();
 }
 }
 else
 $_SESSION["str_system_message"] = "Required fields are missing." ;

 }

 $classified = $data->select ( "Classified" , "*" , array ( "AdID"=> intval ( $_SESSION["last_ad_id"] ) ) ) ;
 if ( empty ( $classified ) )
 {
 header ( "location:".base_url ) ;
 exit ( ) ;
 }
 $classified = $classified[0] ;

 $cat_path = array ( ) ;

 get_category_path ( $classified["CategoryID"] , $cat_path , $data ) ;

 $cat_path = array_reverse ( $cat_path ) ;


 $extra_fields = $data->select ( "CategoryExtraField" , "*" , array ( "CategoryID" => null ) , 0 , 500 ) ;

 $extra_fields_category = $data->select ( "CategoryExtraField" , "*" , array ( "CategoryID" => $classified["CategoryID"] ) , 0 , 500 ) ;

 include ( "theme/".$app_init_data["CurrentSkin"]."/modify_form.php" ) ;

?>

&amp;nbsp;