示例#1
0
     $toecho_exif = $admin_lang_optn_yes;
     $optnecho_exif = $admin_lang_optn_no;
     $optnval_exif = 'F';
 } else {
     $toecho_exif = $admin_lang_optn_no;
     $optnecho_exif = $admin_lang_optn_yes;
     $optnval_exif = 'T';
 }
 /**
  * RSS feed variables and option values
  *
  */
 $feed_title = htmlspecialchars(pullout($cfgrow['feed_title']), ENT_QUOTES);
 $feed_description = htmlspecialchars(pullout($cfgrow['feed_description']), ENT_QUOTES);
 $feed_copyright = htmlspecialchars(pullout($cfgrow['feed_copyright']), ENT_QUOTES);
 $feed_external = pullout($cfgrow['feed_external']);
 if ($cfgrow['allow_comment_feed'] == 'Y') {
     $toecho_feed = $admin_lang_optn_yes;
     $optnecho_feed = $admin_lang_optn_no;
     $optnval_feed = 'N';
 } else {
     $toecho_feed = $admin_lang_optn_no;
     $optnecho_feed = $admin_lang_optn_yes;
     $optnval_feed = 'Y';
 }
 if ($cfgrow['feed_enclosure'] == 'Y') {
     $toecho_feed_enc = $admin_lang_optn_yes;
     $optnecho_feed_enc = $admin_lang_optn_no;
     $optnval_feed_enc = 'N';
 } else {
     $toecho_feed_enc = $admin_lang_optn_no;
示例#2
0
     } else {
         $tpl = replace_exif_tags_null($tpl);
     }
 } else {
     require_once 'includes/functions_exif.php';
     $tpl = replace_exif_tags_null($tpl);
 }
 /**
  * Build a string with all comments.
  * Only perform this code when the user has commenting enabled
  *
  */
 if (isset($_GET['x']) && $_GET['x'] == "" or isset($_GET['popup']) && $_GET['popup'] == "comment") {
     $comment_id = isset($_POST['parent_id']) ? intval($_POST['parent_id']) : '';
     $comments_result = sql_array("SELECT `comments` FROM `" . $pixelpost_db_prefix . "pixelpost` WHERE `id` = '" . $comment_id . "'");
     $cmnt_setting = pullout($comments_result['comments']);
     if ($cmnt_setting == 'F') {
         die('Die you SPAMMER!!');
     }
 }
 // visitor information in comments
 $vinfo_name = "";
 $vinfo_url = "";
 $vinfo_email = "";
 if (isset($_COOKIE['visitorinfo'])) {
     list($vinfo_name, $vinfo_url, $vinfo_email) = split("%", $_COOKIE['visitorinfo']);
 }
 $tpl = ereg_replace("<VINFO_NAME>", $vinfo_name, $tpl);
 $tpl = ereg_replace("<VINFO_URL>", $vinfo_url, $tpl);
 $tpl = ereg_replace("<VINFO_EMAIL>", $vinfo_email, $tpl);
 if ($cfgrow['token'] == 'T') {
示例#3
0
         $message_excerpt = $message;
     }
 } else {
     $message_excerpt = $message;
 }
 $name = pullout($row['name']);
 $url = pullout($row['url']);
 if (strpos($url, 'http://') === FALSE) {
     $url = 'http://' . $url;
 }
 $image = $row['image'];
 $parent_id = $row['parent_id'];
 $ip = $row['ip'];
 $email = $row['email'];
 $datetime = $row['datetime'];
 $imagename = pullout($row['headline']);
 $publish_permission = $row['publish'];
 if ($publish_permission == 'yes') {
     $comment_row_class = "published-comment";
 } else {
     $comment_row_class = "unpublished-comment";
 }
 eval_addon_admin_workspace_menu('single_comment_list');
 $edit_message = str_replace("<br />", "", $message);
 if (isset($comment_divider_header)) {
     // this variable can be used to overide display of the meta information for a comment
     // is used for the defensio addon.
     echo $comment_divider_header;
 }
 echo "\n\t\t\t\t<li class='{$comment_row_class}' ><a href='../index.php?showimage=" . $parent_id . "'>\n\t\t\t\t<img src='" . $cfgrow['thumbnailpath'] . "thumb_{$image}' alt='{$image}' /></a>\n\n\t\t\t\t{$admin_lang_cmnt_name} <a target=\"_blank\" href=\"{$url}\">{$name}</a>\n\t\t\t\t{$admin_lang_cmnt_email} {$email} <br />{$admin_lang_cmnt_comment}\n\t\t\t\t<div id=\"full_{$id}\" style=\"display:none\"><b>{$message}</b></div>\n\t\t\t\t<div id=\"excerpt_{$id}\"><b>{$message_excerpt}</b></div><br />\n\t\t\t\t{$admin_lang_cmnt_image}: \"{$imagename}\"<br />";
 if (isset($comment_meta_information)) {
示例#4
0
        $category = clean($_POST['category']);
        $getid = $_GET['id'];
        $upquery = mysql_query("update " . $pixelpost_db_prefix . "categories set name='{$category}' where id='{$getid}'");
        $result = mysql_query($upquery) || "Error: " . mysql_error();
        echo "<div id='jcaption'>Update</div><div id='content'>\r\n        Updated category to new name <b>\"{$category}\".</b></div><p />";
    }
    echo "\r\n    <div id='jcaption'>Add Category</div>\r\n    <div id='content'>Add a category which you can assign to images.<p />\r\n    <form method='post' action='{$PHP_SELF}?view=categories&amp;action=add'>\r\n    <input type='text' name='category' style='width:300px;' /><p />\r\n    <input type='submit' value='Add Category' />\r\n    </form>\r\n    </div>\r\n    \r\n    \r\n    <div id='jcaption'>Edit Categories</div>\r\n    <div id='content'>\r\n    <form method='post' action='{$PHP_SELF}?view=categories&amp;action=edit'>\r\n    <select name='id'>\r\n    <option value=''>Edit a category</option>\r\n    <option value=''>----------</option>\r\n    ";
    $query = mysql_query("select * from " . $pixelpost_db_prefix . "categories order by name");
    while (list($id, $name) = mysql_fetch_row($query)) {
        $name = pullout($name);
        echo "<option value='{$id}'>{$name}</option>\n";
    }
    echo "\r\n    </select><p />\r\n    <input type='submit' value='Edit Category' />\r\n    </form>\r\n    </div>\r\n    \r\n    <div id='jcaption'>Delete Categories</div>\r\n    <div id='content'>\r\n    <form method='post' action='{$PHP_SELF}?view=categories&amp;action=delete'>\r\n    <select name='id'>\r\n    <option value=''>Delete a category</option>\r\n    <option value=''>----------</option>\r\n    ";
    $query = mysql_query("select * from " . $pixelpost_db_prefix . "categories order by name");
    while (list($id, $name) = mysql_fetch_row($query)) {
        $name = pullout($name);
        echo "<option value='{$id}'>{$name}</option>\n";
    }
    echo "\r\n    </select><p />\r\n    <input type='submit' value='Delete Category' />\r\n    </form>\r\n    </div>\r\n    ";
}
// ##########################################################################################//
// FUNCTIONS
// ##########################################################################################//
// translate file upload errors to something human understandable
function check_upload($string)
{
    $error_explained = array("0" => "Upload went without error.", "1" => "Exceeded maximum filesize for webserver to handle.", "2" => "Exceeded maximum filesize.", "3" => "File was not fully uploaded.", "4" => "No file was uploaded.");
    $result = $error_explained[$string];
    return $result;
}
function clean($string)
示例#5
0
//------------- Make Archive browse menu with link to paged archive
// build browse menu
$browse_select = "";
$temppagenum = 1;
// do you use links with page number?
if ($maxpthumb > 0) {
    $browse_select = "<select name='browse' onchange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>{$lang_browse_select_category}</option><option value='index.php?x=browse&amp;category=&amp;pagenum={$temppagenum}'>{$lang_browse_all} (" . $pixelpost_all_photonumb . ")</option>";
} else {
    $browse_select = "<select name='browse' onchange='self.location.href=this.options[this.selectedIndex].value;'><option value=''>{$lang_browse_select_category}</option><option value='index.php?x=browse&amp;category='>{$lang_browse_all} (" . $pixelpost_all_photonumb . ")</option>";
}
$query = mysql_query("SELECT * FROM " . $pixelpost_db_prefix . "categories ORDER BY name");
while (list($id, $name, $alt_name) = mysql_fetch_row($query)) {
    if ($language_abr == $default_language_abr) {
        $name = pullout($name);
    } else {
        $name = pullout($alt_name);
    }
    $queryr = "SELECT count(*) AS count,datetime\n\tFROM {$pixelpost_db_prefix}catassoc AS t1\n\tINNER JOIN {$pixelpost_db_prefix}pixelpost t2 on t2.id = t1.image_id\n\tWHERE (t1.cat_id = '" . $id . "' AND datetime<='{$datetime}')\n\tGROUP BY t1.cat_id ";
    $count = mysql_query($queryr);
    $count = mysql_fetch_array($count, MYSQL_ASSOC);
    $count = $count['count'];
    // check if you are using this addon
    // u r using
    if ($maxpthumb > 0) {
        $browse_select .= "<option value='index.php?x=browse&amp;category={$id}&amp;pagenum=1'>{$name} (" . $count . ")</option>";
    } else {
        $browse_select .= "<option value='index.php?x=browse&amp;category={$id}'>{$name} (" . $count . ")</option>";
    }
}
// end while
// finilize the tag
示例#6
0
function category_list_as_table_noecho()
{
    global $pixelpost_db_prefix;
    // get the id and name of the first entered category, default category.
    $query = mysql_query("select * from " . $pixelpost_db_prefix . "categories order by id asc LIMIT 0,1");
    list($firstid, $firstname) = mysql_fetch_row($query);
    if (isset($_GET['id'])) {
        $getid = (int) $_GET['id'];
    }
    // begin of category-list as a table
    $toprint = "<table id='cattable'><tr>";
    $catcounter = 0;
    $query = mysql_query("select id, name from " . $pixelpost_db_prefix . "categories  order by name");
    while (list($id, $name) = mysql_fetch_row($query)) {
        $name = pullout($name);
        $id = pullout($id);
        $catcounter++;
        $inarow = 4;
        if ($firstid == $id) {
            // if it is the first defualt category in the new_image page
            $toprint .= "<td><input type='checkbox' CHECKED name='category[]' value='" . $id . "'>&nbsp;" . $name . "</td>";
        } else {
            // if it is other categories in the new image page
            $toprint .= "<td><input type='checkbox' name='category[]' value='" . $id . "'>&nbsp;" . $name . "</td>";
        }
        if ($catcounter % $inarow == 0) {
            $toprint .= "\n</tr><tr>\n";
        } else {
            $toprint .= "\n";
        }
    }
    if ($catcounter % $inarow > 0) {
        $toprint .= "</tr>";
    }
    $toprint .= "</table><br clear='all' />\n\n";
    return $toprint;
}
示例#7
0
    echo $output;
    exit;
}
// ##########################################################################################//
// ATOM FEED - re and triple check the encoding please please please
// ##########################################################################################//
if ($_GET['x'] == "atom") {
    header("content-type: application/atom+xml");
    $tzone = substr(date("O"), 0, 3);
    $tzone = "{$tzone}:00";
    pullout($cfgrow['sitetitle']);
    $atom = "<?xml version='1.0' encoding='utf8'?>\r\n    <feed\r\n    version='0.3'\r\n    xml:lang='en-US'\r\n    xmlns='http://purl.org/atom/ns#'>\r\n    <title>" . $cfgrow['sitetitle'] . "</title>\r\n    <link rel='alternate' type='text/html' href='" . $cfgrow['siteurl'] . "' title='" . $cfgrow['sitetitle'] . "' />\r\n    <author>\r\n    <name>" . $cfgrow['sitetitle'] . "</name>\r\n    <url>" . $cfgrow['siteurl'] . "</url>\r\n    </author>\r\n    <generator\r\n    url='http://www.pixelpunk.se/software/'\r\n    version='1.3'>Pixelpost</generator>\r\n    <modified>" . date("Y-m-d\\TH:i:s{$tzone}") . "</modified>\r\n    ";
    $query = mysql_query("select id,datetime,headline,body,image from " . $pixelpost_db_prefix . "pixelpost where (datetime<='{$cdate}') order by datetime desc");
    while (list($id, $datetime, $headline, $body, $image) = mysql_fetch_row($query)) {
        $headline = pullout($headline);
        $body = pullout($body);
        $image = $cfgrow['siteurl'] . "thumbnails/thumb_{$image}";
        $datetime = strtotime($datetime);
        $issued = $datetime;
        $tzone = substr(date("O"), 0, 3);
        $tzone = "{$tzone}:00";
        $datetime = date("Y-m-d\\TH:i:s{$tzone}", $datetime);
        $issued = date("Y-m-d\\TH:i:s{$tzone}", $issued);
        $atom .= "\r\n        <entry>\r\n        <title\r\n            type='text/html'\r\n            mode='escaped'>\r\n            {$headline}</title>\r\n        <link rel='alternate' \r\n            type='text/html' \r\n            href='" . $cfgrow['siteurl'] . "?showimage={$id}' \r\n            title='{$headline}' />\r\n        <id>" . $cfgrow['siteurl'] . "?showimage={$id}</id>\r\n        <content type='text/xhtml'>\r\n        <img src='{$image}' /><br />\r\n        {$body}\r\n        </content>\r\n        <issued>{$issued}</issued>\r\n        <modified>{$datetime}</modified>\r\n        </entry>\r\n        ";
    }
    $atom .= "</feed>";
    echo $atom;
    exit;
}
$tpl = ereg_replace("<SITE_RSS_LINK>", "<a href='index.php?x=rss'>RSS 2.0</a>", $tpl);
$tpl = ereg_replace("<SITE_TITLE>", $pixelpost_site_title, $tpl);
示例#8
0
/**
 * Create categories HTML table
 *
 */
function category_list_as_table($categories, $cfgrow)
{
    global $pixelpost_db_prefix;
    if (!is_array($categories)) {
        $categories = array();
    }
    // get the id and name of the first entered category, default category.
    $query = mysql_query("SELECT * FROM `" . $pixelpost_db_prefix . "categories` ORDER BY `id` ASC LIMIT 0,1");
    list($firstid, $firstname) = mysql_fetch_row($query);
    $getid = isset($_GET['id']);
    $getid = intval($getid);
    // begin of category-list as a table
    $x = 0;
    $query = mysql_query("SELECT t1.id, `name`, `alt_name`, `image_id` FROM `" . $pixelpost_db_prefix . "categories` AS t1 LEFT JOIN `" . $pixelpost_db_prefix . "catassoc` t2 ON t2.cat_id = t1.id AND t2.image_id = '{$getid}' ORDER BY t1.name");
    while (list($id, $name) = mysql_fetch_row($query)) {
        echo "<table id='cattable'><tr>";
        $catcounter = 0;
        $query = mysql_query("SELECT t1.id, `name`, `alt_name`, `image_id` FROM `" . $pixelpost_db_prefix . "categories` AS t1 LEFT JOIN `" . $pixelpost_db_prefix . "catassoc` t2 ON t2.cat_id = t1.id AND t2.image_id = '{$getid}' ORDER BY t1.name");
        while (list($id, $name, $alt_name, $image_id) = mysql_fetch_row($query)) {
            $name = pullout($name);
            $alt_name = $cfgrow['altlangfile'] != 'Off' ? " (" . pullout($alt_name) . ")" : null;
            $id = pullout($id);
            $catcounter++;
            $inarow = 4;
            if (($image_id != "" and isset($_GET['view']) and $_GET['view'] == 'images') || in_array($id, $categories)) {
                echo "<td><input type='checkbox' CHECKED name='category[]' value='" . $id . "' id='cat" . $x . "'/>&nbsp;<label for='cat" . $x . "'>" . $name . $alt_name . "</label></td>";
            } else {
                //if($firstid == $id && $_GET['view']!='images') // if it is the first defualt category in the new_image page
                echo "<td><input type='checkbox' name='category[]' value='" . $id . "' id='cat" . $x . "'/>&nbsp;<label for='cat" . $x . "'>" . $name . $alt_name . "</label></td>";
                //else // if it is other categories in the new image page
                //echo "<td><input type='checkbox' name='category[]' value='".$id."' id='cat".$x."'/>&nbsp;<label for='cat".$x."'>".$name.$alt_name."</label></td>";
            }
            if ($catcounter % $inarow == 0) {
                echo "\n</tr><tr>\n";
            } else {
                echo "\n";
            }
            $x++;
        }
    }
    if ($catcounter % $inarow > 0) {
        echo "</tr>";
    }
    echo "</table>\n\n";
}
示例#9
0
 $lc = 0;
 while ($lc <= 59) {
     if ($lc < 10) {
         $lc = "0{$lc}";
     }
     echo "<option";
     if (isset($_POST['post_minute']) and $_POST['post_minute'] == $lc) {
         echo " SELECTED";
     }
     echo " value='{$lc}'>{$lc}</option>";
     $lc++;
 }
 echo "</select></td></tr></table></div>";
 echo "<div class='jcaption'>{$admin_lang_optn_comment_setting2}</div>\n \t\t\t<div class='content'>{$admin_lang_optn_cmnt_mod_txt2}\n \t\t\t\t<select name=\"comments_settings\">";
 $comments_result = sql_array("SELECT comments FROM " . $pixelpost_db_prefix . "pixelpost where id = '{$getid}'");
 $comments = pullout($comments_result['comments']);
 if ($comments == 'A') {
     echo "<option selected=\"selected\" value=\"A\">{$admin_lang_optn_cmnt_mod_allowed}</option><option value=\"M\">{$admin_lang_optn_cmnt_mod_moderation}</option><option value=\"F\">{$admin_lang_optn_cmnt_mod_forbidden}</option>";
 } elseif ($comments == 'M') {
     echo "<option value=\"A\">{$admin_lang_optn_cmnt_mod_allowed}</option><option  selected=\"selected\" value=\"M\">{$admin_lang_optn_cmnt_mod_moderation}</option><option value=\"F\">{$admin_lang_optn_cmnt_mod_forbidden}</option>";
 } else {
     echo "<option value=\"A\">{$admin_lang_optn_cmnt_mod_allowed}</option><option value=\"M\">{$admin_lang_optn_cmnt_mod_moderation}</option><option selected=\"selected\" value=\"F\">{$admin_lang_optn_cmnt_mod_forbidden}</option>";
 }
 echo "</select></div>";
 // Check if the language addon is enabled. If not there is no need to show these fields
 if ($cfgrow['altlangfile'] != 'Off') {
     echo "\n\t\t\t\t\t<div class='jcaption' style='text-align:left;color:black;'>{$admin_lang_imgedit_alt_language}</div><br />\n\t\t\t\t\t\t<div class='jcaption'>{$admin_lang_imgedit_title}</div>\n\t\t\t\t\t\t\t<div class='content'><input type='text' name='alt_headline' value='{$alt_headline}' style='width:300px;' /></div>\n\t\t\t\t\t\t<div class='jcaption'>{$admin_lang_imgedit_tags_edit}</div>\n\t\t\t\t\t\t\t<div class='content'><input type='text' name='alt_tags' style='width:550px;' value='{$alt_tags}' />";
     eval_addon_admin_workspace_menu('edit_image_form_alt_lang');
     echo "</div>\n\t\t\t\t\t\t<div class='jcaption'>{$admin_lang_imgedit_txt_desc}</div>\n\t\t\t<div class='content'>";
     if ($cfgrow['markdown'] == 'T') {
         echo "\n   \t\t\t\t\t\t\t<div>" . $admin_lang_ni_markdown_text . "<br/>\n    \t\t\t\t\t\t<a href='http://daringfireball.net/projects/markdown/' title='<?php echo {$admin_lang_ni_markdown_hp}; ?>' target='_blank'>" . $admin_lang_ni_markdown_hp . "</a>\n    \t\t\t\t\t\t&nbsp;&nbsp;&nbsp;\n    \t\t\t\t\t\t<a href='http://daringfireball.net/projects/markdown/basics' title='<?php echo {$admin_lang_ni_markdown_element}; ?>' target='_blank'>" . $admin_lang_ni_markdown_element . "</a>\n    \t\t\t\t\t\t&nbsp;&nbsp;&nbsp;\n    \t\t\t\t\t\t<a href='http://daringfireball.net/projects/markdown/syntax' title='<?php echo {$admin_lang_ni_markdown_syntax}; ?>' target='_blank'>" . $admin_lang_ni_markdown_syntax . "</a>\n    \t\t\t\t\t\t</div>";
示例#10
0
 */
$rss_auto = '<link rel="alternate" type="application/rss+xml" title="' . $feed_title . ' - RSS Feed" href="' . $cfgrow['siteurl'] . 'index.php?x=rss" />';
$tpl = ereg_replace('<RSS_AUTODETECT_LINK>', $rss_auto, $tpl);
$tpl = ereg_replace('<SITE_RSS_LINK>', '<a href="./index.php?x=rss">RSS 2.0</a>', $tpl);
/**
 * Comment Rss template tags
 *
 */
$comment_rss_auto = '<link rel="alternate" type="application/rss+xml" title="' . $feed_title . ' - Comment RSS Feed" href="' . $cfgrow['siteurl'] . 'index.php?x=comment_rss" />';
$tpl = ereg_replace('<COMMENT_RSS_AUTODETECT_LINK>', $comment_rss_auto, $tpl);
$tpl = ereg_replace('<SITE_COMMENT_RSS_LINK>', '<a href="./index.php?x=comment_rss">Comment RSS</a>', $tpl);
/**
 * FEED auto discovery tag
 *
 */
if ($cfgrow['feed_discovery'] == 'RA') {
    $feed_auto_discovery = $rss_auto . "\n" . $atom_auto;
} elseif ($cfgrow['feed_discovery'] == 'R') {
    $feed_auto_discovery = $rss_auto;
} elseif ($cfgrow['feed_discovery'] == 'A') {
    $feed_auto_discovery = $atom_auto;
} elseif ($cfgrow['feed_discovery'] == 'E') {
    if ($cfgrow['feed_external_type'] == 'ER') {
        $feed_auto_discovery = "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"" . $feed_title . " - RSS Feed\" href=\"" . pullout($cfgrow['feed_external']) . "\" />";
    } else {
        $feed_auto_discovery = "<link rel=\"service.feed\" type=\"application/x.atom+xml\" title=\"" . $feed_title . " - ATOM Feed\" href=\"" . pullout($cfgrow['feed_external']) . "\" />";
    }
} else {
    $feed_auto_discovery = '<!--Feeds are currently disabled-->';
}
$tpl = ereg_replace('<FEED_AUTO_DISCOVERY>', $feed_auto_discovery, $tpl);