Added : SEO Links for item

Added : CSS for collections and photos
Added : New Ajax Requests in ajax.php
Updated : collection.class.php
Added : ID parameter in radio and checkbox type input fields
Fixed : get_users count_only parameter
Added : photos.class.php in common.php
Added : function fetch() which will store all Template HTML in a variable. Is useful for JSON
Added : New functions in function.js
Fixed : PakPlayer autoPlay Feature
Added : A lot of new pages
This commit is contained in:
Fawaz 2010-12-14 13:53:51 +00:00
parent a124dc1cba
commit 828cd40cb4
54 changed files with 4103 additions and 190 deletions

155
sql/cb_photos.sql Normal file
View file

@ -0,0 +1,155 @@
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 06, 2010 at 07:46 AM
-- Server version: 5.1.36
-- PHP Version: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `clipbucket_svn`
--
-- --------------------------------------------------------
--
-- Table structure for table `cb_photos`
--
CREATE TABLE IF NOT EXISTS `cb_photos` (
`photo_id` bigint(255) NOT NULL AUTO_INCREMENT,
`photo_title` mediumtext NOT NULL,
`photo_description` mediumtext NOT NULL,
`photo_tags` mediumtext NOT NULL,
`userid` int(255) NOT NULL,
`collection_id` int(255) NOT NULL,
`date_added` datetime NOT NULL,
`last_viewed` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`views` bigint(255) NOT NULL,
`allow_comments` enum('yes','no') NOT NULL DEFAULT 'yes',
`allow_embedding` enum('yes','no') NOT NULL DEFAULT 'yes',
`allow_tagging` enum('yes','no') NOT NULL DEFAULT 'yes',
`featured` enum('yes','no') NOT NULL DEFAULT 'no',
`reported` enum('yes','no') NOT NULL DEFAULT 'no',
`allow_rating` enum('yes','no') NOT NULL DEFAULT 'yes',
`total_comments` int(255) NOT NULL,
`total_favorites` int(255) NOT NULL,
`rating` int(15) NOT NULL,
`rated_by` int(25) NOT NULL,
`voters` mediumtext NOT NULL,
`filename` varchar(100) NOT NULL,
`ext` char(5) NOT NULL,
`downloaded` bigint(255) NOT NULL,
`owner_ip` varchar(20) NOT NULL,
PRIMARY KEY (`photo_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `cb_photos`
--
/* ADDING BROADCAST AND ACTIVE */
ALTER TABLE `cb_photos` ADD `broadcast` ENUM( 'public', 'private' ) NOT NULL DEFAULT 'public' AFTER `allow_rating` ,
ADD `active` ENUM( 'yes', 'no' ) NOT NULL DEFAULT 'yes' AFTER `broadcast`
/* ADDING PHOTO KEY */
ALTER TABLE `cb_photos` ADD `photo_key` MEDIUMTEXT NOT NULL AFTER `photo_id`
/* ADDING PHOTO CONFIG */
INSERT INTO `cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'photo_ratio', '16:10'), (NULL, 'photo_thumb_width', '120'), (NULL, 'photo_thumb_height', '75'), (NULL, 'photo_med_width', '185'), (NULL, 'photo_med_height', '116'), (NULL, 'photo_lar_width', '600'), (NULL, 'photo_crop', '1'), (NULL, 'photo_multi_upload', '5'), (NULL, 'photo_download', '1'), (NULL, 'photo_comments', '1'), (NULL, 'photo_rating', '1');
INSERT INTO `cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'max_photo_size', '2');
/* ADDING WATERMARK CONFIG */
INSERT INTO `clipbucket_svn`.`cb_config` (`configid`, `name`, `value`) VALUES (NULL, 'watermark_photo', '0'), (NULL, 'watermark_max_width', '120'), (NULL,'watermark_placement','left:top');
/* SETTING COLLECTION FEATURED DEFAULT TO 'NO' */
ALTER TABLE `cb_collections` CHANGE `featured` `featured` VARCHAR( 4 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'no';
/* SHARE TEMPLATE */
INSERT INTO `cb_email_templates` (`email_template_id`, `email_template_name`, `email_template_code`, `email_template_subject`, `email_template`, `email_template_allowed_tags`) VALUES (NULL, 'Photo Share Template', 'photo_share_template', '{username} wants to share photo with you', '<html>
<head>
<style type="text/css">
<!--
.title {
font-family: Arial, Helvetica, sans-serif;
padding: 5px;
font-weight:bold;
color: #FFFFFF;
font-size: 16px;
}
.title2 {
font-family: Arial, Helvetica, sans-serif;
padding: 5px;
font-weight:bold;
color: #000000;
font-size: 14px;
}
.messege {
font-family: Arial, Helvetica, sans-serif;
padding: 5px;
font-weight:bold;
color: #000000;
font-size: 12px;
}
#videoThumb{
float:left;
padding: 2px;
margin: 3px;
border: 1px solid #F0F0F0;
text-align: center;
vertical-align: middle;
}
#videoThumb img{border:0px}
body,td,th {
font-family: tahoma;
font-size: 11px;
color: #FFFFFF;
}
.text {
font-family: tahoma;
font-size: 11px;
color: #000000;
padding: 5px;
}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td bgcolor="#0099cc" ><span class="title">{website_title}</span></td>
</tr>
<tr>
<td height="20" class="messege">{username} wants to share this photo with you<br>
<div id="videoThumb"><a class="text" title="{photo_title}" href="{photo_link}"><img src="{photo_thumb}"><br>
View Photo</a></div></td>
</tr>
<tr>
<td class="text" ><span class="title2">Photo Description</span><br>
<span class="text">{photo_description}</span></td>
</tr>
<tr>
<td><span class="title2">Personal Message</span><br>
<span class="text">{user_message}
</span><br>
<br>
<span class="text">Thanks,</span><br>
<span class="text">{website_title}</span></td>
</tr>
<tr>
<td bgcolor="#0099cc">copyrights {date_year} {website_title}</td>
</tr>
</table>
</body>
</html>', '');

View file

@ -76,7 +76,11 @@ RewriteRule ^create_group create_group.php [L]
#Collection Section #Collection Section
RewriteRule ^collections/(.*)/(.*)/(.*)/(.*)/(.*) collections.php?cat=$1&sort=$3&time=$4&page=$5&seo_cat_name=$2 [L] RewriteRule ^collections/(.*)/(.*)/(.*)/(.*)/(.*) collections.php?cat=$1&sort=$3&time=$4&page=$5&seo_cat_name=$2 [L]
RewriteRule ^collections collections.php [L] RewriteRule ^collections collections.php [L]
RewriteRule ^collection/(.*)/(.*)/(.*) view_collection.php?cid=$1&%{QUERY_STRING} [L] RewriteRule ^collection/(.*)/(.*)/(.*)/(.*) view_collection.php?cid=$1&%{QUERY_STRING} [L]
#Photo Section
RewriteRule ^item/(.*)/(.*)/(.*) view_item.php?item=$3&type=$1&collection=$2 [L]
# #
RewriteRule ^sitemap.xml$ sitemap.php RewriteRule ^sitemap.xml$ sitemap.php
RewriteRule ^signup signup.php RewriteRule ^signup signup.php

View file

@ -0,0 +1,134 @@
<?php
/**
* @Author : Fawaz Tahir, Arslan Hassan
* License : SWFUpload <http://swfupload.org/>
* This file is used to upload file using SWFUpload
* you dont need to edit this file, edit it at yout own risk :)
*/
include('../includes/config.inc.php');
$exts = $cbphoto->exts;
$max_size = 1048576; // 2MB in bytes
$form = "photoUpload";
$path = PHOTOS_DIR."/";
// These are found in $_FILES. We can access them like $_FILES['file']['error'].
$upErrors = array(
0 => "There is no error, the file uploaded with success.",
1 => "The uploaded file exceeds the upload_max_filesize directive in php.ini.",
2 => " The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.",
3 => "The uploaded file was only partially uploaded.",
4 => "No file was uploaded.",
6 => "Missing a temporary folder.",
7 => "Failed to write file to disk."
);
// Let's see if everything is working fine by checking $_FILES.
if(!isset($_FILES[$form])) {
HandleError("No upload found in \$_FILES for " . $form);
exit(0);
}
elseif(isset($_FILES[$form]['error']) && $_FILES[$form]['error'] != 0) {
HandleError($upErrors[$_FILES[$form]['error']]);
exit(0);
}
elseif(!isset($_FILES[$form]["tmp_name"]) || !@is_uploaded_file($_FILES[$form]["tmp_name"])) {
HandleError("Upload failed is_uploaded_file test.");
exit(0);
} elseif(empty($_FILES[$form]['name'])) {
HandleError("File name is empty");
exit(0);
}
// Time to check if Filesize is according to demands
//$filesize = filesize($_FILES[$form]['tmp_name']);
//if(!$filesize || $filesize > $max_size)
//{
// HandleError("File exceeds the maximum allowed size");
// exit(0);
//}
//
//if($filesize < 0)
//{
// HandleError("File size outside allowed lower bound");
// exit(0);
//}
//Checking Extension of File
$info = pathinfo($_FILES[$form]['name']);
$extension = strtolower($info['extension']);
$valid_extension = false;
foreach ($exts as $ext) {
if (strcasecmp($extension, $ext) == 0) {
$valid_extension = true;
break;
}
}
if(!$valid_extension)
{
HandleError("Invalid file extension");
exit(0);
}
$filename = $cbphoto->create_filename();
//Now uploading the file
if(move_uploaded_file($_FILES[$form]['tmp_name'],$path.$filename.".".$extension))
{
// Photo Details
$userid = $_POST['userid'];
$collection = $_POST['collection'];
$name = mysql_clean(substr($info['filename'],0,40));
$desc = $name." description";
$tag = strtolower($name);
$key = $cbphoto->photo_key();
//Making Array for inserting
$flds = array("photo_key","photo_title","photo_description","photo_tags","userid","date_added","filename","ext","owner_ip");
$vls = array($key,$name,$desc,$tag,$userid,NOW(),$filename,$extension,$_SERVER['REMOTE_ADDR']);
if(!empty($collection))
{
$flds[] = "collection_id";
$vls[] = $collection;
}
$total = count($flds);
for($i=0;$i<$total;$i++)
{
$detailsArray[$flds[$i]] = $vls[$i];
}
//$FileArray[$key] = $detailsArray;
$FinalVar = base64_encode(serialize($detailsArray));
echo $FinalVar;
// Creating Thumb and Med Size Image
//$cbphoto->createThumb($path.$filename.".".$extension,$path.$filename."_t.".$extension,$extension,$cbphoto->thumb_width,$cbphoto->thumb_height);
//$cbphoto->createThumb($path.$filename.".".$extension,$path.$filename."_m.".$extension,$extension,$cbphoto->mid_width,$cbphoto->mid_height);
//Inserting into Database
//$db->insert(tbl("photos"),$flds,$vls);
//$insert_id = $db->insert_id();
//Sending ID of photo to SWFupload
} else {
HandleError("File could not be saved.");
exit(0);
}
/* Handles the error output. This error message will be sent to the uploadSuccess event handler. The event handler
will have to check for any error messages and react as needed. */
function HandleError($message) {
echo $message;
}
?>

View file

@ -0,0 +1,154 @@
<?php
/*
**************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
***************************************************************
*/
require_once '../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('video_moderation');
$pages->page_redir();
if(isset($_GET['make_feature']))
{
$id = mysql_clean($_GET['make_feature']);
$cbcollection->collection_actions('mcf',$id);
}
if(isset($_GET['make_unfeature']))
{
$id = mysql_clean($_GET['make_unfeature']);
$cbcollection->collection_actions('mcuf',$id);
}
if(isset($_GET['activate']))
{
$id = mysql_clean($_GET['activate']);
$cbcollection->collection_actions('ac',$id);
}
if(isset($_GET['deactivate']))
{
$id = mysql_clean($_GET['deactivate']);
$cbcollection->collection_actions('dac',$id);
}
if(isset($_GET['delete_collection']))
{
$id = mysql_clean($_GET['delete_collection']);
$cbcollection->delete_collection($id);
}
//pr($cbcollection->collection_delete_functions,TRUE);
/* ACTIONS ON MULTI ITEMS */
if(isset($_POST['activate_selected']))
{
$total = count($_POST['check_collection']);
for($i=0;$i<$total;$i++)
{
$cbcollection->collection_actions('ac',$_POST['check_collection'][$i]);
}
$eh->flush();
e($total." collections has been activated","m");
}
if(isset($_POST['deactivate_selected']))
{
$total = count($_POST['check_collection']);
for($i=0;$i<$total;$i++)
{
$cbcollection->collection_actions('dac',$_POST['check_collection'][$i]);
}
$eh->flush();
e($total." collections has been deactivated","m");
}
if(isset($_POST['make_featured_selected']))
{
$total = count($_POST['check_collection']);
for($i=0;$i<$total;$i++)
{
$cbcollection->collection_actions('mcf',$_POST['check_collection'][$i]);
}
$eh->flush();
e($total." collections has been marked as <strong>Featured</strong>","m");
}
if(isset($_POST['make_unfeatured_selected']))
{
$total = count($_POST['check_collection']);
for($i=0;$i<$total;$i++)
{
$cbcollection->collection_actions('mcuf',$_POST['check_collection'][$i]);
}
$eh->flush();
e($total." collections has been marked as <strong>Unfeatured</strong>","m");
}
if(isset($_POST['make_unfeatured_selected']))
{
$total = count($_POST['check_collection']);
for($i=0;$i<$total;$i++)
{
$cbcollection->collection_actions('mcuf',$_POST['check_collection'][$i]);
}
$eh->flush();
e($total." collections has been marked as <strong>Unfeatured</strong>","m");
}
if(isset($_POST['delete_selected']))
{
$total = count($_POST['check_collection']);
for($i=0;$i<$total;$i++)
{
$cbcollection->delete_collection($_POST['check_collection'][$i]);
}
$eh->flush();
e($total." collection(s) has been deleted successfully","m");
}
/* IF SEARCH EXISTS */
if($_GET['search'])
{
$array = array(
'name' => $_GET['title'],
'tags' => $_GET['tags'],
'cid' => $_GET['collectionid'],
'type' => $_GET['collection_type'],
'user' => $_GET['userid'],
'order' => $_GET['order'],
'broadcast' => $_GET['broadcast'],
'featured' => $_GET['featured'],
'active' => $_GET['active']
);
}
$carray = $array;
/* CREATING LIMIT */
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page,RESULTS);
$carray['limit'] = $get_limit;
if(!empty($carray['order']))
$carray['order'] = $carray['order']." DESC";
else
$carray['order'] = " collection_id DESC";
$collections = $cbcollection->get_collections($carray);
assign('c',$collections);
/* COUNTING ALL COLLECTIONS */
$ccount = $carray;
$ccount['count_only'] = TRUE;
$total_rows = $cbcollection->get_collections($ccount);
$total_pages = count_pages($total_rows,RESULTS);
$pages->paginate($total_pages,$page);
subtitle("Collection Manager");
template_files('collection_manager.html');
display_it();
?>

View file

@ -0,0 +1,58 @@
<?php
/*
****************************************************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved. |
| @ Author : ArslanHassan |
| @ Software : ClipBucket , © PHPBucket.com |
****************************************************************************************************
*/
require'../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('video_moderation');
$pages->page_redir();
$id = mysql_clean($_GET['collection']);
if(isset($_POST['update_collection']))
{
$cbcollection->update_collection();
}
if(isset($_POST['delete_preview']))
{
$id = mysql_clean($_POST['delete_preview']);
$cbcollection->delete_thumbs($id);
}
//Performing Actions
if($_GET['mode']!='')
{
$cbcollection->collection_actions($_GET['mode'],$id);
}
$c = $cbcollection->get_collection($id);
switch($c['type'])
{
case "videos":
case "v":
{
$items = $cbvideo->collection->get_collection_items_with_details($c['collection_id'],NULL,4);
}
break;
case "photos":
case "p":
{
$items = $cbphoto->collection->get_collection_items_with_details($c['collection_id'],NULL,4);
}
break;
}
if(!empty($items))
assign('objects',$items);
assign('data',$c);
subtitle("Edit Collection");
template_files('edit_collection.html');
display_it();
?>

View file

@ -0,0 +1,42 @@
<?php
/*
****************************************************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved. |
| @ Author : ArslanHassan |
| @ Software : ClipBucket , © PHPBucket.com |
****************************************************************************************************
*/
require'../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('video_moderation');
$pages->page_redir();
$id = mysql_clean($_GET['photo']);
if(isset($_POST['update']))
{
$cbphoto->update_photo();
}
//Performing Actions
if($_GET['mode']!='')
{
$cbphoto->photo_actions($_GET['mode'],$id);
}
$p = $cbphoto->get_photo($id);
$p['without_user'] = TRUE;
assign('data',$p);
$requiredFields = $cbphoto->load_required_forms($p);
$otherFields = $cbphoto->load_other_forms($p);
assign('requiredFields',$requiredFields);
assign('otherFields',$otherFields);
subtitle("Edit Photo");
template_files('edit_photo.html');
display_it();
?>

View file

@ -0,0 +1,90 @@
<?php
/*
****************************************************************
| Copyright (c) 2007-2008 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
****************************************************************
*/
require_once '../includes/admin_config.php';
$userquery->admin_login_check();
$pages->page_redir();
//$userquery->perm_check('group_moderation',true);
$mode = $_GET['mode'];
//Delete Photo
if(isset($_GET['delete_collect'])){
$collect = mysql_clean($_GET['delete_collect']);
$cbcollection->delete_collection($collect);
}
//Deleting Multiple Photos
if(isset($_POST['delete_selected']))
{
for($id=0;$id<=count($_POST['check_collect']);$id++)
{
$cbphoto->delete_photo($_POST['check_collect'][$id]);
}
$eh->flush();
e("Selected collections have been deleted","m");
}
if(isset($_REQUEST['delete_flags']))
{
$collect = mysql_clean($_GET['delete_flags']);
$cbcollection->action->delete_flags($collect);
}
//Deleting Multiple Videos
if(isset($_POST['delete_flags']))
{
for($id=0;$id<=count($_POST['check_collect']);$id++)
{
$eh->flush();
$cbcollection->action->delete_flags($_POST['check_collect'][$id]);
}
}
switch($mode)
{
case "view":
default:
{
assign("mode","view");
//Getting Video List
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page,5);
$collects = $cbcollection->action->get_flagged_objects($get_limit);
assign('c', $collects);
//Collecting Data for Pagination
$total_rows = $cbcollection->action->count_flagged_objects();
$total_pages = count_pages($total_rows,5);
//Pagination
$pages->paginate($total_pages,$page);
}
break;
case "view_flags":
{
assign("mode","view_flags");
$cid = mysql_clean($_GET['cid']);
$cdetails = $cbcollection->get_collection($cid);
if($cdetails)
{
$flags = $cbcollection->action->get_flags($pid);
assign('flags',$flags);
assign('collection',$cdetails);
}else
e("Collection does not exist");
}
}
subtitle("Flagged Collections");
template_files('flagged_collections.html');
display_it();
?>

View file

@ -0,0 +1,91 @@
<?php
/*
****************************************************************
| Copyright (c) 2007-2008 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
****************************************************************
*/
require_once '../includes/admin_config.php';
$userquery->admin_login_check();
$pages->page_redir();
//$userquery->perm_check('group_moderation',true);
$mode = $_GET['mode'];
//Delete Photo
if(isset($_GET['delete_photo'])){
$photo = mysql_clean($_GET['delete_photo']);
$cbphoto->delete_photo($photo);
}
//Deleting Multiple Photos
if(isset($_POST['delete_selected']))
{
for($id=0;$id<=count($_POST['check_photo']);$id++)
{
$cbphoto->delete_photo($_POST['check_photo'][$id]);
}
$eh->flush();
e("Selected photos have been deleted","m");
}
if(isset($_REQUEST['delete_flags']))
{
$photo = mysql_clean($_GET['delete_flags']);
$cbphoto->action->delete_flags($photo);
}
//Deleting Multiple Videos
if(isset($_POST['delete_flags']))
{
for($id=0;$id<=count($_POST['check_photo']);$id++)
{
$eh->flush();
$cbphoto->action->delete_flags($_POST['check_photo'][$id]);
}
}
switch($mode)
{
case "view":
default:
{
assign("mode","view");
//Getting Video List
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page,5);
$photos = $cbphoto->action->get_flagged_objects($get_limit);
assign('photos', $photos);
//Collecting Data for Pagination
$total_rows = $cbphoto->action->count_flagged_objects();
$total_pages = count_pages($total_rows,5);
//Pagination
$pages->paginate($total_pages,$page);
}
break;
case "view_flags":
{
assign("mode","view_flags");
$pid = mysql_clean($_GET['pid']);
$pdetails = $cbphoto->get_photo($pid);
if($pdetails)
{
$flags = $cbphoto->action->get_flags($pid);
assign('flags',$flags);
assign('photo',$pdetails);
}else
e("Photo does not exist");
}
}
subtitle("Flagged Photos");
template_files('flagged_photos.html');
display_it();
?>

View file

@ -0,0 +1,93 @@
<?php
/*
****************************************************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved. |
| @ Author : ArslanHassan |
| @ Software : ClipBucket , © PHPBucket.com |
****************************************************************************************************
*/
require'../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('video_moderation');
$pages->page_redir();
$id = mysql_clean($_GET['collection']);
$type = mysql_clean($_GET['type']);
switch($type)
{
case "photos":
{
if(isset($_POST['remove_selected']))
{
$total = count($_POST['check_obj']);
for($i=0;$i<$total;$i++)
{
$cbphoto->collection->remove_item($_POST['check_obj'][$i],$id);
$cbphoto->make_photo_orphan($id,$_POST['check_obj'][$i]);
}
$eh->flush();
e($total." photos have been removed.","m");
}
if(isset($_POST['move_selected']))
{
$total = count($_POST['check_obj']);
$new = mysql_clean($_POST['collection_id']);
for($i=0;$i<$total;$i++)
{
$cbphoto->collection->change_collection($new,$_POST['check_obj'][$i],$id);
$db->update(tbl('photos'),array('collection_id'),array($new)," collection_id = $id AND photo_id = ".$_POST['check_obj'][$i]."");
}
$eh->flush();
e($total." photo(s) have been moved to '<strong>".get_collection_field($new,'collection_name')."</strong>'","m");
}
$items = $cbphoto->collection->get_collection_items_with_details($id);
$collection = $cbphoto->collection->get_collections(array("type"=>"photos"));
}
break;
case "videos":
{
if(isset($_POST['remove_selected']))
{
$total = count($_POST['check_obj']);
for($i=0;$i<$total;$i)
{
$cbvideo->collection->remove_item($_POST['check_obj'][$i],$id);
}
}
if(isset($_POST['move_selected']))
{
$total = count($_POST['check_obj']);
$new = mysql_clean($_POST['collection_id']);
for($i=0;$i<$total;$i++)
{
$cbvideo->collection->change_collection($new,$_POST['check_obj'][$i],$id);
}
$eh->flush();
e($total." video(s) have been moved to '<strong>".get_collection_field($new,'collection_name')."</strong>'","m");
}
$items = $cbvideo->collection->get_collection_items_with_details($id);
$collection = $cbphoto->collection->get_collections(array("type"=>"videos"));
}
}
$data = $cbcollection->get_collection($id);
assign('data',$data);
assign('obj',$items);
assign('type',$type);
assign('c',$collection);
subtitle("Manage Items");
template_files('manage_items.html');
display_it();
?>

View file

@ -0,0 +1,77 @@
<?php
/*
****************************************************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved. |
| @ Author : ArslanHassan |
| @ Software : ClipBucket , © PHPBucket.com |
****************************************************************************************************
*/
require'../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('video_moderation');
$pages->page_redir();
if(isset($_GET['delete_photo']))
{
$id = mysql_clean($_GET['delete_photo']);
$cbphoto->delete_photo($id);
}
if(isset($_POST['deleted_selected']))
{
$total = $_POST['check_photo'];
for($i=0;$i<$total;$i++)
{
$cbphoto->delete_photo($_POST['check_photo'][$i]);
}
$eh->flush();
e($total." photos has been deleted successfully.","m");
}
//Multi-featured
if(isset($_POST['make_featured_selected']))
{
$total = count($_POST['check_photo']);
for($i=0;$i<$total;$i++)
{
$cbphoto->photo_actions('feature_photo',$_POST['check_photo'][$i]);
}
$eh->flush();
e($total." photos has been marked as <strong>Featured</strong>","m");
}
//Multi-unfeatured
if(isset($_POST['make_unfeatured_selected']))
{
$total = count($_POST['check_photo']);
for($i=0;$i<$total;$i++)
{
$cbphoto->photo_actions('unfeature_photo',$_POST['check_photo'][$i]);
}
$eh->flush();
e($total." photos has been marked as <strong>Unfeatured</strong>","m");
}
if(isset($_POST['move_selected']))
{
$total = count($_POST['check_photo']);
$new = mysql_clean($_POST['collection_id']);
for($i=0;$i<$total;$i++)
{
$cbphoto->collection->change_collection($new,$_POST['check_photo'][$i]);
$db->update(tbl('photos'),array('collection_id'),array($new)," photo_id = ".$_POST['check_photo'][$i]."");
}
$eh->flush();
e($total." photo(s) have been moved to '<strong>".get_collection_field($new,'collection_name')."</strong>'","m");
}
$photos = $cbphoto->get_photos(array("extra_cond"=>" collection_id = '0'"));
$collection = $cbphoto->collection->get_collections(array("type"=>"photos"));
assign('photos',$photos);
assign('c',$collection);
subtitle("Orphan Photos");
template_files('orphan_photos.html');
display_it();
?>

View file

@ -0,0 +1,164 @@
<?php
/*
**************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
***************************************************************
*/
require_once '../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('video_moderation');
$pages->page_redir();
//Photo Actions are following
//Feature
if(isset($_GET['make_feature']))
{
$id = mysql_clean($_GET['make_feature']);
$cbphoto->photo_actions('feature_photo',$id);
}
//Unfeature
if(isset($_GET['make_unfeature']))
{
$id = mysql_clean($_GET['make_unfeature']);
$cbphoto->photo_actions('unfeature_photo',$id);
}
//Activate
if(isset($_GET['activate']))
{
$id = mysql_clean($_GET['activate']);
$cbphoto->photo_actions('activation',$id);
}
//Deactivate
if(isset($_GET['deactivate']))
{
$id = mysql_clean($_GET['deactivate']);
$cbphoto->photo_actions('deactivation',$id);
}
//Delete
if(isset($_GET['delete_photo']))
{
$id = mysql_clean($_GET['delete_photo']);
$cbphoto->delete_photo($id);
}
//Multi-Active
if(isset($_POST['deactivate_selected']))
{
$total = count($_POST['check_photo']);
for($i=0;$i<$total;$i++)
{
$cbphoto->photo_actions('deactivation',$_POST['check_photo'][$i]);
}
$eh->flush();
e($total." photos has been deactivated","m");
}
//Multi-Deactive
if(isset($_POST['activate_selected']))
{
$total = count($_POST['check_photo']);
for($i=0;$i<$total;$i++)
{
$cbphoto->photo_actions('activation',$_POST['check_photo'][$i]);
}
$eh->flush();
e($total." photos has been activated","m");
}
//Multi-featured
if(isset($_POST['make_featured_selected']))
{
$total = count($_POST['check_photo']);
for($i=0;$i<$total;$i++)
{
$cbphoto->photo_actions('feature_photo',$_POST['check_photo'][$i]);
}
$eh->flush();
e($total." photos has been marked as <strong>Featured</strong>","m");
}
//Multi-unfeatured
if(isset($_POST['make_unfeatured_selected']))
{
$total = count($_POST['check_photo']);
for($i=0;$i<$total;$i++)
{
$cbphoto->photo_actions('unfeature_photo',$_POST['check_photo'][$i]);
}
$eh->flush();
e($total." photos has been marked as <strong>Unfeatured</strong>","m");
}
//Multi-delete
if(isset($_POST['delete_selected']))
{
$total = count($_POST['check_photo']);
for($i=0;$i<$total;$i++)
{
$cbphoto->delete_photo($_POST['check_photo'][$i]);
}
$eh->flush();
e($total." photos has been deleted successfully","m");
}
if(isset($_POST['move_to_selected']))
{
$total = count($_POST['check_photo']);
for($i=0;$i<$total;$i++)
{
$id_array[] = $_POST['check_photo'][$i];
}
//$eh->flush();
}
if(isset($_GET['search']))
{
$array = array(
'title' => $_GET['title'],
'pid' => $_GET['photoid'],
'key' => $_GET['photokey'],
'tags' => $_GET['tags'],
'featured' => $_GET['featured'],
'active' => $_GET['active'],
'user' => $_GET['userid'],
'extension' => $_GET['extension'],
'order' => $_GET['order']
);
}
$parr = $array;
// Creating Limit
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page,RESULTS);
$parr['limit'] = $get_limit;
if(!$parr['order'])
$parr['order'] = " date_added DESC ";
else
$parr['order'] = $parr['order']." DESC";
$collections = $cbcollection->get_collections(array("type"=>"photos"));
$photos = $cbphoto->get_photos($parr);
Assign('photos', $photos);
assign('c',$collections);
$pcount = $parr;
$pcount['count_only'] = true;
$total_rows = $cbphoto->get_photos($pcount);
$total_pages = count_pages($total_rows,RESULTS);
$pages->paginate($total_pages,$page);
subtitle("Photo Manager");
template_files('photo_manager.html');
display_it();
?>

View file

@ -0,0 +1,109 @@
<?php
/*
**************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
***************************************************************
*/
require_once '../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('video_moderation');
$pages->page_redir();
$mode = $_GET['mode'];
assign('mode',$mode);
switch($mode)
{
case "photo_settings":
default:
{
if($_POST['update'])
{
$rows = array(
'photo_ratio',
'photo_thumb_width',
'photo_thumb_height',
'photo_med_width',
'photo_med_height',
'photo_lar_width',
'photo_crop',
'photo_multi_upload',
'max_photo_size',
'photo_download',
'photo_comments',
'photo_rating');
$numeric = array(
'photo_thumb_width',
'photo_thumb_height',
'photo_med_width',
'photo_med_height',
'photo_lar_width',
'photo_crop',
'max_photo_size',
'photo_multi_upload',
'photo_download',
'photo_comments',
'photo_rating');
foreach($rows as $field)
{
$value = $_POST[$field];
if(in_array($field,$numeric))
{
if($value < 0 || !is_numeric($value))
$value = 1;
}
$myquery->Set_Website_Details($field,$value);
}
e("Photo Settings Have Been Updated",'m');
}
subtitle("Photo Settings");
}
break;
case "watermark_settings":
{
if($_POST['update_watermark'])
{
$rows = array(
'watermark_photo',
'watermark_max_width',
'watermark_placement');
$numeric = array(
'watermark_max_width'
);
foreach($rows as $field)
{
$value = $_POST[$field];
if(in_array($filed,$numeric))
{
if($value < 0 || !is_numeric($value))
$value = 1;
}
$myquery->Set_Website_Details($field,$value);
}
if(!empty($_FILES['watermark_file']['tmp_name']))
$cbphoto->update_watermark($_FILES['watermark_file']);
e("Watermark Settings Have Been Updated",'m');
subtitle("Watermark Settings");
}
}
break;
}
$row = $myquery->Get_Website_Details();
assign('row',$row);
template_files('photo_settings.html');
display_it();
?>

View file

@ -0,0 +1,116 @@
<?php
/*
***********************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
*************************************************************************
*/
require'../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('video_moderation');
$pages->page_redir();
$mode = $_GET['mode'];
$photo = mysql_clean($_GET['photo']);
switch($mode)
{
case "single":
{
assign('mode',$mode);
if($cbphoto->photo_exists($photo))
{
if($_GET['recreate'])
{
$cbphoto->generate_photos($photo);
e("Photo has been re-created. Please remove cache if you dont see any change.","m");
}
$files = $cbphoto->get_image_file($photo,'t',TRUE);
$p = $cbphoto->get_photo($photo);
assign('files',$files);
assign('p',$p);
} else
e("Photo does not exist");
}
break;
case "mass":
default:
{
assign('mode',$mode);
$start_index = $_GET['start_index'] ? $_GET['start_index'] : 0;
$loop_size = $_GET['loop_size'];
$loop_size = $loop_size ? $loop_size : 2;
assign('loop_size',$loop_size);
$next_index = $start_index+$loop_size;
assign('next_index',$next_index);
if(isset($_GET['mass_recreation']))
{
$photos = $cbphoto->get_photos(array("limit"=>$start_index.",".$loop_size));
$total = $cbphoto->get_photos(array("count_only"=>true));
$i = 0;
assign('total',$total);
assign('from',$start_index+1);
$to = $start_index+$loop_size;
if($to>$total)
{
$to = $total;
e($total." photos image have been recreated.","m");
assign("stop_loop","yes");
}
assign('to',$to);
while($i < $total)
{
if($photos[$i]['photo_id'])
{
$cbphoto->generate_photos($photos[$i]['photo_id']);
$msg[] = $photos[$i]['photo_id'].": Updating <strong><em>".$photos[$i]['photo_title']."</em></strong>";
}
$i++;
}
e($start_index+1 ." - ".$to." photos image have been recreated.","m");
assign("index_msgs",$msg);
assign("indexing","yes");
assign('button','mass_recreation');
}
}
break;
case "collection":
{
assign('mode',$mode);
$cid = mysql_clean($_GET['cid']);
if($cbphoto->collection->collection_exists($cid))
{
if(isset($_POST['recreating']))
{
$total = count($_POST['check_photo']);
for($i=0;$i<$total;$i++)
{
$cbphoto->generate_photos($_POST['check_photo'][$i]);
}
$eh->flush();
e($total." photo(s) have been re-created. Please remove browser cache if you don't see any change.","m");
}
$items = $cbphoto->collection->get_collection_items_with_details($cid);
assign('items',$items);
} else {
e(lang("Collection does not exist"));
}
}
break;
}
subtitle("Recreate Photos");
template_files('recreate_thumbs.html');
display_it();
?>

View file

@ -0,0 +1,160 @@
<h2>Collection Manager</h2>
<img src="{$imageurl}/dot.gif" class="sarch_button" onclick="toggle_search('searchdiv')" />
<div class="search_box" id="searchdiv" {if $smarty.cookies.show_searchdiv_search!='show'} style="display:none"{/if}>
<form action="collection_manager.php" method="get" name="search_collections">
<table width="400" border="0" cellpadding="2" cellspacing="2">
<tr>
<td width="106" align="right"><label for="title">Collection name</label></td>
<td width="280"><input name="title" type="text" class="input" id="title" value="{'title'|get_form_val:true}" //></td>
</tr>
<tr>
<td align="right"><label for="collectionid">Collection id</label></td>
<td><input name="collectionid" type="text" class="input" id="collectionid" value="{'collectionid'|get_form_val:true}" //></td>
</tr>
<tr>
<td align="right"><label for="tags">Collection tags</label></td>
<td><input name="tags" type="text" class="input" id="tags" value="{'tags'|get_form_val:true}" /></td>
</tr>
<tr>
<td align="right">Userid</td>
<td><input name="userid" type="text" class="input" id="userid" value="{'userid'|get_form_val:true}" /></td>
</tr>
<tr>
<td align="right">Active</td>
<td><label for="active"></label>
<select name="active" id="active" class="input">
<option value="" ></option>
<option value="yes" {if $smarty.get.active=='yes'} selected="selected"{/if}>Yes</option>
<option value="no" {if $smarty.get.active=='no'} selected="selected"{/if}>No</option>
</select></td>
</tr>
<tr>
<td align="right">Broadcast</td>
<td><label for="broadcast"></label>
<select name="broadcast" id="broadcast" class="input">
<option value="" ></option>
<option value="public" {if $smarty.get.broadcast=='public'} selected="selected"{/if}>Public</option>
<option value="private" {if $smarty.get.broadcast=='private'} selected="selected"{/if}>Private</option>
</select></td>
</tr>
<tr>
<td align="right">Featured</td>
<td><label for="featured"></label>
<select name="featured" id="featured" class="input">
<option value="" ></option>
<option value="yes" {if $smarty.get.featured=='yes'} selected="selected"{/if}>Yes</option>
<option value="no" {if $smarty.get.featured=='no'} selected="selected"{/if}>No</option>
</select></td>
</tr>
<tr>
<td align="right">Type</td>
<td>
<select name="collection_type" id="collection_type">
<option value="" ></option>
{foreach from=$cbcollection->types item=name key=type}
<option value="{$type}" {if $smarty.get.collection_type == $type}selected="selected"{/if}>{$name}</option>
{/foreach}
</select>
</td>
</tr>
<tr>
<td align="right">Order</td>
<td>
<select name="order" id="order">
<option value="" ></option>
<option value="collection_id" {if $smarty.get.order == 'collection_id'}selected="selected"{/if}>ID</option>
<option value="total_objects" {if $smarty.get.order == 'total_objects'}selected="selected"{/if}>Total Items</option>
<option value="collection_name" {if $smarty.get.order == 'collection_name'}selected="selected"{/if}>Name</option>
<option value="views" {if $smarty.get.order == 'views'}selected="selected"{/if}>Views</option>
</select>
</td>
</tr>
</table>
<br />
<input type="submit" name="search" id="search" value="Search Form" class="button"/>
</form>
</div>
<form name="video_manage" method="post">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle"><img src="{$imageurl}/arrow_return.png" width="25" height="25"></td>
<td height="50" style="padding-left:15px">
<input type="submit" name="activate_selected" value="Activate" class="button"/>
<input type="submit" name="deactivate_selected" value="Deactivate" class="button" />
<input type="submit" name="make_featured_selected" value="Make Featured" class="button"/>
<input type="submit" name="make_unfeatured_selected" value="Make Unfeatured" class="button"/>
<input type="submit" name="delete_selected" value="Delete" class="button" onclick="return confirm_it('Are you sure you want to delete selected collection(s)')"/>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle" class="left_head">
<input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
<td width="75" class="head">Collection ID</td>
<td class="head">Details</td>
<td width="50" class="right_head">&nbsp;</td>
</tr>
</table>
{if $c}
{section name=list loop=$c}
<li class="clearfix myAdminList" style="background:#{cycle values='FFFFFF,EEEEEE'}"
OnMouseOver="$('#vid_opt-{$c[list].collection_id}').show()"
OnMouseOut="$('#vid_opt-{$c[list].collection_id}').hide()">
<div class="moveL PhotoCheckBox">
<div align="center"><input name="check_collection[]" type="checkbox" id="check_collection" value="{$c[list].collection_id}" /></div>
</div>
<div class="moveL PhotoID">{$c[list].collection_id}</div>
<div class="moveL clearfix PhotoDetails" style="width:88%; min-height:inherit;">
<div class="moveL AdminPhotoThumb">
<img src="{$cbcollection->get_thumb($c[list],'small',TRUE)}" style="padding:2px; border:1px solid #ccc" />
</div>
<div class="moveL">
<a style="font-size:12px;" href="{$baseurl}/admin_area/edit_collection.php?collection={$c[list].collection_id}">{$c[list].collection_name}</a> ({$c[list].total_objects} {$c[list].type})
<div style="height:4px;"></div>
<span class="vdo_sets">
Featured:<strong>{$c[list].featured} </strong> &#8226;
Active:<strong>{$c[list].active}</strong> &#8226;
Type:<strong>{$c[list].type}</strong> &#8226;
Uploaded:<strong>{$c[list].date_added|niceTime}</strong> &#8226;
User:<strong><a href="view_user.php?uid={$c[list].userid}">{$c[list].username}</a></strong>
</span>
<div id="vid_opt-{$c[list].collection_id}" style="display:none" class="AdminPhotoActions">
<a href="edit_collection.php?collection={$c[list].collection_id}">Edit</a> |
<a href="{$baseurl}/view_collection.php?cid={$c[list].collection_id}" target="_blank">View</a> {if $c[list].featured == yes} |
<a href="?make_unfeature={$c[list].collection_id}">Make Unfeatured</a> {/if}
{if $c[list].featured == no} |
<a href="?make_feature={$c[list].collection_id}">Make Featured</a> {/if}
{if $c[list].active == yes} |
<a href="?deactivate={$c[list].collection_id}">Deactivate</a> {else} |
<a href="?activate={$c[list].collection_id}">Activate</a> {/if} |
<a href="?delete_collection={$c[list].collection_id}">Delete</a>
</div>
</div>
</div>
</li>
{/section}
{else}
<div align="center"><strong><em>No Photo Found</em></strong></div>
{/if}
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle"><img src="{$imageurl}/arrow_return.png" width="25" height="25"></td>
<td height="50" style="padding-left:15px">
<input type="submit" name="activate_selected" value="Activate" class="button"/>
<input type="submit" name="deactivate_selected" value="Deactivate" class="button" />
<input type="submit" name="make_featured_selected" value="Make Featured" class="button"/>
<input type="submit" name="make_unfeatured_selected" value="Make Unfeatured" class="button"/>
<input type="submit" name="delete_selected" value="Delete" class="button" onclick="return confirm_it('Are you sure you want to delete selected collection(s)')"/>
</td>
</tr>
</table>
</form>
{include file="$style_dir/blocks/pagination.html" }

View file

@ -0,0 +1,135 @@
{assign var=requiredFields value=$cbcollection->load_required_fields($data)}
{assign var=otherFields value=$cbcollection->load_other_fields($data)}
<form action="" method="post" enctype="multipart/form-data" name="edit_collection" id="edit_collection">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="50%" valign="top">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" class="left_head" style="padding-left:10px"><div class="head">Editing {$data.collection_name}</div></td>
<td width="20" align="right" class="right_head">&nbsp;</td>
</tr>
</table>
<div style="width:97%; margin:auto; padding:10px">
<ul class="admin_links" style="font:bold 11px Tahoma;">
{if $data.active!='yes'}
<li><a href="edit_collection.php?collection={$data.collection_id}&amp;mode=ac">Activate</a></li>
{else}
<li><a href="edit_collection.php?collection={$data.collection_id}&amp;mode=dac">Deactivate</a></li>
{/if}
{if $data.featured!='yes'}
<li><a href="edit_collection.php?collection={$data.collection_id}&amp;mode=mcf">Make Featured</a></li>
{else}
<li><a href="edit_collection.php?collection={$data.collection_id}&amp;mode=mcuf">Make Unfeatured</a></li>
{/if}
<li><a href="javascript:void(0)" onClick="javascript:Confirm_Delete('collection_manager.php?delete_collection={$data.collection_id}')">Delete This Collection</a></li>
</ul>
</div>
<input name="admin" type="hidden" id="admin" value="true" />
<input name="collection_id" type="hidden" value="{$data.collection_id}" />
<fieldset class="fieldset">
<legend>User Information</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
<tr>
<td width="200"><strong>Useid</strong></td>
<td><a href="view_user.php?uid={$data.userid}">{$data.userid|get_username}</a></td>
</tr>
</table>
</fieldset>
<fieldset class="fieldset">
<legend>Collection Details</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
<tr>
<td width="200"><strong>Collection ID</strong></td>
<td><input disabled="disabled" name="collecionID" type="text" id="collecionID" value="{$data.collection_id}" size="45" /></td>
</tr>
{foreach from=$requiredFields item=field}
<tr>
<td width="200" ><strong>{$field.title} :</strong></td>
<td>{$field.hint_1}<br />
{$formObj->createField($field)}<br/>
{$field.hint_2}</td>
</tr>
{/foreach}
</table>
</fieldset>
<fieldset class="fieldset">
<legend>Collection Stats</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
<tr>
<td width="200"><strong>Total Objects</strong></td>
<td><input name="total_objects" type="text" id="total_objects" value="{$data.total_objects}" /></td>
</tr>
<tr>
<td width="200"><strong>Total Comments</strong></td>
<td><input name="total_comments" type="text" id="total_comments" value="{$data.total_comments}" /></td>
</tr>
</table>
</fieldset>
<input type="submit" class="button" value="Update Collection Details" style="margin:15px 0px 0px 15px" name="update_collection">
</td>
<td width="50%" valign="top">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" class="left_head" style="padding-left:10px"><div class="head">Items</div></td>
<td width="20" align="right" class="right_head">&nbsp;</td>
</tr>
<tr>
<td>
{if $objects}
{section name=list loop=$objects}
{if $data.type == 'photos'}
<div class="moveL" style="padding:2px; border:1px solid #ccc; margin:4px;">
{get_photo details=$objects[list] output='html' title=$photos[list].photo_title}
</div>
{/if}
{if $data.type == 'videos'}
<div class="moveL" style="padding:2px; border:1px solid #ccc; margin:4px;">
<img src="{get_thumb vdetails=$objects[list]}" width="120" height="70" />
</div>
{/if}
{/section}
<div style="height:5px; clear:both;"></div>
{assign var=rest value=$data.total_objects-4}
<a style="display:block; font:bold 11px Tahoma; text-align:center; padding:4px; background:#fafafa;border:1px solid #aaa;" href="manage_items.php?collection={$data.collection_id}&amp;type={$data.type}">Manage Items{if $rest && $rest>0} - {$rest} more item{if $rest>1}s{/if}{/if}</a>
{else}
<div align="center" style="font:bold 11px Tahoma; margin-top:10px;">Collection has 0 items</div>
{/if}
</td>
</tr>
</table>
<fieldset class="fieldset">
<legend>Other Fields</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
{foreach from=$otherFields item=field}
<tr>
<td width="200" ><strong>{$field.title} :</strong></td>
<td>{$field.hint_1}<br />
{$formObj->createField($field)}<br/>
{$field.hint_2}</td>
</tr>
{/foreach}
</table>
</fieldset>
<fieldset class="fieldset">
<legend>Collection Preview</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="200" ><strong>Collection Preview :</strong></td>
<td><img style="padding:2px; border:1px solid #ccc;" src="{$cbcollection->get_thumb($data,NULL,TRUE)}" />
</label><input type="checkbox" value="{$data.collection_id}" name="delete_preview" id="del_{$data.collection_id}_preview" /><label for="del_{$data.collection_id}_preview">Delete Preview</label></td>
</tr>
<tr>
<td width="200" ><strong>Upload New :</strong></td>
<td><input type="file" name="collection_thumb" id="collection_thumb" ></td>
</tr>
</table>
</fieldset>
</td>
</tr>
</table>
</form>

View file

@ -0,0 +1,146 @@
<form action="" method="post" name="edit_photo" id="edit_photo">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="50%" valign="top">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" class="left_head" style="padding-left:10px"><div class="head">Editing {$data.photo_title}</div></td>
<td width="20" align="right" class="right_head">&nbsp;</td>
</tr>
</table>
<div style="width:98%; margin:auto; padding:10px">
<ul class="admin_links" style="font:bold 11px Tahoma;">
{if $data.collection_id != 0}
<li><a href="edit_collection.php?collection={$data.collection_id}">Edit Collection ({$data.collection_id|get_collection_field})</a></li>
{else}
<li><a href="#collection_id">Photo is orpahn</a></li>
{/if}
{if $data.featured!='yes'}
<li><a href="edit_photo.php?photo={$data.photo_id}&amp;mode=fp">Make Featured</a></li>
{else}
<li><a href="edit_photo.php?photo={$data.photo_id}&amp;mode=ufp">Make Unfeatured</a></li>
{/if}
<li><a href="recreate_thumbs.php?mode=single&amp;photo={$data.photo_id}">Re-create Photo</a></li>
<li><a href="javascript:void(0)" onClick="javascript:Confirm_Delete('photo_manager.php?delete_photo={$data.photo_id}')">Delete This Photo</a></li>
</ul>
</div>
<input name="admin" type="hidden" id="admin" value="true" />
<input name="photo_id" type="hidden" value="{$data.photo_id}" />
<fieldset class="fieldset">
<legend>User Information</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
<tr>
<td width="200"><strong>Useid</strong></td>
<td><a href="view_user.php?uid={$data.userid}">{$data.userid|get_username}</a></td>
</tr>
</table>
</fieldset>
<fieldset class="fieldset">
<legend>Important Details</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
<tr>
<td width="200"><strong>Photo ID</strong></td>
<td>
<input disabled="disabled" name="photoid" type="text" id="photoid" value="{$data.photo_id}" size="45" />
</td>
</tr>
<tr>
<td width="200"><strong>Photo Key</strong></td>
<td>
<input disabled="disabled" name="photokey" type="text" id="photokey" value="{$data.photo_key}" size="45" />
</td>
</tr>
<tr>
<td width="200"><strong>Filename</strong></td>
<td>
<input disabled="disabled" name="filename" type="text" id="filename" value="{$data.filename}" size="45" />
</td>
</tr>
<tr>
<td width="200"><strong>Extension</strong></td>
<td>
<input disabled="disabled" name="extension" type="text" id="extension" value="{$data.ext}" size="45" />
</td>
</tr>
</table>
</fieldset>
<fieldset class="fieldset">
<legend>Photo Details</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
{foreach from=$requiredFields item=field}
<tr>
<td width="200" ><strong>{$field.title} :</strong></td>
<td>{$field.hint_1}<br />
{$formObj->createField($field)}
{$field.hint_2}</td>
</tr>
{/foreach}
</table>
</fieldset>
<fieldset class="fieldset">
<legend>Photo Stats</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
<tr>
<td width="200"><strong>Views:</strong></td>
<td><input name="views" id="views" value="{$data.views}" /></td>
</tr>
<tr>
<td width="200"><strong>Total Favorites:</strong></td>
<td><input name="total_favorites" id="total_favorites" value="{$data.total_favorites}" /></td>
</tr>
<tr>
<td width="200"><strong>Total Comments:</strong></td>
<td><input name="total_comments" id="total_comments" value="{$data.total_comments}" /></td>
</tr>
<tr>
<td width="200"><strong>Rating:</strong></td>
<td><input name="rating" id="rating" disabled="disabled" value="{$data.rating}" /></td>
</tr>
<tr>
<td width="200"><strong>Rated By:</strong></td>
<td><input name="rated_by" id="rated_by" disabled="disabled" value="{$data.rated_by}" /></td>
</tr>
<tr>
<td width="200"><strong>Voters:</strong></td>
<td><textarea name="voters" id="voters" disabled="disabled">{$data.voters}</textarea></td>
</tr>
</table>
</fieldset>
<input type="submit" class="button" value="Update Photo Details" style="margin:15px 0px 0px 15px" name="update">
</td>
<td width="50%" valign="top">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" class="left_head" style="padding-left:10px"><div class="head">Photo Preview</div></td>
<td width="20" align="right" class="right_head">&nbsp;</td>
</tr>
</table>
<div style="padding:5px">
<div align="center">{get_photo details=$data size='l' output='html' style='max-width:600px'}</div>
</div>
<fieldset class="fieldset">
<legend>Other Fields</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
{foreach from=$otherFields item=field}
<tr>
<td width="200" ><strong>{$field.title} :</strong></td>
<td>{$field.hint_1}<br />
{$formObj->createField($field)}
{$field.hint_2}</td>
</tr>
{/foreach}
</table>
</fieldset>
</td>
</tr>
</table>
</table>
</form>

View file

@ -0,0 +1,105 @@
{if $mode == 'view'}
<span class="page_title">Flagged Photos Manager</span>
<form name="flagged_photo" method="post" id="flagged_photo">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle"><img src="{$imageurl}/arrow_return.png" width="25" height="25"></td>
<td height="50" style="padding-left:15px">
<input type="submit" name="delete_selected" value="Delete Photos" class="button" onclick="return confirm_it('Are you sure you want to delete these photo(s)')"/>
<input type="submit" name="delete_flags" value="Delete Flags" class="button" onclick="return confirm_it('Are you sure you want to delete flags of selected photo(s)')"/>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle" class="left_head">
<input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
<td width="75" align="left" class="head">Photo-ID</td>
<td class="head">Details</td>
<td width="50" class="right_head">&nbsp;</td>
</tr>
</table>
{if $photos}
{section name=list loop=$photos}
<li class="clearfix myAdminList" style="background:#{cycle values='FFFFFF,EEEEEE'}"
OnMouseOver="$('#vid_opt-{$photos[list].photo_id}').show()"
OnMouseOut="$('#vid_opt-{$photos[list].photo_id}').hide()">
<div class="moveL PhotoCheckBox">
<div align="center"><input name="check_photo[]" type="checkbox" id="check_photo" value="{$photos[list].photo_id}" /></div>
</div>
<div class="moveL PhotoID">{$photos[list].photo_id}</div>
<div class="moveL clearfix PhotoDetails" style="width:88%;">
<div class="moveL AdminPhotoThumb">
{get_photo details=$photos[list] id='photo' style='padding:2px; border:1px solid #ccc' output='html'}
</div>
<div class="moveL">
<a href="{$baseurl}/admin_area/edit_photo.php?photo={$photos[list].photo_id}">{$photos[list].photo_title}</a>
<div style="height:4px;"></div>
<span class="vdo_sets">
Featured:<strong>{$photos[list].featured} </strong> &#8226;
{if $photos[list].collection_id}
Collection:<strong><a title="Edit Collection" href="edit_collection.php?collection={$photos[list].collection_id}">{$photos[list].collection_id|get_collection_field}</a></strong>
{else}
Photo is Orphan
{/if} &#8226;
Uploaded:<strong>{$photos[list].date_added|niceTime}</strong> &#8226;
Uploader:<strong><a href="view_user.php?uid={$photos[list].userid}">{$photos[list].userid|get_username}</a></strong> &#8226;
Flag: <strong>{$photos[list].total_flags}</strong>
</span>
<div style="height:4px;"></div>
<div id="vid_opt-{$photos[list].photo_id}" style="display:none" class="AdminPhotoActions">
<a href="edit_photo.php?photo={$photos[list].photo_id}">Edit Photo</a> |
<a href="{$baseurl}/view_item.php?item={$photos[list].photo_key}&amp;type=photos&amp;collection={$photos[list].collection_id}" target="_blank">View Photo</a> | <a href="?delete_photo={$photos[list].photo_id}">Delete Photo</a> | <a href="?mode=view_flags&pid={$photos[list].photo_id}">View Flags</a> | <a href="?delete_flags={$photos[list].photo_id}">Delete Flags</a>
</div>
</div>
</div>
</li>
{/section}
{else}
<div align="center"><strong>No Flags Found</strong></div>
{/if}
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle"><img src="{$imageurl}/arrow_return.png" width="25" height="25"></td>
<td height="50" style="padding-left:15px">
<input type="submit" name="delete_selected" value="Delete Photos" class="button" onclick="return confirm_it('Are you sure you want to delete these photo(s)')"/>
<input type="submit" name="delete_flags" value="Delete Flags" class="button" onclick="return confirm_it('Are you sure you want to delete flags of selected photo(s)')"/>
</td>
</tr>
</table>
</form>
{include file="$style_dir/blocks/pagination.html" }
{/if}
{if $mode == 'view_flags'}
<span class="page_title">Viewing {$photo.photo_title} flags</span> &#8212; <a href="{$cbcollection->collection_links($photo,'view_item')}">View Photo</a> &#8226; <a href="edit_photo.php?photo={$photo.photo_id}">Edit Photo</a> &#8226; <a href="?delete_flags={$photo.photo_id}">Delete Flags</a> &#8226; <a href="?delete_photo={$photo.photo_id}">Delete Photo</a>
<div style="margin-bottom:10px"></div>
<form name="video_manage" method="post">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle" class="left_head">&nbsp;</td>
<td class="head">Flag Details</td>
<td width="50" class="right_head">&nbsp;</td>
</tr>
</table>
{section name=list loop=$flags}
<li class="clearfix myAdminList" style="background:#{cycle values='FFFFFF,EEEEEE'}">
<div class="moveL PhotoID" style="width:30px;">{$smarty.section.list.iteration}</div>
<div class="moveL">
Reported as "{$flags[list].flag_type|flag_type}" by {$flags[list].userid|get_username} {$flags[list].date_added|niceTime}
</div>
</li>
{/section}
</form>
{/if}

View file

@ -61,7 +61,6 @@ var imageurl = "{$imageurl}";
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
function makeTall(divid){ $('#'+divid).animate({"height":209},200);} function makeTall(divid){ $('#'+divid).animate({"height":209},200);}
function makeShort(divid){ $('#'+divid).animate({"height":0},200);} function makeShort(divid){ $('#'+divid).animate({"height":0},200);}
var on = false; var on = false;
@ -132,9 +131,77 @@ var imageurl = "{$imageurl}";
$('.tipsy_tip').tipsy({gravity: 'w'}); $('.tipsy_tip').tipsy({gravity: 'w'});
}); });
</script> </script>
{/literal} {/literal}
{literal}
<script type="text/javascript">
$(document).ready(function(){
$('#ratios input[name=photo_ratio]').click(function()
{
var ratio = this.value;
ratio_part = ratio.split(':');
width = ratio_part[0];
height = ratio_part[1];
ThumbHeight = $('#image_width').val() / width * height;
ThumbHeight = Math.ceil(ThumbHeight);
MedHeight = $('#med_width').val() / width * height;
MedHeight = Math.ceil(MedHeight);
$('#image_height').val(ThumbHeight);
$('#med_height').val(MedHeight);
});
$('#image_width,#med_width').bind(
{
click: function()
{
$(this).select();
},
focusout: function()
{
var ratio = $('#ratios input:checked').val();
id = this.id;
parts = id.split('_');
word = parts[0];
ratio_part = ratio.split(':');
width = ratio_part[0];
height = ratio_part[1];
newHeight = this.value / width * height;
newHeight = Math.ceil(newHeight);
$('input[id="'+word+'_height"]').val(newHeight);
},
keypress: function(event)
{
if(event.which == '10')
{
var ratio = $('#ratios input:checked').val();
id = this.id;
parts = id.split('_');
word = parts[0];
ratio_part = ratio.split(':');
width = ratio_part[0];
height = ratio_part[1];
newHeight = this.value / width * height;
newHeight = Math.ceil(newHeight);
$('input[id="'+word+'_height"]').val(newHeight);
this.blur();
}
}
});
});
</script>
{/literal}
</head> </head>

View file

@ -0,0 +1,117 @@
<h2>Manage Items - <a href="{$baseurl}/admin_area/edit_collection.php?collection={$data.collection_id}">{$data.collection_name}</a></h2>
<form action="" method="post">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle"><img src="{$imageurl}/arrow_return.png" width="25" height="25"></td>
<td height="50" style="padding-left:15px">
<input type="submit" name="remove_selected" value="Remove Selected" class="button"/>
<input type="submit" name="move_selected" value="Move Selected" class="button"/>
<select name="collection_id" id="collection_id">
{foreach from=$c item=item}
{if $smarty.get.collection != $item.collection_id}
<option value="{$item.collection_id}">{$item.collection_name}</option>
{/if}
{/foreach}
</select>
<br />
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle" class="left_head">
<input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
<td width="75" align="center" valign="middle" class="head">Object ID</td>
<td class="head">Details</td>
<td width="50" class="right_head">&nbsp;</td>
</tr>
</table>
{if $obj}
{if $type == ''}
<div align="center"><strong><em>Unknown Type</em></strong></div>
{else}
{if $type == 'photos'}
<li class="clearfix myAdminList" style="background:#f3f3f3; border:1px solid #ccc; margin-top:5px; font:bold 11px Tahoma;">
<div class="clearfix PhotoDetails" style=" text-align:center; min-height:10px;">
<a style="font-size:11px" href="{$baseurl}/admin_area/recreate_thumbs.php?mode=collection&amp;cid={$data.collection_id}">Re-create photos</a>. This will re-create photos found in the collection.
</div>
</li>
{/if}
{section name=list loop=$obj}
{if $type == 'photos'}
<li id="collectionItem_{$obj[list].photo_id}" class="clearfix myAdminList" style="background:#{cycle values='FFFFFF,EEEEEE'}"
OnMouseOver="$('#vid_opt-{$obj[list].photo_id}').show()"
OnMouseOut="$('#vid_opt-{$obj[list].photo_id}').hide()">
<div class="moveL PhotoCheckBox">
<div align="center"><input name="check_obj[]" type="checkbox" id="check_obj" value="{$obj[list].photo_id}" /></div>
</div>
<div class="moveL PhotoID">{$obj[list].photo_id}</div>
<div class="moveL clearfix PhotoDetails" style="width:88%;">
<div class="moveL AdminPhotoThumb">
<img src="{get_photo details=$obj[list]}" id="photo" style="padding:2px; border:1px solid #ccc" />
</div>
<div class="moveL">
<a href="{$baseurl}/admin_area/edit_photo.php?photo={$obj[list].photo_id}" target="_blank">{$obj[list].photo_title}</a>
<div style="height:4px;"></div>
<span class="vdo_sets">
Featured:<strong>{$obj[list].featured} </strong> &#8226;
Collection:<strong><a title="Edit Collection" href="edit_collection.php?collection={$obj[list].collection_id}">{$obj[list].collection_id|get_collection_field}</a></strong> &#8226;
Uploaded:<strong>{$obj[list].date_added|niceTime}</strong> &#8226;
User:<strong><a href="view_user.php?uid={$obj[list].userid}">{$obj[list].username}</a></strong>
</span>
<div style="height:4px;"></div>
<div id="vid_opt-{$obj[list].photo_id}" style="display:none" class="AdminPhotoActions">
<a target="_blank" href="{$cbcollection->collection_links($obj[list],'view_item')}">View</a>
</div>
</div>
</div>
</li>
{/if}
{if $type == 'videos'}
<li id="collectionItem_{$obj[list].videoid}" class="clearfix myAdminList" style="background:#{cycle values='FFFFFF,EEEEEE'}"
OnMouseOver="$('#vid_opt-{$obj[list].videoid}').show()"
OnMouseOut="$('#vid_opt-{$obj[list].videoid}').hide()">
<div class="moveL PhotoCheckBox">
<div align="center"><input name="check_obj[]" type="checkbox" id="check_obj" value="{$obj[list].videoid}" /></div>
</div>
<div class="moveL PhotoID">{$obj[list].videoid}</div>
<div class="moveL clearfix PhotoDetails" style="width:88%;">
<div class="moveL AdminPhotoThumb">
<img src="{get_thumb vdetails=$obj[list]}" width="120" height="70" id="video_{$obj[list].videoid}" style="padding:2px; border:1px solid #ccc" />
</div>
<div class="moveL">
<a href="{$baseurl}/admin_area/edit_video.php?video={$obj[list].videoid}" target="_blank">{$obj[list].title}</a>
<div style="height:4px;"></div>
<span class="vdo_sets">
Featured:<strong>{$obj[list].featured} </strong> &#8226;
Active:<strong>{$obj[list].active}</strong> &#8226;
Uploaded:<strong>{$obj[list].date_added|niceTime}</strong> &#8226;
User:<strong><a href="view_user.php?uid={$obj[list].userid}">{$obj[list].username}</a></strong>
</span>
<div style="height:4px;"></div>
<div id="vid_opt-{$obj[list].videoid}" style="display:none" class="AdminPhotoActions">
<a target="_blank" href="{$cbcollection->collection_links($obj[list],'view_item')}">View</a>
</div>
</div>
</div>
</li>
{/if}
{/section}
{/if}
{else}
<div align="center"><strong><em>No Object Found</em></strong></div>
{/if}
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle"><img src="{$imageurl}/arrow_return.png" width="25" height="25"></td>
<td height="50" style="padding-left:15px">
<input type="submit" name="remove_selected" value="Remove Selected" class="button"/>
<input type="submit" name="move_selected" value="Move Selected" class="button"/>
<br />
</td>
</tr>
</table>
</form>

View file

@ -0,0 +1,84 @@
<h2>Orphan Photos</h2>
<form action="" method="post" name="manage_orpahns">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle"><img src="{$imageurl}/arrow_return.png" width="25" height="25"></td>
<td height="50" style="padding-left:15px">
<input type="submit" name="make_featured_selected" value="Make Featured" class="button"/>
<input type="submit" name="make_unfeatured_selected" value="Make Unfeatured" class="button"/>
<input type="submit" name="delete_selected" value="Delete" class="button" onclick="return confirm_it('Are you sure you want to delete selected photos(s)')"/>
<input type="submit" name="move_selected" value="Move To" class="button"/>
<select name="collection_id" id="collection_id">
{foreach from=$c item=item}
<option value="{$item.collection_id}">{$item.collection_name}</option>
{/foreach}
</select>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle" class="left_head">
<input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
<td width="75" align="center" valign="middle" class="head">Photo ID</td>
<td class="head">Details</td>
<td width="50" class="right_head">&nbsp;</td>
</tr>
</table>
{if $photos}
{section name=list loop=$photos}
<li class="clearfix myAdminList" style="background:#{cycle values='FFFFFF,EEEEEE'}"
OnMouseOver="$('#vid_opt-{$photos[list].photo_id}').show()"
OnMouseOut="$('#vid_opt-{$photos[list].photo_id}').hide()">
<div class="moveL PhotoCheckBox">
<div align="center"><input name="check_photo[]" type="checkbox" id="check_photo_{$photos[list].photo_id}" value="{$photos[list].photo_id}" /></div>
</div>
<div class="moveL PhotoID">{$photos[list].photo_id}</div>
<div class="moveL clearfix PhotoDetails" style="width:88%;">
<div class="moveL AdminPhotoThumb">
<label for="check_photo_{$photos[list].photo_id}">{get_photo details=$photos[list] id='photo' style='padding:2px; border:1px solid #ccc' output='html'}</label>
</div>
<div class="moveL">
<a href="{$baseurl}/admin_area/edit_photo.php?photo={$photos[list].photo_id}">{$photos[list].photo_title}</a>
<div style="height:4px;"></div>
<span class="vdo_sets">
Featured:<strong>{$photos[list].featured} </strong> &#8226;
{if $photos[list].collection_id}
Collection:<strong><a title="Edit Collection" href="edit_collection.php?collection={$photos[list].collection_id}">{$photos[list].collection_id|get_collection_field}</a></strong>
{else}
Photo is Orphan
{/if} &#8226;
Uploaded:<strong>{$photos[list].date_added|niceTime}</strong> &#8226;
User:<strong><a href="view_user.php?uid={$photos[list].userid}">{$photos[list].username}</a></strong>
</span>
<div style="height:4px;"></div>
<div id="vid_opt-{$photos[list].photo_id}" style="display:none" class="AdminPhotoActions">
<a href="edit_photo.php?photo={$photos[list].photo_id}">Edit</a> |
<a href="javascript:void(0);" id="delete-{$photos[list].photo_id}" onmousedown="delete_item('delete','{$photos[list].photo_id}','Are you sure you want to delete? This will permanently delete {$photos[list].photo_title} from website.','?delete_photo={$photos[list].photo_id}');">Delete</a>
</div>
</div>
</div>
</li>
{/section}
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle"><img src="{$imageurl}/arrow_return.png" width="25" height="25"></td>
<td height="50" style="padding-left:15px">
<input type="submit" name="make_featured_selected" value="Make Featured" class="button"/>
<input type="submit" name="make_unfeatured_selected" value="Make Unfeatured" class="button"/>
<input type="submit" name="delete_selected" value="Delete" class="button" onclick="return confirm_it('Are you sure you want to delete selected photos(s)')"/>
</td>
</tr>
</table>
</form>
{else}
<div align="center"><strong><em>No Photo Found</em></strong></div>
{/if}

View file

@ -0,0 +1,148 @@
<h2>Photo Manager</h2>
<img src="{$imageurl}/dot.gif" class="sarch_button" onclick="toggle_search('searchdiv')" />
<div class="search_box" id="searchdiv" {if $smarty.cookies.show_searchdiv_search!='show'} style="display:none"{/if}>
<form action="photo_manager.php" method="get" name="search_photos">
<table width="400" border="0" cellpadding="2" cellspacing="2">
<tr>
<td width="106" align="right"><label for="title">Photo title</label></td>
<td width="280"><input name="title" type="text" class="input" id="title" value="{'title'|get_form_val:true}" //></td>
</tr>
<tr>
<td align="right"><label for="photokey">Photo key</label></td>
<td><input name="photokey" type="text" class="input" id="photokey" value="{'photokey'|get_form_val:true}" //></td>
</tr>
<tr>
<td align="right"><label for="photoid">Photo id</label></td>
<td><input name="photoid" type="text" class="input" id="photoid" value="{'photoid'|get_form_val:true}" //></td>
</tr>
<tr>
<td align="right"><label for="tags">Photo tags</label></td>
<td><input name="tags" type="text" class="input" id="tags" value="{'tags'|get_form_val:true}" /></td>
</tr>
<tr>
<td align="right">Userid</td>
<td><input name="userid" type="text" class="input" id="userid" value="{'userid'|get_form_val:true}" /></td>
</tr>
<tr>
<td align="right">Featured</td>
<td><label for="featured"></label>
<select name="featured" id="featured" class="input">
<option value="" ></option>
<option value="yes" {if $smarty.get.featured=='yes'} selected="selected"{/if}>Yes</option>
<option value="no" {if $smarty.get.featured=='no'} selected="selected"{/if}>No</option>
</select></td>
</tr>
<tr>
<td align="right">Extension</td>
<td>
<select name="extension" id="extension">
<option value="" ></option>
{foreach from=$cbphoto->exts item=ext}
<option value="{$ext}"{if $smarty.get.extension == $ext} selected="selected"{/if}>{$ext|capitalize}</option>
{/foreach}
</select>
</td>
</tr>
<tr>
<td align="right">Order</td>
<td>
<select name="order" id="order">
<option value="" ></option>
<option value="photo_id" {if $smarty.get.order == 'photo_id'}selected="selected"{/if}>ID</option>
<option value="photo_title" {if $smarty.get.order == 'photo_title'}selected="selected"{/if}>Name</option>
<option value="views" {if $smarty.get.order == 'views'}selected="selected"{/if}>Views</option>
</select>
</td>
</tr>
</table>
<br />
<input type="submit" name="search" id="search" value="Search Form" class="button"/>
</form>
</div>
<form name="photo_manager" method="post">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle"><img src="{$imageurl}/arrow_return.png" width="25" height="25"></td>
<td height="50" style="padding-left:15px">
<input type="submit" name="make_featured_selected" value="Make Featured" class="button"/>
<input type="submit" name="make_unfeatured_selected" value="Make Unfeatured" class="button"/>
<input type="submit" name="delete_selected" value="Delete" class="button" onclick="return confirm_it('Are you sure you want to delete selected photos(s). This will permanently delete these photos from website.')"/><br />
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle" class="left_head">
<input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/></td>
<td width="75" align="center" valign="middle" class="head">Photo ID</td>
<td class="head">Details</td>
<td width="50" class="right_head">&nbsp;</td>
</tr>
</table>
{if $photos}
{section name=list loop=$photos}
<li class="clearfix myAdminList" style="background:#{cycle values='FFFFFF,EEEEEE'}"
OnMouseOver="$('#vid_opt-{$photos[list].photo_id}').show()"
OnMouseOut="$('#vid_opt-{$photos[list].photo_id}').hide()">
<div class="moveL PhotoCheckBox">
<div align="center"><input name="check_photo[]" type="checkbox" id="check_photo" value="{$photos[list].photo_id}" /></div>
</div>
<div class="moveL PhotoID">{$photos[list].photo_id}</div>
<div class="moveL clearfix PhotoDetails" style="width:88%;">
<div class="moveL AdminPhotoThumb">
{get_photo details=$photos[list] id='photo' style='padding:2px; border:1px solid #ccc' output='html'}
</div>
<div class="moveL">
<a href="{$baseurl}/admin_area/edit_photo.php?photo={$photos[list].photo_id}">{$photos[list].photo_title}</a>
<div style="height:4px;"></div>
<span class="vdo_sets">
Featured:<strong>{$photos[list].featured} </strong> &#8226;
{if $photos[list].collection_id}
Collection:<strong><a title="Edit Collection" href="edit_collection.php?collection={$photos[list].collection_id}">{$photos[list].collection_id|get_collection_field}</a></strong>
{else}
Photo is Orphan
{/if} &#8226;
Uploaded:<strong>{$photos[list].date_added|niceTime}</strong> &#8226;
User:<strong><a href="view_user.php?uid={$photos[list].userid}">{$photos[list].username}</a></strong>
</span>
<div style="height:4px;"></div>
<div id="vid_opt-{$photos[list].photo_id}" style="display:none" class="AdminPhotoActions">
<a href="edit_photo.php?photo={$photos[list].photo_id}">Edit</a> |
<a href="{$baseurl}/view_item.php?item={$photos[list].photo_key}&amp;type=photos&amp;collection={$photos[list].collection_id}" target="_blank">View</a> {if $photos[list].featured == yes} |
<a href="?make_unfeature={$photos[list].photo_id}">Make Unfeatured</a> {/if}
{if $photos[list].featured == no} |
<a href="?make_feature={$photos[list].photo_id}">Make Featured</a> {/if} |
<a href="javascript:void(0);" id="delete-{$photos[list].photo_id}" onmousedown="delete_item('delete','{$photos[list].photo_id}','Are you sure you want to delete? This will permanently delete {$photos[list].photo_title} from website.','?delete_photo={$photos[list].photo_id}');">Delete</a>
</div>
</div>
</div>
</li>
{/section}
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center" valign="middle"><img src="{$imageurl}/arrow_return.png" width="25" height="25"></td>
<td height="50" style="padding-left:15px">
<input type="submit" name="move_to_selected" value="Move To" class="button"/>
<input type="submit" name="make_featured_selected" value="Make Featured" class="button"/>
<input type="submit" name="make_unfeatured_selected" value="Make Unfeatured" class="button"/>
<input type="submit" name="delete_selected" value="Delete" class="button" onclick="return confirm_it('Are you sure you want to delete selected photos(s)')"/>
</td>
</tr>
</table>
</form>
{else}
<div align="center"><strong><em>No Photo Found</em></strong></div>
{/if}
{include file="$style_dir/blocks/pagination.html" }

View file

@ -0,0 +1,223 @@
{if $mode == '' || $mode == 'photo_settings'}
<h2>Photo Settings</h2>
<div style="height:5px; clear:both;"></div>
<form name="form1" method="post" id="photo_settings">
<div id="tabbed_div" class="clearfix">
<div class="main_page_div">
<fieldset class="fieldset" style="border:none">
<legend>Photo Resizing</legend>
<div style="height:5px; clear:both;"></div>
<table width="100%" border="0" cellpadding="2" cellspacing="0" class="block">
<tr>
<td width="200" valign="top">
Photo Ratio
<span class="smallText">Your photo thumb and medium size thumb will be resized according to these ratios</span>
</td>
<td valign="top">
<div id="ratios">
<input name="photo_ratio" id="ratio_1" value="4:3" type="radio"{if $row.photo_ratio == '4:3'} checked{/if} />
<label for="ratio_1">
<span style="width:120px; height:90px; line-height:90px;" class="RatioBox">4:3</span></label>
<input name="photo_ratio" id="ratio_3" value="16:9" type="radio"{if $row.photo_ratio == '16:9'} checked{/if} />
<label for="ratio_3">
<span style="width:120px; height:68px; line-height:68px;" class="RatioBox">16:9</span>
</label>
<input name="photo_ratio" id="ratio_2" value="16:10" type="radio"{if $row.photo_ratio == '16:10'} checked{/if} />
<label for="ratio_2">
<span style="width:120px; height:75px; line-height:75px;" class="RatioBox">16:10</span>
</label>
</div>
</td>
</tr>
<tr>
<td width="200" valign="top">
Photo Width
<span class="smallText">Height will automatically be updated according to your ratio selected</span>
</td>
<td valign="top" >
<div class="smallText" style="font:bold 10px Tahoma; color:#666; display:block;">Thumb Dimensions:</div>
<input maxlength="3" type="text" name="photo_thumb_width" title="Thumb Width" id="image_width" value="{$row.photo_thumb_width}" />
<input maxlength="3" title="Thumb Height" type="text" name="photo_thumb_height" id="image_height" value="{$row.photo_thumb_height}" readonly>
<br />
<br />
<div class="smallText" style="font:bold 10px Tahoma; color:#666; display:block;"> Medium Thumb Dimensions:</div>
<input maxlength="3" title="Medium Thumb Width" type="text" name="photo_med_width" id="med_width" value="{$row.photo_med_width}" />
<input maxlength="3" title="Medium Thumb Height" type="text" name="photo_med_height" id="med_height" value="{$row.photo_med_height}" readonly>
</td>
</tr>
<tr>
<td width="200" valign="top">
Large Photo Width
<span class="smallText">
Width of Large Photo
</span>
</td>
<td>
<input type="text" maxlength="3" name="photo_lar_width" id="lar_width" value="{$row.photo_lar_width}" />
</td>
</tr>
<tr>
<td width="200" valign="top">
Crop Image
<span class="smallText">
If Enable, your thumb and medium size will be cropped excatly to above dimensions if required.
</span>
</td>
<td valign="top">
<input value="1" type="radio" name="photo_crop" id="crop_yes" {if $row.photo_crop == '1'}checked{/if} /><label for="crop_yes">Enable</label>
<input value="0" type="radio" name="photo_crop" id="crop_no" {if $row.photo_crop == '0'}checked{/if}/><label for="crop_no">Disable</label>
</td>
</tr>
</table>
<div style="height:5px; clear:both;"></div>
<legend>Photo Behavior</legend>
<div style="height:5px; clear:both;"></div>
<table width="100%" border="0" cellpadding="2" cellspacing="0" class="block">
<tr>
<td width="200" valign="top">
Multi-upload
<span class="smallText">
Number of photos, user can upload at once.
</span>
</td>
<td valign="top">
<input type="text" name="photo_multi_upload" id="multi_photo" value="{$row.photo_multi_upload}" >
</td>
</tr>
<tr>
<td width="200" valign="top">
Max Photo Size
<span class="smallText">
Maximum allowed photo size, in MBs.
</span>
</td>
<td valign="top">
<input type="text" name="max_photo_size" id="max_photo_size" value="{$row.max_photo_size}" >
</td>
</tr>
<tr>
<td width="200" valign="top">
<label for="photo_download">Enable Photo Downloading</label>
</td>
<td valign="top">
<input type="checkbox" name="photo_download" id="photo_download" value="{$row.photo_download}" {if $row.photo_download == '1'}checked{/if}>
</td>
</tr>
<tr>
<td width="200" valign="top">
<label for="photo_comments">Enable Photo Comments</label>
</td>
<td valign="top">
<input type="checkbox" name="photo_comments" id="photo_comments" value="{$row.photo_comments}"{if $row.photo_comments == '1'}checked{/if} >
</td>
</tr>
<tr>
<td width="200" valign="top">
<label for="photo_rating">Enable Photo Rating</label>
</td>
<td valign="top">
<input type="checkbox" name="photo_rating" id="photo_rating" value="{$row.photo_rating}"{if $row.photo_rating == '1'}checked{/if} >
</td>
</tr>
</table>
</fieldset>
</div> <!-- main_page_div end -->
<div align="right"class="main_page_div" style="padding:5px; min-height:0px; margin-top:10px">
<label>
<input type="submit" name="update" class="button" value="Update Settings" id="udpate" />
</label>
</div>
</div>
</form>
{/if}
{if $mode == 'watermark_settings'}
<h2>Watermark Settings</h2>
<div style="height:5px; clear:both"></div>
<form action="" method="post" enctype="multipart/form-data">
<div class="main_page_div clearfix">
<fieldset class="fieldset" style="border:0px; display:block;">
<div style="float:left; width:800px;">
<legend>Watermark Settings</legend>
<table width="100%" border="0" cellpadding="2" cellspacing="0" class="block">
<tr>
<td width="200" valign="top">Enable Watermark</td>
<td valign="top"><input name="watermark_photo" id="watermark_photo" type="checkbox" value="1"{if $row.watermark_photo == '1'} checked{/if} ></td>
</tr>
<tr>
<td width="200" valign="top">Maximum Width <span class="smallText">Maximum Width of watermark image. Recommended is 120.</span></td>
<td valign="top"><input name="watermark_max_width" id="watermark_max_width" type="text" value="{$row.watermark_max_width}" ></td>
</tr>
<tr>
<td width="200" valign="top">Watermark Placement</td>
<td valign="top">
<div style="float:left; width:150px;">
<input type="radio" name="watermark_placement" id="top_left" value="left:top"{if $row.watermark_placement == 'left:top'} checked{/if} />
<label for="top_left">Top - Left</label><br/>
<input type="radio" name="watermark_placement" id="top_right" value="right:top"{if $row.watermark_placement == 'right:top'} checked{/if} />
<label for="top_right">Top - Right</label><br/>
<input type="radio" name="watermark_placement" id="top_center" value="center:top"{if $row.watermark_placement == 'center:top'} checked{/if} />
<label for="top_center">Top - Center</label><br/><br/>
</div>
<div style="float:left; width:150px;">
<input type="radio" name="watermark_placement" id="bottom_left" value="left:bottom"{if $row.watermark_placement == 'left:bottom'} checked{/if} />
<label for="bottom_left">Bottom - Left</label><br/>
<input type="radio" name="watermark_placement" id="bottom_right" value="right:bottom"{if $row.watermark_placement == 'right:bottom'} checked{/if} />
<label for="bottom_right">Bottom - Right</label><br/>
<input type="radio" name="watermark_placement" id="bottom_center" value="center:bottom"{if $row.watermark_placement == 'center:bottom'} checked{/if} />
<label for="bottom_center">Bottom - Center</label><br/><br/>
</div>
<div style="float:left; width:150px;">
<input type="radio" name="watermark_placement" id="left" value="left:center"{if $row.watermark_placement == 'left:center'} checked{/if} />
<label for="left">Left</label><br/>
<input type="radio" name="watermark_placement" id="right" value="right:center"{if $row.watermark_placement == 'right:center'} checked{/if} />
<label for="right">Right</label><br/>
<input type="radio" name="watermark_placement" id="center" value="center:center"{if $row.watermark_placement == 'center:center'} checked{/if} />
<label for="center">Center</label><br/>
</div>
</td>
</tr>
</table>
<div style="height:5px; clear:both"></div>
<legend>Upload New Watermark</legend>
<span class="smallText" style="font-size:11px;">This will over-write your existing watermark file, if exists.</span>
<div style="height:5px; clear:both"></div>
<input type="file" name="watermark_file" id="watermark_file" >
</div>
<div class="main_page_div" style="float:right; width:200px; text-align:center; height:auto; min-height:0px;">
<legend style="width:100%;">Current Watermark</legend>
<div style="height:5px; clear:both"></div>
{assign var=file value=$cbphoto->watermark_file()}
{if $file}
<img src="{$cbphoto->watermark_file()}" />
{else}
<strong>Watermark not found</strong>
{/if}
</div>
</fieldset>
</div> <!-- main_page_div end -->
<div align="right"class="main_page_div" style="padding:5px; min-height:0px; margin-top:10px">
<label>
<input type="submit" name="update_watermark" class="button" value="Update Settings" id="update_watermark" />
</label>
</div>
</form>
{/if}

View file

@ -0,0 +1,245 @@
{if $mode == 'single'}
<h2>Re-create Photos</h2>
<form action="recreate_thumbs.php?mode={$mode}&amp;photo={$data.photo_id}" method="post" enctype="multipart/form-data">
<a href="edit_photo.php?photo={$p.photo_id}">&laquo; Back to Edit Details</a>
<div style="height:5px;"></div>
<fieldset class="fieldset" style="padding:10px;">
<legend style="font:bold 11px Tahoma; text-transform:uppercase; background:#FFF; padding:0 20px;">Settings on which photos will be re-created</legend>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Ratio</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_ratio}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Thumb Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_thumb_width}" class="disabled" /> x <input disabled="disabled" value="{$Cbucket->configs.photo_thumb_height}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Medium Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_med_width}" class="disabled" /> x <input disabled="disabled" value="{$Cbucket->configs.photo_med_height}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Large Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_lar_width}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Cropping</div>
<div class="moveL">
{assign var=cropping value=$Cbucket->configs.photo_crop}
{if $cropping == 1}
<span class="AdminBoldText">Enabled</span>
{else}
Disabled
{/if}
</div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Watermarking</div>
<div class="moveL">
{assign var=watermark value=$Cbucket->configs.watermark_photo}
{if $watermark == 1}
<span class="AdminBoldText">Enabled</span> | <span class="AdminBoldText">Placement</span> - <input disabled="disabled" value="{$Cbucket->configs.watermark_placement}" class="disabled" />
{else}
<span class="AdminBoldText">Disabled</span>
{/if}
</div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px; background:#EEE;">
<div class="moveL PhotoID" style="width:10%">&nbsp;</div>
<div class="moveL">
<span class="AdminBoldText" style="color:#333;">Update settings if they are not according to your needs.</span>
</div>
</li>
</fieldset>
<div style="height:5px; clear:both;"></div>
<a href="recreate_thumbs.php?mode={$mode}&amp;photo={$p.photo_id}&amp;recreate=true" style="margin-bottom:5px;" class="myAdminButton moveR">Re-create Photo</a>
<fieldset class="fieldset" style="padding:8px;">
{foreach from=$files item=file}
<div style="float:left; margin-right:15px;">
<div style="font:bold 11px Tahoma;">
{assign var=size value=$cbphoto->get_image_type($file)}
Filename: {$p.filename}{if $size} - Size: {$size}{/if}
</div>
<div style="height:5px;"></div>
<img src="{$file}" style="max-width:300px;" />
</div>
{/foreach}
</fieldset>
</form>
{/if}
{if $mode == 'mass' || $mode == ''}
<h2>Mass Re-creation of Photos</h2>
<div style="height:10px; clear:both;"></div>
<span class="AdminBoldText">This will re-create all the photos uploaded on your website, according to the settings shown below
<div style="height:5px; clear:both;"></div>
<fieldset class="fieldset" style="padding:10px;">
<legend style="font:bold 11px Tahoma; text-transform:uppercase; background:#FFF; padding:0 20px;">Settings on which photos will be re-created</legend>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Ratio</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_ratio}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Thumb Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_thumb_width}" class="disabled" /> x <input disabled="disabled" value="{$Cbucket->configs.photo_thumb_height}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Medium Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_med_width}" class="disabled" /> x <input disabled="disabled" value="{$Cbucket->configs.photo_med_height}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Large Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_lar_width}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Cropping</div>
<div class="moveL">
{assign var=cropping value=$Cbucket->configs.photo_crop}
{if $cropping == 1}
<span class="AdminBoldText">Enabled</span>
{else}
Disabled
{/if}
</div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Watermarking</div>
<div class="moveL">
{assign var=watermark value=$Cbucket->configs.watermark_photo}
{if $watermark == 1}
<span class="AdminBoldText">Enabled</span> | <span class="AdminBoldText">Placement</span> - <input disabled="disabled" value="{$Cbucket->configs.watermark_placement}" class="disabled" />
{else}
<span class="AdminBoldText">Disabled</span>
{/if}
</div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px; background:#EEE;">
<div class="moveL PhotoID" style="width:10%">&nbsp;</div>
<div class="moveL">
<span class="AdminBoldText" style="color:#333;">Update settings if they are not according to your needs.</span>
</div>
</li>
</fieldset>
<div style="height:5px; clear:both;"></div>
<div class="moveL">
<span class="AdminBoldText">Loop Size</span> - <input type="text" name="textfield" style="width:60px; font:normal 11px Tahoma" value="{$loop_size}" id="the_loop_size" /><br/>
<div class="smallText" style="margin-top:2px">Number of photos to re-create in one go.</div>
</div>
<form name="mass_recreation" method="get" action="">
<input type="hidden" name="loop_size" value="" id="loop_start" />
<input type="submit" name="mass_recreation" id="mass_recreation" value="Start Recreation" class="myAdminButton moveR"
onclick="$('#loop_start').val($('#the_loop_size').val())"/>
</form>
{if $indexing}
<div align="right" style="padding:5px">{$from} - {$to} of {$total}</div>
<ul>
{foreach from=$index_msgs item=themsg}
<li>{$themsg}</li>
{/foreach}
</ul>
{if $stop_loop!='yes'}
<script type="text/javascript">
var start_index = '{$next_index}';
var loop_size = '{$smarty.get.loop_size}';
var mode = '{$mode}';
var button = '{$button}';
{literal}$(document).oneTime(2000,function(){$(window.location).attr('href', '?loop_size='+loop_size+'&'+button+'=yes&start_index='+start_index)});{/literal}
</script>
redirecting....do not close this window
{else}
Re-creation of photos have been completed.
{/if}
{/if}
{/if}
{if $mode == "collection"}
<h2>Recreate Photos</h2>
<div style="height:10px; clear:both;"></div>
{if $items}
{assign var=cid value=$items[0].collection_id}
{assign var=c_name value=$items[0].collection_id|get_collection_field}
<span style="font:bold 14px Arial; text-transform:uppercase;">{$c_name}</span>
<span style="font:bold 11px Tahoma;">
- <a href="{$baseurl}/view_collection.php?cid={$cid}">View Collection</a> -
<a href="{$baseurl}/admin_area/edit_collection.php?collection={$cid}">Edit Collection</a> -
<a href="{$baseurl}/admin_area/manage_items.php?collection={$cid}&amp;type={$items[0].collection_id|get_collection_field:type}">Manage Items</a>
</span>
<fieldset class="fieldset" style="padding:10px;">
<legend style="font:bold 11px Tahoma; text-transform:uppercase; background:#FFF; padding:0 20px;">Settings on which photos will be re-created</legend>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Ratio</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_ratio}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Thumb Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_thumb_width}" class="disabled" /> x <input disabled="disabled" value="{$Cbucket->configs.photo_thumb_height}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Medium Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_med_width}" class="disabled" /> x <input disabled="disabled" value="{$Cbucket->configs.photo_med_height}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Large Size</div>
<div class="moveL"><input disabled="disabled" value="{$Cbucket->configs.photo_lar_width}" class="disabled" /></div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Cropping</div>
<div class="moveL">
{assign var=cropping value=$Cbucket->configs.photo_crop}
{if $cropping == 1}
<span class="AdminBoldText">Enabled</span>
{else}
Disabled
{/if}
</div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px;">
<div class="moveL PhotoID" style="width:10%">Watermarking</div>
<div class="moveL">
{assign var=watermark value=$Cbucket->configs.watermark_photo}
{if $watermark == 1}
<span class="AdminBoldText">Enabled</span> | <span class="AdminBoldText">Placement</span> - <input disabled="disabled" value="{$Cbucket->configs.watermark_placement}" class="disabled" />
{else}
<span class="AdminBoldText">Disabled</span>
{/if}
</div>
</li>
<li class="clearfix myAdminList" style="padding-bottom:5px; background:#EEE;">
<div class="moveL PhotoID" style="width:10%">&nbsp;</div>
<div class="moveL">
<span class="AdminBoldText" style="color:#333;">Update settings if they are not according to your needs.</span>
</div>
</li>
</fieldset>
<form action="" method="post" name="collection_photos_recreate">
<fieldset class="fieldset" style="padding:10px;">
<legend style="font:bold 11px Tahoma; text-transform:uppercase; background:#FFF; padding:0 20px;">Photos</legend>
<table border="0" cellspacing="0">
{section name=list loop=$items}
<td style="display:inline-block; padding:5px;">
<div style="position:relative">
<input type="checkbox" value="{$items[list].photo_id}" id="photo_{$items[list].photo_id}" style="position:absolute; top:1px; right:1px; " name="check_photo[]" />
<label for="photo_{$items[list].photo_id}">{get_photo output=html details=$items[list] style='padding:1px; border:1px solid #aaa'}</label>
</div>
</td>
{/section}
</table>
</fieldset>
<div class="AdminBoldText moveL" style="padding:10px 0 0;">Select photos you want to re-created | </div>
<label for="id_selectALL" class="myAdminButton clearfix moveL" type="button" name="checkall" onclick="checkUncheckAll(this);" style="margin:5px 0 0 5px">Select All</label><input type="checkbox" id="id_selectALL" style="visibility:hidden;" name="checkall" onclick="checkUncheckAll(this);"/>
<div style="margin-top:5px;" class="moveR"><input type="submit" name="recreating" value="Re-create Photos" class="myAdminButton"/></div>
</form>
{else}
{/if}
{/if}

View file

@ -285,4 +285,23 @@ margin-top: 0;
.cb_div input[type=submit]{padding:5px} .cb_div input[type=submit]{padding:5px}
.reindex_tbl .button {width:130px} .reindex_tbl .button {width:130px}
.reindex_tbl td{height:60px} .reindex_tbl td{height:60px}
.RatioBox { background:#0099cc; border:1px solid #026f93; font:bold 11px Tahoma; color:#FFF; text-align:center; display:inline-block; }
.smallText { font:normal 10px Tahoma; color:#7b7b7b; display:inline-block; margin-top:5px; }
.AdminBoldText { font:bold 11px Tahoma; color:#7b7b7b; }
/* I GOT FUKING ANNOYED THOSE TD's TR's SO I HAVE DEDICED TO ADD THIS CSS */
.moveL { float:left; }
.moveR { float:right; }
li.myAdminList { list-style:none; padding:5px 0px; border-bottom:1px solid #ccc; position:relative; }
li.myAdminList .PhotoCheckBox { width:30px; }
li.myAdminList .PhotoID { width:75px; font:bold 11px Tahoma; text-align:center; }
li.myAdminList .PhotoDetails { min-height:90px; height:90px; height:auto !important; }
li.myAdminList .PhotoDetails a { color:#0C4469; font-size:13px; font-weight:bold; text-decoration:none; }
li.myAdminList .AdminPhotoThumb { margin-right:8px; }
li.myAdminList .AdminPhotoActions a { font:bold 11px Tahoma; }
li.myAdminList .AdminPhotoActions a:hover { border-bottom:1px dashed #0099cc; }
li.myAdminList input[disabled=disabled].disabled { font:normal 11px Tahoma; padding:1px; }
.myAdminButton { background:url(../images/gradients.png); border:1px solid #000; padding:4px; margin:0px; font:bold 11px Tahoma; color:#FFF; }

View file

@ -68,6 +68,16 @@ if(!empty($mode))
$cbvid->show_video_rating($result); $cbvid->show_video_rating($result);
} }
break; break;
case "photo":
{
$rating = $_POST['rating']*2;
$id = $_POST['id'];
$result = $cbphoto->rate_photo($id,$rating);
$result['is_rating'] = true;
$cbvid->show_video_rating($result);
}
break;
} }
} }
break; break;
@ -101,6 +111,28 @@ if(!empty($mode))
echo $msg; echo $msg;
} }
break; break;
case "p":
case "photo":
{
$id = $_POST['id'];
$ph = $cbphoto->get_photo($id);
$cbphoto->set_share_email($ph);
$cbphoto->action->share_content($ph['photo_id']);
if(msg())
{
$msg = msg_list();
$msg = '<div class="msg">'.$msg[0].'</div>';
}
if(error())
{
$msg = error_list();
$msg = '<div class="error">'.$msg[0].'</div>';
}
echo $msg;
}
break;
} }
} }
break; break;
@ -131,6 +163,27 @@ if(!empty($mode))
echo $msg; echo $msg;
} }
break; break;
case 'p':
case 'photo':
{
$id = $_POST['id'];
$cbphoto->action->add_to_fav($id);
// Need a function to update favs count
if(msg())
{
$msg = msg_list();
$msg = '<div class="msg">'.$msg[0].'</div>';
}
if(error())
{
$msg = error_list();
$msg = '<div class="error">'.$msg[0].'</div>';
}
echo $msg;
}
break;
} }
} }
break; break;
@ -167,6 +220,16 @@ if(!empty($mode))
$userquery->action->report_it($id); $userquery->action->report_it($id);
} }
break; break;
case 'p':
case 'photo':
default:
{
$id = $_POST['id'];
$cbphoto->action->report_it($id);
// Need a function to set photo reported field to yes
}
break;
} }
if(msg()) if(msg())
@ -582,13 +645,13 @@ if(!empty($mode))
} }
break; break;
case "pictures": case "photos":
case "picture": case "photo":
case "p": case "p":
{ {
$cid = $_POST['cid']; $cid = $_POST['cid'];
$id = $_POST['obj_id']; $id = $_POST['obj_id'];
$cbpicture->collection->add_collection_item($id,$cid); $cbphoto->collection->add_collection_item($id,$cid);
} }
} }
@ -626,11 +689,12 @@ if(!empty($mode))
} }
break; break;
case "pictures": case "photos":
{ {
$obj_id = $_POST['obj_id']; $obj_id = $_POST['obj_id'];
$cid = $_POST['cid']; $cid = $_POST['cid'];
$cbpicture->collection->remove_item($obj_id,$cid); $cbphoto->collection->remove_item($obj_id,$cid);
$cbphoto->make_photo_orphan($cid,$obj_id);
} }
break; break;
} }
@ -644,7 +708,7 @@ if(!empty($mode))
if(error()) if(error())
{ {
$err = error_list(); $err = error_list();
$err = $err[0]; $err = '<div class="error">'.$err[0].'</div>';
} }
$ajax['msg'] = $msg; $ajax['msg'] = $msg;
@ -654,9 +718,9 @@ if(!empty($mode))
} }
break; break;
case "NePrItem": case "get_item":
{ {
$item_id = $_POST['item_id']; $item_id = $_POST['ci_id'];
$cid = $_POST['cid']; $cid = $_POST['cid'];
$direc = mysql_clean($_POST['direction']); $direc = mysql_clean($_POST['direction']);
$t = $_POST['type']; $t = $_POST['type'];
@ -664,17 +728,36 @@ if(!empty($mode))
switch($t) switch($t)
{ {
case "videos": case "videos":
case "video":
case "v": case "v":
{ {
$N_item = $cbvideo->collection->get_next_prev_item($item_id,$cid,$direc); $N_item = $cbvideo->collection->get_next_prev_item($item_id,$cid,$direc);
//increment_views($N_item[0]['videoid'],'video');
$cbvideo->collection->set_item_cookie($N_item[0]['videokey']);
$ajax['key'] = $N_item[0]['videokey'];
$ajax['cid'] = $N_item[0]['collection_id'];
}
break;
case "photos":
case "photo":
case "p":
{
$N_item = $cbphoto->collection->get_next_prev_item($item_id,$cid,$direc);
increment_views($N_item[0]['photo_id'],'photo');
$cbphoto->collection->set_item_cookie($N_item[0]['photo_key']);
$ajax['key'] = $N_item[0]['photo_key'];
$ajax['cid'] = $N_item[0]['collection_id'];
} }
break; break;
} }
if($N_item) if($N_item)
{ {
$ajax['ci_id'] = $N_item[0]['ci_id']; assign('type',$t);
$ajax['cid'] = $N_item[0]['collection_id']; assign('object',$N_item[0]);
$ajax['content'] = Fetch('view_item.html');
echo json_encode($ajax); echo json_encode($ajax);
} else { } else {
return false; return false;
@ -682,27 +765,89 @@ if(!empty($mode))
} }
break; break;
case "get_item": case "load_more_items":
case "more_items":
case "moreItems":
{ {
$t = $_POST['type'];
$ci_id = $_POST['ci_id'];
$cid = $_POST['cid']; $cid = $_POST['cid'];
$page = $_POST['page'];
switch($t) $newPage = $page+1;
$type = $_POST['type'];
$limit = create_query_limit($page,VLISTPP);
$order = tbl("collection_items").".ci_id DESC";
switch($type)
{ {
case "videos": case "videos":
case "video":
case "v": case "v":
{ {
$item = $cbvideo->collection->get_next_prev_item($ci_id,$cid,NULL); $items = $cbvideo->collection->get_collection_items_with_details($cid,$order,$limit);
assign('type',$t);
assign('object',$item[0]);
} }
break;
case "photos":
case "photo":
case "p":
{
$items = $cbphoto->collection->get_collection_items_with_details($cid,$order,$limit);
}
break;
}
if($items)
{
assign('page_no',$newPage);
assign('type',$type);
assign('cid',$cid);
$itemsArray['pagination'] = Fetch("blocks/new_pagination.html");
foreach($items as $item)
{
assign('object',$item);
assign('display_type','view_collection');
assign('type',$type);
$itemsArray['content'] .= Fetch("blocks/collection.html");
}
echo json_encode($itemsArray);
} else
return false;
}
break;
case "add_collection":
{
$name = mysql_clean($_POST['collection_name']);
$desc = mysql_clean($_POST['collection_description']);
$tags = mysql_clean(genTags($_POST['collection_tags']));
$cat = ($_POST['category']);
$type = "photos";
$CollectParams = array("collection_name"=>$name,"collection_description"=>$desc,"collection_tags"=>$tags,"category"=>$cat,"type"=>$type);
$cbcollection->create_collection($CollectParams);
if(msg())
{
$msg = msg_list();
$msg = '<div class="msg">'.$msg[0].'</div>';
} }
if(!empty($item)) if(error())
{ {
Template('blocks/view_item.html'); $err = error_list();
$err = '<div class="error">'.$err[0].'</div>';
} }
$ajax['msg'] = $msg;
$ajax['err'] = $err;
echo json_encode($ajax);
}
break;
case "ajaxPhotos":
{
echo "TEST SUCCESSFULL";
} }
break; break;

View file

@ -9,25 +9,26 @@
class Collections extends CBCategory class Collections extends CBCategory
{ {
var $collect_thumb_width = 140; var $collect_thumb_width = 160;
var $collect_thumb_height = 140; var $collect_thumb_height = 120;
var $collect_small_thumb_width = 60; var $collect_small_thumb_width = 120;
var $collect_small_thumb_height = 60; var $collect_small_thumb_height = 90;
var $items = 'collection_items'; // ITEMS TABLE var $items = 'collection_items'; // ITEMS TABLE
var $types = ''; // TYPES OF COLLECTIONS var $types = ''; // TYPES OF COLLECTIONS
var $user_links = ''; var $user_links = '';
var $custom_collection_fields = array(); var $custom_collection_fields = array();
var $collection_delete_functions = array();
var $action = '';
/** /**
* Setting variables of different thing which will * Setting variables of different thing which will
* help makes this class reusble for very object * help makes this class reusble for very object
*/ */
var $objTable = 'pictures'; var $objTable = 'photos';
var $objType = 'p'; var $objType = 'p';
var $objName = 'Picture'; var $objName = 'Photo';
var $objClass = 'cbpicture'; var $objClass = 'cbphoto';
var $objFunction = 'picture_exists'; var $objFunction = 'photo_exists';
var $objFieldID = 'picture_id'; var $objFieldID = 'photo_id';
/** /**
@ -37,11 +38,26 @@ class Collections extends CBCategory
{ {
$this->cat_tbl = "collection_categories"; $this->cat_tbl = "collection_categories";
$this->section_tbl = "collections"; $this->section_tbl = "collections";
$this->types = array('videos' => lang("Videos"),'pictures' => lang("Pictures")); $this->types = array('videos' => lang("Videos"),'photos' => lang("Photos"));
ksort($this->types); ksort($this->types);
$this->setting_up_collections(); $this->setting_up_collections();
} }
/**
* Settings up Action Class
*/
function init_actions()
{
$this->action = new cbactions();
$this->action->init(); // Setting up reporting excuses
$this->action->type = 'cl';
$this->action->name = 'collection';
$this->action->obj_class = 'cbcollection';
$this->action->check_func = 'collection_exists';
$this->action->type_tbl = "collection";
$this->action->type_id_field = 'collection_id';
}
/** /**
* Setting links up in my account * Setting links up in my account
*/ */
@ -53,13 +69,19 @@ class Collections extends CBCategory
$links = array(); $links = array();
$links[lang('Collections')] = array( $links[lang('Collections')] = array(
lang('Add New Collection') => "manage_collections.php?mode=add_new", lang('Add New Collection') => "manage_collections.php?mode=add_new",
lang('Manage Collections') => "manage_collections.php" lang('Manage Collections') => "manage_collections.php",
lang('Favorite Collections') => "manage_collections.php?mode=favorites"
); );
$userquery->user_account = $links; $userquery->user_account = $links;
// Adding Search Type // Adding Search Type
$Cbucket->search_types['collections'] = "cbcollection"; $Cbucket->search_types['collections'] = "cbcollection";
// Adding Collection links in Admin Area
$Cbucket->AdminMenu['Collections'] = array(
lang('Manage Collections')=>'collection_manager.php',
lang('Flagged Collections')=>'flagged_collections.php');
// Adding Collection links in Cbucket Class // Adding Collection links in Cbucket Class
$Cbucket->links['manage_collections'] = array('manage_collections.php','manage_collections'); $Cbucket->links['manage_collections'] = array('manage_collections.php','manage_collections');
$Cbucket->links['edit_collection'] = array('manage_collections.php?mode=edit_collection&amp;cid=', $Cbucket->links['edit_collection'] = array('manage_collections.php?mode=edit_collection&amp;cid=',
@ -120,11 +142,12 @@ class Collections extends CBCategory
'value'=>cleanForm($default['query']) 'value'=>cleanForm($default['query'])
), ),
'category' => array( 'category' => array(
'title' => lang('vdo_cat'), 'title' => lang('category'),
'type' => 'checkbox', 'type' => 'checkbox',
'name' => 'category[]', 'name' => 'category[]',
'id' => 'category', 'id' => 'category',
'value' => array('category',$cat_array), 'value' => array('category',$cat_array),
'category_type' => 'collections'
), ),
'uploaded' => array( 'uploaded' => array(
'title' => lang('uploaded'), 'title' => lang('uploaded'),
@ -140,7 +163,7 @@ class Collections extends CBCategory
'name' => 'sort', 'name' => 'sort',
'value' => $sorting, 'value' => $sorting,
'checked' => $sort 'checked' => $sort
) )
); );
$this->search->search_type['collections']['fields'] = $fields; $this->search->search_type['collections']['fields'] = $fields;
@ -186,6 +209,31 @@ class Collections extends CBCategory
return false; return false;
} }
function is_viewable($cid)
{
global $userquery;
$c = $this->get_collection($cid);
if(empty($c))
{
e(lang('collection_not_exists'));
return false;
} elseif($c['active'] == 'no') {
e(lang('collection_not_active'));
if(!has_access('admin_access',TRUE))
return false;
else
return true;
} elseif($c['broadcast'] == 'private' && !$userquery->is_confirmed_friend($c['userid'],userid())
&& $c['userid']!=userid() && !has_access('admin_access',TRUE))
{
e(lang('collection_is_private'));
return false;
} else {
return true;
}
}
/** /**
* Function used to get collections * Function used to get collections
*/ */
@ -197,8 +245,10 @@ class Collections extends CBCategory
$order = $p['order']; $order = $p['order'];
$cond = ""; $cond = "";
if(!has_access('admin_access',TRUE)) if(!has_access('admin_access',TRUE) && $p['user'] != userid())
$cond .= " ".tbl('collections.active')." = 'yes' AND ".tbl('collections.broadcast')." = 'public' "; $cond .= " ".tbl('collections.active')." = 'yes' AND ".tbl('collections.broadcast')." = 'public' ";
elseif($p['user'] == userid())
$cond .= " ".tbl('collections.active')." = 'yes'";
else else
{ {
if($p['active']) if($p['active'])
@ -371,7 +421,7 @@ class Collections extends CBCategory
/** /**
* Function used to get next / previous collection item * Function used to get next / previous collection item
*/ */
function get_next_prev_item($ci_id,$cid,$item="prev",$limit=1) function get_next_prev_item($ci_id,$cid,$item="prev",$limit=1,$check_only=false)
{ {
global $db; global $db;
$iTbl = tbl($this->items); $iTbl = tbl($this->items);
@ -394,8 +444,34 @@ class Collections extends CBCategory
$op = "="; $op = "=";
$order = ''; $order = '';
} }
$cond = " $iTbl.collection_id = $cid AND $iTbl.ci_id $op $ci_id AND $iTbl.object_id = $oTbl.".$this->objFieldID." AND $oTbl.userid = $uTbl.userid";
if(!$check_only)
{
$result = $db->select($tbls,"$iTbl.*,$oTbl.*,$uTbl.username", $cond,$limit,$order);
$result = $db->select($tbls,"$iTbl.*,$oTbl.*,$uTbl.username", " $iTbl.collection_id = $cid AND $iTbl.ci_id $op $ci_id AND $iTbl.object_id = $oTbl.".$this->objFieldID." AND $oTbl.userid = $uTbl.userid",$limit,$order); // Result was empty. Checking if we were going backwards, So bring last item
if(empty($result) && $item == "prev")
{
$order = $iTbl.".ci_id ASC";
$op = "<";
$result = $db->select($tbls,"$iTbl.*,$oTbl.*,$uTbl.username", " $iTbl.collection_id = $cid AND $iTbl.ci_id $op $ci_id AND $iTbl.object_id = $oTbl.".$this->objFieldID." AND $oTbl.userid = $uTbl.userid",$limit,$order);
}
// Result was empty. Checking if we were going fowards, So bring first item
if(empty($result) && $item == "next")
{
$order = $iTbl.".ci_id DESC";
$op = ">";
$result = $db->select($tbls,"$iTbl.*,$oTbl.*,$uTbl.username", " $iTbl.collection_id = $cid AND $iTbl.ci_id $op $ci_id AND $iTbl.object_id = $oTbl.".$this->objFieldID." AND $oTbl.userid = $uTbl.userid",$limit,$order);
}
}
if($check_only)
{
$result = $db->count($iTbl.",".$oTbl,"$iTbl.ci_id", " $iTbl.collection_id = $cid AND $iTbl.ci_id $op $ci_id AND $iTbl.object_id = $oTbl.".$this->objFieldID,$limit,$order);
}
//echo $db->db_query; //echo $db->db_query;
if($result) if($result)
return $result; return $result;
@ -404,6 +480,18 @@ class Collections extends CBCategory
} }
/**
* Function used to set cookie on moving
* forward or backward
*/
function set_item_cookie($value)
{
if(isset($_COOKIE['current_item']))
unset($_COOKIE['current_item']);
setcookie('current_item',$value,time()+240);
}
/** /**
* Function used to get collection items with details * Function used to get collection items with details
*/ */
@ -416,7 +504,7 @@ class Collections extends CBCategory
if(!$count_only) if(!$count_only)
{ {
$result = $db->select($tables,"$itemsTbl.*,$objTbl.*,".tbl('users').".username"," $itemsTbl.collection_id = '$id' AND $itemsTbl.object_id = $objTbl.".$this->objFieldID." AND $objTbl.userid = ".tbl('users').".userid",$limit,$order); $result = $db->select($tables,"$itemsTbl.ci_id,$itemsTbl.collection_id,$objTbl.*,".tbl('users').".username"," $itemsTbl.collection_id = '$id' AND $itemsTbl.object_id = $objTbl.".$this->objFieldID." AND $objTbl.userid = ".tbl('users').".userid",$limit,$order);
//echo $db->db_query; //echo $db->db_query;
} else { } else {
$result = $db->count($itemsTbl,"ci_id"," collection_id = $id"); $result = $db->count($itemsTbl,"ci_id"," collection_id = $id");
@ -430,6 +518,20 @@ class Collections extends CBCategory
return false; return false;
} }
/**
* Function used to get collection items with
* specific fields
*/
function get_collection_item_fields($cid,$objID,$fields)
{
global $db;
$result = $db->select(tbl($this->items),$fields," object_id = $objID AND collection_id = $cid");
if($result)
return $result;
else
return false;
}
/** /**
* Function used to load collections fields * Function used to load collections fields
*/ */
@ -471,6 +573,7 @@ class Collections extends CBCategory
'value' => $description, 'value' => $description,
'db_field' => 'collection_description', 'db_field' => 'collection_description',
'required' => 'yes', 'required' => 'yes',
'anchor_before' => 'before_desc_compose_box',
'invalid_err' => lang("collect_descp_er") 'invalid_err' => lang("collect_descp_er")
), ),
'tags' => array( 'tags' => array(
@ -777,10 +880,20 @@ class Collections extends CBCategory
$collection = $this->get_collection($cid); $collection = $this->get_collection($cid);
if(empty($collection)) if(empty($collection))
e("collection_not_exists"); e("collection_not_exists");
elseif($collection['userid'] != userid() || !has_access('admin_access',true)) elseif($collection['userid'] != userid() && !has_access('admin_access',true))
e("cant_perform_action_collect"); e("cant_perform_action_collect");
else else
{ {
$del_funcs = $this->collection_delete_functions;
if(is_array($del_funcs) && !empty($del_funcs))
{
foreach($del_funcs as $func)
{
if(function_exists($func))
$func($collection);
}
}
$db->delete(tbl($this->items),array("collection_id"),array($cid)); $db->delete(tbl($this->items),array("collection_id"),array($cid));
$this->delete_thumbs($cid); $this->delete_thumbs($cid);
$db->delete(tbl($this->section_tbl),array("collection_id"),array($cid)); $db->delete(tbl($this->section_tbl),array("collection_id"),array($cid));
@ -797,7 +910,7 @@ class Collections extends CBCategory
$collection = $this->get_collection($id); $collection = $this->get_collection($id);
if(!$collection) if(!$collection)
e("collection_not_exists"); e("collection_not_exists");
elseif($collection['userid'] != userid() || !has_access('admin_access',true)) elseif($collection['userid'] != userid() && !has_access('admin_access',true))
e("cant_perform_action_collect"); e("cant_perform_action_collect");
else { else {
$db->delete(tbl($this->items),array("collection_id"),array($cid)); $db->delete(tbl($this->items),array("collection_id"),array($cid));
@ -819,7 +932,7 @@ class Collections extends CBCategory
e("you_not_logged_in"); e("you_not_logged_in");
elseif(!$this->object_in_collection($id,$cid)) elseif(!$this->object_in_collection($id,$cid))
e(sprintf(lang("object_not_in_collect"),$this->objName)); e(sprintf(lang("object_not_in_collect"),$this->objName));
elseif(!$this->is_collection_owner($cid) || !has_access('admin_access',true)) elseif(!$this->is_collection_owner($cid) && !has_access('admin_access',true))
e("cant_perform_action_collect"); e("cant_perform_action_collect");
else else
{ {
@ -869,7 +982,7 @@ class Collections extends CBCategory
*/ */
function upload_thumb($cid,$file) function upload_thumb($cid,$file)
{ {
global $imgObj; global $imgObj,$cbphoto;
$file_ext = strtolower(getext($file['name'])); $file_ext = strtolower(getext($file['name']));
$exts = array("jpg","gif","jpeg","png"); $exts = array("jpg","gif","jpeg","png");
@ -890,8 +1003,8 @@ class Collections extends CBCategory
e("pic_upload_vali_err"); e("pic_upload_vali_err");
else else
{ {
$imgObj->CreateThumb($thumb,$thumb,$this->collect_thumb_width,$ext,$this->collect_thumb_height,true); $imgObj->createThumb($thumb,$thumb,$this->collect_thumb_width,$ext,$this->collect_thumb_height);
$imgObj->CreateThumb($thumb,$sThumb,$this->collect_small_thumb_width,$ext,$this->collect_small_thumb_height,true); $imgObj->createThumb($thumb,$sThumb,$this->collect_small_thumb_width,$ext,$this->collect_small_thumb_height);
} }
} }
} }
@ -954,22 +1067,24 @@ class Collections extends CBCategory
if(has_access('admin_access',TRUE)) if(has_access('admin_access',TRUE))
{ {
if(!empty($array['featured']))
{
$query_field[] = "featured";
$query_val[] = $array['featured'];
}
if(!empty($array['total_comments'])) if(!empty($array['total_comments']))
{ {
$total_comments = $array['total_comments'];
if(!is_numeric($total_comments) || $total_comments<0)
$total_comments = 0;
$query_field[] = "total_comments"; $query_field[] = "total_comments";
$query_val[] = $array['total_comments']; $query_val[] = $total_comments;
} }
if(!empty($array['total_objects'])) if(!empty($array['total_objects']))
{ {
$tobj = $array['total_objects'];
if(!is_numeric($tobj) || $tobj<0)
$tobj = 0;
$query_field[] = "total_objects"; $query_field[] = "total_objects";
$query_val[] = $array['total_objects']; $query_val[] = $tobj;
} }
} }
} }
@ -980,7 +1095,7 @@ class Collections extends CBCategory
e("you_not_logged_in"); e("you_not_logged_in");
elseif(!$this->collection_exists($cid)) elseif(!$this->collection_exists($cid))
e("collect_not_exist"); e("collect_not_exist");
elseif(!$this->is_collection_owner($cid,userid())) elseif(!$this->is_collection_owner($cid,userid()) && !has_access('admin_access',TRUE))
e("cant_edit_collection"); e("cant_edit_collection");
else else
{ {
@ -1037,7 +1152,7 @@ class Collections extends CBCategory
return COLLECT_THUMBS_URL."/".$cid.$s.".".$ext; return COLLECT_THUMBS_URL."/".$cid.$s.".".$ext;
} }
} else { } else {
$item = $this->get_collection_items($cid,'date_added DESC',1); $item = $this->get_collection_items($cid,'ci_id DESC',1);
$type = $item[0]['type']; $type = $item[0]['type'];
switch($type) switch($type)
{ {
@ -1050,8 +1165,8 @@ class Collections extends CBCategory
case "p": case "p":
{ {
global $cbpicture; global $cbphoto;
return $cbpicture->get_preview($cbpicture->get_pic_details($item[0]['object_id'])); return $cbphoto->get_image_file($cbphoto->get_photo($item[0]['object_id']));
} }
} }
} }
@ -1071,9 +1186,42 @@ class Collections extends CBCategory
{ {
global $cbvideo; global $cbvideo;
$items = $cbvideo->collection->get_collection_items_with_details($cid); $items = $cbvideo->collection->get_collection_items_with_details($cid);
$total_rating = '';
if(!empty($items))
{
foreach($items as $item)
{
$total_rating += $item['rating'];
if(!empty($item['rated_by']) && $item['rated_by'] != 0)
$voters[] = $item['rated_by'];
}
}
}
break;
case "photos":
case "p":
{
global $cbphoto;
$items = $cbphoto->collection->get_collection_items_with_details($cid);
$total_rating = '';
if(!empty($items))
{
foreach($items as $item)
{
$total_rating += $item['rating'];
if(!empty($item['rated_by']) && $item['rated_by'] != 0)
$voters[] = $item['rated_by'];
}
}
} }
} }
$total_voters = count($voters);
if(!empty($total_rating) && $total_voters != 0)
{
$collect_rating = $total_rating / $total_voters;
return $collect_rating;
}
} }
/** /**
@ -1123,10 +1271,10 @@ class Collections extends CBCategory
* Function used return collection links * Function used return collection links
*/ */
function collection_links($details,$type=NULL) function collection_links($details,$type=NULL)
{ {
if(is_array($details)) if(is_array($details))
{ {
if(empty($details['collection_name'])) if(empty($details['collection_id']))
return BASEURL; return BASEURL;
else else
$cdetails = $details; $cdetails = $details;
@ -1152,12 +1300,77 @@ class Collections extends CBCategory
return BASEURL."/collection/".$cdetails['collection_id']."/".$cdetails['type']."/".SEO(clean(str_replace(' ','-',$cdetails['collection_name']))).""; return BASEURL."/collection/".$cdetails['collection_id']."/".$cdetails['type']."/".SEO(clean(str_replace(' ','-',$cdetails['collection_name'])))."";
else else
return BASEURL."/view_collection.php?cid=".$cdetails['collection_id']."&amp;type=".$cdetails['type']; return BASEURL."/view_collection.php?cid=".$cdetails['collection_id']."&amp;type=".$cdetails['type'];
} elseif($type == "vi" || $type == "view_item" ||$type == "item") {
$item_type = $this->get_collection_field($cdetails['collection_id'],'type');
switch($item_type)
{
case "videos":
case "v":
{
if(SEO == "yes")
return BASEURL."/item/".$item_type."/".$details['collection_id']."/".$details['videokey'];
else
return BASEURL."/view_item.php?item=".$details['videokey']."&amp;type=".$item_type."&amp;collection=".$details['collection_id'];
}
break;
case "photos":
case "p":
{
if(SEO == "yes")
return BASEURL."/item/".$item_type."/".$details['collection_id']."/".$details['photo_key'];
else
return BASEURL."/view_item.php?item=".$details['photo_key']."&amp;type=".$item_type."&amp;collection=".$details['collection_id'];
}
break;
}
} elseif($type == 'load_more' || $type == 'more_items' || $type='moreItems') {
if(empty($cdetails['page_no']))
$cdetails['page_no'] = 2;
if(SEO == 'yes')
return "?cid=".$cdetails['collection_id']."&amp;type=".$cdetails['type']."&amp;page=".$cdetails['page_no'];
else
return "?cid=".$cdetails['collection_id']."&amp;type=".$cdetails['type']."&amp;page=".$cdetails['page_no'];
} }
} else { } else {
return BASEURL; return BASEURL;
} }
} }
/**
* Used to update counts
*/
function update_collection_counts($id,$amount,$op)
{
global $db;
$db->update(tbl("collections"),array("total_objects"),array("|f|total_objects$op$amount")," collection_id = $id");
}
/**
* Used to change collection of product
*/
function change_collection($new,$obj,$old=NULL)
{
global $db;
/* THIS MEANS OBJECT IS ORPHAN MOST PROBABLY AND HOPEFULLY - PHOTO
NOW WE WILL ADD $OBJ TO $NEW */
if($old == 0 || $old == NULL)
{
$this->add_collection_item($obj,$new);
} else {
$update = $db->update(tbl($this->items),array('collection_id'),array($new)," collection_id = $old AND type = '".$this->objType."' AND object_id = $obj");
if(!empty($update))
{
$this->update_collection_counts($new,1,'+');
$this->update_collection_counts($old,1,'-');
}
}
}
/** /**
* Sorting links for collection * Sorting links for collection
*/ */
@ -1176,6 +1389,57 @@ class Collections extends CBCategory
return $array; return $array;
} }
/**
* Used to perform actions on collection
*/
function collection_actions($action,$cid)
{
global $db;
switch($action)
{
case "activate":
case "activation":
case "ac":
{
$db->update(tbl($this->section_tbl),array("active"),array("yes")," collection_id = $cid");
e("collection_activated","m");
}
break;
case "deactivate":
case "deactivation":
case "dac":
{
$db->update(tbl($this->section_tbl),array("active"),array("no")," collection_id = $cid");
e("collection_deactivated","m");
}
break;
case "make_feature":
case "featured":
case "mcf":
{
$db->update(tbl($this->section_tbl),array("featured"),array("yes")," collection_id = $cid");
e("collection_featured","m");
}
break;
case "make_unfeature":
case "unfeatured":
case "mcuf":
{
$db->update(tbl($this->section_tbl),array("featured"),array("no")," collection_id = $cid");
e("collection_unfeatured","m");
}
break;
default:
{
header("location:".BASEURL);
}
}
}
} }
?> ?>

View file

@ -177,7 +177,11 @@ class formObj
$field_name = $this->rmBrackets($field_name); $field_name = $this->rmBrackets($field_name);
$field_name = $field_name.$multi_cat_id.'[]'; $field_name = $field_name.$multi_cat_id.'[]';
} }
echo '<label><input name="'.$field_name.'" type="checkbox" value="'.$key.'" '.$checked.' '.$field['extra_tags'].'>'.$value.'</label>' ;
if(!empty($field['id']))
$field_id = ' id="'.$field['id'].'" ';
echo '<label><input name="'.$field_name.'" type="checkbox" value="'.$key.'" '.$field_id.' '.$checked.' '.$field['extra_tags'].'>'.$value.'</label>' ;
echo $field['sep']; echo $field['sep'];
} }
} }
@ -215,13 +219,15 @@ class formObj
$checked = ''; $checked = '';
$count++; $count++;
} }
if(!empty($field['id']))
$field_id = ' id="'.$field['id'].'" ';
if(!$multi) if(!$multi)
$field_name = $field['name']; $field_name = $field['name'];
else else
$field_name = $field['name'].'[]'; $field_name = $field['name'].'[]';
echo '<label><input name="'.$field_name .'" type="radio" value="'.$key.'" '.$checked.' '.$field['extra_tags'].'>'.$value.'</label>' ; echo '<label><input name="'.$field_name .'" type="radio" value="'.$key.'" '.$field_id.' '.$checked.' '.$field['extra_tags'].'>'.$value.'</label>' ;
echo $sep; echo $sep;
} }
} }

View file

@ -3745,12 +3745,12 @@ class userquery extends CBCategory{
$cond .= ' AND '; $cond .= ' AND ';
$cond .= " ".$params['cond']." "; $cond .= " ".$params['cond']." ";
} }
if(!$params['count_only'])
$result = $db->select(tbl('users'),'*',$cond,$limit,$order); $result = $db->select(tbl('users'),'*',$cond,$limit,$order);
if($params['count_only']) if($params['count_only'])
return $result = $db->count(tbl('users'),'*',$cond); return $result = $db->count(tbl('users'),'userid',$cond);
if($params['assign']) if($params['assign'])
assign($params['assign'],$result); assign($params['assign'],$result);
else else

View file

@ -27,6 +27,7 @@ define("DEV_INGNORE_SYNTAX",FALSE);
define('COOKIE_TIMEOUT',86400*30); // 30 Days define('COOKIE_TIMEOUT',86400*30); // 30 Days
define('GARBAGE_TIMEOUT',COOKIE_TIMEOUT); define('GARBAGE_TIMEOUT',COOKIE_TIMEOUT);
if(!@$in_bg_cron) if(!@$in_bg_cron)
{ {
//Setting Session Max Life //Setting Session Max Life
@ -77,6 +78,7 @@ if(!@$in_bg_cron)
require_once('classes/cbpage.class.php'); require_once('classes/cbpage.class.php');
require_once('classes/reindex.class.php'); require_once('classes/reindex.class.php');
require_once('classes/collections.class.php'); require_once('classes/collections.class.php');
require_once('classes/photos.class.php');
//Adding Gravatar //Adding Gravatar
require_once('classes/gravatar.class.php'); require_once('classes/gravatar.class.php');
@ -108,6 +110,7 @@ if(!@$in_bg_cron)
$cbpage = new cbpage(); $cbpage = new cbpage();
$cbindex = new CBreindex(); $cbindex = new CBreindex();
$cbcollection = new Collections(); $cbcollection = new Collections();
$cbphoto = new CBPhotos();
require 'defined_links.php'; require 'defined_links.php';
@ -294,9 +297,22 @@ if(phpversion() < '5.2.0')
define('TOPIC_ICON_DIR',BASEDIR.'/images/icons/topic_icons'); define('TOPIC_ICON_DIR',BASEDIR.'/images/icons/topic_icons');
define('TOPIC_ICON_URL',BASEURL.'/images/icons/topic_icons'); define('TOPIC_ICON_URL',BASEURL.'/images/icons/topic_icons');
//TOPIC ICON DIR //COLLECTIONS ICON DIR
define('COLLECT_THUMBS_DIR',BASEDIR.'/images/collection_thumbs'); define('COLLECT_THUMBS_DIR',BASEDIR.'/images/collection_thumbs');
define('COLLECT_THUMBS_URL',BASEURL.'/images/collection_thumbs'); define('COLLECT_THUMBS_URL',BASEURL.'/images/collection_thumbs');
//PHOTOS DETAILS
define('PHOTOS_DIR',FILES_DIR."/photos");
define('PHOTOS_URL',FILES_URL."/photos");
//SETTING PHOTO SETTING
$cbphoto->thumb_width = $row['photo_thumb_width'];
$cbphoto->thumb_height = $row['photo_thumb_height'];
$cbphoto->mid_width = $row['photo_med_width'];
$cbphoto->mid_height = $row['photo_med_height'];
$cbphoto->lar_width = $row['photo_lar_width'];
$cbphoto->cropping = $row['photo_crop'];
$cbphoto->position = $row['watermark_placement'];
//Enable youtube videos //Enable youtube videos
define("YOUTUBE_ENABLED",$row['youtube_enabled']); define("YOUTUBE_ENABLED",$row['youtube_enabled']);
@ -420,6 +436,7 @@ $Smarty->assign_by_ref('cbpm',$cbpm);
$Smarty->assign_by_ref('cbpage',$cbpage); $Smarty->assign_by_ref('cbpage',$cbpage);
$Smarty->assign_by_ref('cbemail',$cbemail); $Smarty->assign_by_ref('cbemail',$cbemail);
$Smarty->assign_by_ref('cbcollection',$cbcollection); $Smarty->assign_by_ref('cbcollection',$cbcollection);
$Smarty->assign_by_ref('cbphoto',$cbphoto);
/* /*
REGISERTING FUNCTION FOR SMARTY TEMPLATES REGISERTING FUNCTION FOR SMARTY TEMPLATES
*/ */
@ -450,6 +467,7 @@ $Smarty->register_function('lang','smarty_lang');
$Smarty->register_function('get_videos','get_videos'); $Smarty->register_function('get_videos','get_videos');
$Smarty->register_function('get_users','get_users'); $Smarty->register_function('get_users','get_users');
$Smarty->register_function('get_groups','get_groups'); $Smarty->register_function('get_groups','get_groups');
$Smarty->register_function('get_photos','get_photos');
$Smarty->register_function('private_message','private_message'); $Smarty->register_function('private_message','private_message');
$Smarty->register_function('show_video_rating','show_video_rating'); $Smarty->register_function('show_video_rating','show_video_rating');
$Smarty->register_function('load_captcha','load_captcha'); $Smarty->register_function('load_captcha','load_captcha');
@ -462,6 +480,9 @@ $Smarty->register_function('get_binaries','get_binaries');
$Smarty->register_function('check_module_path','check_module_path'); $Smarty->register_function('check_module_path','check_module_path');
$Smarty->register_function('rss_feeds','rss_feeds'); $Smarty->register_function('rss_feeds','rss_feeds');
$Smarty->register_function('website_logo','website_logo'); $Smarty->register_function('website_logo','website_logo');
$Smarty->register_function('get_photo','get_photo');
$Smarty->register_function('uploadButton','upload_photo_button');
$Smarty->register_function('embedCodes','photo_embed_codes');
$Smarty->register_modifier('SetTime','SetTime'); $Smarty->register_modifier('SetTime','SetTime');
$Smarty->register_modifier('getname','getname'); $Smarty->register_modifier('getname','getname');
@ -482,7 +503,9 @@ $Smarty->register_modifier('cbsearch',new cbsearch());
$Smarty->register_modifier('flag_type','flag_type'); $Smarty->register_modifier('flag_type','flag_type');
$Smarty->register_modifier('get_username','get_username'); $Smarty->register_modifier('get_username','get_username');
$Smarty->register_modifier('formatfilesize','formatfilesize'); $Smarty->register_modifier('formatfilesize','formatfilesize');
$Smarty->register_modifier('getWidth','getWidth');
$Smarty->register_modifier('getHeight','getHeight');
$Smarty->register_modifier('get_collection_name','get_collection_name');
/* /*
* Registering Video Remove Functions * Registering Video Remove Functions
@ -507,6 +530,7 @@ include('admin.functions.php');
//Other settings //Other settings
define("SEND_COMMENT_NOTIFICATION",config("send_comment_notification")); define("SEND_COMMENT_NOTIFICATION",config("send_comment_notification"));
define("SEND_VID_APPROVE_EMAIL",config("approve_video_notification")); define("SEND_VID_APPROVE_EMAIL",config("approve_video_notification"));
?> ?>

View file

@ -121,7 +121,18 @@
</script>'; </script>';
exit("Javascript is turned off, <a href='$url'>click here to go to requested page</a>"); exit("Javascript is turned off, <a href='$url'>click here to go to requested page</a>");
} }
//Test function to return template file
function Fetch($name,$inside=FALSE)
{
if($inside)
$file = CBTemplate::fetch(LAYOUT.'/'.$inside.'/'.$name);
else
$file = CBTemplate::fetch(LAYOUT.'/'.$name);
return $file;
}
//Simple Template Displaying Function //Simple Template Displaying Function
function Template($template,$layout=true){ function Template($template,$layout=true){
@ -394,7 +405,44 @@
}else { }else {
return false; return false;
} }
} }
//Simple Width Fetcher
function getWidth($file)
{
$sizes = getimagesize($file);
if($sizes)
return $sizes[0];
}
//Simple Height Fetcher
function getHeight($file)
{
$sizes = getimagesize($file);
if($sizes)
return $sizes[1];
}
//Photo File Fetcher
function get_photo($params)
{
global $cbphoto;
$cbphoto->getFileSmarty($params);
}
//Photo Upload BUtton
function upload_photo_button($params)
{
global $cbphoto;
$cbphoto->upload_photo_button($params);
}
//Photo Embed Cides
function photo_embed_codes($params)
{
global $cbphoto;
$cbphoto->photo_embed_codes($params);
}
//Function Used To Validate Email //Function Used To Validate Email
@ -2806,6 +2854,18 @@
setcookie('collection_'.$id,'viewed',time()+3600); setcookie('collection_'.$id,'viewed',time()+3600);
} }
} }
break;
case "photos":
case "photo":
case "p":
{
if(!isset($_COOKIE['photo_'.$id]))
{
$db->update(tbl('photos'),array("views","last_viewed"),array("|f|views+1",NOW())," photo_id = '$id'");
setcookie('photo_'.$id,'viewed',time()+3600);
}
}
} }
} }
@ -3143,6 +3203,15 @@
return $cbvideo->get_videos($param); return $cbvideo->get_videos($param);
} }
/**
* function used to get photos
*/
function get_photos($param)
{
global $cbphoto;
return $cbphoto->get_photos($param);
}
/** /**
* function used to get vidos * function used to get vidos
@ -3537,6 +3606,39 @@
return $userquery->get_username($uid,'username'); return $userquery->get_username($uid,'username');
} }
/**
* Function used to get collection name from id
* Smarty Function
*/
function get_collection_field($cid,$field='collection_name')
{
global $cbcollection;
return $cbcollection->get_collection_field($cid,$field);
}
/**
* Function used to delete photos if
* whole collection is being deleted
*/
function delete_collection_photos($details)
{
global $cbcollection,$cbphoto;
$type = $details['type'];
if($type == 'photos')
{
$ps = $cbphoto->get_photos(array("collection"=>$details['collection_id']));
if(!empty($ps))
{
foreach($ps as $p)
{
$cbphoto->make_photo_orphan($details,$p['photo_id']);
}
unset($ps); // Empty $ps. Avoiding the duplication prob
}
}
}
/** /**
* FUnction used to get head menu * FUnction used to get head menu
*/ */

View file

@ -246,6 +246,12 @@
$Cbucket->actions_play_video[] = $func; $Cbucket->actions_play_video[] = $func;
} }
function register_collection_delete_functions($func)
{
global $cbcollection;
$cbcollection->collection_delete_functions[] = $func;
}
/** /**

View file

@ -139,6 +139,20 @@
$obj = $cbgroup; $obj = $cbgroup;
} }
break; break;
case 'user':
case 'users':
{
global $userquery;
$obj = $userquery;
}
break;
case 'collection':
case 'collections':
{
global $cbcollection;
$obj = $cbcollection;
}
break;
} }
preg_match_all('/#([0-9]+)#/',$input,$m); preg_match_all('/#([0-9]+)#/',$input,$m);

View file

@ -954,47 +954,196 @@ function collection_actions(form,mode,objID,result_con,type,cid)
return false; return false;
} }
function get_collection_item(obj,ci_id,cid,type,direction) // Simple function to open url with javascript
{ function openURL(url) {
var btn_text = $(obj).text(); document.location = url;
$(obj).text('Working ...');
$(obj).attr('disabled','disalbed');
$.post(page,
{
mode : 'NePrItem',
item_id : ci_id,
cid : cid,
type : type,
direction: direction
},
function(data)
{
if(!data)
{
alert("No "+btn_text+" "+type+" Found");
$(obj).text(btn_text);
$(obj).removeAttr('disabled');
} else {
//alert(data);
get_item(data.ci_id,data.cid,type);
}
},'json')
} }
function get_item(ci_id,cid,type)
function get_item(obj,ci_id,cid,type,direction)
{ {
$("#collectionItemsList div").removeClass('selected'); var btn_text = $(obj).text();
$("#item_"+ci_id).addClass('selected'); $(obj).text('Working');
$.post(page, $.post(page,
{ {
mode : 'get_item', mode : 'get_item',
ci_id: ci_id, ci_id: ci_id,
cid : cid, cid : cid,
type: type type: type,
direction: direction
}, },
function(data) function(data)
{ {
$("#collectionItemView").html(data); if(!data)
},'text') {
} alert('No '+type+' returned');
$(obj).text(btn_text);
} else {
var jsArray = new Array(type,data['cid'],data['key']);
construct_url(jsArray);
$("#collectionItemView").html(data['content']);
}
},'json')
}
function construct_url(jsArr)
{
var url;
if(Seo == 'yes')
{
url = '#!/item/'+jsArr[0]+'/'+jsArr[1]+'/'+jsArr[2];
window.location.hash = url
} else {
url = '#!?item='+jsArr[2]+'&type='+jsArr[0]+'&collection='+jsArr[1];
window.location.hash = url
}
}
function onReload_item()
{
var comURL,
regEX;
if(window.location.hash)
{
comURL = window.location.href;
if(Seo == 'yes')
{
regEX = RegExp('\/item.+#!');
if(regEX.test(comURL))
{
comURL = comURL.replace(regEX,'');
window.location.href = comURL;
}
} else {
regEX = RegExp('\\\?item.+#!');
if(regEX.test(comURL))
{ comURL = comURL.replace(regEX,'')
window.location.href = comURL;
}
}
}
}
function pagination(object,cid,type,pageNumber)
{
obj = $(object); objID = obj.id; parent = obj.parent();
if(parent.attr('id'))
parentID = parent.attr('id')
else
{ parent.attr('id','loadMoreParent'); parentID = parent.attr('id'); }
newCall =
$.ajax({
url: page,
type: "post",
dataType: "json",
data: { mode: "moreItems", page:pageNumber, cid: cid, type: type },
beforeSend: function() { obj.removeAttr('onClick'); obj.html(loading) },
success : function(data) {
if(!data)
{
if(object.tagName == "BUTTON")
obj.attr('disabled','disabled');
obj.removeAttr('onClick'); obj.text('No more '+type);
} else {
$('#collectionItemsList').append(data['content']);
$('#NewPagination').html(data['pagination']);
obj.text('Load More');
}
}
});
}
function ajax_add_collection(obj)
{
var formID = obj.form.id, Form = $('#'+formID),
This = $(obj), AjaxCall, ButtonHTML = This.html(),
Result = $('#CollectionResult');
AjaxCall =
$.ajax
({
url: page,
type: "post",
dataType: "json",
data: "mode=add_collection&"+Form.serialize(),
beforeSend: function() { if(Result.css('display') == 'block') Result.slideUp('fast'); This.attr('disabled','disabled'); This.html(loading) },
success: function(data) {
if(data.msg)
{
$('#CollectionDIV').slideUp('fast');
Result.html(data['msg']).slideDown('fast');
}
else
{
Result.html(data['err']).slideDown('fast');
This.removeAttr('disabled'); This.html(ButtonHTML);
}
}
});
}
function updatePhotos(obj)
{
var ID = obj.form.id,
Child = $("#"+ID).children().filter('div'),
total = Child.length, eachObj, AjaxCall;
for(i=0;i<total;i++)
{
alert(i)
}
}
/*function updatePhotos(obj)
{
var ID = obj.form.id,
Child = $("#"+ID).children().filter('div'),
eachObj, AjaxCall, saving = 1;
var err_count = 0;
$.each(Child,function(index,elem){
eachObj = $(elem);
var inputs = $("#"+elem.id+" :input"),
query = '';
inputs.each(function(ind, input)
{
if(input.type == "text" || input.type == "textarea" || input.type == "hidden")
{
if(input.value == null || input.value == '')
{
err_count++;
input.style.border = '2px solid #ed0000';
//ShouldContinue = false;
} else {
query += input.id+"="+input.value+"&";
err_count = 0;
//ShouldContinue = true;
}
}
if(input.type == "select-one" && input.selected)
query += input.id+"="+input.value+"&";
if(input.type == "radio" && input.checked)
query += input.id+"="+input.value+"&";
})
query += "mode=ajaxPhotos";
alert(query);
/*
AjaxCall =
$.ajax
({
url: page,
type: "post",
dataType: "text",
data: query,
cache: false,
beforeSend: function() { $(obj).text("Saving "+saving+" out of "+ Child.length); $(obj).attr('disabled','disabled') },
//complete : function() { alert("Request Completed") }
success: function(data) { $("#"+eachObj.attr('id')).hide() }
});
saving++;
})
}*/

View file

@ -810,6 +810,19 @@ function uploadSuccess(file, serverData) {
this.debug(ex); this.debug(ex);
} }
} }
var array = new Array();
function PictureUploadSuccess(file, serverData) {
try {
var progress = new FileProgress(file, this.customSettings.progressTarget);
progress.setComplete();
progress.setStatus("Complete.");
progress.toggleCancel(false);
array.push(serverData);
$('#photoIDS').val(array);
} catch (ex) {
this.debug(ex);
}
}
function uploadError(file, errorCode, message) { function uploadError(file, errorCode, message) {
try { try {
@ -872,5 +885,6 @@ function uploadComplete(file) {
// This event comes from the Queue Plugin // This event comes from the Queue Plugin
function queueComplete(numFilesUploaded) { function queueComplete(numFilesUploaded) {
var status = document.getElementById("divStatus"); var status = document.getElementById("divStatus");
$('#EnterInfo').removeAttr('disabled');
status.innerHTML = numFilesUploaded + " file" + (numFilesUploaded === 1 ? "" : "s") + " uploaded."; status.innerHTML = numFilesUploaded + " file" + (numFilesUploaded === 1 ? "" : "s") + " uploaded.";
} }

View file

@ -106,6 +106,22 @@ switch($mode)
$objs = $cbvideo->collection->get_collection_items_with_details($cid,$order); $objs = $cbvideo->collection->get_collection_items_with_details($cid,$order);
} }
break; break;
case "photos":
{
if(isset($_POST['delete_selected']))
{
$count = count($_POST['check_item']);
for($i=0;$i<$count;$i++)
{
$cbphoto->collection->remove_item($_POST['check_item'][$i],$cid);
}
$eh->flush();
e(sprintf("selected_items_removed","pictures"),"m");
}
$objs = $cbphoto->collection->get_collection_items_with_details($cid,$order);
}
break;
} }
$collection = $cbcollection->get_collection($cid); $collection = $cbcollection->get_collection($cid);

View file

@ -76,9 +76,9 @@ if(!function_exists("pak_player"))
$in['height'] = $in['height'].'px'; $in['height'] = $in['height'].'px';
if($in['autoplay'] =='yes' || $in['autoplay']===true) if($in['autoplay'] =='yes' || $in['autoplay']===true)
$in['autoplay'] = "true"; $in['autoplay'] = true;
else else
$in['autoplay'] = "false"; $in['autoplay'] = false;
//Logo Placement //Logo Placement
@ -110,7 +110,7 @@ if(!function_exists("pak_player"))
break; break;
} }
assign('player_data',$in); assign('player_data',$in);
assign('player_logo',website_logo()); assign('player_logo',website_logo());
assign('normal_vid_file',$vid_file); assign('normal_vid_file',$vid_file);

View file

@ -85,7 +85,7 @@ flowplayer("the_Video_Player", "{$pak_player_url}/pak_player{if $Cbucket->config
, ,
clip:{ clip:{
{/literal} {/literal}
autoplay:'{$player_data.autoplay}', autoPlay :'{$player_data.autoplay}',
{if $youtube} {if $youtube}
url : 'api:{$ytcode}', url : 'api:{$ytcode}',

View file

@ -1,28 +1,35 @@
{if $display_type == "" || $display_type == "normal"} {if $display_type == "" || $display_type == "normal"}
<div class="moveL grid_view" id="collection_{$collection.collection_id}"> <div class="moveL grid_view" id="collection_{$collection.collection_id}">
<div class="vid_thumb"> <div class="vid_thumb">
<a href="{$cbcollection->collection_links($collection,'view')}"><img src="{$cbcollection->get_thumb($collection)}" /></a> <a href="{$cbcollection->collection_links($collection,'view')}"><img src="{$cbcollection->get_thumb($collection,'small')}" /></a>
<span class="vid_time" style="font:normal 10px Tahoma; padding:2px 4px;">{$collection.total_objects|number_format} {$collection.type|capitalize}</span> <span class="vid_time" style="font:normal 10px Tahoma; padding:2px 4px;">{$collection.total_objects|number_format} {$collection.type|capitalize}</span>
</div> </div>
<div class="vid_info_wrap"> <div class="vid_info_wrap">
<h2 class="title" style="font-family:Tahoma;"><a href="{$cbcollection->collection_links($collection,'view')}">{$collection.collection_name|truncate:30}</a></h2> <h2 class="title" style="font-family:Tahoma;"><a href="{$cbcollection->collection_links($collection,'view')}">{$collection.collection_name|truncate:30}</a></h2>
<p class="vid_info">{$collection.views} {lang code="views"}</p> <p class="vid_info">{$collection.views} {lang code="views"}</p>
<p class="vid_info"><a href="{$userquery->profile_link($collection)}" title="{$collection.username}">{$collection.username|truncate:16}</a></p> <p class="vid_info"><a href="{$userquery->profile_link($collection)}" title="{$collection.username}">{$collection.username|truncate:16}</a></p>
{$cbcollection->collection_rating($collection.collection_id,"videos")} {assign var=rating value=$cbcollection->collection_rating($collection.collection_id,$collection.type)}
<div class="CollectionRating">{show_rating class='rating' rating=$rating total='10'}</div>
</div> </div>
</div> </div>
{/if} {/if}
{if $display_type == "view_collection"} {if $display_type == "view_collection"}
<td class="collectItemBox">
{if $type == "videos"} {if $type == "videos"}
<div class="moveL collect_grid{if $smarty.section.o_list.first} selected{/if}" onclick="get_item('{$object.ci_id}','{$object.collection_id}','{$type}')" id="item_{$object.ci_id}"> <div class="collect_grid">
<div class="vid_thumb"> <a class="CollectThumb" href="{$cbphoto->photo_links($object,'view_item')}">
<a href="{videoLink vdetails=$object}"><img src="{getThumb vdetails=$object}" alt="{$object.title}" /></a> <img src="{getThumb vdetails=$object}" alt="{$object.title}" width="120" height="70" />
</div> </a>
<div style="height:4px;"></div> </div> <!-- collection_{$collection.videokey} end -->
<span class="obj_title"><a href="{videoLink vdetails=$object}" target="_blank" title="Go to video page" style="font:bold 11px Tahoma;">{$object.title|truncate:26}</a></span>
<div style="height:5px;"></div>
{show_rating class='rating' rating=$object.rating ratings=$object.rated_by total='10'}
</div> <!-- collection_{$collection.collection_id} end -->
{/if} {/if}
{if $type == "photos"}
<div class="collect_grid" style="height:auto">
<a class="CollectThumb" href="{$cbphoto->photo_links($object,'view_item')}">
{get_photo details=$object size='t' output='html' alt=$object.photo_title}
</a>
</div> <!-- collection_{$object.photo_key} end -->
{/if}
</td>
{/if} {/if}

View file

@ -8,3 +8,4 @@
<span>discussions : <strong>{$group.total_topics|number_format}</strong></span> <span>discussions : <strong>{$group.total_topics|number_format}</strong></span>
<span>owner : <strong><a href="{$userquery->profile_link($group)}">{$group.username}</a></strong></span> <span>owner : <strong><a href="{$userquery->profile_link($group)}">{$group.username}</a></strong></span>
</div> </div>
<img

View file

@ -31,7 +31,7 @@
<td valign="middle"> <td valign="middle">
<div style="padding-left:10px; float:left;width:300px"> <div style="padding-left:10px; float:left;width:300px">
<img src="{getThumb vdetails=$collection}" width="40" height="30" border="0" class="acc_usr_video_thumb" />{$collection.title|truncate:100}<br /> <img src="{getThumb vdetails=$collection}" width="40" height="30" border="0" class="acc_usr_video_thumb" />{$collection.title|truncate:100}<br />
<span class="video_control"><a href="{videoLink vdetails=$collection}">{lang code="view"}</a></span> <span class="video_control"><a href="{$cbcollection->collection_links($collection,'view_item')}">{lang code="view"}</a></span>
</div> </div>
</td> </td>
<td width="100">{$collection.date_added|date_format}</td> <td width="100">{$collection.date_added|date_format}</td>
@ -44,4 +44,28 @@
</table> </table>
</div> </div>
{/if} {/if}
{if $type == "photos"}
<div id="collectionItem_{$collection.photo_id}" class="account_vid_list" style="background-color:#{$bg}">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="25"><input type="checkbox" name="check_item[]" id="check_item-{$collection.photo_id}" value="{$collection.photo_id}" />
<label for="checkbox"></label></td>
<td valign="middle">
<div style="padding-left:10px; float:left;">
{get_photo style='padding:1px; border:1px solid #999; float:left;' details=$collection output="html"}
{$collection.photo_title|truncate:100}<br />
<span class="video_control"><a href="{$cbphoto->photo_links($collection,'view_item')}">{lang code="view"}</a></span>
</div>
</td>
<td width="100">{$collection.date_added|date_format}</td>
<td width="100">{$collection.views|number_format}</td>
<td width="100">
<a onclick="collection_actions('collectionItem','remove_collection_item','{$collection.photo_id}','#removeItemContainer','{$type}','{$c.collection_id}')" id="collectionItem{$collection.photo_id}" href="javascript:void(0);"><img src="{$imageurl}/cancel.png" width="16" height="16" /></a>
<div id="removeItemContainer_{$collection.photo_id}" style="display:none"></div>
</td>
</tr>
</table>
</div>
{/if}
{/if} {/if}

View file

@ -0,0 +1,4 @@
{if $page_no}{assign var=ajaxPage value=$page_no}{else}{assign var=ajaxPage value=2}{/if}
<div class="NextPrevButtons clearfix">
<button class="LoadMoreButton" onClick="pagination(this,'{$cid}','{$type}','{$ajaxPage}');" type="button">Load More</button>
</div>

View file

@ -0,0 +1,9 @@
{if $display_type == 'related_photos'}
<div class="relatedPhotos clearfix">
<a href="{$cbphoto->photo_links($photo,'view_item')}">{get_photo details=$photo output='html' class='photoThumbBox moveL' style='margin-right:5px;'}</a>
<div class="photoTitle" style="margin-bottom:5px;"><a href="{$cbphoto->photo_links($photo,'view_item')}" title="{$photo.photo_title}">{$photo.photo_title|truncate:15}</a></div>
<span class="photoInfo">{$photo.views|number_format} {lang code="views"} <br/> {$photo.total_comments} {lang code="comments"}</span>
<div style="height:5px;"></div>
{show_rating rating=$photo.rating total='10' class='rating moveL'}
</div>
{/if}

View file

@ -0,0 +1,54 @@
{if $smarty.get.collection}
{assign var=c value=$cbphoto->collection->get_collection($smarty.get.collection)}
{if $cbphoto->is_addable($c.collection_id)}
<div class="clearfix photoBox">
<div style="background:#FFF; text-align:center; border-bottom:1px solid #ccc; color:#666; padding:8px; font:normal 11px Tahoma;">You are about to add new photos in <strong>{$c.collection_name}</strong></div>
<div class="clearfix" style="padding:8px">
<div class="moveL">
<img src="{$cbcollection->get_thumb($c,'small',TRUE)}" style="padding:2px; border:1px solid #ccc; background:#FFF;" />
</div>
<div class="moveL" style="margin-left:10px;">
<div class="photoTitle"><a href="{$cbcollection->collection_links($c,'view')}" style="text-transform:uppercase;">{$c.collection_name}</a></div>
<div style="height:5px;"></div>
<div style="color:#666; font:normal 10px Tahoma, Geneva, sans-serif;">
Total Items: {$c.total_objects} <div style="height:3px;"></div>
Views: {$c.views|number_format} <div style="height:3px;"></div>
Date Added: {$c.date_added|niceTime}
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
{else}
<div class="clearfix photoBox">
<div style="background:#FFF; text-align:center; border-bottom:1px solid #ccc; color:#666; padding:8px; font:normal 11px Tahoma;">You can not add new photos in collection because of following reasons:</div>
<div style="padding:8px; font:normal 11px Tahoma; color:#666;">
<li style="list-style:none">Collection does not exist.</li>
<li style="list-style:none">It is unactive.</li>
<li style="list-style:none">It is private.</li>
<li style="list-style:none">Your are not own of collection.</li>
<li style="list-style:none; margin-top:5px; font-weight:bold;">You can select collection once your photos have been uploaded.</li>
</div>
</div>
{/if}
{else}
{if !$c}
<div class="photoBox clearfix">
<div style="background:#FFF; text-align:center; border-bottom:1px solid #ccc; color:#666; padding:8px; font:bold 11px Tahoma;">Create Collection</div>
{assign var='reqFields' value=$cbcollection->load_required_fields()}
<div class="CollectionResult" id="CollectionResult" style="display:none;"></div>
<div class="clearfix" style="padding:8px;" id="CollectionDIV" >
{foreach from=$reqFields item=field}
{if $field.id != 'type'}
<div class="field clearfix" style="margin-bottom:3px;">
<label for="{$field.id}" style="font:bold 11px Tahoma; width:100px;" class="moveL">{$field.title}</label> &nbsp;
{$formObj->createField($field)}
</div>
{/if}
{/foreach}
<div class="moveR"><button type="button" onclick="ajax_add_collection(this);" class="LoadMoreButton">Add Collection</button></div>
</div>
</div>
{/if}
{/if}

View file

@ -52,6 +52,7 @@ var imageurl = '{$imageurl}';
{/foreach} {/foreach}
<!-- Including JS Files--> <!-- Including JS Files-->
{include_header file='global_header'}
<!-- Including Headers --> <!-- Including Headers -->
{foreach from=$Cbucket->header_files key=file item=type} {foreach from=$Cbucket->header_files key=file item=type}
@ -62,7 +63,6 @@ var imageurl = '{$imageurl}';
<!-- Ending Headers --> <!-- Ending Headers -->
<!-- Including Plugin Headers --> <!-- Including Plugin Headers -->
{foreach key=file item=type from=$Cbucket->header_files} {foreach key=file item=type from=$Cbucket->header_files}
{include_header file=$file type=$type} {include_header file=$file type=$type}
@ -81,7 +81,7 @@ var mid = {$smarty.get.mid};
{/if} {/if}
<!-- Including Common Js --> <!-- Including Common Js -->
{include_header file='global_header'}
<!-- End Including Common Js --> <!-- End Including Common Js -->
{literal} {literal}
@ -116,6 +116,7 @@ var mid = {$smarty.get.mid};
window.location = "?set_site_lang="+optionSelectedValue; window.location = "?set_site_lang="+optionSelectedValue;
}); });
get_video('recent_viewed_vids','#index_vid_container'); get_video('recent_viewed_vids','#index_vid_container');
}); });
@ -148,7 +149,35 @@ var mid = {$smarty.get.mid};
<!--[if IE 7]> <!--[if IE 7]>
<link href="{$theme}/ie7.css" rel="stylesheet" type="text/css" /> <link href="{$theme}/ie7.css" rel="stylesheet" type="text/css" />
<![endif]--> <![endif]-->
{literal}
<script type="text/javascript">
/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.personalbar)
{
window.personalbar.Addpage(title, url);
}
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
</script>
{/literal}
</head> </head>
<!-- Global Header Ends Here --> <!-- Global Header Ends Here -->

View file

@ -32,6 +32,7 @@
<li class="selected"><a href="javascript:void(0)" id="watched" onclick="get_video('recent_viewed_vids','#index_vid_container')">{lang code='being_watched'}</a></li> <li class="selected"><a href="javascript:void(0)" id="watched" onclick="get_video('recent_viewed_vids','#index_vid_container')">{lang code='being_watched'}</a></li>
<li><a href="javascript:void(0)" id="most_watched" onclick="get_video('most_viewed','#index_vid_container')">{lang code='most_viewed'}</a></li> <li><a href="javascript:void(0)" id="most_watched" onclick="get_video('most_viewed','#index_vid_container')">{lang code='most_viewed'}</a></li>
<li><a href="javascript:void(0)" id="recently_watched" onclick="get_video('recently_added','#index_vid_container')">{lang code='recently_added'}</a></li> <li><a href="javascript:void(0)" id="recently_watched" onclick="get_video('recently_added','#index_vid_container')">{lang code='recently_added'}</a></li>
<li><a href="javascript:bookmarksite('{$title}','{$baseurl}')">Bookmark Site</a></li>
</ul> </ul>
</div> <!--TABS END--> </div> <!--TABS END-->
<div class="main_vids clearfix"> <div class="main_vids clearfix">
@ -53,7 +54,7 @@
<div class="side_con"> <div class="side_con">
<!-- Displaying 300x250 Advertisment --> <!-- Displaying 300x250 Advertisment -->
<div class="ads">{AD place=ad_300x250}</div> {AD place=ad_300x250}
{if !$userquery->login_check('',true)} {if !$userquery->login_check('',true)}
<div class="login"> <div class="login">
@ -85,6 +86,7 @@
<div class="top_bg"> <div class="top_bg">
<h2>{lang code='t_10_users'}</h2> <h2>{lang code='t_10_users'}</h2>
{get_users assign=topusers limit=10 order=' total_videos DESC '} {get_users assign=topusers limit=10 order=' total_videos DESC '}
{section name=tusers loop=$topusers} {section name=tusers loop=$topusers}
<div class="top_user"> <div class="top_user">
<div class="user_no">{$smarty.section.tusers.iteration}</div> <div class="user_no">{$smarty.section.tusers.iteration}</div>

View file

@ -0,0 +1,66 @@
<div class="content_con clearfix">
<div class="upload_info">
<form action="" method="post" name="photo_form" id="photo_form">
{if $step == 1 || $step == ""}
{include file="$style_dir/blocks/upload_head.html"}
<div class="upload_form_div clearfix">
<input type="hidden" id="photoIDS" name="photoIDS" />
<div id="progress_status" class="divStatus"></div>
<div id="divStatus" class="divStatus moveL">Click 'Upload' to select files</div>
<div class="moveR">
<span id="spanButtonPlaceHolder"></span>
<input id="btnCancel" type="button" value="Cancel"
onClick="swfu.cancelQueue();" disabled="disabled" style="margin:0px 0px 1px 3px" />
</div>
<div class="fieldset flash" id="fsUploadProgress"></div>
</div>
<button name="EnterInfo" class="LoadMoreButton moveR" id="EnterInfo" disabled="disabled">{lang code="Continue"}</button>
{/if}
{if $step == 2}
<button class="LoadMoreButton moveR clearfix" onclick="updatePhotos(this);" type="button" name="update_photos" id="update_photos">Save All</button>
{section name=p_list loop=$photos}
{assign var='reqFields' value=$cbphoto->load_required_forms($photos[p_list])}
{assign var='otherFields' value=$cbphoto->load_other_forms($photos[p_list])}
<div id="{$photos[p_list].photo_key}_Box" class="photoBox clearfix">
<input type="hidden" value="{$photos[p_list].photo_key}" name="photo_key_{$photos[p_list].photo_key}" id="photo_key" />
<div class="photoDetailsBox clearfix">
<div class="moveL" style="width:52.1%;">
{foreach from=$reqFields item=item}
<div class="field clearfix">
<div class="moveL"><label class="label">{$item.title}</label></div>
{$formObj->createField($item)}
{if $item.hint_1}
<div class="clear"></div>
<span class="hint">{$item.hint_1}</span>
{/if}
</div>
{/foreach}
</div>
<div class="moveR">
<div class="photoThumbBox">
{get_photo details=$photos[p_list] output='html' size='m'}
</div>
</div>
</div>
<div class="OptionalSettings">
<div class="Heading"><a href="#" onclick="$('#{$photos[p_list].photo_key}_Settings').slideToggle(); return false;">{lang code="Optional"} {lang code="Settings"}</a></div>
<div class="OptionalBox" style="display:none;" id="{$photos[p_list].photo_key}_Settings">
{foreach from=$otherFields item=field}
{$field.title}<br />
{$formObj->createField($field)}
{/foreach}
</div>
</div>
</div>
{/section}
{/if}
{if $step == 3}
<h2>Photos have uploaded successfully.</h2>
{/if}
</form>
</div>
</div>

View file

@ -17,10 +17,13 @@
</div> </div>
<div class="simple_container clearfix" style="min-height:400px; overflow:visible; display:none" id="advance_search"> <div class="simple_container clearfix" style="min-height:400px; overflow:visible; display:none" id="advance_search">
{foreach from=$Cbucket->search_types item=search_type key=search_type_key} {foreach from=$Cbucket->search_types item=search_type key=search_type_key}
{if $search_type} {if $search_type}
{assign var='type' value=$cbsearch->init_search($search_type_key)} {assign var='type' value=$cbsearch->init_search($search_type_key)}
{if $type} {if $type}
{assign var='types' value=$type->search_type} {assign var='types' value=$type->search_type}
{foreach from=$types key=stype item=search} {foreach from=$types key=stype item=search}
<div class="search_type"> <div class="search_type">
{lang code='search_for_s' assign='searchfor'} {lang code='search_for_s' assign='searchfor'}

View file

@ -1,30 +1,27 @@
<div style="width:880px; margin:0px auto"> <div style="width:880px; margin:0px auto">
<div class="video_title" style="padding-bottom:5px; margin-bottom:5px; border-bottom:1px solid #ccc;">{$c.collection_name}</div> <div class="video_title" style="padding-bottom:5px; margin-bottom:5px; border-bottom:1px solid #ccc;">{$c.collection_name} </div>
{uploadButton details=$c target='_blank'}
<div style="font:normal 10px Tahoma; color:#333; padding-bottom:5px; margin-bottom:5px; border-bottom:1px solid #ccc;">{lang code="by"|capitalize} <a href="{$userquery->profile_link($c)}">{$c.username|capitalize}</a> - <a href="{link name='user_videos'}{$c.username}">{lang code="view"|capitalize} {$c.username|capitalize} {lang code="videos"|capitalize}</a> {if $c.userid == $userquery->userid} - <a href="{link name='edit_collection'}{$c.collection_id}">{lang code="edit_collection"}</a> - {link name='manage_items' assign='miLink'} <a href="{$miLink|sprintf:$c.collection_id:$c.type}">{lang code="manage_items"}</a>{/if}</div> <div style="font:normal 10px Tahoma; color:#333; padding-bottom:5px; margin-bottom:5px; border-bottom:1px solid #ccc;">{lang code="by"|capitalize} <a href="{$userquery->profile_link($c)}">{$c.username|capitalize}</a> - <a href="{link name='user_videos'}{$c.username}">{lang code="view"|capitalize} {$c.username|capitalize} {lang code="videos"|capitalize}</a> {if $c.userid == $userquery->userid} - <a href="{link name='edit_collection'}{$c.collection_id}">{lang code="edit_collection"}</a> - {link name='manage_items' assign='miLink'} <a href="{$miLink|sprintf:$c.collection_id:$c.type}">{lang code="manage_items"}</a>{/if}</div>
<div id="collectionItemView">
{section name=item loop=$objects max=1}
{include file="$style_dir/blocks/view_item.html" object=$objects[item]}
{/section}
</div>
<div style="clear:both;"></div> <div style="clear:both;"></div>
<div style="height:1px; border-bottom:1px solid #ccc; margin:5px 0;"></div> <!-- <div style="height:1px; border-bottom:1px solid #ccc; margin:5px 0;"></div>-->
<div class="video_title" style="font-size:14px;">{$c.type|capitalize} ({$c.total_objects})</div> <div class="moveL video_title" style="font-size:14px;">{$c.type|capitalize} ({$c.total_objects})</div>
<div style="height:1px; border-bottom:1px solid #ccc; margin:5px 0;"></div>
<div id="collectionItemsList">
{section name=o_list loop=$objects}
{include file="$style_dir/blocks/collection.html" object=$objects[o_list] display_type="view_collection" type=$c.type}
{sectionelse}
<div align="center" style="font:bold 11px Tahoma">{$c.collection_name} has 0 {$c.type}</div>
{/section}
</div>
<div class="clear"></div> <div class="clear"></div>
<div class="clearfix" style="padding:10px; background:#f7f7f7; border:1px solid #ccc;">
<!-- {include file="$style_dir/blocks/pagination.html"} --> <table cellpadding="0" class="collectionTable" cellspacing="0" border="0">
<div style="padding-bottom:5px; height:1px; margin-bottom:5px; border-bottom:1px solid #ccc;"></div> <tr id="collectionItemsList" >
{section name=list loop=$objects}
{include file="$style_dir/blocks/collection.html" object=$objects[list] display_type=view_collection type=$c.type}
{/section}
</tr>
</table>
</div>
<div id="NewPagination" class="moveR">{include file="$style_dir/blocks/new_pagination.html"}</div>
<!--{include file="$style_dir/blocks/pagination.html"}-->
<div style="padding-bottom:5px; height:1px; margin-bottom:5px; clear:both; border-bottom:1px solid #ccc;"></div>
<div class="moveL" style="width:200px; font:normal 11px Tahoma;"> <div class="moveL" style="width:200px; font:normal 11px Tahoma;">
<span style="color:#333; font-weight:bold;">{lang code="date_added"}</span> <span style="color:#333; font-weight:bold;">{lang code="date_added"}</span>
<div style="height:2px; clear:both;"></div> <div style="height:2px; clear:both;"></div>
@ -53,7 +50,9 @@
{$c.collection_description|description} {$c.collection_description|description}
<div style="height:10px;"></div> <div style="height:10px;"></div>
<div class="video_title" style="font-size:14px; padding-bottom:5px; margin-bottom:5px; border-bottom:1px solid #ccc;">{lang code="comments"} ({$c.total_comments})</div> <div class="video_title" style="font-size:14px; padding-bottom:5px; margin-bottom:5px; border-bottom:1px solid #ccc;">{lang code="comments"} ({$c.total_comments})</div>
{include file="$style_dir/blocks/comments/comments.html" id=$c.collection_id type='cl'} <div id="collectionComments">
{include file="$style_dir/blocks/comments/comments.html" id=$c.collection_id type='cl'}
</div>
<div style="height:5px;"></div> <div style="height:5px;"></div>
{if $myquery->is_commentable($c,'collection')} {if $myquery->is_commentable($c,'collection')}
{include file="$style_dir/blocks/comments/add_comment.html" id=$c.collection_id type='cl'} {include file="$style_dir/blocks/comments/add_comment.html" id=$c.collection_id type='cl'}

View file

@ -0,0 +1,68 @@
<div id="collectionItemView">
<div class="NextPrevButtons clearfix">
<li class="moveL">
<a href="javascript:void(0)" onClick="get_item(this,'{$object.ci_id}','{$object.collection_id}','{$type}','prev');">Previous</a>
</li>
<li class="moveR">
<a href="javascript:void(0)" onClick="get_item(this,'{$object.ci_id}','{$object.collection_id}','{$type}','next');">Next</a>
</li>
</div>
<div class="clearfix" style="padding:10px;">
{if $type == 'photos'}
<div class="moveL" style="width:700px; margin:0px 10px;">
<div style="background:#f3f3f3; border:1px solid #ccc; padding:10px 0px;">
<div align="center">{get_photo output='html' size='l' details=$object}</div>
</div>
<div style="height:10px;"></div>
<div class="video_actions_cont clearfix">
<div class="rating_container">
{show_video_rating rating=$object.rating ratings=$object.rated_by total='10' id=$object.photo_id type=photo}
</div>
<div style="float:left; margin-left:15px;" class="actions clearfix">
<ul>
<li><a href="javascript:void(0)" onclick="slide_up_watch_video('#video_action_result_cont');add_to_fav('video','{$vdo.videoid}');"><img src="{$imageurl}/dot.gif" class="add_to_fav" />{lang code='add_to_favs'}</a></li>
<li><a href="javascript:void(0)" onclick="slide_up_watch_video('#flag_item');$('#flag_item').slideToggle();"><img src="{$imageurl}/dot.gif" class="report_this" />{lang code='report_this'}</a></li>
<li><a href="javascript:void(0)" onclick="slide_up_watch_video('#share_form');$('#share_form').slideToggle();"><img src="{$imageurl}/dot.gif" class="add_to_play" />{lang code='share_this'}</a></li>
</ul>
</div>
</div>
</div>
<div style="width:245px;" class="moveR">
<div style="background:#f3f3f3; border:1px solid #ccc; padding:10px">
<div class="video_title">{$object.photo_title}</div>
<div class="borderLine"></div>
{$object.photo_description}
<div class="borderLine"></div>
<div style="font:normal 10px Tahoma;">{$object.photo_tags|tags:photos}</div>
</div>
{assign var=cid value=$object.collection_id}
{get_photos assign=related extra_cond=" collection_id <> $cid" show_related=TRUE title=$object.photo_title tags=$object.photo_tags exclude=$object.photo_id limit='5'}
{if $related}
<div style="height:5px; clear:both"></div>
<div class="PhotoHeading hover" onclick="$('#relatedPhotos').slideToggle('fast');">Related Photos</div>
<div id="relatedPhotos">
{section name=list loop=$related}
{include file="$style_dir/blocks/photo.html" display_type="related_photos" photo=$related[list]}
{/section}
</div>
{/if}
</div>
{/if}
{if $type == 'videos'}
<div style="width:700px; margin:0px 10px; float:left;">
<div style="background:#f3f3f3; border:1px solid #ccc; padding:10px 0px;">
<div align="center">{FlashPlayer vdetails = $object}</div>
</div>
{$object.description}
<div class="clear"></div>
</div>
<div style="width:245px;" class="moveR">
<div class="video_title">{$object.title}</div>
</div>
{/if}
</div>
</div>

View file

@ -3,7 +3,7 @@
{if $userquery->perm_check('admin_access')=='yes'}<div>{ANCHOR place=watch_admin_options data=$vdo}</div>{/if} {if $userquery->perm_check('admin_access')=='yes'}<div>{ANCHOR place=watch_admin_options data=$vdo}</div>{/if}
<!-- START before_watch_player plugin --> <!-- START before_watch_player plugin -->
{ANCHOR place="before_watch_player" data=$vdo} {ANCHOR place="before_watch_player" data=$vdo }
<!-- END before_watch_player plugin anchor --> <!-- END before_watch_player plugin anchor -->
{if has_hq($vdo)} {if has_hq($vdo)}

View file

@ -518,6 +518,8 @@ display:inline-block; width:18px; height:18px; line-height:18px; text-align:cent
.add_comment_box{background-color:#f0f0f0} .add_comment_box{background-color:#f0f0f0}
.add_comment_box .input{ border:1px solid #CCC; background-image:url(../images/watch_video_details_bg.png); background-position:10px; padding:5px; width:400px; background-repeat:repeat-x} .add_comment_box .input{ border:1px solid #CCC; background-image:url(../images/watch_video_details_bg.png); background-position:10px; padding:5px; width:400px; background-repeat:repeat-x}
#collectionComments .comment .comm_other{width:86%; }
.cb_warning,.cb_error,.cb_message{border-radius:10px;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px; padding:5px; border:1px #0099cc solid; margin:5px;background-image:url(../images/watch_video_details_bg.png); background-position:10px} .cb_warning,.cb_error,.cb_message{border-radius:10px;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px; padding:5px; border:1px #0099cc solid; margin:5px;background-image:url(../images/watch_video_details_bg.png); background-position:10px}
.cb_warning ul,.cb_error ul,.cb_message ul{display:block; margin:0px; padding:0px; padding-left:10px;} .cb_warning ul,.cb_error ul,.cb_message ul{display:block; margin:0px; padding:0px; padding-left:10px;}
.cb_warning ul li,.cb_error ul li,.cb_message ul li{border-left:3px solid #ccc; list-style:none; padding-left:10px; cursor:pointer} .cb_warning ul li,.cb_error ul li,.cb_message ul li{border-left:3px solid #ccc; list-style:none; padding-left:10px; cursor:pointer}
@ -782,9 +784,50 @@ ul.upload_opts li.selected { cursor:pointer; background:none; border:1px solid;
width:0px width:0px
} }
/* COLLECTION */ /* COLLECTION */
.collect_grid { padding:5px; border:1px solid #FFF; height:120px; margin:0 0 10px -1px; position:relative; -moz-border-radius:6px; } .collect_grid { position:relative; }
.collect_grid:hover { border-color:#CCC; background:#fafafa; z-index:50; cursor:pointer; }
.collect_grid.selected { background:url(../images/simple_gradient.png) bottom repeat-x; border:1px solid #aaa; z-index:51; }
.collect_grid:first-child { margin-left:none; }
.obj_title { width:110px; display:inline-block; } .obj_title { width:110px; display:inline-block; }
.obj_title a { text-decoration:none; } .obj_title a { text-decoration:none; }
.collectionTable { border-collapse:collapse; border-spacing:0px; width:100%; }
td.collectItemBox { vertical-align:middle; display:inline-block; width:18%; text-align:center; padding:10px 0px; }
a.CollectThumb { border:1px solid #ccc; display:inline-block; background:#FFF; }
.collect_grid img { display:block; margin:3px; }
/* PHOTOS */
.photoBox { background:url(../images/simple_gradient.png) repeat-x bottom; border:1px solid #ccc; margin-bottom:10px; border-radius:4px; -webkit-border-radius:4px; -moz-border-radius:4px; }
.photoBox .OptionalSettings { background:#f3f3f3; border:solid #ccc; border-width:1px 0px 0px; display:block;}
.photoBox .Heading a { padding:5px; display:block; border-bottom:1px solid #ccc; font:bold 11px Tahoma; text-decoration:none; }
.photoDetailsBox { padding:5px; }
.photoDetailsBox .field { margin-bottom:5px; }
.photoDetailsBox .field .label { font:bold 11px Tahoma; padding-top:6px; width:125px; display:inline-block; }
.photoDetailsBox input[type=text], .photoDetailsBox textarea, .photoDetailsBox select { font:normal 11px Tahoma; padding:4px; width:200px; }
.photoDetailsBox textarea { width:202px; height:50px; }
.photoDetailsBox select { width:212px; }
.photoDetailsBox .hint { color:#666; font:normal 10px Tahoma; float:right; }
.photoThumbBox { padding:1px; background:#FFF; border:1px solid #aaa; }
.OptionalBox { padding:5px; }
.PhotoHeading { margin:5px 0px; padding-bottom:5px; border-bottom:1px solid #ccc; font:bold 11px Tahoma; }
.PhotoHeading.hover:hover { cursor:pointer; }
.relatedPhotos { clear:both; margin-bottom:10px; }
.photoTitle { font:bold 11px Tahoma; }
.photoTitle a { text-decoration:none; }
.photoInfo { font:normal 10px Tahoma; color:#666; }
/* VIEW ITEM */
.borderLine { border-bottom:1px solid #ccc; padding:5px 0px 0px; margin:0 0 5px; }
.NextPrevButtons { width:100%; margin-bottom:5px; }
.NextPrevButtons li { list-style:none; width:49%; }
.NextPrevButtons li a { font:bold 11px Tahoma, Geneva, sans-serif; text-decoration:none; }
.NextPrevButtons li a { display:block; text-align:center; padding:8px 0px; border:1px solid #ccc; background:url(../images/simple_gradient.png) repeat-x bottom; color:#000;}
.NextPrevButtons li a:hover { color:#FFF; background:#EEE url(../images/nav_grads.png) left top repeat-x; border:1px solid #053a5c }
.LoadMoreButton { font:bold 11px Tahoma, Geneva, sans-serif; background:url(../images/simple_gradient.png) repeat-x bottom; border:1px solid #ccc; padding:6px; margin-top:5px; -moz-border-radius:4px; -webkit-border-radius:4px; border-radius:4px; }
.LoadMoreButton:hover { color:#FFF; background:#115582 url(../images/nav_grads.png) left top repeat-x; border:1px solid #053a5c; cursor:pointer; }
.LoadMoreButton:active { background:#115582; }
.LoadMoreButton[disabled], .LoadMoreButton[disabled]:hover, .LoadMoreButton[disabled]:active { background:#EEE; border:1px solid #ccc; cursor:default; color:#7b7b7b; }
.CollectionResult { background:#FFF url(../images/simple_gradient.png) bottom repeat-x; border:1px solid #aaa; margin:8px 8px 0px; padding:5px; font:bold 11px Tahoma; color:#666; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; }
.CollectionResult .error { color:#ed0000; }
.CollectionResult .msg { color:#0099cc; }

View file

@ -1,14 +1,15 @@
<script type="text/javascript" language="javascript">
var Seo = '{$Cbucket->configs.seo}';
onReload_item();
</script>
{if $smarty.const.THIS_PAGE == 'upload' && $step =="2"} {if $smarty.const.THIS_PAGE == 'upload' && $step =="2"}
<script src="{$js}/swfupload/swfupload.js" type="text/javascript"></script> <script src="{$js}/swfupload/swfupload.js" type="text/javascript"></script>
<script src="{$js}/swfupload/plugins/all_in_one.js" type="text/javascript"></script> <script src="{$js}/swfupload/plugins/all_in_one.js" type="text/javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
{assign var="get_api_server" value=$multi_server->get_server_api()}
{if $get_api_server}
var result_page = '{$get_api_server.server_api_path}/actions/file_results.php';
var download_page = '{$get_api_server.server_api_path}/actions/file_downloader.php';
{/if}
var swfu; var swfu;
var file_name = '{$file_name}'; var file_name = '{$file_name}';
@ -18,14 +19,8 @@ window.onload = function() {
var settings = { var settings = {
{/literal} {/literal}
flash_url : "{$js}/swfupload/swfupload.swf",
{if $get_api_server} upload_url: "{$baseurl}/actions/file_uploader.php",
flash_url : "{$get_api_server.server_api_path}/js/swfupload/swfupload.swf",
upload_url: "{$get_api_server.server_api_path}/actions/file_uploader.php",
{else}
flash_url : "{$js}/swfupload/swfupload.swf",
upload_url: "{$baseurl}/actions/file_uploader.php",
{/if}
button_image_url: "{$imageurl}/cb_button.png", button_image_url: "{$imageurl}/cb_button.png",
post_params: post_params:
@ -95,7 +90,63 @@ window.onload = function() {
</script> </script>
{/if} {/if}
{literal} {if $smarty.const.THIS_PAGE == 'photo_upload'}
<script src="{$js}/swfupload/swfupload.js" type="text/javascript"></script>
<script src="{$js}/swfupload/plugins/all_in_one.js" type="text/javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
var swfu;
window.onload = function ()
{ldelim}
var settings =
{ldelim}
flash_url : "{$js}/swfupload/swfupload.swf",
file_post_name: 'photoUpload',
upload_url: "{$baseurl}/actions/photo_uploader.php",
button_image_url: "{$imageurl}/cb_button.png",
file_size_limit : "{$Cbucket->configs.max_photo_size} MB",
file_types : "{$cbphoto->extensions()}",
file_types_description : "Image Files",
file_upload_limit : {$max_upload},
post_params :
{ldelim}
{if $smarty.get.collection}
{if $cbphoto->is_addable($smarty.get.collection)}
collection : {$smarty.get.collection},
{/if}
{/if}
userid : {$userquery->userid}
{rdelim},
file_queue_limit : 0,
custom_settings : {ldelim}
progressTarget : "fsUploadProgress",
cancelButtonId : "btnCancel"
{rdelim},
debug: false,
// Button settings
button_placeholder_id: "spanButtonPlaceHolder",
button_width: 77,
button_height: 22,
button_text_left_padding: 18,
button_text_top_padding: 2,
button_text: '<span class="cb_button_font">Upload</span>',
// The event handler functions are defined in handlers.js
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : PictureUploadSuccess,
upload_complete_handler : uploadComplete,
queue_complete_handler : queueComplete // Queue plugin event
{rdelim}
swfu = new SWFUpload(settings);
{rdelim}
</script> </script>
{/literal} {/if}

View file

@ -13,57 +13,55 @@ require 'includes/config.inc.php';
$pages->page_redir(); $pages->page_redir();
$c = mysql_clean($_GET['cid']); $c = mysql_clean($_GET['cid']);
$cdetails = $cbcollection->get_collection($c); $type = mysql_clean($_GET['type']);
$page = mysql_clean($_GET['page']); $page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page,VLISTPP); $get_limit = create_query_limit($page,VLISTPP);
$order = tbl("collection_items").".ci_id DESC"; $order = tbl("collection_items").".ci_id DESC";
if($cdetails) if($cbcollection->is_viewable($c))
{ {
$type = $cdetails['type']; $cdetails = $cbcollection->get_collection($c);
switch($type) switch($type)
{ {
case "videos": case "videos":
case "video":
case "v":
{ {
$items = $cbvideo->collection->get_collection_items_with_details($cdetails['collection_id'],$order); $items = $cbvideo->collection->get_collection_items_with_details($c,$order,$get_limit);
$count = $cbvideo->collection->get_collection_items_with_details($c,NULL,NULL,TRUE);
} }
break; break;
case "pictures": case "photos":
case "photo":
case "p":
{ {
// Following to two lines will be un-commented once we have written picture.class $items = $cbphoto->collection->get_collection_items_with_details($c,$order,$get_limit);
//$items = $cbpicture->collection->get_collection_items_with_details($cdetails['collection_id'],NULL,$get_limit); $count = $cbphoto->collection->get_collection_items_with_details($c,NULL,NULL,TRUE);
//$total_rows = $cbpicture->collection->get_collection_items_with_details($cdetails['collection_id'],NULL,NULL,true);
} }
break;
} }
// Calling nesscary function for view collection // Calling nesscary function for view collection
call_view_collection_functions($cdetails); call_view_collection_functions($cdetails);
$total_pages = count_pages($count,VLISTPP);
$total_pages = count_pages($total_rows,VLISTPP);
//Pagination //Pagination
$pages->paginate($total_pages,$page); $pages->paginate($total_pages,$page);
assign('objects',$items);
assign("c",$cdetails); assign("c",$cdetails);
assign("type",$type); assign("type",$type);
assign("objects",$items); assign("cid",$c);
subtitle($cdetails['collection_name']); subtitle($cdetails['collection_name']);
} else { } else {
e(lang("collect_not_exist"));
$Cbucket->show_page = false; $Cbucket->show_page = false;
} }
// Getting ready for Pagination
$page = mysql_clean($_GET['page']);
if($Cbucket->show_page)
{
template_files('view_collection.html');
}
template_files('view_collection.html');
display_it(); display_it();
?> ?>

79
upload/view_item.php Normal file
View file

@ -0,0 +1,79 @@
<?php
/*
******************************************************************
| Copyright (c) 2007-2009 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
*******************************************************************
*/
define("THIS_PAGE",'view_item');
define("PARENT_PAGE",'view_collection');
require 'includes/config.inc.php';
$item = $_GET['item'];
$type = $_GET['type'];
$cid = $_GET['collection'];
$order = tbl("collection_items").".ci_id DESC";
if(empty($item))
header('location:'.BASEURL);
else
{
if(empty($type))
header('location:'.$_COOKIE['pageredir']);
else
{
assign('type',$type);
switch($type)
{
case "videos":
case "v":
{
global $cbvideo;
$video = $cbvideo->get_video($item);
if($video)
{
$info = $cbvideo->collection->get_collection_item_fields($cid,$video['videoid'],'ci_id,collection_id');
$video = array_merge($video,$info[0]);
increment_views($video['videoid'],'video');
assign('object',$video);
assign('c',$collect);
} else {
e("Item does not exist");
$Cbucket->show_page = false;
}
}
break;
case "photos":
case "p":
{
global $cbphoto;
$photo = $cbphoto->get_photo($item);
if($photo)
{
$info = $cbphoto->collection->get_collection_item_fields($cid,$photo['photo_id'],'ci_id');
$photo = array_merge($photo,$info[0]);
increment_views($photo['photo_id'],'photo');
assign('object',$photo);
assign('c',$collect);
} else {
e("Item does not exist");
$Cbucket->show_page = false;
}
}
break;
}
template_files('view_item.html');
display_it();
}
}
?>