• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Admin-panel (MySQL) 1.1 + 1.2 from Bonkaz

How do I add a user?
because in here it's MD5 encrypted!

sry for my Bad English 🙂

Hier auf Deutsch:
Wie kann ich einen User hinzufügen?
weil in der Datenbank ist es ja MD 5 verschlüsselt!
 
zh_TW

Translated by magicfx, 2010.12.23
==
<?
//Login
define('LOGIN', '登入');
define('PASSWORD', '密碼');
define('DOLOGIN', '登入');

//Index
define('ADMINISTRATION', '管理');
define('MAIN', '綜觀');
define('BROWSE', '瀏覽');
define('ACTIONS', '動作');
define('LOGOUT', '登出');

//Statistics
define('NUMBER_OF_IMAGES', '系統中照片數量');
define('SIZE_OF_ALL_IMAGES', '所有照片大小');
define('NEW_IMAGES_PER_DAY', '單日新照片數');

//Actions
define('OPTIMIZE_TABLES', '資料表最佳化');
define('REPAIR_TABLES', '修復資料表');
define('REMOVE_IMAGE_BY_FILENAME', '根據檔名移除照片');
define('REMOVE_IMAGE_THAT_DO_NOT_LOOK', '移除久未被瀏覽的照片');
define('FIND_IMAGE_BY_FILENAME', '用檔名找照片');
define('DAYS', '天');
define('FILE_DELETED', '已刪除檔案');
define('OPTIMIZED', '已最佳化');
define('THE_REQUEST_MUST_BE', '需求必須在3到50個字元');
define('DELETE_INSTALL', '請從伺服器中刪除 install.php!');

//Browse
define('NEWS', '最新');
define('LAST_VIEWS', '最近觀看');
define('TOP', '熱門');
define('ANTI_TOP', '冷門');
define('LIGHT', '小檔在前');
define('HEAVY', '大檔在前');
define('PAGES', '頁數');
define('NO_IMAGES', '沒有照片');
define('UPLOAD_DATE', '上傳日期');
define('LAST_VIEW', '最後觀看');
define('VIEWS', '觀看數');
?>
 
action.php

three buttons get value from action.php
not from language files....... 🙁
==

<center>
<a href="./?op=opt"><?echo OPTIMIZE_TABLES;?></a>
-
<a href="./?op=rep"><?echo REPAIR_TABLES;?></a>
</center>
<table border=0 cellpadding=10 cellspacing=10 align=center width=100%>
<tr>
<td class=z>
<form action="./?op=delbyid" method=post>
<b><?echo REMOVE_IMAGE_BY_FILENAME;?></b><br>
<input type=text name=id size=32 value="">
<input type=submit value="刪除">
</form>
</td>
<td class=z>
<form action="./?op=deldays" method=post>
<b><?echo REMOVE_IMAGE_THAT_DO_NOT_LOOK;?></b><br>
<input type=text name=days size=10 value="60"> <?echo DAYS;?>
<input type=submit value="刪除"><br>
</form>
</td></tr>
<tr><td class=z>
<form action="./?op=searchid" method=post>
<b><?echo FIND_IMAGE_BY_FILENAME;?></b><br>
<input type=text name=id size=40 value="">
<input type=submit value="瀏覽"><br>
</form>
</tr>
</table>
 
login.php
==
<!-------------------------------------------
Admin-panel for Chevereto [NB 1.91] (http://www.chevereto.com)
Version: 1.2

Creative Commons (CC) 2010 by SunLord
Web: http://sunlord.ru
Email: lapenkoff@gmail.com
ICQ: 2643333
Skype: sunlord.ru

modded by Bonkaz
Web: www.gigabitcomputers.com.au
Email: mr5_litre@hotmail.com
------------------------------------------->
<?php
include("func.php");

$errno = 0;
$file = "install.php";

$page .="<html><head>
<meta http-equiv='Content-type' content='text/html; charset=windows-1251'>
<link href='./style.css' rel='stylesheet' type='text/css' />
<link href='../estilo.css' rel='stylesheet' type='text/css' />
<title>Administration</title>
</head>
<body bgcolor=#ffffff text=#555555>
<div id='top'>
<center><a href='index.php'><img src='../site-img/logo.png' alt=APP_NAME /></a></center>
</div>";
$errno = file_check($file);

if ($errno != 0)
{
$page .="<table cellpadding=10 cellspacing=0 border=0 align=center>
<tr>
<td align=center>".errchk($errno)."</td>
</tr>
</table>";
}

$page .="<form name=form1 action=dologin.php method=post>
<table cellpadding=10 cellspacing=0 border=0 align=center>
<tr>
<td colspan=2 align=center>管理員登入介面</td>
</tr>
<tr>
<td>使用者名稱:</td>
<td><input type=text name='uname'></td>
</tr>
<tr>
<td>密碼:</td>
<td><input type=password name='upass'></td>
</tr>
<tr>
<td></td>
<td>
<input type=submit value=' 登入 ' class=i name=login>
</td>
</tr>
</table>
</form>
</body>";
render($page);
?>

===
browse.php
===
<center><p><a href="./?op=browse"><?echo NEWS;?></a>
| <a href="./?op=browse&sortby=lastviewed&dir=desc"><?echo LAST_VIEWS;?></a>
| <a href="./?op=browse&sortby=views&dir=desc"><?echo TOP;?></a>
| <a href="./?op=browse&sortby=views&dir=asc"><?echo ANTI_TOP;?></a>
| <a href="./?op=browse&sortby=size&dir=asc"><?echo LIGHT;?></a>
| <a href="./?op=browse&sortby=size&dir=desc"><?echo HEAVY;?></a>
</p>
</center>
<?
$sortby=$_GET["sortby"];
$dir=$_GET["dir"];

$sqlorder="created";
$sqlsort="desc";

switch($sortby) {
case "lastviewed": $sqlorder="lastviewed"; break;
case "views": $sqlorder="views"; break;
case "size": $sqlorder="picfsize"; break;
default: break;
}

switch($dir) {
case "desc": $sqlsort="desc"; break;
case "asc": $sqlsort="asc"; break;
default: break;
}

$onpage=20;
$pg=$_GET["pg"];
if(!is_numeric($pg)) $pg=0;
$start=$pg*$onpage;

$req=mysql_query("select count(*) from pics");
$r=mysql_fetch_row($req);
$total=$r[0];

$req=mysql_query("select * from pics
order by $sqlorder $sqlsort
limit $start,$onpage");

//make a page navigator
$pages=$total/$onpage;
$nav="";
if($pages>=1) {
for($i=0; $i<$pages; $i++) {
$c=$i+1;
if($pg==$i) {
$nav.="<span class=thispage>$c</span> ";
} else {
$nav.="<span class=page><a href='./?op=browse&pg=$i&sortby=$sortby&dir=$dir'>$c</a></span> ";
}
}
}
if($nav) $nav="<center><p><?echo PAGES;?>: $nav</p></center>";
//------------------------------------------



if(mysql_num_rows($req)==0) die(NO_IMAGES);

echo $nav;

$bounce=0;
while($r=mysql_fetch_assoc($req)) {
$r['title']=htmlspecialchars($r['title'],ENT_QUOTES);
$created=date("d-m-Y H:i",$r['created']);
$lastv=$r['lastviewed']?date("d-m-Y H:i",$r['lastviewed']):"N/A";
$size=round($r['picfsize']/1024);
$ip=$r['submitip'];
?>
<table width=100% border=0 cellpadding=10 cellspacing=0>
<tr<?=$bounce?"":" bgcolor=#eeeeee";?>>
<td nowrap class=sm>
<a href="<?=$conf["site_url"]?>/?v=<?=$r['uniqid']?>" target=_blank><img src="<?=$conf["site_url"]."/thumbs";?>/<?=$r['uniqid']?>" border=0 width="<?=$conf["thumb_width"]?>" height="<?=$conf["thumb_height"]?>"></a><br>
<a href="./?op=delpic&id=<?=$r['uid']?>" style="color:red"> [X] 刪除 </a>

</td><td width=100% valign=top class=sm>
<b><?=$r['uniqid']?></b><br/><br/>
<?=$r['pic_width']?>x<?=$r['pic_height']?> <?=$size?>K<br/>
<?echo UPLOAD_DATE;?>: <?=$created?> / IP: <?=$ip?><br>
<?echo LAST_VIEW;?>: <?=$lastv?><br>
<?echo VIEWS;?>: <?=$r['views']?><br>
</td></tr></table>
<?
$bounce ^=1;
}
echo $nav;
?>
 
sorry guys, ive been flat out with christmas, i will update the panel again in a week or so to support the language files, and re-release another version. ive also added a couple more features.

ill have a look at deleting pics by IP, and also the "add admin" function is not yet written, ill try to find time to add it into the next release, i only made an allowance for it in the db tables so far.
 
ok ive started on the next release, hopefully in the next few days ill have a stble version for you.

this next release will be going into a new thread aswell.

it will just be a quick fix for a bit odd ends that are needed to make it a fully functional admin area.

keep the requests and ideas coming.

cheers.
 
have you considered adding an audit log for the panel seeing as it is setup for multiple admins and user levels? i have one created if you are interested you can edit it to your liking.
 
th3fallen said:
have you considered adding an audit log for the panel seeing as it is setup for multiple admins and user levels? i have one created if you are interested you can edit it to your liking.


yeah, im adding log files and going to add a module to the main admin page to show admin activity, kinda phpbb style i guess.
 
One small issue I've come across in my extensive testing:

When I select a file to upload, then resize it to a dimension that's not allowed (1px for example), the upload will of course fail and an error message is shown, but the image information is still sent to the database.

Is there a quick solution to this? Such as, check for errors before submitting the SQL insert.
 
I fixed it!

Change:
Code:
//For admin-panel. Send info about img to DB.
           mysql_query("insert into pics(created,lastviewed,pictype,submitip,picfsize,uniqid,pic_width,pic_height,owner,visibility)
           values('".$created."','".$lastviewed."','".$exten."','".$submitip."','".$tamano."','".$name."','".$ancho."','".$alto."','".$_SESSION['username']."','".$vis."')");

To this:
Code:
    if($spit != true) {
//For admin-panel. Send info about img to DB.
           mysql_query("insert into pics(created,lastviewed,pictype,submitip,picfsize,uniqid,pic_width,pic_height,owner,visibility)
           values('".$created."','".$lastviewed."','".$exten."','".$submitip."','".$tamano."','".$name."','".$ancho."','".$alto."','".$_SESSION['username']."','".$vis."')");
}
 
thanks ill fix this in v2.0 i never even realised it. in the new version all this code is gone anyway, i made it all into functions to make it easier for future updates,😀 less editing of the engine and index so it doesnt mess up other mods.
 
Good evening,
sorry my English is very bad ^ ^

must change your file or just get the dl is nothing to change it?

thank you
 
hello,

sorry for the double post ...

I dl version "Admin-panel 1.2", it does me in revenche detects more images uploaded,

Can you help me?

thank you

ps: thx for super script 🙂
 
hello

from version "Admin-panel 1.2" I have no more images in admin in revenche in the previous version no problem, definitely a problem "engine.php" but I'm not good enough to resolve the problem

cordially
 
hello,

so I redid a new installation on a new database, so the image directory is unique

but all the new images may not appear

cordially
 
when you say they wont appear? you mean in the browse section of the admin area? could u post your config settings, make sure u blank out the mysql settings.

in particular what is the name of your thumbs directory. and have you set the $conf['site_url'] is the admin/config.php file.

also, did you update your index.php and engine.php with the ones supplied...
 
sorry me, i wanted try to install this mod but i cannot find that part:
And under the code

else { // Check local + remote
unset($modo);
$modo = 1;
$spit = true;
$errormsg = CRITIC_ERROR_INPUT;
$titulo = ERROR_UPLOADING.ESP_TITULO;
}

somebody can help me?
 
Back
Top