hi
I am using dynamic titles on my site
i would like to be able to use them on the PHP-Nuke Video v2.3
i need help for Create this dynamic titles for my php-nuke video
Thanks a lot.
Joined: Aug 29, 2004 Posts: 9071 Location: Arizona
Posted:
Sat Aug 22, 2009 9:08 am
abdlali8, I would look at how includes/dynamic_titles.php is doing it and add your module code in there. However, I have to tell you, though, that we're moving to a completely different system for generating dynamic titles in the soon to be release 2.40.00 version.
If I recall PHP-Nuke Video v2.3 is a knocked off version of Video_Stream
If so this should work...
includes/dynamic_titles.php
Code:
if($name=="Video_Stream"){
global $db, $prefix, $id,$page;
$name = "Whatever you want for the Base Name";
if ($page == 'watch'){
$result = $db->sql_query("SELECT * FROM ".$prefix."_video_stream WHERE id='$id'");
$row = $db->sql_fetchrow($result);
$newpagetitle = $name." - ".$row['vidname'];
}
elseif($page != 'watch'){
$name = "$Whatever you want for the Base Name";
$newpagetitle = "$name";
}
}
Palbin wrote:
yes, you will have to uncomment the few lines for it as before.
WOOT WOOT....I have 2 MODs I use that I really do not want to recreate that use dbi.
abdlali8, I would look at how includes/dynamic_titles.php is doing it and add your module code in there. However, I have to tell you, though, that we're moving to a completely different system for generating dynamic titles in the soon to be release 2.40.00 version.
Thank you Boss
i Wait the new version with impatience
If I recall PHP-Nuke Video v2.3 is a knocked off version of Video_Stream
If so this should work...
includes/dynamic_titles.php
Code:
if($name=="Video_Stream"){
global $db, $prefix, $id,$page;
$name = "Whatever you want for the Base Name";
if ($page == 'watch'){
$result = $db->sql_query("SELECT * FROM ".$prefix."_video_stream WHERE id='$id'");
$row = $db->sql_fetchrow($result);
$newpagetitle = $name." - ".$row['vidname'];
}
elseif($page != 'watch'){
$name = "$Whatever you want for the Base Name";
$newpagetitle = "$name";
}
}
Palbin wrote:
yes, you will have to uncomment the few lines for it as before.
WOOT WOOT....I have 2 MODs I use that I really do not want to recreate that use dbi.
If I recall PHP-Nuke Video v2.3 is a knocked off version of Video_Stream
If so this should work...
includes/dynamic_titles.php
Code:
if($name=="Video_Stream"){
global $db, $prefix, $id,$page;
$name = "Whatever you want for the Base Name";
if ($page == 'watch'){
$result = $db->sql_query("SELECT * FROM ".$prefix."_video_stream WHERE id='$id'");
$row = $db->sql_fetchrow($result);
$newpagetitle = $name." - ".$row['vidname'];
}
elseif($page != 'watch'){
$name = "$Whatever you want for the Base Name";
$newpagetitle = "$name";
}
}
Palbin wrote:
yes, you will have to uncomment the few lines for it as before.
WOOT WOOT....I have 2 MODs I use that I really do not want to recreate that use dbi.
Dawg
hey again
the codes not working with me
please i need anthor method
thank you
$this->db->sql_query("update ".$this->prefix."_vidmod_videos set file_video='".mysql_real_escape_string($video_file)."', file_converted='".mysql_real_escape_string($converted_file)."', file_thumbnail='".mysql_real_escape_string($thumb_file)."' where id='".$video_id."'");
$name_video_file = $this->upload_video($video_id, $upload_video_file);
if($name_video_file != '')
$this->db->sql_query("update ".$this->prefix."_vidmod_videos set file_video='".mysql_escape_string($name_video_file)."' where id=".$video_id."");
$name_converted_file = $this->upload_converted($video_id, $upload_converted_file);
if($name_converted_file != '')
$this->db->sql_query("update ".$this->prefix."_vidmod_videos set file_converted='".mysql_escape_string($name_converted_file)."' where id=".$video_id."");
$name_thumb_file = $this->upload_thumbnail($video_id, $upload_thumb_file);
if($name_thumb_file != '')
$this->db->sql_query("update ".$this->prefix."_vidmod_videos set file_thumbnail='".mysql_escape_string($name_thumb_file)."' where id=".$video_id."");
function update_ftp_thumbnail($video_id, $file){
$this->db->sql_query("update ".$this->prefix."_vidmod_videos set file_thumbnail='".$file."' where id=".$video_id."");
}
function update_ftp_converted($video_id, $file){
$this->db->sql_query("update ".$this->prefix."_vidmod_videos set file_converted='".$file."' where id=".$video_id."");
}
function video_exists($video_id){
//check if video exists
if(is_numeric($video_id)){
$result_id = $this->db->sql_query("select id from ".$this->prefix."_vidmod_videos where id=".$video_id."");
if($this->db->sql_numrows($result_id) == 1){
return true;
}
}
return false;
}
function video_exists_approve($video_id){
if(is_numeric($video_id)){
$result_id = $this->db->sql_query("select id from ".$this->prefix."_vidmod_videos where id=".$video_id." and approved=1");
if($this->db->sql_numrows($result_id) == 1){
return true;
}
}
return false;
}
function approve_video($video_id){
//Email user here.
$this->update_video($video_id, array('approved' => 1));
}
function reject_video($video_id, $reason){
//Email here
$this->delete_video($video_id);
}
function delete_video($video_id){
//delete video
if(is_numeric($video_id)){
$video_info = $this->get_video($video);
$this->db->sql_query("delete from ".$this->prefix."_vidmod_videos where id=".$video_id."");
@unlink($this->video_path.$video_id.'_'.$video_info['file_video']);
@unlink($this->converted_path.$video_id.'_'.$video_info['file_converted']);
@unlink($this->thumbnail_path.$video_id.'_'.$video_info['file_thumbnail']);
}
}
function get_all_submitted_videos(){
//get video information
$videos = array();
$result_id = $this->db->sql_query("select * from ".$this->prefix."_vidmod_videos where approved=0 order by date_created");
function get_category_videos($category_id, $start, $end){
$videos = array();
$result_id = $this->db->sql_query("select * from ".$this->prefix."_vidmod_videos where approved=1 and category_id=".$category_id." order by id desc");
$count = 0;
while($video = $this->db->sql_fetchrow($result_id)){
$count++;
if($count >= $start && $count <= $end){
$video['comment_count'] = $this->count_comments($video['id']);
$video['rate_round'] = $this->rate_round($video['rating_avg']);
$videos[] = $video;
}
}
$this->temp_count = $this->db->sql_numrows($result_id);
return $videos;
}
function get_user_videos($user_id){
$videos = array();
$result_id = $this->db->sql_query("select * from ".$this->prefix."_vidmod_videos where approved=1 and submitted_by='".$user_id."' order by id desc");
$count = 0;
function get_search_videos($query){
$videos = array();
$result_id = $this->db->sql_query("select * from ".$this->prefix."_vidmod_videos where approved=1 and name like '%".mysql_real_escape_string($query)."%' or description like '%".mysql_real_escape_string($query)."%' order by id desc");
function create_comment($video_id, $user_id, $subject, $content){
//create a comment for a specific video
if($this->video_exists($video_id)){
$this->db->sql_query("insert into ".$this->prefix."_vidmod_comments values (null, ".$video_id.", ".$user_id.", '".htmlspecialchars($subject)."', '".htmlspecialchars($content)."', ".time().")");
}
}
function delete_comment($comment_id){
//simply delete a comment
if(is_numeric($comment_id)){
$this->db->sql_query("delete from ".$this->prefix."_vidmod_comments where id=".$comment_id."");
}
}
function get_comments($video_id){
$comments = array();
if(is_numeric($video_id)){
$result_id = $this->db->sql_query("select c.id, c.video_id, c.user_id, u.username, c.subject, c.content, c.date_posted from ".$this->prefix."_vidmod_comments c, ".$this->user_prefix."_users u where c.video_id=".$video_id." and c.user_id=u.user_id order by c.date_posted");
while($comment = $this->db->sql_fetchrow($result_id)){
$comments[] = $comment;
}
}
return $comments;
}
function count_comments($video_id){
if(is_numeric($video_id)){
$result_id = $this->db->sql_query("select id from ".$this->prefix."_vidmod_comments where video_id=".$video_id."");
return $this->db->sql_numrows($result_id);
}
return 0;
}
function update_views($video_id, $add_repstop = false){
//if valid video, update view count
if($this->video_exists($video_id)){
$video_info = $this->get_video($video_id);
$this->db->sql_query("update ".$this->prefix."_vidmod_videos set views=".($video_info['views'] + 1)." where id=".$video_id."");
}
//if add_repstop is true, add ip of viewer to repstop list
if($add_repstop){
$this->add_repstop($video_id, 'view');
}
}
function update_rating($video_id, $score, $add_repstop = false){
//if valid rating and video, update score and rating count
if($this->valid_rating($score) && $this->video_exists($video_id)){
$video_info = $this->get_video($video_id);
$rating_score = $video_info['rating_score'] + $score;
$rating_count = $video_info['rating_count'] + 1;
if($rating_count != 0){
$rating_avg = $rating_score / $rating_count;
} else {
$rating_avg = 0;
}
$this->db->sql_query("update ".$this->prefix."_vidmod_videos set rating_score=".$rating_score.", rating_count=".$rating_count.", rating_avg=".$rating_avg." where id='".$video_id."'");
}
//if add_repstop is true, add ip of rater to repstop list
if($add_repstop){
$this->add_repstop($video_id, 'rating');
}
}
function check_repstop($video_id, $action = null){
//if video exists, get repstop count, and return true if user has committed action to video
$result_id = $this->db->sql_query("select * from ".$this->prefix."_vidmod_repstop where video_id=".$video_id." and action='".mysql_escape_string($action)."' and ip_address='".$_SERVER['REMOTE_ADDR']."'");
function valid_rating($score){
//checks for a valid score
if(is_numeric($score) && $score >= 1 && $score <= 5){
return true;
}
return false;
}
function add_repstop($video_id, $action){
//add ip address and action to video
if(is_numeric($video_id)){
$this->db->sql_query("insert into ".$this->prefix."_vidmod_repstop values (".$video_id.", '".mysql_escape_string($action)."', '".$_SERVER['REMOTE_ADDR']."', ".time().")");
}
}
function download_video($video_id){
if($this->video_exists($video_id)){
$video_info = $this->get_video($video_id);
Look in the database and see where it is storing the Name of the Video. My guess is that this sql will get the $name....along with the rest of the video info.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum