Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 56 Ответов
  • 43612 Просмотров
*

unclestas

  • Новичок
  • 5
  • 0 / 0
Доброе время суток Всем!!

В ремозитории в файле - com_remository/v-classes/remositoryFileInfoHTML.php
есть функция - function audioPlayer ($link, $title)
явно для всавки плеера xspf player mp3 для предворительного прослушивания файла.
Может кто подскажет, как использовать это хозяийство по назначению? Очень надо!
Или, как прекрутить мп3 плеер чтоб файл послушать можно было прежде чем скачать?
*

unclestas

  • Новичок
  • 5
  • 0 / 0
Господа! Дык что, по теме некому сказать что нибудь  >:(
*

nikonor

  • Давно я тут
  • 513
  • 56 / 0
  • Content Grabber
смотри файл remositoryFileInfoHTML.php
ищи функцию audioPlayer ... я ее переписал так:
Код
function audioPlayer ($link) {
      $live_site = $this->interface->getCfg ('live_site')
      ?>
      <!-- id=FlashMediaPlayer1 -->
      <object type="application/x-shockwave-flash" width="17" height="17"
      data="<?php echo $live_site ?>/components/com_remository/musicplayer.swf?song_url=<?php echo $link ?>">
      <param name="movie"
      value="<?php echo $live_site ?>/components/com_remository/musicplayer.swf?song_url=<?php echo $link ?>" />
      <param name="menu" value="false">
      </object>
      <?php
   }

потом в файл remository.html.php вставляй примерно это (куда - на твое усмотрение :) )
Код
if ($file->filetype=='mp3') { 
 echo "<tr>";
 echo "<td class='name' align='left' valign='middle'>"._DOWN_ART_LISEN."</td>";
 echo "<td class='col2' align='left' valign='middle'>";
  $medialink = $this->repository->RemositoryBasicFunctionMediaURL('download', $file->id, $file->realname);
 require_once ('components/com_remository/v-classes/remositoryFileInfoHTML.php');
      $view =& new remositoryFileInfoHTML($this);
      $view->audioPlayer ($medialink);
echo "</td>";
echo "</tr>";
}

сразу предупреждаю - xspf player работает только с ЧПУ (или попробуй предварительно конвертнуть ссылку на файл в html сущности типа &amp;)
и еще одно но ... каждое прослушивание считается за скачивание, то есть если файл не скачают, а только прослушают счетчик скачиваний всеравно поставит +1
« Последнее редактирование: 18.12.2007, 01:14:07 от nikonor »
*

unclestas

  • Новичок
  • 5
  • 0 / 0
Респект! Буду пытаться реализовать ^-^
*

unclestas

  • Новичок
  • 5
  • 0 / 0
Немогу функцию отыскать RemositoryBasicFunctionMediaURL() :(
*

unclestas

  • Новичок
  • 5
  • 0 / 0
nikonor!  Просто супер! Все работает  :D Огромное спасибо!
*

nikonor

  • Давно я тут
  • 513
  • 56 / 0
  • Content Grabber
на здоровье :)
*

ziArt

  • Осваиваюсь на форуме
  • 16
  • 0 / 0

сразу предупреждаю - xspf player работает только с ЧПУ (или попробуй предварительно конвертнуть ссылку на файл в html сущности типа &amp;)
и еще одно но ... каждое прослушивание считается за скачивание, то есть если файл не скачают, а только прослушают счетчик скачиваний всеравно поставит +1

если можна поподробней насчет чпу, я его включил и по статьям настроил в файле .htacess этого достаточно или нужно установить еще какой нибудь компонент?

и функцию можна вставлять в любое место? куда именно вы вставили?
*

nikonor

  • Давно я тут
  • 513
  • 56 / 0
  • Content Grabber
Достаточно стандартного ЧПУ.
Сама функция audioPlayer должна быть там, где она сейчас и находится ... нужно ее лишь немного изменить (см. выше).
Как ее применять потом смотри на 5 постов выше ... вставляй указанный код куда тебе нужно (там где кнопка плэера наиболее удобна)
*

ziArt

  • Осваиваюсь на форуме
  • 16
  • 0 / 0
Если не сложно прикрепите файл remository.html.php что бы посмотреть куда вписан код. пробовал разные варианты даже кнопку не показывает.
*

nikonor

  • Давно я тут
  • 513
  • 56 / 0
  • Content Grabber
Если не сложно прикрепите файл remository.html.php что бы посмотреть куда вписан код. пробовал разные варианты даже кнопку не показывает.
давай лучше посмотрим как ты делаешь: что и куда вставляешь
*

ziArt

  • Осваиваюсь на форуме
  • 16
  • 0 / 0
сначала
заменил в файле remositoryFileInfoHTML.php
функцию плеера
Код
<?php

/**************************************************************
* This file is part of Remository
* Copyright (c) 2006 Martin Brampton
* Issued as open source under GNU/GPL
* For support and other information, visit http://remository.com
* To contact Martin Brampton, write to martin@remository.com
*
* Remository started life as the psx-dude script by psx-dude@psx-dude.net
* It was enhanced by Matt Smith up to version 2.10
* Since then development has been primarily by Martin Brampton,
* with contributions from other people gratefully accepted
*/

class remositoryFileInfoHTML extends remositoryUserHTML {

function showComment (&$legend, &$comment) {
echo "\n\t\t\t<dt>$legend</dt>";
$legend = '';
if ($this->tabcnt == 0) $class = 'remositorylight';
else $class='remositorydark';
echo "\n\t\t\t<dd class='$class'><em>$comment->name $comment->date</em> $comment->comment</dd>";
$this->tabcnt = ($this->tabcnt+1) % 2;
}

function commentBox ($file) {
$action = $this->repository->RemositoryBasicFunctionURL('fileinfo',$file->id);
    echo "<form method='post' action='$action'>";
echo "\n\t\t\t<dt>"._DOWN_YOUR_COMM;
echo '<p><em>'._DOWN_MAX_COMM.'</em></p>';
echo '</dt><dd>';
echo "<textarea class='inputbox' name='comment' rows='2' cols='35'></textarea>";
echo "\n\t\t\t<input class='button' type='submit' name='submit_comm' value='"._DOWN_LEAVE_COMM."' />";
echo "\n\t\t\t<input type='hidden' name='id' value='$file->id' />";
echo "\n\t\t\t</form></dd>";
}

function URLDisplay ($text, $value) {
echo "\n\t\t\t<dt>$text</dt>";
echo "\n\t\t\t<dd><a href='$value'>"._DOWN_CLICK_TO_VISIT.'</a></dd>';
}

function videoPlayer ($link, $title) {
?>
<!-- id=MediaPlayer1 -->
<object id=mediaplayer1 type=application/x-oleobject
                  height="24" width="320"
                  classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<param name="url" value="<?php echo $link ?>">
<param name="animationatstart" value="true">
<param name="transparentatstart" value="true">
<param name="autostart" value="false">
<param name="showcontrols" value="true">

<embed type="application/x-mplayer2" name="mediaplayer"  autostart="false" loop="false"  width="384" height="364"
        src="<?php echo $link ?>" showcontrols="true">
</embed>
</object>
<?php
}

function audioPlayer ($link) {
      $live_site = $this->interface->getCfg ('live_site')
      ?>
      <!-- id=FlashMediaPlayer1 -->
      <object type="application/x-shockwave-flash" width="17" height="17"
      data="<?php echo $live_site ?>/components/com_remository/musicplayer.swf?song_url=<?php echo $link ?>">
      <param name="movie"
      value="<?php echo $live_site ?>/components/com_remository/musicplayer.swf?song_url=<?php echo $link ?>" />
      <param name="menu" value="false">
      </object>
      <?php
   }

// This is the function that creates the output for a file details page
function fileinfoHTML( &$file, $autodown=0 ) {
$is_video = in_array($file->filetype, array());
$is_audio = in_array($file->filetype, array());
$file->setMetaData();
$thumbnails = new remositoryThumbnails($file);
$submitter = new remositoryUser($file->submittedby,null);
$this->pathwayHTML($file->getContainer());
$forbidden = $file->downloadForbidden($this->remUser, $message);
if ($forbidden AND !$this->repository->See_Files_no_download) {
echo $message;
return;
}
$downloadstuff = $file->filetitle.' ';
if ($file->updatePermitted($this->remUser)) {
$usersubmitstuff = $this->repository->RemositoryFunctionURL('userupdate',$file->id);
$usersubmitstuff .= $this->repository->RemositoryImageURL('edit.gif',32,32);
$usersubmitstuff .= _DOWN_UPDATE_SUB.'</a>';
}
else $usersubmitstuff = '';
$thumbupdatestuff = '';
if ($this->repository->Max_Thumbnails) {
if ($this->remUser->isAdmin() OR
($this->repository->Allow_User_Edit AND $this->remUser->isLogged() AND
($this->remUser->id==$file->submittedby OR ($file->editgroup != 0 AND remositoryGroup::isUserMember($file->editgroup,$this->remUser))))) {
$thumbupdatestuff = $this->repository->RemositoryFunctionURL('thumbupdate',$file->id);
$thumbupdatestuff .= $this->repository->RemositoryImageURL('edit.gif',32,32);
$thumbupdatestuff .= _DOWN_UPDATE_THUMBNAILS.'</a>';
}
}
$thumbimages = $thumbnails->displayAllThumbnails();

echo "\n\t<div id='remositoryfileinfo'>";
if (!$forbidden) {
echo "\n";
?>
<script type="text/javascript">
/* <![CDATA[ */
function download(){window.location = <?php echo $file->downloadURL($autodown); ?>}
/* ]]> */
</script>
<?php
$syndstyle = (remositoryRepository::GetParam($_GET, 'syndstyle', '') == 'yes');
    if ($autodown == 1 AND !$syndstyle AND !$is_video AND !$is_audio) echo '<script type="text/javascript"> window.onload=download; </script>';
    if ($autodown AND $syndstyle) {
echo '<p><strong>In Firefox you can drag and drop the "Download" link to the "Install HTTP URL" box above, in IE you have to right click on "Download" and use "Copy shortcut" and paste into the box above, then click the "Upload URL & Install" button</strong></p>';
}
$downloadstuff .= $file->downloadLink($autodown);
$downloadstuff .= $this->repository->RemositoryImageURL('download_trans.gif');
$downloadstuff .= '<strong> '._DOWNLOAD.'</strong></a>';
}
else $downloadstuff .= $message;
echo "\n\t\t<h2>$downloadstuff</h2>";
if ($autodown) {
    echo '<h3>'._DOWN_THANK_YOU.htmlspecialchars($file->filetitle).'</h3>';
    if (!$syndstyle) {
    if ($is_video) $this->videoPlayer($file->basicDownloadLink($autodown), $file->filetitle);
    elseif ($is_audio) $this->audioPlayer($file->basicDownloadLink($autodown), $file->filetitle);
    else echo '<h4>'._DOWN_WAIT_OR_CLICK.'</h4>';
    }
    if ($file->download_text) echo $file->download_text;
    else echo $this->repository->download_text;
}
if ($thumbupdatestuff OR $thumbimages OR $usersubmitstuff) {
echo "\n\t\t<div id='remositorythumbbox'>";
echo "\n\t\t\t<div id='remositorycmdbox'>";
echo "\n\t\t\t<p>"._DOWN_THUMBNAILS."</p>";
if ($thumbupdatestuff) echo "\n\t\t\t<p class='remositorycommand'>$thumbupdatestuff</p>";
if ($usersubmitstuff) echo "\n\t\t\t<p class='remositorycommand'>$usersubmitstuff</p>";
echo '</div>';
echo "$thumbimages";
echo "\n\t\t<!-- End of remositorythumbbox -->";
echo "\n\t\t</div>";
}
echo "\n\t\t<dl>";
if ($this->remUser->isAdmin()) $this->fileOutputBox(_DOWN_PUB, ($file->published ? _YES : _NO));
if ($file->description) $this->fileOutputBox(_DOWN_DESC, $file->description, false);
if (($file->licenseagree==0) AND ($file->license<>'')) $this->fileOutputBox (_DOWN_LICENSE, $file->license);
if ($file->submitdate<>'') $this->fileOutputBox (_DOWN_SUB_DATE, date ($this->repository->Date_Format, $this->controller->revertFullTimeStamp($file->submitdate)));
if ($file->submittedby<>'') $this->fileOutputBox (_DOWN_SUB_BY, $submitter->fullname().' ('.$submitter->name.')');
if ($file->filedate<>'') $this->fileOutputBox (_DOWN_FILE_DATE, date($this->repository->Date_Format,$this->controller->revertFullTimeStamp($file->filedate)));
if ($file->fileauthor<>'') $this->fileOutputBox (_DOWN_FILE_AUTHOR, $file->fileauthor);
if ($file->fileversion<>'') $this->fileOutputBox (_DOWN_FILE_VER, $file->fileversion);
if ($file->filesize<>'') $this->fileOutputBox (_DOWN_FILE_SIZE, $file->filesize);
if ($file->filetype<>'') $this->fileOutputBox (_DOWN_FILE_TYPE, $file->filetype);
if ($file->filehomepage<>'') $this->URLDisplay (_DOWN_FILE_HOMEPAGE, $file->filehomepage);
$this->fileOutputBox (_DOWN_DOWNLOADS, $file->downloads);
if ($this->repository->Allow_Votes) $this->voteDisplay($file, true);
// The following block of code provides the comment facility
// If you want to replace it with Jom Comment, remove this block and replace it with:
// $interface =& remositoryInterface::getInstance();
// include_once($interface->getCfg('absolute_path').'/mambots/content/jom_comment_bot.php');
// echo jomcomment($file->id, "com_remository");
if ($this->repository->Allow_Comments) {
$commentsdb = $file->getComments();
if ($commentsdb){
$this->tabcnt = 1;
$legend = _DOWN_COMMENTS;
foreach ($commentsdb as $comment) $this->showComment($legend, $comment);
}
else {
$legend = $this->remUser->isLogged() ? _DOWN_FIRST_COMMENT : _DOWN_FIRST_COMMENT_NL;
$this->fileOutputBox('', '<strong>'.$legend.'</strong>');
}
if ($this->remUser->isLogged()) $this->commentBox($file);
// include_once('components/com_reviews/reviews.class.php');
// include_once('components/com_reviews/reviews.html.php');
// echo HTML_reviews::listItemCommentsHTML('com_remository',$file->id);
// echo HTML_reviews::solicitCommentHTML('com_remository', $file->id, "&func=fileinfo&id=$file->id");
}
// End of code for Remository comment facility
echo "\n\t</dl>";
echo "\n\t<!-- End of remositoryfileinfo -->";
echo "\n\t</div>";
if ($file->plaintext) {
echo "\n\t\t<div id='remositoryplaintext'>";
  highlight_string($file->getPlainText());
  echo "\n\t\t</div>";
}
}
}

?>

далее вставляю воторой код в файл remository.html.php

Код
<?php

/**************************************************************
* This file is part of Remository
* Copyright (c) 2006 Martin Brampton
* Issued as open source under GNU/GPL
* For support and other information, visit http://remository.com
* To contact Martin Brampton, write to martin@remository.com
*
* Remository started life as the psx-dude script by psx-dude@psx-dude.net
* It was enhanced by Matt Smith up to version 2.10
* Since then development has been primarily by Martin Brampton,
* with contributions from other people gratefully accepted
*/

class remositoryUserHTML {
var $controller = '';
var $repository = '';
var $interface = '';
var $remUser = '';
var $submitok = false;
var $submit_text = '';
var $orderby = 2;
var $mainpicture = '';

function remositoryUserHTML (&$controller) {
$this->controller = $controller;
$this->interface =& remositoryInterface::getInstance();
$this->repository = $controller->repository;
$this->mainpicture = $this->repository->headerpic;
$thumb_width_x = $this->repository->Small_Image_Width + 40;
$thumb_height_y = $this->repository->Small_Image_Height + 50;

$css = <<<end_css
<style type='text/css'>
/* Remository specific CSS requiring variables */
#remositorypageheading {
background-image: url($this->mainpicture);
}
.remositoryfilesummary
{
margin-right: {$thumb_width_x}px;
}
.remositorydelthumb {
height: {$thumb_height_y}px;
}
/* End of variable Remository CSS */
</style>
end_css;

$this->interface->addCustomHeadTag($css);

$basepath = $this->interface->getCfg('live_site');
$css = "\n<link href='$basepath/components/com_remository/remository.css' rel='stylesheet' type='text/css' />";
$this->interface->addCustomHeadTag($css);

$this->remUser = $controller->remUser;
$this->submitok = $controller->submitok;
$this->submit_text = $controller->submit_text;
$this->orderby = $controller->orderby;
}

function fileOutputBox ($title, $value, $suppressHTML=false) {
    if ($suppressHTML) $value = htmlspecialchars($value);
echo <<<OUTPUT_BOX
<dt>$title</dt>
<dd>
  $value
</dd>
OUTPUT_BOX;
}

function mainPageHeading ($belowTop) {
$title = _DOWNLOADS_TITLE;
if ($title OR $this->mainpicture) {
if ($belowTop) $headlevel = 'h3';
else $headlevel = 'h3';
echo "\n\t<div id='remositorypageheading'>";
// if ($this->mainpicture != '') echo "\n\t\t<img src='$this->mainpicture' alt='Header'/>";
echo "\n\t\t<$headlevel>$title ";
// The following three lines create RSS links - remove if not required
// End of RSS link code
echo "</$headlevel>";
echo "\n\t<!-- End of remositorypageheading-->";
echo "\n\t</div>\n";
}
}

function remositoryCredits () {
echo "\n\t<div id='remositorycredits'>";
echo "\n\t\t<a href='http://www.remository.com'></a> <a href='http://www.black-sheep-research.com'></a>";
echo "\n\t<!-- End of remositorycredits-->";
echo "\n\t</div>\n";
}

function pathwayHTML ($parent) {
echo "\n\t<div id='remositorypathway'>";
echo "\n\t\t".$this->repository->RemositoryFunctionURL().$this->repository->RemositoryImageURL('gohome.gif').' '._MAIN_DOWNLOADS.'</a>';
if ($parent) {
echo "\n\t\t";
$parent->showPathway();
}
echo "\n\t<!-- End of remositorypathway-->";
echo "\n\t</div>\n";
}

function filesFooterHTML () {
echo "\n\t<div id='remositoryfooter'>";
echo "\n\t\t<div id='left'>";
echo $this->repository->RemositoryFunctionURL('search');
echo $this->repository->RemositoryImageURL('search.gif');
echo _DOWN_SEARCH.'</a></div>';

echo "\n\t\t<div id='right'>";
if ($this->submitok) {
$idparm = remositoryRepository::GetParam($_REQUEST, 'id', 0);
echo $this->repository->RemositoryFunctionURL('addfile', $idparm);
}
echo $this->repository->RemositoryImageURL('add_file.gif');
if ($this->submitok) echo _SUBMIT_FILE_BUTTON.'</a>';
else echo $this->submit_text;
echo '</div>';
echo "\n\t<!-- End of remositoryfooter-->";
echo "\n\t</div>\n";
}

function fileListing ($file, $container, $downlogo, $remUser, $showContainer = false) {
$thumbnails = new remositoryThumbnails($file);
$downlink = $this->repository->RemositoryFunctionURL('fileinfo',$file->id);
if ($file->icon == '') $downlink .= $this->repository->RemositoryImageURL('stuff1.gif');
else $downlink .= $this->repository->RemositoryImageURL('file_icons/'.$file->icon);
$downlink .= $file->filetitle.'</a>';


if ($this->repository->Enable_List_Download AND is_object($container) AND $container->isDownloadable($this->remUser)) {
$downlink .= $file->downloadLink(0).' '.$downlogo.' '._DOWNLOAD.'</a>';

if ($file->filetype=='mp3') {
 echo "<table><tr>";
 echo "<td class='name' align='left' valign='middle'>"._DOWN_ART_LISEN."</td>";
 echo "<td class='col2' align='left' valign='middle'>";
  $medialink = $this->repository->RemositoryBasicFunctionMediaURL('download', $file->id, $file->realname);
 require_once ('components/com_remository/v-classes/remositoryFileInfoHTML.php');
      $view =& new remositoryFileInfoHTML($this);
      $view->audioPlayer ($medialink);
echo "</td>";
echo "</tr></table>";
}

}
if ($showContainer AND is_object($container)) $downlink .= ' ('.remositoryRepository::RemositoryFunctionURL('select', $container->id).$container->name.'</a>)';
echo "\n\t\t<div class='remositoryfileblock'>";
echo "\n\t\t\t<h3>$downlink</h3>";


    echo "\n\t\t\t<div class='remositoryonethumb'>";
                echo "\n\t\t\t".$thumbnails->displayOneThumbnail();
    echo "\n\t\t\t<!-- End of remositoryonethumb -->";
    echo "\n\t\t\t</div>";

echo "\n\t\t\t<div class='remositoryfilesummary'><dl>";


          if ($remUser->isAdmin()) $this->fileOutputBox(_DOWN_PUB, ($file->published == 1 ? _YES : _NO), false);

// The following lines show file details - comment out any that are not wanted (use // in front)
if ($file->smalldesc<>'') $this->fileOutputBox(_DOWN_DESC_SMALL, $file->smalldesc, !$file->autoshort);
if ($file->submittedby) {
    $submitter =& new remositoryUser($file->submittedby);
    $this->fileOutputBox(_DOWN_SUB_BY, $submitter->name);
        }
if ($file->submitdate<>'') $this->fileOutputBox(_DOWN_SUB_DATE, date ($this->repository->Date_Format, $this->controller->revertFullTimeStamp($file->submitdate)));
if ($file->filesize<>'') $this->fileOutputBox(_DOWN_FILE_SIZE, $file->filesize);
$this->fileOutputBox(_DOWN_DOWNLOADS, $file->downloads);

if ($this->repository->Allow_Votes) $this->voteDisplay($file, false);
echo "\n\t\t\t<!-- End of remositoryfilesummary -->";
echo "\n\t\t\t</dl></div>";
echo "\n\t\t<!-- End of remositoryfileblock -->";
echo "\n\t\t</div>";

}

function voteDisplay (&$file, $entry) {
echo "\n";
?>
<dt><?php echo _DOWN_RATING; ?></dt>
<dd>
<div class='remositoryrating'><?php echo $this->repository->RemositoryImageURL('stars/'.$file->evaluateVote().'.gif',64,12);
echo _DOWN_VOTES;
echo round($file->vote_count); ?></div>
<?php
if ($entry AND $this->remUser->isLogged() AND !$file->userVoted($this->remUser)) {
$formurl = sefRelToAbs('index.php?option=com_remository&Itemid='.$this->interface->getCurrentItemid().'&func=fileinfo&id='.$file->id);
?>
<div>
<form method="post" action="<?php echo $formurl; ?>">
<select name="user_rating" class="inputbox">
<option value="0">?</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<input class="button" type="submit" name="submit_vote" value="<?php echo _DOWN_RATE_BUTTON; ?>" />
<input type="hidden" name="id" value="<?php echo $file->id; ?>" />
</form>
</div>
<?php
}
echo "\n\t\t\t\t</dd>";
}

// Not presently used in Remository, but kept here for potential value of the code
function multiOptionList ($name, $title, $options, $current, $tooltip=null) {
$alternatives = explode(',',$options);
$already = explode(',', $current);
?>
<tr>
    <td width="30%" valign="top" align="right">
  <b><?php echo $title; ?></b>&nbsp;
    </td>
    <td valign="top">
<?php
foreach ($alternatives as $one) {
if (in_array($one,$already)) $mark = 'checked="checked"';
else $mark = '';
$value = $name.'_'.$one;
echo "<input type=\"checkbox\" name=\"$value\" $mark />$one";
}
if ($tooltip) echo '&nbsp;'.tooltip($tooltip);
echo '</td></tr>';
}

function tooltip ($text) {
return '<a href="javascript:void(0)"  onmouseover="return escape('."'".$text."'".')">'.RemositoryRepository::RemositoryImageURL('tooltip.png').'</a>';
}

}

?>

 у меня даже кнопку не выводит

если опция показа в списке ссилки скачать включена то вообще ошибка на странице, ну а если отключена то по то все работает ну кроме, ну кнопка и не должна тогда работать в принципе
« Последнее редактирование: 22.01.2008, 11:16:33 от ziArt »
*

nikonor

  • Давно я тут
  • 513
  • 56 / 0
  • Content Grabber
Цитировать
то вообще ошибка на странице
что за ошибка?
Некоторые нюансы:
  • надеюсь ты не забыл положить сам проигрыватель в components/com_remository/ и назвать его musicplayer.
  • проигрыватель будет отображаться только если файл имеет расширение mp3 (это прописано в условии).
  • в коде осталось кой чего от моей модификации, поэтому давай что б было более корректно немного изменим код вот так:

Код
if ($file->filetype=='mp3') { // mp3 - расширение файла, при котором отображается проигрыватель
 echo "<table><tr>";
 echo "<td align='left' valign='middle'>Прослушать</td>";
 echo "<td align='left' valign='middle'>";
  $medialink = $this->repository->RemositoryBasicFunctionMediaURL('download', $file->id, $file->realname);
  require_once ('components/com_remository/v-classes/remositoryFileInfoHTML.php');
  $view =& new remositoryFileInfoHTML($this);
  $view->audioPlayer ($medialink);
echo "</td>";
echo "</tr></table>";
}
*

ziArt

  • Осваиваюсь на форуме
  • 16
  • 0 / 0
плеер есть, вернее я взял кнопку с сайта и закинул в папку

функцию исправил, в какое бы место не вставлял имею то что на рисунке

если функцию закоментировать, сайт отображается нормально вообще мучусь вот здесь www.ncholiday.com.ua




[вложение удалено Администратором]
*

adold

  • Новичок
  • 7
  • 0 / 0
  • "Всякое бывает. Но не с каждым."
Уважаемый, nikonor
У меня точно такая же ошибка как и у ziArt картинка точь в точь, единственное что я понял ошибка пропадает, но и кнопка не работает если закоментировать строчку
$medialink = $this->repository->RemositoryBasicFunctionMediaURL('download', $file->id, $file->realname);

Что может быть в ней не так? может функции такой нету, может ещё что... и где вообще она прописана?

*

nikonor

  • Давно я тут
  • 513
  • 56 / 0
  • Content Grabber
открываем файл p-classes/remositoryRepository.php строка примерно 2171 ищем
Код
function RemositoryBasicFunctionURL
после это функции (она заканчивается вот так
Код
return $sefurl;

   }
) вставляем это
Код
 function RemositoryBasicFunctionMediaURL ($func=null, $idparm=null, $fname=null ) {

$interface =& remositoryInterface::getInstance();
$database =& $interface->getDB();

if (!class_exists('aliroRequest')) {
if (isset($GLOBALS['remosef_itemids']['com_remository'])) $Itemid = $GLOBALS['remosef_itemids']['com_remository'];
else {
$database->setQuery("SELECT id, (CASE menutype WHEN 'mainmenu' THEN 1 WHEN 'topmenu' THEN 2 WHEN 'othermenu' THEN 3 ELSE 99 END) menorder"
." FROM #__menu WHERE link = 'index.php?option=com_remository' AND published=1 ORDER BY menorder");
$GLOBALS['remosef_itemids']['com_remository'] = $Itemid = $database->loadResult();
}
$url = 'index.php?option=com_remository&Itemid=';
            $url .= intval($Itemid);
}
else $url = 'index.php?option=com_remository';
if ($func) $url .= '&func='.$func;
if ($idparm) $url .= '&id='.$idparm;
        $url .= '&chk='.$this->makeCheck($idparm,$func).'&no_html=1';
        $url .= '&fname='.urlencode($fname);

if (function_exists('sefRelToAbs')) $url = sefRelToAbs($url);
$ampreg = '/\&([^amp;])/';
$url = preg_replace ($ampreg, '&amp;$1', $url);
return $url;

}
на всякий случай плэер в атаче

[вложение удалено Администратором]
« Последнее редактирование: 23.01.2008, 12:33:44 от nikonor »
*

adold

  • Новичок
  • 7
  • 0 / 0
  • "Всякое бывает. Но не с каждым."
Remository 3.42

Код
<?php

/**************************************************************
* This file is part of Remository
* Copyright (c) 2006 Martin Brampton
* Issued as open source under GNU/GPL
* For support and other information, visit http://remository.com
* To contact Martin Brampton, write to martin@remository.com
*
* Remository started life as the psx-dude script by psx-dude@psx-dude.net
* It was enhanced by Matt Smith up to version 2.10
* Since then development has been primarily by Martin Brampton,
* with contributions from other people gratefully accepted
*/

// Don't allow direct linking
if (!defined( '_VALID_MOS' ) AND !defined('_JEXEC')) die( 'Direct Access to this location is not allowed.' );

$remository_dir = str_replace('\\','/',dirname(__FILE__));
require_once ($remository_dir.'/com_remository_constants.php');

if (!class_exists('aliroRequest')) {
        require_once($remository_dir.'/remository.interface.php');
        require_once ($remository_dir.'/p-classes/remositoryFile.php');
        require_once ($remository_dir.'/p-classes/remositoryTempFile.php');
        require_once ($remository_dir.'/p-classes/remositoryPhysicalFile.php');
        require_once ($remository_dir.'/p-classes/remositoryContainerManager.php');
        require_once ($remository_dir.'/p-classes/remositoryContainer.php');
        require_once ($remository_dir.'/p-classes/remositoryUser.php');
        require_once ($remository_dir.'/p-classes/remositoryGroup.php');
        require_once ($remository_dir.'/p-classes/remositoryRepository.php');
        require_once ($remository_dir.'/p-classes/remositoryDirectory.php');
        require_once ($remository_dir.'/p-classes/remositoryThumbnails.php');
        require_once ($remository_dir.'/p-classes/remositoryComment.php');
        require_once ($remository_dir.'/p-classes/remositoryLogEntry.php');
}

/**
* Abstract class for Remository classes that involve straightforward database tables
* Requires child classes to implement: tableName(), notSQL().
* tableName() must return the name of the database table, using #__ in the usual Mambo way
* notSQL() must return an array of strings, where each string is the name of a
*         variable that is NOT in the database table, or is not written explicitly,
*   e.g. the auto-increment key.  If this is the ONLY non-SQL field, then the
*   child class need not implement it, as that it is already in the abstract class.
* Child classes may optionally implement: forcebools().
*/

class remositoryAbstract {
        /** @var int ID for file record in database */
        var $id=0;
        /** @var int Sequencing number for records */
        var $sequence=0;
        /** @var string Window Title */
        var $windowtitle='';
        /** @var string Keywords */
        var $keywords='';

        function remositoryAbstract () {
                die ('Cannot instantiate remositoryAbstract');
        }

        function addPostData () {
                foreach (get_class_vars(get_class($this)) as $field=>$value) {
                        if ($field!='id' AND isset($_POST[$field])) {
                                $this->$field = trim($_POST[$field]);
                        }
                }
                $this->forceBools();
          }

        function forceBools () {
        }

        function updateObjectDB () {
                remositoryRepository::doSQL($this->updateSQL());
        }

        function timeStampField () {
                return '';
        }

        function prepareValues () {
                $interface =& remositoryInterface::getInstance();
                foreach (get_class_vars(get_class($this)) as $field=>$value) {
                        if (!is_numeric($this->$field)) $this->$field = $interface->getEscaped($this->$field);
                }
        }

        function updateSQL () {
                $interface =& remositoryInterface::getInstance();
                $tabname = $this->tableName();
                $sql = "UPDATE $tabname SET ";
                $exclude = $this->notSQL();
                foreach (get_class_vars(get_class($this)) as $field=>$value) {
                        if (!in_array($field,$exclude)) {
                                $data = is_numeric($this->$field) ? $this->$field : $interface->getEscaped($this->$field);
                                $item[] = $field."='".$data."'";
                        }
                }
                if ($this->timeStampField()) $item[] = $this->timeStampField()."='".date('Y-m-d H:i:s')."'";
                if (isset($item)) {
                        $sql .= implode (', ', $item);
                }
                return $sql.' WHERE id='.$this->id;
        }

        function notSQL () {
                return array ('id');
        }

        function insertSQL () {
                $interface =& remositoryInterface::getInstance();
                $tabname = $this->tableName();
                $exclude = $this->notSQL();
                foreach (get_class_vars(get_class($this)) as $field=>$value) {
                        if (!in_array($field,$exclude)) {
                                $column[] = $field;
                                $data = is_numeric($this->$field) ? $this->$field : $interface->getEscaped($this->$field);
                                $item[] = "'".$data."'";
                        }
                }
                $timestamp = $this->timeStampField();
                if ($timestamp) {
                        $column[] = $timestamp;
                        $item[] = "'".date('Y-m-d H:i:s')."'";
                }
                $columns = implode(',', $column);
                $datafields = implode(',', $item);
                return "INSERT INTO $tabname ($columns) VALUES($datafields)";
        }

        function setValues (&$anObject) {
                foreach (get_class_vars(get_class($this)) as $field=>$value) {
                        if ($field != 'id' AND isset($anObject->$field)) $this->$field = $anObject->$field;
                }
        }

        function readDataBase($sql) {
                $interface =& remositoryInterface::getInstance();
                $database =& $interface->getDB();
                $database->setQuery( $sql );
                if (!$database->loadObject($this)) $this->id = 0;
        }

        function lastPart ($field, $separator, $lowercase=true) {
        $split_array = explode ( $separator, $field);
                $last = $split_array[count($split_array)-1];
                if ($lowercase) return strtolower($last);
                return $last;
        }

        function allButLast ($field, $separator) {
                $last = remositoryAbstract::lastPart($field,$separator);
                return substr($field,0,strlen($field)-strlen($last)-1);
        }

        function visibilitySQL (&$user, $see_objects) {
                $sql = '';
                if (!$user->isAdmin()) {
                        $sql .= " AND f.published=1";
                        if (!$see_objects) {
                                $grouplist = remositoryGroup::getMembersGroupList ($user);
                                if (strlen($grouplist)) $sql .= " AND ((f.registered & 2) OR ((f.userupload & 2) AND f.groupid IN ($grouplist)))";
                                else $sql .= " AND (f.registered & 2)";
                        }
                }
                return $sql;
        }

}

?>
*

adold

  • Новичок
  • 7
  • 0 / 0
  • "Всякое бывает. Но не с каждым."
remositoryRepository.php

Код
<?php

/**************************************************************
* This file is part of Remository
* Copyright (c) 2006 Martin Brampton
* Issued as open source under GNU/GPL
* For support and other information, visit http://remository.com
* To contact Martin Brampton, write to martin@remository.com
*
* Remository started life as the psx-dude script by psx-dude@psx-dude.net
* It was enhanced by Matt Smith up to version 2.10
* Since then development has been primarily by Martin Brampton,
* with contributions from other people gratefully accepted
*/

class remositoryRepository extends remositoryAbstract {

        /** @var string Remository version number */
        var $version='';
        /** @var book Default to database to store files */
        var $Use_Database='1';
        /** @var string Table classes */
        var $tabclass=null;
        /** @var string Table headers */
        var $tabheader=null;
        /** @var string URL to header picture */
        var $headerpic=null;
        /** @var array Permitted file extensions */
        var $ExtsOk=null;
        /** @var string Download file path */
        var $Down_Path=null;
        /** @var string Upload file path */
        var $Up_Path=null;
        /** @var int Length of full description (maximum) */
        var $Large_Text_Len=null;
        /** @var int Length of short description (maximum) */
        var $Small_Text_Len=null;
        /** @var int Small Image width (pixels) */
        var $Small_Image_Width=null;
        /** @var int Small Image height (pixels) */
        var $Small_Image_Height=null;
        /** @var int Large Image width (pixels) */
        var $Large_Image_Width=null;
        /** @var int Large Image height (pixels) */
        var $Large_Image_Height=null;
        /** @var bool Allow Large images to be popped up */
        var $Allow_Large_Images=1;
        /** @var int Maximum file size in Kbytes */
        var $MaxSize=null;
        /** @var int Maximum uploads per user per day */
        var $Max_Up_Per_Day=null;
        /** @var int Maximum downloads per user per day */
        var $Max_Down_Per_Day=null;
        /** @var int Maximum downloads per file per day */
        var $Max_Down_File_Day=null;
        /** @var int Maximum space allowed for files directory */
        var $Max_Up_Dir_Space=null;
        /** @var int Number of favourites to be marked by a registered user */
        var $Favourites_Max=null;
        /** @var int Maximum number of thumbnail image files, 0 = use URL in file data */
        var $Max_Thumbnails=0;
        /** @var bool Make automatic thumbnail for image file */
        var $Make_Auto_Thumbnail=0;
        /** @var string Default Version Number */
        var $Default_Version=null;
        /** @var string Date format string for PHP data function  */
        var $Date_Format=null;
        /** @var bool Anti Leach in effect */
        var $Anti_Leach=null;
        /** @var bool Allow uploads that overwrite an earlier file */
        var $Allow_Up_Overwrite=null;
        /** @var bool Allow users to submit files */
        var $Allow_User_Sub=null;
        /** @var bool Allow users to edit existing file information */
        var $Allow_User_Edit=null;
        /** @var bool Allow users to delete the files they submitted */
        var $Allow_User_Delete=null;
        /** @var bool Allow users to upload files */
        var $Allow_User_Up=null;
        /** @var bool Enable Auto approve and publish for admin */
        var $Enable_Admin_Autoapp=null;
        /** @var bool Enable Auto approve and publish for registered users */
        var $Enable_User_Autoapp=null;
        /** @var bool Allow comments on files */
        var $Allow_Comments=null;
        /** @var bool Allow votes on files */
        var $Allow_Votes=null;
        /** @var bool Enable downloads directly from a list of files */
        var $Enable_List_Download=null;
        /** @var bool Show pathway through filebase */
        var $User_Remote_Files=null;
        /** @var bool Let users see containers where download not permitted */
        var $See_Containers_no_download='1';
        /** @var bool Let users see files that are not permitted to be downloaded */
        var $See_Files_no_download='1';
        /** @var bool Send mail when a file is submitted */
        var $Send_Sub_Mail=null;
        /** @var string Submit Mail Alt Add */
        var $Sub_Mail_Alt_Addr=null;
        /** @var string Submit Mail Alt Name */
        var $Sub_Mail_Alt_Name=null;
        /** @var time Timestamp for authentication */
        var $Time_Stamp;
        /** @var string Information to be displayed during download */
        var $download_text = '';

        function remositoryRepository () {
                $interface =& remositoryInterface::getInstance();
                $database =& $interface->getDB();
                if (true OR $type=='GLOBAL') {
                        $mosConfig_live_site = $interface->getCfg('live_site');
                        $sql = "SELECT * FROM #__downloads_repository WHERE id=0";
                        $database->setQuery($sql);
                        if (!$database->loadObject($this)) {
                                $mosConfig_absolute_path = $interface->getCfg('absolute_path');
                                require ($mosConfig_absolute_path.'/components/com_remository/com_remository_settings.php');
                                $this->id = 0;
                                foreach (get_class_vars(get_class($this)) as $k=>$v) {
                                        if(isset($$k)) $this->$k = $$k;
                                        else $this->$k = '';
                                }
                                $this->saveValues();
                        }
                }
                foreach (get_class_vars(get_class($this)) as $k=>$v) {
                        $this->$k = str_replace ('{live_site}', $mosConfig_live_site, $this->$k);
                }
        }

    function &getInstance () {
        static $instance;
        if (!is_object($instance)) $instance = new remositoryRepository();
        return $instance;
    }

        function tableName () {
                return '#__downloads_repository';
        }

        function getVarText() {
                $txt = '';
                $this->Time_Stamp = time();
                foreach (get_class_vars(get_class($this)) as $k=>$v) {
                        if (substr($k,0,1) != '_') {
                                if (is_numeric($this->$k)){
                                        $txt .= "\$$k = ".intval($this->$k).";\n";
                                } elseif (strlen($k) > 0) $txt .= "\$$k = \"".addslashes( $this->$k )."\";\n";
                        }
                }
                return $txt;
        }

        function saveValues () {
                $interface =& remositoryInterface::getInstance();
                $database =& $interface->getDB();
                $this->forceBools();
                $this->id = 0;
                $sql = 'SELECT COUNT(id) FROM #__downloads_repository WHERE id = 0';
                $database->setQuery($sql);
                if ($database->loadResult()) $sql = $this->updateSQL();
                else $sql = $this->insertSQL();
                remositoryRepository::doSQL ($sql);
        }

        function searchRepository($search_text, $seek_title, $seek_desc, &$user) {
                if (!$search_text) return array();
                $sql = remositoryFile::searchFilesSQL($search_text, $seek_title, $seek_desc, $user, $this);
                return $this->doSQLget($sql,'remositoryFile');
        }

        function badExtension ($filepath) {
                $ext = $this->lastPart($filepath, '.');
                if (trim($this->ExtsOk) != '*' AND !in_array($ext,$this->getExtensionsOK())) {
                        echo "<script> alert('"._ERR4."'); window.history.go(-1); </script>\n";
                        return true;
                }
                return false;
        }

        function getUploadLimit () {
                return $this->maxUploads;
        }

    function canUserSubmit () {
            return $this->userSubmit;
    }

        function getTableClasses () {
                return explode(",",$this->tabclass);
        }

        function getExtensionsOK () {
                return explode(",",strtolower($this->ExtsOk));
        }

        function getSelectList ($allowTop, $default, $type, $parm, &$user, $usable=false) {
                if ($allowTop) $selector[] = $this->makeOption(0,_DOWN_NO_PARENT);
                else $selector = array();
                $manager =& remositoryContainerManager::getInstance();
                foreach ($manager->getCategories() as $category) $category->addSelectList('', $selector, null, $user, $usable);
                if (count($selector)) return $this->selectList( $selector, $type, $parm, $default );
                else return '';
        }

        function &getIcons ($location) {

                $interface =& remositoryInterface::getInstance();

                $mosConfig_live_site = $interface->getCfg('live_site');
                $iconList='';
                $handle=@opendir($interface->getCfg('absolute_path').'/components/com_remository/images/'.$location);
                if ($handle) {
                        $ss = 0;
                        while (($file = readdir($handle))!==false) {
                                if ($file != "." && $file != "..") {
                                        $iconList.="\n\t\t\t\t<a href=\"JavaScript:paste_strinL('{$file}')\" onmouseover=\"window.status='{$file}'; return true\"><img src=\"{$mosConfig_live_site}/components/com_remository/images/{$location}/{$file}\" width=\"32\" height=\"32\" alt=\"{$file}\" /></a>&nbsp;&nbsp;";
                                        /*
                                $ss++;
                                        if ($ss>=10) {
                                                $ss = 0;
                                                $iconList.="<br/>\n";
                                        }
                                        */
                                }
                        }
                           closedir($handle);
                        if ($iconList=='') $iconList="_DOWN_NOT_AUTH";
                }
                return $iconList;
        }

        function &requireCategories () {
                $manager =& remositoryContainerManager::getInstance();
                $cats = $manager->getCategories();
                if (count($cats)==0){
                        echo "<script> alert('"._DOWN_NO_CAT_DEF."'); </script>\n";
                        $interface =& remositoryInterface::getInstance();
                        $interface->redirect( "index2.php?option=com_remository" );
                }
                return $cats;
        }

        function resetCounts ($chain=null) {
                $manager =& remositoryContainerManager::getInstance();
                $categories = $manager->getCategories();
                if (is_array($chain)) $this->doSQL('TRUNCATE TABLE #__downloads_structure');
                foreach ($categories as $category) $category->setFileCount($chain);
        }

        function getFiles ($search='', $limitstart=0, $limit=0) {
                $sql = remositoryFile::getFilesSQL(true, false, 0, true, 2, $search, $limitstart, $limit);
                return $this->doSQLget($sql,'remositoryFile');
        }

        function getFilesCount ($search) {
                $interface =& remositoryInterface::getInstance();
                $database =& $interface->getDB();
                $sql = remositoryFile::getFilesSQL(true, true, 0, true, 2, $search);
                $database->setQuery( $sql );
                return $database->loadResult();
        }

        function getTempFiles () {
                $sql = "SELECT * FROM #__downloads_files WHERE metatype > 0 ORDER BY id";
                $results = $this->doSQLget($sql,'remositoryTempFile');
                foreach ($results as $key=>$result) $results[$key]->containerid = -$result->containerid;
                return $results;
        }

        function RemositoryFunctionURL ($func=null, $idparm=null, $os=null, $orderby=null, $item=null) {

                return '<a href="'.remositoryRepository::RemositoryBasicFunctionURL($func,$idparm,$os,$orderby,$item).'">';

        }

        function RemositoryBasicFunctionURL ($func=null, $idparm=null, $os=null, $orderby=null, $item=null, $fname=null ) {

                $interface =& remositoryInterface::getInstance();
                $database =& $interface->getDB();

                if (!class_exists('aliroRequest')) {
                        if (isset($GLOBALS['remosef_itemids']['com_remository'])) $Itemid = $GLOBALS['remosef_itemids']['com_remository'];
                        else {
                                $database->setQuery("SELECT id, (CASE menutype WHEN 'mainmenu' THEN 1 WHEN 'topmenu' THEN 2 WHEN 'othermenu' THEN 3 ELSE 99 END) menorder"
                                        ." FROM #__menu WHERE link = 'index.php?option=com_remository' AND published=1 ORDER BY menorder");
                                $GLOBALS['remosef_itemids']['com_remository'] = $Itemid = $database->loadResult();
                        }
                        $url = 'index.php?option=com_remository&Itemid=';
                        if ($item) $url .= $item;
                        else $url .= intval($Itemid);
                }
                else $url = 'index.php?option=com_remository';
                if ($func) $url .= '&func='.$func;
                if ($idparm) $url .= '&id='.$idparm;
                if (!$os) $os = remositoryRepository::getParam($_REQUEST,'os',null);
                if (!in_array($os,array('win','mac','linux','all'))) $os = null;
                if ($os AND $os != 'All') $url .= '&os='.$os;
                if ($orderby) $url .= '&orderby='.$orderby;
                if ($func == 'download') $url .= '&chk='.$this->makeCheck($idparm,$func).'&no_html=1';
                elseif ($func == 'rss') $url .= '&no_html=1';
                // if ($fname) $url .= '&fname='.urlencode($fname);

                if (function_exists('sefRelToAbs')) $url = sefRelToAbs($url);
                $ampreg = '/\&([^amp;])/';
                $url = preg_replace ($ampreg, '&amp;$1', $url);
                return $url;

        }


        function wrongCheck ($chk, $id, $func) {

                if ($chk == $this->makeCheck($id, $func)) return false;
                return true;
        }

        function makeCheck ($id, $func) {

                $interface =& remositoryInterface::getInstance();
                return md5($this->Time_Stamp.$interface->getCfg('absolute_path').date('md').$id.$func);
        }

        function sendAdminMail ($user_full, $filetitles) {
                $interface =& remositoryInterface::getInstance();
                // Site name and live site are needed for evaluation of message text below
                // as is the user_full parameter
                $mosConfig_live_site = $interface->getCfg('live_site');
                $mosConfig_sitename = $interface->getCfg('sitename');
                $superadmin = remositoryUser::superAdminMail();
                if ($this->Sub_Mail_Alt_Addr=='') $recipient = 'Administrator <'.$superadmin.'>';
            else $recipient = "$this->Sub_Mail_Alt_Name <$this->Sub_Mail_Alt_Addr>";
                $subject = $interface->getCfg('sitename').':'._DOWN_MAIL_SUB;
                $message = _DOWN_MAIL_MSG_APP."\n"._DOWN_FILE_TITLE."\n". $filetitles;
                eval ("\$message = \"$message\";");
                mosMail ($superadmin, 'Administrator', $recipient, $subject, $message);
        }

        function RemositoryImageURL($imageName, $width=32, $height=32) {

                $interface =& remositoryInterface::getInstance();

                $element = '<img src="';
                $element .= $interface->getCfg('live_site').'/components/com_remository/images/'.$imageName;
                $element .= '" width="';
                $element .= $width;
                $element .= '" height="';
                $element .= $height;
                $element .= '" alt="';
                $element .= $imageName;
                $element .= '"/>';
                return $element;

        }

        function doSQL ($sql) {
                if ($sql) {
                        $interface =& remositoryInterface::getInstance();
                        $database =& $interface->getDB();
                        $database->setQuery($sql);
                        if (!$database->query()) {
                                echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>\n";
                                exit();
                        }
                }
        }

        function &doSQLget ($sql, $classname) {
                if ($sql) {
                        $interface =& remositoryInterface::getInstance();
                        $database =& $interface->getDB();
                        $database->setQuery($sql);
                        $rows = $database->loadObjectList();
                }
                else $rows = null;
                $target = get_class_vars($classname);
                if ($rows) {
                        foreach ($rows as $row) {
                                $next =& new $classname(0);
                                foreach (get_object_vars($row) as $field=>$value) {
                                        if (isset($target[$field])) $next->$field = $value;
                                }
                                $result[] = $next;
                        }
                }
                else $result = (array());
                return $result;
        }

        function makeOption($value, $text='', $value_name='value', $text_name='text') {
                $obj = new stdClass;
                $obj->$value_name = $value;
                $obj->$text_name = trim($text) ? $text : $value;
                return $obj;
        }

        function selectList (&$arr, $tag_name, $tag_attribs='', $selected=NULL, $key='value', $text='text' ) {
                $html = "\n\t\t<select name=\"$tag_name\" $tag_attribs>";
                foreach ($arr as $option) {
                        $picked = ($option->$key == $selected ? "selected='selected'" : '');
                        $html .= "\n\t\t\t<option value='{$option->$key}' $picked>{$option->$text}</option>";
                }
                $html .= "\n\t\t</select>\n";
                return $html;
        }

        function getParam (&$array, $name, $default='') {
                if (isset($array[$name])) {
                        if (is_numeric($default)) return intval($array[$name]);
                        else return $array[$name];
                }
                else return $default;
        }

}

?>


куда здесь точно вставлять функцию?
*

ziArt

  • Осваиваюсь на форуме
  • 16
  • 0 / 0
Мега зачет  :D :D :D работает. Огромное спасибо за помощь и потраченое время.

Вставлять нужно сразу после указаной никонором функции правда она там немного не так заанчивается.
*

nikonor

  • Давно я тут
  • 513
  • 56 / 0
  • Content Grabber
Цитировать
Вставлять нужно сразу после указаной никонором функции правда она там немного не так заанчивается.
Действительно, та оконцовка верна для версии архива 3.41
*

adold

  • Новичок
  • 7
  • 0 / 0
  • "Всякое бывает. Но не с каждым."
Супер  ;D Всё сделали, всё работает! Правда по разному выглядит в Explorere и в FF, но это уже мелочи...
Спасибки.

 :o не поет ничего!я сначала на версии 3.40 хотел сделать, потом доперло что скачать 3.42 будет менее геморройно...Скачал, поменял в файлах что надо.. Кнопка появилась, там где нужно, но >:( нажимаешь play а нифига не поет.... !!!???!!!

Кстати, есть такой мамбот- World press mp3 player, там гораздо удобнее было бы прикрутить к скачке и одновременой прослушке :o может кто поможет как это сделать? заранее пасиб :D я верю в силу коллективног разума!

 8) прикрутил wp player к ремоситорию... ;D нифига не работает, молчит как и обычный плеер.. :laugh:
*

nikonor

  • Давно я тут
  • 513
  • 56 / 0
  • Content Grabber
SEF включен?

 ^-^ыхы, я установил RemoSef, он вроде автоматически начинает работать :o или нет?

 :dry:поставил Денвер, стер нафиг старый Апач, и все заработало! :laugh:

8) прикрутил wp player к ремоситорию...
А как его прикрутить? Оочень надо.
*

amitakrishna

  • Осваиваюсь на форуме
  • 31
  • 2 / 0
Перепробовал все перечисленные предложения от nikonor на текущих версиях Remository3441 для J1.x и на Remository3444J для J1.5.6. В обоих случаях плеер на странице не появляется  >:(

Подскажите, может надо что поправить в коде для новых версий Remository?
*

amitakrishna

  • Осваиваюсь на форуме
  • 31
  • 2 / 0
Вопрос решен. Плеер в Remository3441 под Joostina 2.0.0 beta работает. Секрет был во фразе "вставляй примерно это (куда - на твое усмотрение)". Для тех, кто не очень фамилиарен с PHP, шаг в лево шаг в право - сразу плеер пропадет или ошибка. Так что вставлять надо зная куда, особенно если заботишься о том, чтобы плеер в дизайн вписался.

сразу предупреждаю - xspf player работает только с ЧПУ (или попробуй предварительно конвертнуть ссылку на файл в html сущности типа &amp;)

Пожалуйста расшифруйте эту цитату. Я хочу установить плеер на Joomla 1.5.6, а там ЧПУ другой и плеер показывается, но файл не играет. Как можно оптимизировать код под ЧПУ Джумлы 1.5 или под ARITO Joomsef ???

Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Ошибка ReMOSitory "У вас нет прав для просмотра этой страницы."

Автор KingSnake

Ответов: 11
Просмотров: 1545
Последний ответ 07.11.2022, 16:42:58
от marksetter
Remository 3.58 for Joomla 3.x

Автор olaf

Ответов: 4
Просмотров: 2603
Последний ответ 04.12.2017, 21:28:04
от olaf
Плагин remository Xmap

Автор sword852d

Ответов: 0
Просмотров: 4265
Последний ответ 07.01.2015, 13:23:24
от sword852d
ReMOSitory 3.42

Автор Смотрящий на луну

Ответов: 39
Просмотров: 42243
Последний ответ 09.04.2014, 18:11:44
от alex75300
J1.7 + Remository = не хотят делать?

Автор bato

Ответов: 2
Просмотров: 5441
Последний ответ 28.01.2012, 19:27:31
от bato