Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#51 Re: Modifications » Add text in the search box » 2015-07-26 12:01:27

yes, that is what i need for the search bar

#53 Re: Modifications » Add text in the search box » 2015-07-24 15:10:07

yes that is what i want big_smile
thanks.

you're very helpfull to me
thanks for that

#55 Re: Feature Requests » adding extern link in video description with the title of that video. » 2015-07-24 13:53:22

thanks..

what i have done for the description link under the video.

i've edit the modules/video/components/upload.php
and copied the description and paste it below it and add _link   
so i create in database the same as description only with _link behind it.

description_link is added in the video structure of the database.

also i edit the video-view where the link will be displayed.


also i have modified the admin edit in backend to add a link. ( this works)
also works when users upload a video and go to the dashboard and edit a video. they can also add a link.

the only problem is the users upload area.

hope you understand,
other i can send you some codes..

greets

#56 Re: Feature Requests » adding extern link in video description with the title of that video. » 2015-07-24 12:58:22

module/video/components/upload.php :

<?php
defined('_VALID') or die('Restricted Access!');

class VComponent_video_upload extends VModule_video
{
	private $errors = array();
	private $vcfg;
	public function __construct()
	{
		parent::__construct();
		
		$this->vcfg = VF::cfg('module.video');
	}	
	
	public function render()
	{
		VLanguage::load('frontend.upload');
		VLanguage::load('frontend.video');

		if (!$this->vcfg['upload_enabled']) {
			$_SESSION['error'] = __('upload-disabled');
			VModule::load('error', TRUE);
		}
		
		if ($this->vcfg['upload_perm'] != 'anonymous') {
			VAuth::check(ucfirst($this->vcfg['upload_perm']), NULL, __('upload-perm', array($this->vcfg['upload_perm'])));
			$user_id = (int) $_SESSION['user_id'];
		} else {
			$user_id = (VAuth::loggedin()) ? (int) $_SESSION['user_id'] : $this->get_anonymous_id();
		}
		
		$errors		= array();
		$messages	= array();
		$allow		= TRUE;
		
		$this->db->query("SHOW CREATE TABLE #__video");
		$data = $this->db->fetch_rows();
		echo VF::debug($data);
		
		if (!empty($this->vcfg['upload_limit'])) {
			$add_time   = strtotime(date('Y-m-d').' 00:00:00');
			$this->db->query("SELECT COUNT(*) AS total_videos
		                	  FROM #__video
		                	  WHERE add_time > ".$add_time."
		                	  AND user_id = ".$user_id);
			if ($this->db->affected_rows()) {
				$total_videos	= (int) $this->db->fetch_field('total_videos');
				$upload_limit	= (int) $this->vcfg['upload_limit'];
				if ($total_videos >= $upload_limit) {
					$errors[]	= __('upload-limit', array($upload_limit));
				}
			}
		}
		
		$categories	= $this->get_video_categories();
		$unique     = time().'0'.mt_rand();
		$video		= array(
			'title' => '', 'description' => '', 'tags' => '', 'description_link' => '', 'category' => array(),
			'url' => '', 'code' => ''
		);

		if (isset($_POST['cancel-upload'])) {
			$allow = FALSE;
		}
		
		if (isset($_POST['upload-submitted']) && $allow === TRUE) {
			$filter			= VF::factory('filter');
			$title			= $filter->get('title');
			$description	= $filter->get('description');
			$category		= (isset($_POST['category'])) ? (array) $_POST['category'] : array();
			$pornstars		= (isset($_POST['pornstars'])) ? (array) $_POST['pornstars'] : array();
			$tags			= $filter->get('tags');
			$upload_id		= $filter->get('unique_id');
			$description_link = trim($_POST['description_link']);
			
			if ($title == '') {
				$errors[] = __('title-empty');
			} elseif (!VValid::length($title, 1, 100)) {
				$errors[] = __('title-length');
			} else {
				$video['title'] = $title;
			}
			 
			if ($description != '') {
				$video['description'] = $description;
			}
			
			if (!$category) {
				$errors[] = __('category-empty', array($this->vcfg['max_categories']));
			} elseif (count($category) > $this->vcfg['max_categories']) {
				$errors[] = __('category-max', array($this->vcfg['max_categories']));
			} else {
				$video['category'] = $category;
			}
						if ($description_link != '') {
				$video['description_link'] = $description_link;
			}
			
			if ($tags == '') {
				$errors[] = __('tags-empty');
			} else {
				$tags 	= prepare_tags($tags);
				if ($tags == '') {
					$errors[] = __('tags-invalid');
				} else {
					$arr	= explode(',', $tags);
					foreach ($arr as $tag) {
						if (strlen($tag) > $this->vcfg['tag_max_length']) {
							$errors[] = __('tag-length', array('"'.$tag.'"', $this->vcfg['tag_max_length']));
						}
						
						if (str_word_count($tag) > $this->vcfg['tag_max_words']) {
							$errors[] = __('tag-words', array('"'.$tag.'"', $this->vcfg['tag_max_words']));
						}
					}
				
					$video['tags'] = $tags;
				}
			}
			
			if (!ctype_digit($upload_id)) {
				$errors[]	= 'Invalid upload identifier!';
			}
			
			if (!$errors) {
				if (!$file = $this->process_file($upload_id, $this->vcfg['video_max_size'], $this->vcfg['video_allowed_ext'])) {
					$errors = array_merge($errors, $this->errors);
				}
			}
			
			if (!$errors) {
				$vmodel = VModel::load('video', 'video', true);
				if ($video_id = $vmodel->add(array(
					'user_id'		=> $user_id,
					'title'			=> $title,
					'slug'			=> prepare_string($title, true, $this->vcfg['slug_max_length']),
					'description'	=> $description,
					'type'			=> 'public',
					'description_link'	=> $description_link,
					'premium'		=> '0',
					'status'		=> 3))) {
					$dst        = MEDIA_DIR.'/videos/vid/'.$video_id.'.'.$file['ext'];
					$status		= ($this->vcfg['approve']) ? 2 : 1;
					if (rename($file['path'], $dst)) {
						@chmod($dst, 0777);
						if ($this->vcfg['queue']) {
							$status = 6;
						} else {
							$cmd = VF::cfg_core_item('php_cli_path').' '.MODULES_DIR.'/video/scripts/convert.php '.$video_id.' '.$file['ext'].' '.$status;
							exec(escapeshellcmd($cmd). ' >/dev/null &');
						}
						
						if ($status !== 6) {
							$status = 4;
						}
						
						foreach ($category as $cat_id) {
							$vmodel->add_category($video_id, $cat_id);
						}
						
						$tags	= explode(',', $tags);
						foreach ($tags as $tag) {
							$vmodel->add_tag($video_id, trim($tag));
						}
						
						$vmodel->add_orig(array(
                            'video_id'      => $video_id,
                            'user_id'       => $user_id,
                            'filename'      => $file['name'],
                            'ext'           => $file['ext'],
                            'size'          => $file['size'],
                            'method'        => 'upload'
                        ));

						$vmodel->add_activity($user_id);
						
						if ($status === 6) {
							$vmodel->add_queue($video_id, $status);
						}
						
						foreach ($pornstars as $model_id) {
							$vmodel->add_model($video_id, (int) $model_id);
						}
						
						$vmodel->update($video_id, array(
							'status'	=> $status
						));
						
						$video['title']			= '';
						$video['description']	= '';
						$video['tags']			= '';
						$video['description_link']	= '';
						$video['category']		= array();
						
						if ($status === 1 OR $status === 4) {
							$messages[] = __('upload-success');
						} elseif ($status === 2 OR $status === 0) {
							$messages[] = __('upload-approve');
						} elseif ($status == 6) {
							$messages[] = __('upload-queue');
						}
					} else {
						$errors[] = __('file-error');
					}
				} else {
					throw new VException(__('database-error'));
				}
			}
		}
		
		$tpl = VF::factory('template');
		$tpl->menu				= 'video';
		$tpl->meta_title		= __('upload-video');

		$tpl->canonical			= BASE_URL.'/upload/';
		$tpl->canonicalm		= MOBILE_URL.'/upload/';

		$tpl->errors			= $errors;
		$tpl->messages			= $messages;
		$tpl->video				= $video;
		$tpl->categories		= $categories;
		$tpl->tag_max_length	= $this->vcfg['tag_max_length'];
		$tpl->tag_max_words		= $this->vcfg['tag_max_words'];
		$tpl->max_categories	= $this->vcfg['max_categories'];
		$tpl->unique			= $unique;
		$tpl->pornstars			= (VModule::enabled('pornstar')) ? $this->get_pornstars('a') : NULL;
		$tpl->load(array('header', 'video_upload', 'footer'));
		$tpl->display();
	}
	
	private function get_anonymous_id()
	{
		$this->db->query("SELECT user_id FROM #__user WHERE username = 'anonymous' LIMIT 1");
		if ($this->db->affected_rows()) {
			return (int) $this->db->fetch_field('user_id');
		}
		
		throw new Exception('Failed to get anonymous id! Application error!?');
	}
	
	private function get_pornstars($letter='a')
	{
		$this->db->query("SELECT model_id, name
                  		  FROM #__model
                  		  WHERE slug LIKE '".$letter."%'
                  		  AND status = '1'");
        
        return $this->db->fetch_rows();
	}
	
	private function process_file($upload_id, $max_size, $allowed_ext)
	{
		VLanguage::load('frontend.upload');
		
		$sec	= substr(md5(VF::cfg_item('secret')), -5);
		$info	= TMP_DIR.'/uploads/'.$upload_id.'_'.$sec;
		if (file_exists($info) && is_file($info)) {
			$info	= file($info);
			$name	= trim($info['0']);
			$ext	= trim($info['1']);
			$path	= TMP_DIR.'/uploads/'.$upload_id.'_'.$sec.'.'.$ext;
			if (file_exists($path) && is_file($path)) {
				$size	= filesize($path);
				if ($max_size !== 0 && $size > ($max_size*1024*1024)) {
              		$this->errors[] = __('file-limit', array($max_size));
				} else {
					if (in_array($ext, $allowed_ext)) {
						@unlink($info);
						return array(
							'path'	=> $path,
							'name'	=> $name,
							'size'	=> $size,
							'ext'	=> $ext
						);
					} else {
						$this->errors[] = __('file-invalid', array(implode(', ', $allowed_ext)));
					}
				}
			} else {
				$this->errors[]	= __('file-select');
			}
		} else {
			$this->errors[]	= __('file-select').'*';
		}
		
		return FALSE;
	}
}

and do any one know why it still doesn't save the link input in the database when i add text or links.

#58 Re: Modifications » Add text in the search box » 2015-07-23 08:57:50

maybe a nice feature for a new update in the future

#61 Re: Feature Requests » adding extern link in video description with the title of that video. » 2015-07-22 11:12:08

this still shows in the header of the members upload area

(array) Array
(
    [0] => Array
        (
            [Table] => video
            [Create Table] => CREATE TABLE `video` (
  `video_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) unsigned NOT NULL DEFAULT '0',
  `channel_id` int(11) unsigned NOT NULL DEFAULT '0',
  `title` varchar(100) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `rating` float NOT NULL DEFAULT '0',
  `rated_by` bigint(20) NOT NULL DEFAULT '0',
  `duration` float NOT NULL DEFAULT '0',
  `thumb` tinyint(2) unsigned NOT NULL DEFAULT '1',
  `thumbs` tinyint(2) unsigned NOT NULL DEFAULT '20',
  `embed_code` text NOT NULL,
  `allow_embed` enum('0','1') NOT NULL DEFAULT '1',
  `allow_rating` enum('0','1') NOT NULL DEFAULT '1',
  `allow_comment` enum('0','1') NOT NULL DEFAULT '1',
  `allow_download` enum('0','1') NOT NULL DEFAULT '1',
  `total_views` bigint(20) NOT NULL DEFAULT '0',
  `total_comments` int(11) NOT NULL DEFAULT '0',
  `total_downloads` int(11) NOT NULL DEFAULT '0',
  `total_favorites` int(11) NOT NULL DEFAULT '0',
  `type` enum('public','private') NOT NULL DEFAULT 'public',
  `ext` enum('flv','mp4') NOT NULL DEFAULT 'flv',
  `hd` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `size` int(11) NOT NULL DEFAULT '0',
  `add_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `view_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `server` int(11) NOT NULL DEFAULT '0',
  `sponsor` int(11) unsigned NOT NULL DEFAULT '0',
  `flagged` enum('0','1') NOT NULL DEFAULT '0',
  `locked` enum('0','1') NOT NULL DEFAULT '0',
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `adv` int(11) unsigned NOT NULL DEFAULT '0',
  `url` varchar(255) NOT NULL DEFAULT '',
  `premium` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `price` float NOT NULL DEFAULT '0',
  `slug` varchar(100) NOT NULL DEFAULT '',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0',
  `view_time` int(11) unsigned NOT NULL DEFAULT '0',
  `mobile` enum('0','1') NOT NULL DEFAULT '0',
  `mobile_url` varchar(255) NOT NULL DEFAULT '',
  `featured` enum('0','1') NOT NULL DEFAULT '0',
  `s3` enum('0','1') NOT NULL DEFAULT '0',
  `yt_video_id` varchar(32) NOT NULL DEFAULT '',
  `likes` int(11) unsigned NOT NULL DEFAULT '0',
  `slideversion` int(11) NOT NULL DEFAULT '2',
  `slidenum` int(11) NOT NULL DEFAULT '0',
  `slideoffset` int(11) NOT NULL DEFAULT '5',
  `description_link` text NOT NULL,
  PRIMARY KEY (`video_id`),
  KEY `user_id` (`user_id`),
  KEY `add_date` (`add_date`),
  KEY `view_date` (`view_date`),
  KEY `status_id` (`status`,`video_id`),
  KEY `status_views` (`status`,`total_views`),
  KEY `status_comments` (`status`,`total_comments`),
  KEY `status_downloads` (`status`,`total_downloads`),
  KEY `status_rating` (`status`,`rating`,`rated_by`),
  KEY `status_duration` (`status`,`duration`),
  KEY `status_view` (`status`,`view_time`),
  KEY `status` (`status`),
  KEY `mobile` (`mobile`),
  KEY `status_addtime` (`status`,`add_time`),
  FULLTEXT KEY `title` (`title`)
) ENGINE=MyISAM AUTO_INCREMENT=5299 DEFAULT CHARSET=utf8
        )

)

#64 Re: Feature Requests » adding extern link in video description with the title of that video. » 2015-07-10 23:56:30

it still doesn't work, either what you post before.

and i don't know what i must do that the array is gone in the upload area.

#65 Re: Feature Requests » adding extern link in video description with the title of that video. » 2015-07-09 08:52:34

Thanks

Let me know if you need something from me, you can also email me, i can response directly

#66 Re: Feature Requests » adding extern link in video description with the title of that video. » 2015-07-08 12:55:23

this i get above the upload page.

(array) Array
(
    [0] => Array
        (
            [Table] => video
            [Create Table] => CREATE TABLE `video` (
  `video_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) unsigned NOT NULL DEFAULT '0',
  `channel_id` int(11) unsigned NOT NULL DEFAULT '0',
  `title` varchar(100) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `rating` float NOT NULL DEFAULT '0',
  `rated_by` bigint(20) NOT NULL DEFAULT '0',
  `duration` float NOT NULL DEFAULT '0',
  `thumb` tinyint(2) unsigned NOT NULL DEFAULT '1',
  `thumbs` tinyint(2) unsigned NOT NULL DEFAULT '20',
  `embed_code` text NOT NULL,
  `allow_embed` enum('0','1') NOT NULL DEFAULT '1',
  `allow_rating` enum('0','1') NOT NULL DEFAULT '1',
  `allow_comment` enum('0','1') NOT NULL DEFAULT '1',
  `allow_download` enum('0','1') NOT NULL DEFAULT '1',
  `total_views` bigint(20) NOT NULL DEFAULT '0',
  `total_comments` int(11) NOT NULL DEFAULT '0',
  `total_downloads` int(11) NOT NULL DEFAULT '0',
  `total_favorites` int(11) NOT NULL DEFAULT '0',
  `type` enum('public','private') NOT NULL DEFAULT 'public',
  `ext` enum('flv','mp4') NOT NULL DEFAULT 'flv',
  `hd` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `size` int(11) NOT NULL DEFAULT '0',
  `add_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `view_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `server` int(11) NOT NULL DEFAULT '0',
  `sponsor` int(11) unsigned NOT NULL DEFAULT '0',
  `flagged` enum('0','1') NOT NULL DEFAULT '0',
  `locked` enum('0','1') NOT NULL DEFAULT '0',
  `status` tinyint(1) NOT NULL DEFAULT '0',
  `adv` int(11) unsigned NOT NULL DEFAULT '0',
  `url` varchar(255) NOT NULL DEFAULT '',
  `premium` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `price` float NOT NULL DEFAULT '0',
  `slug` varchar(100) NOT NULL DEFAULT '',
  `add_time` int(11) unsigned NOT NULL DEFAULT '0',
  `view_time` int(11) unsigned NOT NULL DEFAULT '0',
  `mobile` enum('0','1') NOT NULL DEFAULT '0',
  `mobile_url` varchar(255) NOT NULL DEFAULT '',
  `featured` enum('0','1') NOT NULL DEFAULT '0',
  `s3` enum('0','1') NOT NULL DEFAULT '0',
  `yt_video_id` varchar(32) NOT NULL DEFAULT '',
  `likes` int(11) unsigned NOT NULL DEFAULT '0',
  `slideversion` int(11) NOT NULL DEFAULT '2',
  `slidenum` int(11) NOT NULL DEFAULT '0',
  `slideoffset` int(11) NOT NULL DEFAULT '5',
  `description_link` text NOT NULL,
  PRIMARY KEY (`video_id`),
  KEY `user_id` (`user_id`),
  KEY `add_date` (`add_date`),
  KEY `view_date` (`view_date`),
  KEY `status_id` (`status`,`video_id`),
  KEY `status_views` (`status`,`total_views`),
  KEY `status_comments` (`status`,`total_comments`),
  KEY `status_downloads` (`status`,`total_downloads`),
  KEY `status_rating` (`status`,`rating`,`rated_by`),
  KEY `status_duration` (`status`,`duration`),
  KEY `status_view` (`status`,`view_time`),
  KEY `status` (`status`),
  KEY `mobile` (`mobile`),
  KEY `status_addtime` (`status`,`add_time`),
  FULLTEXT KEY `title` (`title`)
) ENGINE=MyISAM AUTO_INCREMENT=4506 DEFAULT CHARSET=utf8
        )

)

#70 Re: Development » Premium Membership 2.0 Development » 2015-07-06 20:12:38

@adrian

I don't have a account is This for the payments the customers send to me? And go to verotel?

#71 Re: Feature Requests » adding extern link in video description with the title of that video. » 2015-07-06 20:08:33

I've add the user :anonymous

Only the database table video still there on the upload area for users

#72 Re: Feature Requests » adding extern link in video description with the title of that video. » 2015-07-06 14:19:27

I've changed description_link in database from text to varcar 255 and i get in the upload area the database structure above the header

Http://www.wizzporn.com/upload

And it is still there after change it back to text

#73 Re: Development » Premium Membership 2.0 Development » 2015-07-06 14:17:54

I don't have a verotel account, can i pay with paxum?

#75 Re: Feature Requests » adding extern link in video description with the title of that video. » 2015-06-29 13:12:49

I have a customer that wants to add link beneath the video, so i would like to know how i can make a code in the user upload area that can save the text or link to database

Board footer

Powered by FluxBB