Пример #1
0
  function Commit($post)
  {
    $message = trim($post["message"]);

    $r = SQLLib::SelectRow("SELECT count(0) as c FROM bbs_posts WHERE topic=".$this->topic);

  	$a = array();
  	$a["userlastpost"] = get_login_id();
  	$a["lastpost"] = date("Y-m-d H:i:s");
  	$a["count"] = $r->c;

    SQLLib::UpdateRow("bbs_topics",$a,"id=".$this->topic);

  	$a = array();
  	$a["added"] = date("Y-m-d H:i:s");
  	$a["author"] = get_login_id();
  	$a["post"] = $message;
  	$a["topic"] = $this->topic;

    SQLLib::InsertRow("bbs_posts",$a);

    @unlink("cache/pouetbox_latestbbs.cache");

    return array();
  }
Пример #2
0
function file_save($filearr)
{
    if ($filearr['error'] != 0) {
        echo 'error occured by upload';
        return FALSE;
    }
    $path = $_SERVER['DOCUMENT_ROOT'] . '/forum/uploads/';
    if (file_exists($filearr['tmp_name']) && is_readable($filearr['tmp_name'])) {
        $newname = md5($filearr['tmp_name']);
        if (strrpos($filearr['name'], '.')) {
            $ext = substr($filearr['name'], strrpos($filearr['name'], '.'));
        } else {
            $ext = '';
        }
        while (file_exists($path . $newname)) {
            echo "filename {$newname} exists<br />\n";
            $newname = md5($newname);
        }
        $newname = substr($newname, 0, -5) . '.' . substr($newname, -4);
        if (move_uploaded_file($filearr['tmp_name'], $path . $newname)) {
            db_query("INSERT INTO files VALUES(NULL,'" . get_login_id() . "','{$newname}')");
            return $newname;
        }
    }
    echo "\n" . $filearr['tmp_name'] . "\n";
    return FALSE;
}
  function Commit($data)
  {
    $post = array();

    global $REQUESTTYPES;
    if ($REQUESTTYPES[ $_POST["requestType"] ])
    {
      $error = $REQUESTTYPES[ $_POST["requestType"] ]::ValidateRequest($data,$post);
      if ($error) return $error;
    }
    else
    {
      return array("no such request type!");
    }
    $a = array();
    $a["requestType"] = $data["requestType"];
    if($_REQUEST["prod"])
    {
      $a["itemID"] = (int)$_REQUEST["prod"];
      $a["itemType"] = "prod";
    }
    $a["requestDate"] = date("Y-m-d H:i:s");
    $a["userID"] = get_login_id();

    $a["requestBlob"] = serialize($post);

    global $reqID;
    $reqID = SQLLib::InsertRow("modification_requests",$a);

    return array();
  }
Пример #4
0
  function Commit($post)
  {
    $message = trim($post["comment"]);
    $rating = $post["rating"];

    if ($this->myVote)
      $rating = "isok"; // user already has a vote

    $vote = 0;
    switch($rating) {
      case "rulez": $vote = 1; break;
      case "sucks": $vote = -1; break;
      default: $vote = 0; break;
    }

    $a = array();
    $a["addedDate"] = date("Y-m-d H:i:s");
    $a["who"] = get_login_id();
    $a["which"] = $this->prod;
    $a["comment"] = $message;
    $a["rating"] = $vote;
    SQLLib::InsertRow("comments",$a);

    $rulez=0;
    $piggie=0;
    $sucks=0;
    $total=0;
    $checktable = array();

    $r = SQLLib::SelectRows("SELECT rating,who FROM comments WHERE which=".$this->prod);
    foreach ($r as $t)
      if(!array_key_exists($t->who, $checktable) || $t->rating != 0)
        $checktable[$t->who] = $t->rating;

    foreach($checktable as $k=>$v)
    {
      if($v==1) $rulez++;
      else if($v==-1) $sucks++;
      else $piggie++;
      $total++;
    }

    if ($total!=0)
      $avg = sprintf("%.2f",(float)($rulez*1+$sucks*-1)/(float)$total);
    else
      $avg = "0.00";

    $a = array();
    $a["voteup"] = $rulez;
    $a["votepig"] = $piggie;
    $a["votedown"] = $sucks;
    $a["voteavg"] = $avg;
    SQLLib::UpdateRow("prods",$a,"id=".$this->prod);

    @unlink("cache/pouetbox_latestcomments.cache");
    @unlink("cache/pouetbox_topmonth.cache");
    @unlink("cache/pouetbox_stats.cache");

    return array();
  }
Пример #5
0
  function Commit( $data )
  {
    $a = array();
    $a["name"] = trim($data["name"]);
    $a["desc"] = $data["desc"];
    $a["upkeeper"] = get_login_id();
    $a["addedUser"] = get_login_id();
    $a["addedDate"] = date("Y-m-d H:i:s");
    $this->listID = SQLLib::InsertRow("lists",$a);

    return array();
  }
Пример #6
0
function get_login_gids()
{
    if (!empty($_SESSION['user'])) {
        $q = "SELECT gid FROM groups WHERE belongsto='%" . get_login_id() . "%'";
        $res = db_fetch_query(db_query($q), SQLITE_NUM);
        if (isset($res['0']['0'])) {
            return $res['0']['0'];
        } else {
            return 0;
        }
    } else {
        die('no logged in user detected');
    }
}
Пример #7
0
  function RenderBody()
  {
    global $currentUser;
    if (!get_login_id())
    {
      require_once("box-login.php");
      $box = new PouetBoxLogin();
      $box->RenderBody();
    }
    else
    {
      if (!$currentUser->CanPostInBBS())
        return;

      echo "<form action='add.php' method='post'>\n";

      $csrf = new CSRFProtect();
      $csrf->PrintToken();

      echo "<div class='content'>\n";
      echo " <input type='hidden' name='type' value='bbs'>\n";

      echo " <label for='topic'>topic:</label>\n";
      echo " <input name='topic' id='topic'/>\n";

      echo " <label for='category'>category:</label>\n";
      echo " <select name='category' id='category'>\n";
      foreach($this->categories as $v)
        printf("<option value='%s'>%s</option>",_html($v),_html($v));
      echo " </select>\n";

      echo " <label for='message'>message:</label>\n";
      echo " <textarea name='message' id='message'></textarea>\n";

      echo " <div><a href='faq.php#BB Code'><b>BB Code</b></a> is allowed here</div>\n";
      echo "</div>\n";
      echo "<div class='foot'>\n";
      echo " <script language='JavaScript' type='text/javascript'>\n";
      echo " <!--\n";
      echo "   document.observe('dom:loaded',function(){ AddPreviewButton($('submit')); });\n";
      echo " //-->\n";
      echo " </script>\n";
      echo " <input type='submit' value='Submit' id='submit'>";
      echo "</div>\n";
      echo "</form>\n";
    }
  }
Пример #8
0
  function Commit($data)
  {
    global $groupID;

    $a = array();
    $a["name"] = trim($data["name"]);
    $a["acronym"] = $data["acronym"];
    $a["web"] = $data["website"];
    $a["addedUser"] = get_login_id();
    $a["csdb"] = $data["csdbID"];
    //$a["zxdemo"] = $data["zxdemoID"];
    $a["demozoo"] = $data["demozooID"];
    $a["addedDate"] = date("Y-m-d H:i:s");
    $this->groupID = SQLLib::InsertRow("groups",$a);

    return array();
  }
Пример #9
0
 function RenderBody()
 {
   //echo "\n\n";
   //echo "<div class='pouettbl' id='".$this->uniqueID."'>\n";
   if (get_login_id())
   {
     echo "<ul class='boxlist'>\n";
     echo "  <li><a href='submit_prod.php'>submit a prod</a></li>\n";
     echo "  <li><a href='submit_group.php'>submit a group</a></li>\n";
     echo "  <li><a href='submit_party.php'>submit a party</a></li>\n";
     echo "  <li><a href='submit_board.php'>submit a bulletin board</a></li>\n";
     echo "  <li><a href='submit_avatar.php'>upload an avatar</a></li>\n";
     echo "  <li><a href='submit_logo.php'>upload a logo</a></li>\n";
     echo "  <li><a href='submit_list.php'>create a list</a></li>\n";
     echo "  <li><a href='logo_vote.php'>vote on logos</a></li>\n";
     echo "</ul>\n";
   }
   echo "<h2>free 4 all stuffz!</h2>\n";
   echo "<ul class='boxlist'>\n";
   echo "  <li><a href='http://www.bitfellas.org/submitnews.php'>submit news via bitfellas</a></li>\n";
   echo "</ul>\n";
   //echo "</div>\n";
 }
Пример #10
0
 function RenderBody() {
   if (!get_login_id())
   {
     echo "<div class='content loggedout'>\n";
     printf( "<a href='login.php?return=%s'>login via SceneID</a>",_html(rootRelativePath()) );
     echo "</div>\n";
   } else {
     global $currentUser;
     echo "<div class='content loggedin'>\n";
     echo "you are logged in as<br/>\n";
     echo $currentUser->PrintLinkedAvatar()." ";
     echo $currentUser->PrintLinkedName();
     echo "</div>\n";
     if ($currentUser->IsGloperator())
     {
       $req = SQLLib::SelectRow("select count(*) as c from modification_requests where approved is null")->c;
       if ($req)
       {
         echo "<div class='content notifications'>\n";
         echo "[ <a href='admin_modification_requests.php' class='adminlink'>";
         echo $req;
         if ($req==1)
           echo " request waiting!";
         else
           echo " requests waiting!";
         echo "</a> ]";
         echo "</div>\n";
       }
     }
     echo "<div class='foot'>\n";
     echo "<a href='account.php'>account</a> ::\n";
     echo "<a href='customizer.php'>cust&ouml;omizer</a> ::\n";
     echo "<a href='logout.php'>logout</a>\n";
     echo "</div>";
   }
 }
Пример #11
0
  function Commit($data)
  {
    $this->LoadFromDB();

    $prodID = (int)$this->prod->id;

    $sql = array();

    if ($this->fields["releaseDate"])
    {
      if ($data["releaseDate_month"] && $data["releaseDate_year"] && checkdate( (int)$data["releaseDate_month"], 15, (int)$data["releaseDate_year"]) )
        $sql["releaseDate"] = sprintf("%04d-%02d-15",$data["releaseDate_year"],$data["releaseDate_month"]);
      else if ($data["releaseDate_year"])
        $sql["releaseDate"] = sprintf("%04d-00-15",$data["releaseDate_year"]);
      else
        $sql["releaseDate"] = null;
    }

    if ($this->fields["partyCompo"])
      $sql["party_compo"] = nullify($data["partyCompo"]);
    if ($this->fields["partyRank"])
      $sql["party_place"] = $data["partyRank"];

    if ($sql)
      SQLLib::UpdateRow("prods",$sql,"id=".$prodID);

    if ($this->fields["screenshot"])
    {
      if(is_uploaded_file($_FILES["screenshot"]["tmp_name"]))
      {
        foreach( array( "jpg","gif","png" ) as $v )
          @unlink( get_local_screenshot_path( $prodID, $v ) );

        list($width,$height,$type) = GetImageSize($_FILES["screenshot"]["tmp_name"]);
        $extension = "_";
        switch($type) {
          case 1:$extension="gif";break;
          case 2:$extension="jpg";break;
          case 3:$extension="png";break;
        }
        move_uploaded_file_fake( $_FILES["screenshot"]["tmp_name"], get_local_screenshot_path( $prodID, $extension ) );

        $a = array();
        $a["prod"] = $prodID;
        $a["user"] = get_login_id();
        $a["added"] = date("Y-m-d H:i:s");
        SQLLib::InsertRow("screenshots",$a);
      }
    }
    if ($this->fields["nfofile"])
    {
      if(is_uploaded_file($_FILES["nfofile"]["tmp_name"]))
      {
        move_uploaded_file_fake( $_FILES["nfofile"]["tmp_name"], get_local_nfo_path( $prodID ) );

        $a = array();
        $a["prod"] = $prodID;
        $a["user"] = get_login_id();
        $a["added"] = date("Y-m-d H:i:s");
        SQLLib::InsertRow("nfos",$a);
      }
    }
    return array();
  }
Пример #12
0
 function Commit($data)
 {
   global $currentUser;
   global $currentUserSettings;
   global $ephemeralStorage;
   $sql = array();
   foreach ($this->fieldsSettings as $k=>$v)
   {
     if ($v["type"] == "number")
     {
       $sql[$k] = min($v["max"], max($v["min"], (int)($data[$k]) ));
     }
     else
     {
       $sql[$k] = (int)$data[$k];
     }
     $currentUserSettings->$k = (int)$sql[$k];
   }
   if (SQLLib::SelectRow(sprintf_esc("select id from usersettings where id = %d",(int)get_login_id())))
   {
     SQLLib::UpdateRow("usersettings",$sql,"id=".(int)get_login_id());
   }
   else
   {
     $sql["id"] = (int)get_login_id();
     SQLLib::InsertRow("usersettings",$sql);
   }
   $ephemeralStorage->set( "settings:".$currentUser->id, $currentUserSettings );
 }
Пример #13
0
    //$_SESSION['report_value'] = $result;
    /*echo $col++;
    		echo "<pre>";
    		print_r( $_SESSION['report_value'] );
    		echo "</pre>";
    		foreach($_SESSION['report_value'] as $rows){
    			foreach($rows as $key => $val ){
    				print_r( $rows["$key"] );
    				print "Key $key, Value $val\n";
    			}
    		}*/
    export_xls($_SESSION['report_value'], $cols_name, "export", "export");
    exit;
}
auth_check("member", false, false);
$user_id = get_login_id();
$get_member_group_sql = "SELECT group_id,name FROM plu_member WHERE account = '{$user_id}'";
$member_info = $db->get_results($get_member_group_sql, ARRAY_A);
$_SESSION['member_group'] = $member_info[0]['group_id'];
?>
<!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>CMS後台管理系統-商品服務列表</title>
    <script src="js/jquery.js" type="text/javascript"></script>
    <script src="js/jquery.history_remote.pack.js" type="text/javascript"></script>
    <script src="js/jquery.tabs.pack.js" type="text/javascript"></script>
	
    <script type="text/javascript">
	function aHover(url){
Пример #14
0
$topicid = (int)$_GET["which"];
$view = new PouetBoxBBSView($topicid);
$view->Load();

$post = new PouetBoxBBSPost($topicid);

$TITLE = $view->topic->topic;

require_once("include_pouet/header.php");
require("include_pouet/menu.inc.php");

echo "<div id='content'>\n";
if ($view->topic)
{
  echo $view->Render();
  if (!get_login_id())
  {
    require_once("include_pouet/box-login.php");
    $box = new PouetBoxLogin();
    $box->Render();
  }
  else
  {
    if ($view->topic->id == FIXMETHREAD_ID)
    {
      $msg = new PouetBoxModalMessage( true );
      $msg->uniqueID = "pouetbox_fixmewarning";
      $msg->classes[] = "errorbox";
      $msg->title = "want to add or update a link ?";
      $msg->message = "we've made a new automated edit request system to modify prods - if you just want to add credits or links to prods, <b>go to the prod page and click the edit link at the bottom</b>!";
      $msg->Render();
Пример #15
0
//VER 0.01-INITIAL VERSION, SD:16/09/2014 ED:08/10/2014,TRACKER NO:82
//*********************************************************************************************************//-->
<?php
require_once 'google/appengine/api/mail/Message.php';
use google\appengine\api\mail\Message;
include "COMMON_FUNCTIONS.php";
include "CONNECTION.php";
date_default_timezone_set('Asia/Kolkata');
$get_active_user=array();
$get_active_user=get_active_login_id();//GET ALL ACTIVE LOGIN ID
$currentdate=date("Y-m-d");//CURRENT DATE
$Current_day=date('l');//CURRENT DAY
$check_ph=Check_public_holiday($currentdate);//CHECK CURRENT DATE IS IN PUBLIC HOLIDAY
$check_onduty=check_onduty($currentdate);//CHECK CURRENT DATE IS IN ONDUTY
$get_login_id=array();
$get_login_id=get_login_id($currentdate);//GET WHO ARE ALL ENTERED REPORT FOR CURRENT DATE
$ph_array=get_public_holiday();// GET ALL PUBLIC HOLIDAY
$select_admin="SELECT * FROM VW_ACCESS_RIGHTS_TERMINATE_LOGINID WHERE URC_DATA='ADMIN'";
$select_sadmin="SELECT * FROM VW_ACCESS_RIGHTS_TERMINATE_LOGINID WHERE URC_DATA='SUPER ADMIN'";
$admin_rs=mysqli_query($con,$select_admin);
$sadmin_rs=mysqli_query($con,$select_sadmin);
if($row=mysqli_fetch_array($admin_rs)){
    $admin=$row["ULD_LOGINID"];//get admin
}
if($row=mysqli_fetch_array($sadmin_rs)){
    $sadmin=$row["ULD_LOGINID"];//get super admin
}
$select_template="SELECT * FROM EMAIL_TEMPLATE_DETAILS WHERE ET_ID=3";
$select_template_rs=mysqli_query($con,$select_template);
if($row=mysqli_fetch_array($select_template_rs)){
    $mail_subject=$row["ETD_EMAIL_SUBJECT"];
Пример #16
0
$trail = new Breadcrumb();
?>
<script type="text/javascript">
function logoutHaver(){
	location.href = "index.php?func=logout";
}
function changeLangHaver(lang){
	location.href = "index.php?func=set_lang&lang="+lang;
}
</script>
<div  class="page-bread">
 <p><?php 
$trail->output();
?>
  <b class="user">使用者 : <?php 
echo get_login_id();
?>
<input type="button"name="button"class="button60" value="登出" onClick="logoutHaver()" title=""/><br /><br />
      Change Language 
<select name="change_lang" id="change_lang" onChange="changeLangHaver(this.value);">
<option value="ZH-TW" >繁體中文</option>
<option value="ZH-CN" >简体中文</option>
<option value="DE" >Deutsch</option>
<option value="EN" >English</option>
</select>
  </b>
  </p>
  

</div>
<script type="text/javascript">
Пример #17
0
<?php

require_once 'includes/header.inc.php';
require_once 'includes/user.inc.php';
$q = "SELECT * FROM files WHERE up_user_id='" . get_login_id() . "'";
$res = db_fetch_array(db_query($q), SQLITE_ASSOC);
$keys = array_keys($res['0']);
echo '<table border=1 width=850><tr>';
foreach ($keys as $k) {
    echo "\t" . '<td>' . $k . '</td>' . "\n";
}
echo '</tr>' . "\n";
foreach ($res as $r) {
    echo '<tr>' . "\n";
    foreach ($r as $k => $rt) {
        echo "\t" . '<td>';
        if ($k == 'file') {
            echo '<a href="uploads/' . $rt . '">';
        }
        echo $rt;
        if ($k == 'file') {
            echo '</a>';
        }
        echo '</td>' . "\n";
    }
    echo '</tr>' . "\n";
}
echo '</table>';
echo '<br /><br />' . "\n";
echo '<a href="' . $_SERVER['HTTP_REFERER'] . '">Back</a>';
require_once 'includes/footer.inc.php';
Пример #18
0
     } else {
         $tou = user2id($receiver);
     }
     if (post_save(get_login_id(), $tou, $message)) {
         echo 'Message successfully saved!<br />';
     } else {
         echo ' Problem saving message ... Try again please.<br />';
     }
     form_msg();
     echo '<br /><br />' . "\n";
     unset($_GET);
     unset($_POST);
     echo '<a href="' . $_SERVER['PHP_SELF'] . '">Return to overview</a><br />' . "\n";
 } else {
     if (!isset($uid)) {
         $uid = get_login_id();
     }
     $q = "SELECT * FROM msgs WHERE to_id='" . sqlite_escape_string($uid) . "'";
     $res = db_fetch_array(db_query($q), SQLITE_ASSOC);
     $keys = array_keys($res['0']);
     echo '<table border=1 width=850><tr>';
     foreach ($keys as $k) {
         echo "\t" . '<td>' . $k . '</td>' . "\n";
     }
     echo '</tr>' . "\n";
     foreach ($res as $r) {
         echo '<tr>' . "\n";
         foreach ($r as $rt) {
             echo "\t" . '<td>' . $rt . '</td>' . "\n";
         }
         echo '</tr>' . "\n";
Пример #19
0
function auth_get_modules($site_id = 0, $is_front = null, $mod_type = null, $is_admin = null, $mcat_id = null)
{
    $user_id = get_login_id();
    if (empty($user_id)) {
        return null;
    }
    $available_funcs = auth_get_functions($user_id, $site_id);
    if (empty($available_funcs)) {
        return null;
    }
    $sql_values = "'" . implode("','", $available_funcs) . "'";
    $sql = "SELECT DISTINCT m.mod_id, m.mod_name, m.mcat_id, m.mod_order FROM sys_functions AS f, sys_modules AS m ";
    $sql .= "WHERE mod_enable = 1 AND func_id IN ({$sql_values}) AND f.mod_id = m.mod_id ";
    if (isset($is_admin)) {
        $sql .= "AND m.mod_admin = '" . ($is_admin ? 1 : 0) . "' ";
    }
    if (isset($is_front)) {
        $sql .= "AND mod_frontname IS " . ($is_front ? "NOT" : "") . " NULL ";
    }
    if (isset($mod_type)) {
        $mod_type = addslashes($mod_type);
        $sql .= "AND m.mod_type = '{$mod_type}' ";
    }
    if (isset($mcat_id)) {
        $mcat_id = addslashes($mcat_id);
        $sql .= "AND m.mcat_id = '{$mcat_id}' ";
    }
    //避免在子站出現不支援的功能
    if ($site_id > 0) {
        $sql .= "AND m.mod_multi_site = '1' ";
    }
    $sql .= "ORDER BY m.mod_order, f.func_order";
    $db = init_db();
    $results = $db->get_results($sql);
    if (isset($results)) {
        foreach ($results as $row) {
            $sub_funcs = auth_get_func_calls($site_id, $row->mod_id);
            $data[] = array('mod_id' => $row->mod_id, 'mcat_id' => $row->mcat_id, 'mod_name' => $row->mod_name, 'mod_order' => $row->mod_order, 'func_call' => $sub_funcs);
        }
    }
    return $data;
}
Пример #20
0
function set_log($func_id, $row_id, $status)
{
    $db = init_db();
    $user_id = get_login_id();
    $status = strtoupper($status);
    if (!strpos("INSERT,UPDATE,DELETE", $status)) {
        echo "status type error";
        return true;
    }
    $sql = "INSERT INTO `sys_log` (`log_id` ,`func_id` ,`row_id` ,`log_status` ,`log_time` ,`user_id`)\r\n\tVALUES (NULL , '{$func_id}', '{$row_id}', '{$status}', 'NOW()', '{$login_id}') ";
    $db->query($sql);
}
Пример #21
0
include "../TSLIB/TSLIB_COMMON_FUNCTIONS.php";
include "../TSLIB/TSLIB_CONNECTION.php";
date_default_timezone_set('Asia/Kolkata');
$get_active_user = array();
$get_active_user = get_active_login_id();
//GET ALL ACTIVE LOGIN ID
$currentdate = date("Y-m-d");
//CURRENT DATE
$Current_day = date('l');
//CURRENT DAY
$check_ph = Check_public_holiday($currentdate);
//CHECK CURRENT DATE IS IN PUBLIC HOLIDAY
$check_onduty = check_onduty($currentdate);
//CHECK CURRENT DATE IS IN ONDUTY
$get_login_id = array();
$get_login_id = get_login_id($currentdate);
//GET WHO ARE ALL ENTERED REPORT FOR CURRENT DATE
$ph_array = get_public_holiday();
// GET ALL PUBLIC HOLIDAY
$onduty_array = get_onduty();
$select_template = "SELECT * FROM EMAIL_TEMPLATE_DETAILS WHERE ET_ID=6";
$select_template_rs = mysqli_query($con, $select_template);
if ($row = mysqli_fetch_array($select_template_rs)) {
    $mail_subject = $row["ETD_EMAIL_SUBJECT"];
    $body = $row["ETD_EMAIL_BODY"];
}
$get_displayname = get_displayname();
$select_admin = "SELECT * FROM VW_ACCESS_RIGHTS_TERMINATE_LOGINID WHERE URC_DATA='ADMIN'";
$select_sadmin = "SELECT * FROM VW_ACCESS_RIGHTS_TERMINATE_LOGINID WHERE URC_DATA='SUPER ADMIN'";
$admin_rs = mysqli_query($con, $select_admin);
$sadmin_rs = mysqli_query($con, $select_sadmin);
Пример #22
0
<?php

require_once 'includes/header.inc.php';
require_once 'includes/user.inc.php';
if (!($uid = get_login_id())) {
    die('only logged in users can use this page');
}
if ($order == 1) {
    $o = "ASC";
} else {
    $o = "DESC";
}
unset($_GET['order']);
if (empty($_GET)) {
    $wc = "from_id='{$uid}'";
} else {
    $wc = '';
    foreach ($_GET as $k => $v) {
        $wc .= sqlites_escape_string($k) . "='" . sqlite_escape_string($v) . "' AND ";
    }
    $wc .= '1';
}
$res = db_fetch_array(db_query("SELECT * FROM msgs WHERE {$wc} ORDER BY mid {$o}"), SQLITE_ASSOC);
if (!is_array($res) || empty($res)) {
    die('No entries returned!');
} else {
    $keys = array_keys($res['0']);
    echo '<table border=1 width=850><tr>';
    foreach ($keys as $k) {
        echo "\t" . '<td>' . $k . '</td>' . "\n";
    }
Пример #23
0
$form->SetSuccessURL( "", false );

$form->Add( "avatarGallery", new PouetBoxAvatarGallery() );
$form->Add( "avatar", new PouetBoxSubmitAvatar() );

if ($currentUser && $currentUser->CanSubmitItems())
  $form->Process();

$TITLE = "submit an avatar";

require_once("include_pouet/header.php");
require("include_pouet/menu.inc.php");

echo "<div id='content'>\n";

if (get_login_id())
{
  $form->Display();
}
else
{
  require_once("include_pouet/box-login.php");
  $box = new PouetBoxLogin();
  $box->Render();
}

echo "</div>\n";

require("include_pouet/menu.inc.php");
require_once("include_pouet/footer.php");
Пример #24
0
  function Commit($data)
  {
    //////////////////////////////////////////////////////////////////
    // everything has been validated (..., the new album by BT!)

    $a = array();
    $a["name"] = $data["name"];
    $a["download"] = $data["download"];

    $a["addedUser"] = get_login_id();
    $a["addedDate"] = date("Y-m-d H:i:s");

    if( $data["releaseDate_year"] && $data["releaseDate_month"] && checkdate( (int)$data["releaseDate_month"], 15, (int)$data["releaseDate_year"]) )
      $a["releaseDate"] = sprintf("%04d-%02d-15",$data["releaseDate_year"],$data["releaseDate_month"]);
    else if ($data["releaseDate_year"])
      $a["releaseDate"] = sprintf("%04d-00-15",$data["releaseDate_year"]);

    $a["type"] = implode(",",$data["type"]);

    $groups = array();
    if ($data["group1"]) $groups[] = (int)$data["group1"];
    if ($data["group2"]) $groups[] = (int)$data["group2"];
    if ($data["group3"]) $groups[] = (int)$data["group3"];
    $groups = array_unique($groups);
    $a["group1"] = nullify( array_shift($groups) );
    $a["group2"] = nullify( array_shift($groups) );
    $a["group3"] = nullify( array_shift($groups) );

    $a["csdb"] = $data["csdbID"];
    //$a["sceneorg"] = $data["sceneOrgID"];
    //$a["zxdemo"] = $data["zxdemoID"];
    $a["demozoo"] = $data["demozooID"];
    $a["party"] = nullify($data["partyID"]);
    $a["party_year"] = $data["partyYear"];
    $a["party_compo"] = nullify($data["partyCompo"]);
    $a["party_place"] = $data["partyRank"];
    $a["invitation"] = nullify($data["invitationParty"]);
    $a["invitationyear"] = $data["invitationYear"];
    $a["boardID"] = nullify($data["boardID"]);

    $this->prodID = SQLLib::InsertRow("prods",$a);

    $data["platform"] = array_unique($data["platform"]);
    foreach($data["platform"] as $k=>$v)
    {
      $a = array();
      $a["prod"] = $this->prodID;
      $a["platform"] = $v;
      SQLLib::InsertRow("prods_platforms",$a);
    }

    if(is_uploaded_file($_FILES["screenshot"]["tmp_name"]))
    {
      list($width,$height,$type) = GetImageSize($_FILES["screenshot"]["tmp_name"]);
      $extension = "_";
      switch($type) {
        case 1:$extension="gif";break;
        case 2:$extension="jpg";break;
        case 3:$extension="png";break;
      }
      move_uploaded_file_fake( $_FILES["screenshot"]["tmp_name"], get_local_screenshot_path( $this->prodID, $extension ) );

      $a = array();
      $a["prod"] = $this->prodID;
      $a["user"] = get_login_id();
      $a["added"] = date("Y-m-d H:i:s");
      SQLLib::InsertRow("screenshots",$a);
    }
    if(is_uploaded_file($_FILES["nfofile"]["tmp_name"]))
    {
      move_uploaded_file_fake( $_FILES["nfofile"]["tmp_name"], get_local_nfo_path( $this->prodID ) );

      $a = array();
      $a["prod"] = $this->prodID;
      $a["user"] = get_login_id();
      $a["added"] = date("Y-m-d H:i:s");
      SQLLib::InsertRow("nfos",$a);
    }

    @unlink("cache/pouetbox_latestadded.cache");
    @unlink("cache/pouetbox_latestreleased.cache");
    @unlink("cache/pouetbox_latestparties.cache");

    return array();
  }