
Przedszkolak

Postów: 38 Ostrzeżeń: 2
Data rejestracji: 10.06.2008 14:36
|
Witam,
mam drobny problem z wtyczk? Kroax. Otó? chcia?bym, aby po dodaniu filmiku na li?cie automatycznie sortowane wszystko by?o alfabetycznie. W prawdzie istnieje link sortowania, ale ka?dy u?ytkownik musi robi? to samodzielnie. Mi zale?y na tym, ?eby dodaj?c filmiki, automatycznie uk?adane by?o w odpowiedniej kolejno?ci.
Druga sprawa jest taka, ?e chcia?bym aby ogl?da? mogli tylko zarejestrowani u?ytkownicy. Spis filmów widz? wszyscy, ale gdy kto? kliknie, aby odtworzy? video, to wtedy pojawi si? odpowiedni komunikat. Wykorzysta?em do tego takie co?:
if (iGUEST) {
openside("Zaloguj si?");
echo "Jaki? tam tekst, ?wiadcz?cy o zablokowanym dost?pie";
closeside();
}
Dodaj? to w pliku embed.php. W prawdzie komunikat si? pojawia, ale dalej mo?na ogl?da? filmik. Komunikat widnieje nad odtwarzaczem :/
Edytowane przez Pieka dnia 13.08.2008 10:28:33
|

Przedszkolak

Postów: 38 Ostrzeżeń: 2
Data rejestracji: 10.06.2008 14:36
|
Próbowa?em te? takiego zabiegu i co prawda go?ciom pojawia si? komunikat, nie maj? mo?liwo?ci ogl?dania, ale za to u?ytkownicy widz? pust? stron? :|
Kod, gdzie wy?wietlana jest lista tytu?ów to:
<?php
/*--------------------------------------------+
| PHP-Fusion 6 - Content Management System |
|---------------------------------------------|
| author: Nick Jones (Digitanium) © 2002-2005 |
| web: http://www.php-fusion.co.uk |
| email: |
|---------------------------------------------|
|This program is released as free software |
|under the |Affero GPL license. |
|You can redistribute it and/or |
|modify it under the terms of this license |
|which you |can read by viewing the included |
|agpl.html or online |
|at http://www.gnu.org/licenses/agpl.html. |
|Removal of this|copyright header is strictly |
|prohibited without |written permission from |
|the original author(s). |
+---------------------------------------------+
|Kroax is written by Domi & fetloser |
|http://www.venue.nu |
+--------------------------------------------*/
require_once "../../maincore.php";
require_once BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
if (iSUPERADMIN) error_reporting(E_ALL);
if (!defined("LANGUAGE")) {
// PHPFusion environment
$this_lang = str_replace("/", "", LOCALESET);
if (file_exists(INFUSIONS."the_kroax/locale/".$this_lang.".php")) {
include INFUSIONS."the_kroax/locale/".$this_lang.".php";
} else {
include INFUSIONS."the_kroax/locale/English.php";
}
} else {
// mFusion environment
$this_lang = LANGUAGE;
if (file_exists(INFUSIONS."the_kroax/locale/".$this_lang.".php")) {
include INFUSIONS."the_kroax/locale/".$this_lang.".php";
} else {
include INFUSIONS."the_kroax/locale/English.php";
}
}
include INFUSIONS."the_kroax/functions.php";
$read_settingskroax = dbquery("SELECT * FROM ".$db_prefix."kroax_set");
if (dbrows($read_settingskroax) != 0) {
$settingskroax = dbarray($read_settingskroax);
$skroaxembed = $settingskroax['kroax_set_show'];
}
opentable($locale['KROAX201']);
makeheader();
$resultset = dbquery("SELECT * FROM ".$db_prefix."kroax_set WHERE kroax_set_id='1'");
while ($dataset = dbarray($resultset)) {
$moviepage ="".$dataset['kroax_set_pre']."";
$height = "".$dataset['kroax_set_hi']."";
$width = "".$dataset['kroax_set_wi']."";
$latestmovies ="".$dataset['kroax_set_pic']."";
$thumbview ="".$dataset['kroax_set_thumb']."";
}
echo "<div id='lajv'>";
if ($thumbview == '1') {
//Album view start
$result = dbquery("SELECT * FROM ".$db_prefix."kroax_kategori WHERE ".groupaccess('kroax_namn_access')."");
$counter = 0; $r = 0; $k = 1;
echo "<table cellpadding='0' cellspacing='1' width='100%'>\n<tr>\n";
while ($data = dbarray($result)) {
if ($counter != 0 && ($counter % $settings['thumbs_per_row'] == 0)) echo "</tr>\n<tr>\n";
echo "<td align='center' valign='top' class='tbl'>\n";
echo "<a href='#' onclick=\"javascript:makeRequest('sortby.php?sortby=".$data['kroax_namn_cat1']."')\"><b>".$data['kroax_namn_cat1']."</b></a><br>\n";
if ($data['kroax_cat_img'] && file_exists(INFUSIONS.the_kroax/categoryimg/$data['kroax_cat_img'])){
echo "<a href='#' onclick=\"javascript:makeRequest('sortby.php?sortby=".$data['kroax_namn_cat1']."')\"><img src='".INFUSIONS."the_kroax/categoryimg/".$data['kroax_cat_img']."' alt='".$data['kroax_namn_cat1']."' title='".$data['kroax_namn_cat1']."' border='0'></a>";
} else {
echo "<a href='#' onclick=\"javascript:makeRequest('sortby.php?sortby=".$data['kroax_namn_cat1']."')\"><img src='".INFUSIONS."the_kroax/categoryimg/default.gif' alt='".$data['kroax_namn_cat1']."' title='".$data['kroax_namn_cat1']."' border='0'></a>";
}
echo "</a><br>\n<span class='small'>\n";
echo "".$locale['KROAX201'].":".dbcount("(kroax_id)", "kroax", "kroax_cat ='".$data['kroax_namn_cat1']."'")."</span>\n";
echo "</td>\n";
$counter++; $k++;
}
echo "</tr>\n</table>\n";
if ($rows > $settings['thumbs_per_page']) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,$settings['thumbs_per_page'],$rows,3)."\n</div>\n";
//Album view end
}
else
{
$result = dbquery("SELECT * FROM ".$db_prefix."kroax WHERE kroax_approval='' AND ".groupaccess('kroax_access')." AND ".groupaccess('kroax_access_cat')." ORDER BY kroax_id DESC LIMIT $latestmovies");
while ($data = dbarray($result)) {
makelist();
}
}
echo "</div>";
closetable();
echo "<br>";
require_once "footer.php";
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>
A to podstrona, gdzie ma si? pojawi? zablokowany dost?p:
<?php
/*--------------------------------------------+
| PHP-Fusion 6 - Content Management System |
|---------------------------------------------|
| author: Nick Jones (Digitanium) © 2002-2005 |
| web: http://www.php-fusion.co.uk |
| email: |
|---------------------------------------------|
|This program is released as free software |
|under the |Affero GPL license. |
|You can redistribute it and/or |
|modify it under the terms of this license |
|which you |can read by viewing the included |
|agpl.html or online |
|at http://www.gnu.org/licenses/agpl.html. |
|Removal of this|copyright header is strictly |
|prohibited without |written permission from |
|the original author(s). |
+---------------------------------------------+
|Kroax is written by Domi & fetloser |
|http://www.venue.nu |
| Embed player functions by:Wain Glaister |
+--------------------------------------------*/
require_once "../../maincore.php";
error_reporting(E_ALL -E_NOTICE);
if (isset($url) && !isNum($url)) fallback("index.php");
if (!defined("LANGUAGE"))
{
// PHPFusion environment
$this_lang = str_replace("/", "", LOCALESET);
if (file_exists(INFUSIONS."the_kroax/locale/".$this_lang.".php"))
{
include INFUSIONS."the_kroax/locale/".$this_lang.".php";
}
else
{
include INFUSIONS."the_kroax/locale/English.php";
}
}
else
{
// mFusion environment
$this_lang = LANGUAGE;
if (file_exists(INFUSIONS."the_kroax/locale/".$this_lang.".php"))
{
include INFUSIONS."the_kroax/locale/".$this_lang.".php";
}
else
{
include INFUSIONS."the_kroax/locale/English.php";
}
}
include INFUSIONS."the_kroax/functions.php";
if (isset($panel)) {
require_once BASEDIR."subheader.php";
$read_settingskroax = dbquery("SELECT * FROM ".$db_prefix."kroax_set");
if (dbrows($read_settingskroax) != 0) {
$settingskroax = dbarray($read_settingskroax);
$skroaxembed = $settingskroax['kroax_set_show'];
}
opentable($locale['KROAX201']);
makeheader();
$resultset = dbquery("SELECT * FROM ".$db_prefix."kroax_set WHERE kroax_set_id='1'");
while ($dataset = dbarray($resultset)) {
$moviepage ="".$dataset['kroax_set_pre']."";
$height = "".$dataset['kroax_set_hi']."";
$width = "".$dataset['kroax_set_wi']."";
$latestmovies ="".$dataset['kroax_set_pic']."";
}
echo "<div id='lajv'>";
}
//GET ACCESS LEVEL AND REDIRECT IF CHEAT LOOP IS DETECTED
$detect = dbquery("SELECT kroax_access,kroax_cat FROM ".$db_prefix."kroax WHERE kroax_id='$url'");
while ($detect_access = dbarray($detect)) {
$access = $detect_access['kroax_access'];
$kroax_cat = $detect_access['kroax_cat'];
}
if(checkgroup($access)) {
//PROCEED AS PLANNED
}else{
redirect(INFUSIONS."the_kroax/kroax.php");
}
$detect = dbquery("SELECT kroax_namn_access FROM ".$db_prefix."kroax_kategori WHERE kroax_namn_cat1='$kroax_cat'");
while ($detect_access = dbarray($detect)) {
$access = $detect_access['kroax_namn_access'];
}
if(checkgroup($access)) {
//PROCEED AS PLANNED
}else{
redirect(INFUSIONS."the_kroax/kroax.php");
}
//END DETECTION
$result = dbquery("SELECT * FROM ".$db_prefix."kroax WHERE kroax_id='$url'");
$data = dbarray($result);
$extract_url = dbquery("SELECT kroax_titel,kroax_url,kroax_spare2,kroax_tumb FROM ".$db_prefix."kroax WHERE kroax_id='$url'");
$result = dbquery("UPDATE ".$db_prefix."kroax SET kroax_hits=kroax_hits+1 WHERE kroax_id='$url'");
while ($dataextract = dbarray($extract_url)) {
$url = $dataextract['kroax_url'];
$embed = $dataextract['kroax_spare2'];
$thumb = $dataextract['kroax_tumb'];
$title = $dataextract['kroax_titel'];
}
// WG - mod to select a suitable embedded player
// include the file containing the arrays of accepted file extensions
include INFUSIONS."the_kroax/embeddedextensions.php";
// create a regex to get the file extension
// file extension is allowed to contain 2 to 5 charachers
// both upper and lower case and any digit
$pattern = "/\.[a-zA-Z-0-9]{2,5}$/";
preg_match($pattern, $url, $match);
// test the file extension against the allowed arrays
// and add code for the appropriate media
if (array_search($match[0], $quicktime_extensions) !== FALSE)
{
quicktime_player($url);
}
elseif (array_search($match[0], $windowsmedia_extensions) !== FALSE)
{
windowsmedia_player($url);
}
elseif (array_search($match[0], $flash_extensions) !== FALSE)
{
flash_player($url);
}
elseif (array_search($match[0], $realplayer_extensions) !== FALSE)
{
real_player($url);
}
elseif (array_search($match[0], $not_config) !== FALSE)
{
misc($url);
}
elseif (array_search($match[0], $weird_extensions) !== FALSE)
{
weird_player($url);
}
elseif (array_search($match[0], $flash_flv_extensions) !== FALSE)
{
flvplayer($url);
}
elseif (array_search($match[0], $myspace) !== FALSE)
{
space_player($url);
}
elseif (array_search($match[0], $embed_code) !== FALSE)
{
embed_player($embed);
}
elseif (array_search($match[0], $divx_code) !== FALSE)
{
divx_player($url);
}
elseif (array_search($match[0], $googlevideo) !== FALSE)
{
googleplayer($url);
}
elseif (array_search($match[0], $streammedia) !== FALSE)
{
streammedia($url);
}
else
{
// a player could not be found
echo $locale['WGKROAX001'] . $url . $locale['WGKROAX002'] . $match[0] . $locale['WGKROAX003'];
}
$kroax_comment_count = dbcount("(comment_id)", "comments", "comment_type='K' AND comment_item_id='".$data['kroax_id']."'");
echo "<br><center>
<b>".$data['kroax_titel']."</b> | Autor: ".$data['kroax_uploader']." | Dodano: ".$data['kroax_date']." | Obejrzano: ".$data['kroax_hits']."<br><br>";
rating_bar($data['kroax_id']);
echo "</center>";
echo "<div id='".$data['kroax_id']."' style='display:none'>";
echo '<IFRAME frameborder="0" SRC="'.INFUSIONS.'the_kroax/callcomments.php?comment_id='.$data['kroax_id'].'" width="100%" HEIGHT="200px"></IFRAME>';
echo "</div>";
// quicktime
function quicktime_player($file_url)
{
$theplayer = <<<EOD
<center><table border='0' cellpadding='0' align="center">
<tr>
<td>
<object classid='clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616' width='640' height='500' codebase='http://download.divx.com/player/DivXBrowserPlugin.cab'>
<param name='custommode' value='Stage6' />
<param name='previewImage' value='false' />
<param name='autoPlay' value='false' />
<param name='src' value='$file_url' />
<embed type='video/divx' src='$file_url' custommode='Stage6' width='640' height='500' autoPlay='false' previewImage='false' pluginspage='http://go.divx.com/plugin/download/'>
</embed></object>
</td>
</tr>
<!-- ...end embedded QuickTime file -->
</table></center>
EOD;
echo ($theplayer);
}
// flash
function flash_player($file_url)
{
$theplayer = <<<EOD
<center><table border='0' cellpadding='0' align="center">
<center><b>$title</b></center>
<tr>
<td>
<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'
width="640" height="480">
<param name='movie' value="$file_url">
<param name='quality' value="high">
<param name='bgcolor' value='#FFFFFF'>
<param name='loop' value="false">
<EMBED src="$file_url" quality='high' bgcolor='#FFFFFF' width="640"
height="480" loop="false" type='application/x-shockwave-flash'
pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>
</EMBED>
</OBJECT>
</td>
</tr>
</table></center>
EOD;
echo ($theplayer);
}
// windows media
function windowsmedia_player($file_url)
{
$theplayer = <<<EOD
<center><table border='0' cellpadding='0' align='center'>
<tr>
<td>
<object classid='clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616' width='640' height='500' codebase='http://download.divx.com/player/DivXBrowserPlugin.cab'>
<param name='custommode' value='Stage6' />
<param name='previewImage' value='false' />
<param name='autoPlay' value='false' />
<param name='src' value='$file_url' />
<embed type='video/divx' src='$file_url' custommode='Stage6' width='640' height='500' autoPlay='false' previewImage='false' pluginspage='http://go.divx.com/plugin/download/'>
</embed></object></center>
</td>
</tr>
<!-- ...end link to launch external media player... -->
</table>
EOD;
echo ($theplayer);
}
// real player
function real_player($file_url)
{
$theplayer = <<<EOD
<center><table border='0' cellpadding='0' align="center">
<tr>
<td>
<object classid='clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616' width='640' height='500' codebase='http://download.divx.com/player/DivXBrowserPlugin.cab'>
<param name='custommode' value='Stage6' />
<param name='previewImage' value='false' />
<param name='autoPlay' value='false' />
<param name='src' value='$file_url' />
<embed type='video/divx' src='$file_url' custommode='Stage6' width='640' height='500' autoPlay='false' previewImage='false' pluginspage='http://go.divx.com/plugin/download/'>
</embed></object></center>
</td>
</tr>
<!-- begin control panel... -->
<tr>
<td>
<center><object classid='clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616' width='640' height='500' codebase='http://download.divx.com/player/DivXBrowserPlugin.cab'>
<param name='custommode' value='Stage6' />
<param name='previewImage' value='false' />
<param name='autoPlay' value='false' />
<param name='src' value='$file_url' />
<embed type='video/divx' src='$file_url' custommode='Stage6' width='640' height='500' autoPlay='false' previewImage='false' pluginspage='http://go.divx.com/plugin/download/'>
</embed></object></center>
</td>
</tr>
<!-- ...end control panel -->
<!-- begin link to launch external media player... -->
<tr>
<td align='center'>
<a href="$file_url" style='font-size: 85%;' target='_blank'>Launch in external player</a>
</td>
</tr>
<!-- ...end link to launch external media player... -->
</table>
EOD;
echo ($theplayer);
}
//Misc player
function misc($file_url)
{
$theplayer = <<<EOD
<table border='0' cellpadding='0' align="center">
<tr>
<td>
<a href="$file_url" style='font-size: 140%;' target='_blank'><br>Filen kommer att öppnas i ett nytt fönster, klicka p? textraden</a><br>
</td>
</tr>
<!-- ...end link to launch external media player... -->
</table>
EOD;
echo ($theplayer);
}
// flash with weird extensions
@$file_url = substr($file_url, 0, -4);
function weird_player($file_url)
{
$theplayer = <<<EOD
<center><table border='0' cellpadding='0' align="center">
<tr>
<td>
<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'
width="640" height="480">
<param name='movie' value="$file_url">
<param name='quality' value="high">
<param name='bgcolor' value='#FFFFFF'>
<param name='loop' value="false">
<EMBED src="$file_url" quality='high' bgcolor='#FFFFFF' width="640" height="480" loop="false" type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'>
</EMBED>
</OBJECT>
</td>
</tr>
</table></center>
EOD;
echo ($theplayer);
}
// flash with google
$file_url = substr($file_url, 0, -4);
function googleplayer($file_url)
{
$theplayer = <<<EOD
<table border='0' cellpadding='0' align="center">
<tr>
<td>
<embed style="width:640px; height:480px;" id="VideoPlayback" type="application/x-shockwave-flash" src="$file_url"> </embed>
</td>
</tr>
</table>
EOD;
echo ($theplayer);
}
$file_url = ($file_url);
function flvplayer($file_url) {
global $thumb;
$theplayer = <<<EOD
<table border='0' cellpadding='0' align="center">
<tr>
<td>
<embed src="http://www.jeroenwijering.com/extras/mediaplayer.swf" width="640" height="480" allowfullscreen="true" flashvars="&displayheight=240&file=$file_url&height=480&image=$thumb&width=640" /></td>
</tr>
</table>
EOD;
echo ($theplayer);
}
// flash with myspace
$file_url = substr($file_url, 0, -4);
function space_player($file_url)
{
$theplayer = <<<EOD
<table border='0' cellpadding='0' align="center">
<tr>
<td>
<embed src="http://lads.myspace.com/videos/vplayer.swf" flashvars="$file_url" type="application/x-shockwave-flash" width="640" height="480"></embed>
</td>
</tr>
</table>
EOD;
echo ($theplayer);
}
// Embed test area
$file_url = ($file_url);
function embed_player($file_url)
{
$theplayer = <<<EOD
<table border='0' cellpadding='0' align="center">
$file_url
</table>
EOD;
echo ($theplayer);
}
// DivX/AVI tester
$file_url = ($file_url);
function divx_player($file_url)
{
$theplayer = <<<EOD
<table border='0' cellpadding='0' align="center">
<center><object classid='clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616' width='640' height='500' codebase='http://download.divx.com/player/DivXBrowserPlugin.cab'>
<param name='custommode' value='Stage6' />
<param name='previewImage' value='false' />
<param name='autoPlay' value='false' />
<param name='src' value='$file_url' />
<embed type='video/divx' src='$file_url' custommode='Stage6' width='640' height='500' autoPlay='false' previewImage='false' pluginspage='http://go.divx.com/plugin/download/'>
</embed></object></center>
</table>
EOD;
echo ($theplayer);
}
// streaming media
function streammedia($file_url)
{
$theplayer = <<<EOD
<table border='0' cellpadding='0' align="center">
<tr>
<td>
<object classid='clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616' width='640' height='500' codebase='http://download.divx.com/player/DivXBrowserPlugin.cab'>
<param name='custommode' value='Stage6' />
<param name='previewImage' value='false' />
<param name='autoPlay' value='false' />
<param name='src' value='$file_url' />
<embed type='video/divx' src='$file_url' custommode='Stage6' width='640' height='500' autoPlay='false' previewImage='false' pluginspage='http://go.divx.com/plugin/download/'>
</embed></object>
</td>
</tr>
<!-- ...end embedded WindowsMedia file -->
<!-- begin link to launch external media player... -->
<tr>
<td align='center'>
<a href="$file_url" style='font-size: 85%;' target='_blank'>Launch in external player</a> |
<a href="http://www.iol.ie/~locka/mozilla/plugin.htm#download" style='font-size: 85%;' target='_blank'>Got firefox problems?</a>
</td>
</tr>
<!-- ...end link to launch external media player... -->
</table>
EOD;
echo ($theplayer);
}
if (isset($panel)) {
echo "</div>";
closetable();
echo "<br>";
require_once "footer.php";
require_once BASEDIR."footer.php";
}
?>
|