PHP Scripts High Lines WordPress Mobile Theme

A free 2 column WordPress theme with a clean layout and widget ready sidebar. The 1.1 update includes a Windows installer to put it on your blog and some nice streamlining of the code.Works with all different browsers and is fully standards compliant. Layout done with CSS so no tables to break. There is no shortage of WordPress themes out there but some of them are not coded correctly. This one is and will work with all WordPress features.

 

 

<?
/****************************************************************

gmail-mobile (a.k.a. unofficial Gmail Mobile)
Copyright (c) 2005, 2006
Neerav Modi and others

Version 0.11 (c) 2004
GAN Ying Hung, Rudi Pittman, Gaston Annebicque

Licensed under the GNU GPL. For full terms see the file COPYING.

gmail-mobile (unofficial Gmail Mobile since Sept 2004) provides
access to Gmail accounts with any WAP enabled phone or hand held
(in WML format).

http://gmail-mobile.sourceforge.net

*****************************************************************/


require_once("libgmailer.php");
require_once("config.php");

// create the gmail object
$gmailer = new GMailer();
// initialize connection
quick_init($gmailer);

// Connect to gmail
connect_gmail();

// Localization (l10n) phrases
load_language();

$status = false;
$status_message = "";

$action        = (isset($_REQUEST['act']))     ? $_REQUEST['act']        : false;

if ($action == "save") {

 $id         = (isset($_POST["id"]))        ? trim($_POST["id"])                     : -1;
 $label     = (isset($_POST["label"]))    ? stripslashes(trim($_POST["label"]))    : "";
 $query     = (isset($_POST["query"]))    ? stripslashes(trim($_POST["query"]))     : "";
 $unread = (isset($_POST["unread"]))    ? trim($_POST["unread"])                : 0;
 $total     = (isset($_POST["total"]))    ? trim($_POST["total"])                 : 0;

 // peristent query settings
 $searches         = parse_persist_searches();
 $contact_id     = $searches['contact_id'];

 //debug_print("before saving pquery: ".print_r($searches,true));

 $temp = array();
 $temp['label']     = rawurlencode($label);
 $temp['query']     = rawurlencode($query);
 $temp['unread'] = $unread;
 $temp['total']     = $total;
 if ($id != -1) {
 $searches['searches'][$id] = $temp;
 } else {
 $searches['searches'][] = $temp;
 }

 //debug_print("after updating pquery: ".print_r($searches,true));

 $count_searches = count($searches['searches']);
 $new_searches = array();
 for ($i=0; $i < $count_searches; $i++) {
 if (trim($searches['searches'][$i]['label']) === "" or trim($searches['searches'][$i]['query']) === "") continue;
 // %3D = &amp;
 $new_searches[] = rawurlencode(
 "query=".(trim(urldecode($searches['searches'][$i]['query'])))
 ."&amp;label=".trim(urldecode($searches['searches'][$i]['label']))
 ."&amp;totalResults=".((trim($searches['searches'][$i]['total']) === "") ? $searches['searches'][$i]['total']: 0)
 ."&amp;unreadResults=".((trim($searches['searches'][$i]['unread']) === "") ? $searches['searches'][$i]['unread']: 0)
 );
 }
 $new_searches = "PersistentSearches%3D".implode("%7C",$new_searches); // %7C = |
 $cookie = "PersistentSearchesCollapsedCookie%3D0";
 $all_searches = "contact_id%3D".$contact_id."%3B".$new_searches."%3B".$cookie."%3B"; // %3B = ;

 $name     = "zzqqzzqqzzqqzzqqzzqqzzqqzzqqzzqqzzqqzzqq";
 $email     = "zzqqzzqqzzqqzzqqzzqqzzqqzzqqzzqqzzqqzzqq@gmail.com";

 //debug_print("after updating pquery: ".print_r($all_searches,true));

 // if contact id is unknown
 if (trim($contact_id) === "" or $contact_id == -1) {
 $contact_id = -1;
 $status = $gmailer->editContact(
 $contact_id,
 $name,
 $email,
 $all_searches
 );
 if ($status) {
 $contact_id = $gmailer->lastActionStatus('contact_id');
 }
 }

 if ($contact_id !== -1) {
 $all_searches = "contact_id%3D".$contact_id."%3B".$new_searches."%3B".$cookie."%3B"; // %3B = ;
 $status = $gmailer->editContact(
 $contact_id,
 $name,
 $email,
 $all_searches
 );

 if ($status) {
 $_SESSION['searches']        = $all_searches;
 $status_message                = $gm_lang['saved_search_saved'];
 }
 } else {
 $status_message    = $gm_lang['saved_search_error'];
 }

} elseif ($action == "edit") {
 $ids     = explode(";",((isset($_REQUEST['s_ids'])) ? $_REQUEST['s_ids'] : ""));
 // str_replace is safe; we are dealing with english internals
 $values = explode(";",str_replace(")","",$_REQUEST['s_vals']));

 $edit_id = "";
 $count_ids = count($ids);
 for ($i=0 ; $i < $count_ids; $i++) {
 if ($values[$i] == "e") {
 $edit_id = $ids[$i];
 break;
 }
 }

 if ($edit_id !== "") {
 // display edit searches screen
 print_searches_edit($edit_id);
 exit;
 }

 $status_message = $gm_lang['no_search_edit'];

} elseif ($action == "create") {

 // display edit searches screen
 print_searches_edit(-1);
 exit;

}

// for debugging
/* debug_print("gmailer object: ".print_r($gmailer,true)); */
//debug_print("snapshot: ".print_r($snapshot,true));
/* exit; */

$searches         = parse_persist_searches();
$s_count        = count($searches['searches']);
$has_searches     = ($s_count > 0) ? true : false ;

$ids = "-1";
$values = "-1";
$set_vars = "";
if ($has_searches) {
 for ($i = 0; $i < $s_count; $i++) {
 $id    = $i;
 $set_vars .= "<setvar name=\"s_$id\" value=\"0\" />\n";
 $ids .= ";".$id;
 $values .= ";"."$(s_".$id.")";
 }
}


print_headers();    // send wml headers
/* include("template.php");    // print template */
 ?>
<card title="<? echo $gm_lang['saved_searches'] ?>" id='main'>
<? if ($has_searches) { ?>
<onevent type="onenterforward">
<refresh>
<? echo $set_vars ; ?>
</refresh>
</onevent>
<? } ?>
<p>
<?
// display a system-wide message
system_message();

if ($status_message != "") echo "<em>".$status_message."</em><br /><br />\n";
?>
<b><? echo $gm_lang['saved_searches'] ?></b><br />
<small><? echo $gm_lang['saved_search_expl'] ?></small><br /><br />
<?
/* print_r($searches); */
if ($has_searches) {
 foreach ($searches['searches'] as $indexval => $search) {
 echo "<small><b>".cleanse_string(urldecode($search['label']))."</b><br />\n";
 $query = urldecode($search['query']);
 if (strlen($query) > 120) $query = substr($query,0,120)."...";
 echo cleanse_string($query)."</small><br />\n";
 echo "<select name=\"s_".$indexval."\">\n";
 echo "<option value=\"0\"> - </option>\n";
 echo "<option value=\"e\">".$gm_lang['edit']."</option>\n";
 //echo "<option value=\"d\">".$gm_lang['delete']."</option>\n";
 echo "</select>\n";
 echo "<br />\n";
 }
} else {
 echo $gm_lang['have_no_searches']."<br />\n";
}
echo "<br />\n";
print_searches_footer();
print_footer();


function print_searches_footer() {
 global $page;
 global $ids;
 global $values;
 global $has_searches;
 global $gm_lang;

 echo "<small>[".$gm_lang['saved_search_fx']."]</small><br /><br />";

 echo "<a href='".basename(SELF)."?act=create".RANDOM.GMID."'>".$gm_lang['create_new_search']."</a><br />\n";
 if ($has_searches) {
 ?>
 <anchor title="<? echo $gm_lang['edit_saved_search'] ?>"><go href="<? echo basename(SELF).'?act=edit&amp;amp;p='.$page.RANDOM.'&amp;amp;'.strip_tags(SID) ?>" method="post">
 <?
 echo "<postfield name=\"s_ids\" value=\"".$ids."\" />\n";
 echo "<postfield name=\"s_vals\" value=\"".$values."\" />\n";
 ?>
 </go><? echo $gm_lang['edit_saved_search'] ?></anchor>
 <br />
 <?

 }

/*     if ($_SESSION['gm_links_display'] != 2) { */
 echo "----------<br />";

 echo "<a href='setting.php?".RANDOM.GMID."'>".$gm_lang['settings']."</a><br />\n";
 echo "<a href='main.php?sum=1".RANDOM.GMID."'>".$gm_lang['summary']."</a><br />\n";
 echo "<a href='compose.php?action=new&amp;amp;back=filter.php".RANDOM.GMID."'>".$gm_lang['compose_mail']."</a><br />\n";
 echo "<a href='logout.php?".RANDOM.GMID."'>".$gm_lang['sign_out']."</a>\n";
/*     } */
 echo "</p>\n";

}

function print_searches_edit($search_id) {
 global $action;
 global $conf;
 global $gm_lang;

 $searches = parse_persist_searches();

 if ($search_id == -1) {
 $search = array("label" => "","query" => "", "unread" => 0,"total" => 0);
 } else {
 $search = $searches['searches'][$search_id];
 }

 print_headers();    // send wml headers
 ?>
<template>
<do type="prev" label="<? echo $gm_lang['back'] ?>" name="z"><prev/></do>
</template>
<card title="<? echo $gm_lang['filter'] ?>" id='main'>
<onevent type="onenterforward">
<refresh>
<setvar name="id" value="<? echo $search_id ?>" />
<setvar name="label" value="<? echo cleanse_string(urldecode($search['label'])) ?>" />
<setvar name="query" value="<? echo cleanse_string(urldecode($search['query'])) ?>" />
<setvar name="unread" value="<? echo $search['unread'] ?>" />
<setvar name="total" value="<? echo $search['total'] ?>" />
</refresh>
</onevent>
<p>
<?
// display a system-wide message
system_message();

?><b><? echo ($search_id == -1) ? $gm_lang['create_new_search'] : $gm_lang['edit_saved_search']; ?></b><br />
<br />
<small><? echo $gm_lang['search_clear_field'] ?></small><br />
<br />
<? echo $gm_lang['search_dis_name'] ?><br />
<small><? echo $gm_lang['search_dis_name_eg'] ?></small><br />
<input title="<? echo $gm_lang['search_dis_name'] ?>" name="label" emptyok="true" /><br />
<br />
<? echo $gm_lang['search_query_string'] ?><br />
<small><? echo $gm_lang['search_query_eg'] ?></small><br />
<input title="<? echo $gm_lang['search_query_string'] ?>" name="query" emptyok="true" /><br />
<br />
<br />
<a href="<? echo basename(SELF).'?'.RANDOM.GMID ?>"><? echo $gm_lang['cancel'] ?></a><br />
<b><anchor title="<? echo $gm_lang['save_changes'] ?>"><go href="<? echo basename(SELF).'?act=save'.RANDOM.'&amp;amp;'.strip_tags(SID) ?>" method="post">
 <?
 echo "<postfield name=\"id\" value=\"$(id)\" />\n";
 echo "<postfield name=\"label\" value=\"$(label)\" />\n";
 echo "<postfield name=\"query\" value=\"$(query)\" />\n";
 echo "<postfield name=\"unread\" value=\"$(unread)\" />\n";
 echo "<postfield name=\"total\" value=\"$(total)\" />\n";
 ?>
</go><? echo $gm_lang['save_changes'] ?></anchor></b>
<br />
<br />
<?
 echo "</p>\n";
 print_footer();
}

?>

&amp;nbsp;

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>