Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules
Author Message
draxx
Involved
Involved



Joined: Nov 19, 2003
Posts: 282

PostPosted: Mon Jun 22, 2009 4:38 pm Reply with quote

[ Added by Raven: This is a continuation of a thread that was started at [ Only registered users can see links on this board! Get registered or login! ] 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!
 
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team



Joined: Nov 07, 2003
Posts: 928

PostPosted: Mon Jun 22, 2009 5:20 pm Reply with quote

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 @ [ Only registered users can see links on this board! Get registered or login! ] //
//----------------------------------------//


//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&amp;page=watch&amp;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&amp;page=watch&amp;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&amp;page=watch&amp;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&amp;page=watch&amp;id=$vid1\">$thumb_title1</a></b>";
$content .="    </center>";
$content .="    </td>";
$content .="    <td><center><b><a href=\"modules.php?name=Video_Stream&amp;page=watch&amp;id=$vid2\">$thumb_title2</a></b>";
$content .="    </center>";
$content .="    </td>";
$content .="    <td><center><b><a href=\"modules.php?name=Video_Stream&amp;page=watch&amp;id=$vid3\">$thumb_title3</a></b>";
$content .="    </center>";
$content .="    </td>";
$content .="  </tr>";
$content .="</table>";

                    }
                     }
                      }
   
?>
 
View user's profile Send private message
Dawg







PostPosted: Mon Jun 22, 2009 5:22 pm Reply with quote

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 @ [ Only registered users can see links on this board! Get registered or login! ] //
//----------------------------------------//

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&amp;page=watch&amp;id=".$row['id'].">".$row['vidname']."</a><br>";
      $content .="<a href=modules.php?name=Video_Stream&amp;page=watch&amp;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&amp;page=watch&amp;id=".$row['id'].">".$row['vidname']."</a><br>";

}
?>
 
Dawg







PostPosted: Mon Jun 22, 2009 5:23 pm Reply with quote

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 @ [ Only registered users can see links on this board! Get registered or login! ] //
//----------------------------------------//


//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&amp;page=watch&amp;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&amp;page=watch&amp;id=".$row['id'].">".$row['vidname']."</a><br>";

}
?>
 
Dawg







PostPosted: Mon Jun 22, 2009 5:26 pm Reply with quote

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







PostPosted: Mon Jun 22, 2009 5:31 pm Reply with quote

I also recently posted a new Referrs Block that works with RN....You can get it here...

[ Only registered users can see links on this board! Get registered or login! ]

Dawg
 
draxx







PostPosted: Mon Jun 22, 2009 9:05 pm Reply with quote

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 Smile 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







PostPosted: Mon Jun 22, 2009 9:08 pm Reply with quote

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 Laughing Embarassed ROTFL Embarassed gawd I hate feeling needy.
 
Dawg







PostPosted: Tue Jun 23, 2009 2:36 am Reply with quote

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
Involved



Joined: Sep 10, 2008
Posts: 424
Location: France,Translator

PostPosted: Tue Jun 23, 2009 4:20 am Reply with quote

Good job dawg , huhm , can you guys point me to the download of that module so I can make the blocks work Wink I can't seem to find it anywhere on this site and their site is down Sad
 
View user's profile Send private message Visit poster's website MSN Messenger
Dawg







PostPosted: Tue Jun 23, 2009 9:17 am Reply with quote

I sent you a PM with it. I will sit down and package it up for Everyones use and post it.

Dawg
 
draxx







PostPosted: Tue Jun 23, 2009 11:13 am Reply with quote

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







PostPosted: Tue Jun 23, 2009 12:26 pm Reply with quote

What is the error and I will see if I have seen it before....Dawg
 
draxx







PostPosted: Tue Jun 23, 2009 12:30 pm Reply with quote

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

PostPosted: Tue Jun 23, 2009 12:42 pm Reply with quote

Sounds like you may have more than one listener then for the window.open event, possibly a chat block ??
 
View user's profile Send private message Send e-mail
draxx







PostPosted: Tue Jun 23, 2009 1:01 pm Reply with quote

It works on IE but not Firefoxx. ? Still possible? I've no chat blocks ... ?
 
Dawg







PostPosted: Tue Jun 23, 2009 7:24 pm Reply with quote

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







PostPosted: Tue Jun 23, 2009 10:28 pm Reply with quote

Okay its got something to do with & and &amp;

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 &amp; and that doesnt work. It must be & ... even if I load it with &amp; in the window it does not open.
 
Dawg







PostPosted: Tue Jun 23, 2009 10:36 pm Reply with quote

If you roll through the code and change the "&" to "&amp;" it doesn't work?

&amp; should be converted to & by php.....Heck if I know....

Dawg
 
draxx







PostPosted: Tue Jun 23, 2009 11:52 pm Reply with quote

Nope if I change the & to &amp; it doesnt work. And firefoxx or the java seems to convert the & to the &amp; by itself.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©