Author |
Message |
draxx
Involved


Joined: Nov 19, 2003
Posts: 282
|
Posted:
Mon Jun 22, 2009 4:38 pm |
|
[ Added by Raven: This is a continuation of a thread that was started at http://www.ravenphpscripts.com/postx17808-0-0.html but had to be locked due to some trolling. ]
Please dont muck up my thread guys.
@@Dawg - the fixes you provided were perfect!
I would indeed love the blocks.
Thanks! |
|
|
|
 |
Dawg
RavenNuke(tm) Development Team

Joined: Nov 07, 2003
Posts: 928
|
Posted:
Mon Jun 22, 2009 5:20 pm |
|
Blocks....Here ya go....
block-Video_H_3.php
Code:<?php
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// ------------------------------------------------------------------------- //
//----------------------------------------//
//
//Center Block by Dawg at ravenphpscripts.com//
//Validated with CSE HTML Validator by Dawg//
//Based on The Random video block by Q @ www.3c0x1.net //
//----------------------------------------//
//Center Block to show Latest Video, Highest Rated and Most Viewed//
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
global $prefix, $prefix, $db;
$limit = 1;
//Views
$result1 = $db->sql_query("SELECT * FROM ".$prefix."_video_stream WHERE request=0 ORDER BY (views) DESC LIMIT $limit");
while ($row1 = $db->sql_fetchrow($result1)) {
$imsrc1 = $row1['imgurl'];
$vid1 = $row1['id'];
if ($row1['vidname'] != '') {
$thumb_title1 = $row1['vidname'];
} else {
$thumb_title1 = substr($row1['imgurl'], 0, -4);
}
// echo "$thumb_title1";
// echo "$imsrc1";
// echo "$vid1";
//Latest Added
$result2 = $db->sql_query("SELECT * FROM ".$prefix."_video_stream WHERE request=0 ORDER BY id DESC LIMIT $limit");
while ($row2 = $db->sql_fetchrow($result2)) {
$imsrc2 = $row2['imgurl'];
$vid2 = $row2['id'];
if ($row2['vidname'] != '') {
$thumb_title2 = $row2['vidname'];
} else {
$thumb_title2 = substr($row2['imgurl'], 0, -4);
}
// echo "$thumb_title2";
// echo "$imsrc2";
// echo "$vid2";
//Rated
$result3 = $db->sql_query("SELECT * FROM ".$prefix."_video_stream WHERE request=0 ORDER BY (rating/rates) DESC LIMIT $limit");
while ($row3 = $db->sql_fetchrow($result3)) {
$imsrc3 = $row3['imgurl'];
$vid3 = $row3['id'];
if ($row3['vidname'] != '') {
$thumb_title3 = $row3['vidname'];
} else {
$thumb_title3 = substr($row3['imgurl'], 0, -4);
}
// echo "$thumb_title3";
// echo "$imsrc3";
// echo "$vid3";
$content .=" <table width=\"100%\">";
$content .=" <tr>";
$content .=" <td><center><b>Most Viewed Video</b></center></td>";
$content .=" <td><center><b>Latest Video</b></center></td>";
$content .=" <td><center><b>Highest Rated Video</b></center></td>";
$content .=" </tr>";
$content .=" <tr>";
$content .=" <td><center><a href=\"modules.php?name=Video_Stream&page=watch&id=$vid1\"><img src=\"$imsrc1\" border=\"0\" width=\"145\" alt=\"$thumb_title1\" /></a>";
$content .=" </center>";
$content .=" </td>";
$content .=" <td><center><a href=\"modules.php?name=Video_Stream&page=watch&id=$vid2\"><img src=\"$imsrc2\" border=\"0\" width=\"145\" alt=\"$thumb_title2\" /></a>";
$content .=" </center>";
$content .=" </td>";
$content .=" <td><center><a href=\"modules.php?name=Video_Stream&page=watch&id=$vid3\"><img src=\"$imsrc3\" border=\"0\" width=\"145\" alt=\"$thumb_title3\" /></a>";
$content .=" </center>";
$content .=" </td>";
$content .=" </tr>";
$content .=" <tr>";
$content .=" <td><center><b><a href=\"modules.php?name=Video_Stream&page=watch&id=$vid1\">$thumb_title1</a></b>";
$content .=" </center>";
$content .=" </td>";
$content .=" <td><center><b><a href=\"modules.php?name=Video_Stream&page=watch&id=$vid2\">$thumb_title2</a></b>";
$content .=" </center>";
$content .=" </td>";
$content .=" <td><center><b><a href=\"modules.php?name=Video_Stream&page=watch&id=$vid3\">$thumb_title3</a></b>";
$content .=" </center>";
$content .=" </td>";
$content .=" </tr>";
$content .="</table>";
}
}
}
?>
|
|
|
|
|
 |
Dawg

|
Posted:
Mon Jun 22, 2009 5:22 pm |
|
Random Video
Code:<?php
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// ------------------------------------------------------------------------- //
//----------------------------------------//
//Random video block by Q @ www.3c0x1.net //
//----------------------------------------//
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
define('NO_HEADER', true);
global $prefix, $prefix, $db;
$limit = 1;
$content = "<p align=\"center\">";
$result = $db->sql_query("SELECT * FROM " .$prefix. "_video_stream GROUP BY id ORDER BY RAND() DESC LIMIT $limit");
while ($row = $db->sql_fetchrow($result)) {
$imsrc = $row['imgurl'];
if ($row['vidname'] != '') {
$thumb_title = $row['vidname'];
} else {
$thumb_title = substr($row['imgurl'], 0, -4);
}
//$content .= "<a href=modules.php?name=Video_Stream&page=watch&id=".$row['id'].">".$row['vidname']."</a><br>";
$content .="<a href=modules.php?name=Video_Stream&page=watch&id=".$row['id']."><img src=".$row['imgurl']." border=\"0\" width=145 alt=".$row['vidname']."></a>\n";
$content .= "<br><a href=modules.php?name=Video_Stream&page=watch&id=".$row['id'].">".$row['vidname']."</a><br>";
}
?>
|
|
|
|
|
 |
Dawg

|
Posted:
Mon Jun 22, 2009 5:23 pm |
|
Most Views...
Code:<?php
// ------------------------------------------------------------------------- //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// ------------------------------------------------------------------------- //
//----------------------------------------//
//Block by Dawg//
//Based on The Random video block by Q @ www.3c0x1.net //
//----------------------------------------//
//Side Block to show Most Views//
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
define('NO_HEADER', true);
global $prefix, $prefix, $db;
$limit = 1;
$content = "<p align=\"center\">";
//Views
$result = $db->sql_query("SELECT * FROM ".$prefix."_video_stream WHERE request=0 ORDER BY (views) DESC LIMIT $limit");
while ($row = $db->sql_fetchrow($result)) {
$imsrc = $row['imgurl'];
if ($row['vidname'] != '') {
$thumb_title = $row['vidname'];
} else {
$thumb_title = substr($row['imgurl'], 0, -4);
}
$content .="Most Viewed Video\n";
$content .="<a href=modules.php?name=Video_Stream&page=watch&id=".$row['id']."><img src=".$row['imgurl']." border=\"0\" width=145 alt=".$row['vidname']."></a>\n";
$content .= "<br><a href=modules.php?name=Video_Stream&page=watch&id=".$row['id'].">".$row['vidname']."</a><br>";
}
?>
|
|
|
|
|
 |
Dawg

|
Posted:
Mon Jun 22, 2009 5:26 pm |
|
I made a side block with all three as well...but I can't find it.
Just take H 3 and change the layout at the bottom of the screen to fit your needs.
Dawg |
|
|
|
 |
Dawg

|
Posted:
Mon Jun 22, 2009 5:31 pm |
|
|
|
 |
draxx

|
Posted:
Mon Jun 22, 2009 9:05 pm |
|
Thanks Dawg.
Whenever you do anything with this module it loads a popup.
Works on your site in both firefox and IE ... but on mine only works in IE>
Therefore can I have your javascript.php file from this module please I have narrowed it down to this and I researched it this night - from what I can tell of the javascript docs its coded properly... so beats me why it works on one and not the other. I would have to see whats different.
Many Many thanks! |
|
|
|
 |
draxx

|
Posted:
Mon Jun 22, 2009 9:08 pm |
|
LOL and Dawg, While your at it - will you install it and upload a bunch of videos and then send a bunch of traffic to watch them for me too gawd I hate feeling needy. |
|
|
|
 |
Dawg

|
Posted:
Tue Jun 23, 2009 2:36 am |
|
Draxx,
I sent you a PM with a downlaod link for the zip. Hope that helps. IT is not really packaged for others use. I am happy to help where I can.
Dawg |
|
|
|
 |
eldorado
Involved


Joined: Sep 10, 2008
Posts: 424
Location: France,Translator
|
Posted:
Tue Jun 23, 2009 4:20 am |
|
Good job dawg , huhm , can you guys point me to the download of that module so I can make the blocks work I can't seem to find it anywhere on this site and their site is down  |
|
|
|
 |
Dawg

|
Posted:
Tue Jun 23, 2009 9:17 am |
|
I sent you a PM with it. I will sit down and package it up for Everyones use and post it.
Dawg |
|
|
|
 |
draxx

|
Posted:
Tue Jun 23, 2009 11:13 am |
|
Thanks Dawg.
Now I'm completely baffeled. On your site my firefoxx loads that popup just fine. On mine it doesnt. Same javascript.php
What could I be missing about open.window ?
Any ideas? Anyone? |
|
|
|
 |
Dawg

|
Posted:
Tue Jun 23, 2009 12:26 pm |
|
What is the error and I will see if I have seen it before....Dawg |
|
|
|
 |
draxx

|
Posted:
Tue Jun 23, 2009 12:30 pm |
|
It doesnt error. It opens a new window with the same page that called it. It's supposed to open a new window with the form for comment/submission or a popup player.
It sizes the window to the window.open specifications but the content in the window is always the same page it was clicked on from. |
|
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Tue Jun 23, 2009 12:42 pm |
|
Sounds like you may have more than one listener then for the window.open event, possibly a chat block ?? |
|
|
|
 |
draxx

|
Posted:
Tue Jun 23, 2009 1:01 pm |
|
It works on IE but not Firefoxx. ? Still possible? I've no chat blocks ... ? |
|
|
|
 |
Dawg

|
Posted:
Tue Jun 23, 2009 7:24 pm |
|
Drax,
Just to make sure of what we are looking at. Did you overwrite everything I gave you in the zip file?
Look through your includes/javascript.php and see if you see anything that is calling that same javascript function.
I think G is right. There is more than one call....
Shoot me a PM with the URL and I will have a look at it.
Dawg |
|
|
|
 |
draxx

|
Posted:
Tue Jun 23, 2009 10:28 pm |
|
Okay its got something to do with & and &
Code:
function loadcomment(id, modcom) {
window.open('modules.php?name=Video_Stream&page=comment&moderateVS='+modcom+'&id='+id+'','','scrollbars=no,menubar=no,height=250,width=500,resizable=no,toolbar=no,location=no,status=no');
}
function loadsend(id) {
window.open('modules.php?name=Video_Stream&page=send&id='+id+'','','scrollbars=no,menubar=no,height=240,width=200,resizable=no,toolbar=no,location=no,status=no');
}
function loadadd() {
window.open('modules.php?name=Video_Stream&page=vidadd','','scrollbars=no,menubar=no,height=600,width=360,resizable=no,toolbar=no,location=no,status=no');
}
function loadrate(rate, id) {
window.open('modules.php?name=Video_Stream&page=rate&id='+id+'&rate='+rate+'','','scrollbars=no,menubar=no,height=50,width=250,resizable=no,toolbar=no,location=no,status=no');
}
function loadvidpop(id, height, width) {
window.open('modules.php?name=Video_Stream&page=vidpop&id='+id+'','','scrollbars=no,menubar=no,height='+height+',width='+width+',resizable=yes,toolbar=no,location=no,status=no');
}
|
Firefoxx subs the & with & and that doesnt work. It must be & ... even if I load it with & in the window it does not open. |
|
|
|
 |
Dawg

|
Posted:
Tue Jun 23, 2009 10:36 pm |
|
If you roll through the code and change the "&" to "&" it doesn't work?
& should be converted to & by php.....Heck if I know....
Dawg |
|
|
|
 |
draxx

|
Posted:
Tue Jun 23, 2009 11:52 pm |
|
Nope if I change the & to & it doesnt work. And firefoxx or the java seems to convert the & to the & by itself. |
|
|
|
 |
|