Wybacz już wszystko wypisuje.
Ta funkcja dodaje video ze skryptu allvideoshare, który dodaje użytkownik i będzie oczekiwało na zaakceptowanie.
function savevideo() {
$mainframe = JFactory::getApplication();
$row = &JTable::getInstance('allvideosharevideos', 'Table');
$cid = JRequest
::getVar( 'cid', array(0), '', 'array' ); $id = $cid[0];
$row->load($id);
// Tutaj dodawane są automatycznie punkty za dodanie video.
$api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php';
{
require_once ($api_AUP);
$id = itemid ;
$keyreference = AlphaUserPointsHelper::buildKeyreference('function_name', 'itemid' );
AlphaUserPointsHelper::newpoints( 'plgaup_alladd', '', $keyreference);
}
// koniec czesci pkt
if(!$row->bind(JRequest::get('post'))) {
JError::raiseError(500, $row->getError());
}
jimport( 'joomla.filter.output' );
$row->title = JRequest::getVar('title', '', 'post', 'string', JREQUEST_ALLOWHTML);
$row->title = JString
::trim($row->title); if(!$row->slug) $row->slug = $row->title;
$row->slug = JFilterOutput::stringURLSafe($row->slug);
$row->description = JRequest::getVar('description', '', 'post', 'string', JREQUEST_ALLOWHTML);
$row->thirdparty = JRequest::getVar('thirdparty', '', 'post', 'string', JREQUEST_ALLOWRAW);
[b][center]...[/center][/b]
}
$itemId = '';
if(JRequest::getInt('Itemid')) {
$itemId = '&Itemid=' . JRequest::getInt('Itemid');
}
$link = JRoute::_( 'index.php?option=com_allvideoshare&view=user' . $itemId, false );
$mainframe->redirect($link, JText::_('Zapisano'));
}
Potem ja akceptuje video tj. publikuje.