function display($tpl = null) { $layout = JRequest::getVar('layout', 'list'); $permission = Jrequest::getVar('permission', 0); $config = new JConfig(); $pagetitle = ' RSS Feed ' . ' ' . $config->sitename; $document = JFactory::getDocument(); $document->setTitle($pagetitle); switch (strtolower($layout)) { case 'guide': $this->getItemList(); break; case 'form': $this->displayForm(); break; case 'rss': $this->rss(); break; default: $this->listItems(); break; } $this->assignRef('permission', $permission); parent::display($tpl); }
function display($tpl = null) { global $mainframe, $option; $limit = JRequest::getVar('limit', $mainframe->getCfg('list_limit'), '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $options['limit'] = $limit; $options['limitstart'] = $limitstart; $user =& JFactory::getUser(); $pathway =& $mainframe->getPathway(); $document =& JFactory::getDocument(); $model =& $this->getModel(); // Get the parameters of the active menu item $menus =& JSite::getMenu(); $menu = $menus->getActive(); // Push a model into the view $model =& $this->getModel(); $jobType = JRequest::getVar('jobType'); $options['jobType'] = $jobType; $order = Jrequest::getVar('orderby'); $options['order'] = $order; $catsone = $model->getCatsone($options); $total = count($catsone); // Set the document page title $document->setTitle(JText::_("Catsone module")); jimport('joomla.html.pagination'); $pagination = new JPagination($total, $limitstart, $limit); $this->assignRef('catsone', $catsone); $this->assignRef('jobType', $jobType); $this->assignRef('pagination', $pagination); //JHTML::_('behavior.formvalidation'); parent::display($tpl); }
function display($cachable = false, $urlparams = false) { global $javconfig; $layout = Jrequest::getVar('layout'); $per = FALSE; $permission = $javconfig['systems']->get('user_group', "1,6,7,2,3,4,5,10,12,8"); if ($permission) { $permissions = explode(",", $permission); $user = JFactory::getUser(); //Get all groups that the user is mapped to recursively. $groups = $user->getAuthorisedGroups(); if ($user->id) { if ($permissions[0] == "1") { $per = TRUE; } else { foreach ($groups as $gkey => $gVal) { if (in_array($gVal, $permissions)) { $per = TRUE; break; } } } } } if (!$per && ($layout == 'guide' || $layout == 'form')) { Jrequest::setVar('layout', 'list'); } Jrequest::setVar('permission', $per); parent::display($cachable = false, $urlparams = false); return TRUE; }
public function getRuncode(){ //Get params $params = &JComponentHelper::getParams( 'com_jfoxconsole' ); //load post and put on variables $jfoxcode = Jrequest::getVar('code', '', 'post','string', JREQUEST_ALLOWRAW ); $format = JRequest::getCmd('format', 'html'); $cols = JRequest::getInt('cols'); $rows = JRequest::getInt('rows'); if ($cols == 0) { if ($format == 'html') { $cols = $params->get('cols_html', 130); $rows = $params->get('rows_html', 20); } else { $cols = $params->get('cols_raw', 130); $rows = $params->get('rows_raw', 3); } } //load $app for be able to take at least live_site $app = JFactory::GetApplication(); // the core that execute the code and put in one variable ob_start(); eval($jfoxcode); $eval_result = ob_get_contents(); ob_end_clean(); // Way to abstract errors //todo: think a bit better who to do it to show another useful messages to user $errormessage = 'Parse error'; $pos = strpos($eval_result , $errormessage); if ($pos === false OR $params->get('filter_error') == 0) { if ($eval_result != ''){ $jfoxconsoleoutput = $eval_result; } else { $jfoxconsoleoutput = JTEXT::_('COM_JFOXCONSOLE_NO_RESULT'); } } else { $jfoxconsoleoutput = JTEXT::_('COM_JFOXCONSOLE_RUNCODE_HAS_ERROR'); } $result = new stdClass; $result->jfoxconsoleoutput = $jfoxconsoleoutput; $result->jfoxcode = $jfoxcode; $result->cols = $cols; $result->rows = $rows; return $result; }
function display($tpl = null) { $layout = Jrequest::getVar('layout'); switch ($layout) { case 'wordle': $this->wordle($tpl); break; default: $this->allTags($tpl); } }
public function edit() { JRequest::setVar('hidemainmenu', 1); JRequest::setVar('layout', 'default'); JRequest::setVar('view', 'session'); JRequest::setVar('standalone', true); if (Jrequest::getVar('task') == 'edit') { JRequest::setVar('edit', true); } else { JRequest::setVar('edit', false); } parent::display(); }
/** * Method to get a JDatabaseQuery object for retrieving the data set from a database. * * @return object A JDatabaseQuery object to retrieve the data set. */ protected function getListQuery() { $w = explode('|', urldecode(JRequest::getVar('filterStr', ''))); $user = JFactory::getUser(); $filterStr = $w[0]; $filterAktiv = $w[1]; if ($filterAktiv == 1) { $lezartLimit = 1; } else { $lezartLimit = 99; } $db = $this->getDbo(); $query = $db->getQuery(true); $catid = (int) $this->getState('authorlist.id', 1); $query = 'select sz.id, sz.megnevezes, if(sz.vita1>0,"X"," ") vita1, if(sz.vita2>0,"X"," ") vita2, if(sz.szavazas>0,"X"," ") szavazas, if(sz.lezart>0,"X"," ") lezart, sz.szavazas_vege, sz.titkos, szo.user_id, szo.kepviselo_id from #__szavazasok as sz left outer join #__szavazok as szo on szo.user_id = "' . $user->id . '" and szo.szavazas_id = sz.id '; if (Jrequest::getVar('temakor') > 0) { $query .= ' where sz.temakor_id="' . JRequest::getVar('temakor', 0) . '"'; } else { $query .= ' where sz.temakor_id > 0 and sz.lezart=0 '; } if ($filterStr == '') { $query .= ' and sz.lezart < ' . $lezartLimit; } else { $query .= ' and sz.megnevezes like "%' . $filterStr . '%" and sz.lezart < ' . $lezartLimit; } if (JRequest::getVar('order') == '') { $query .= ' order by 1 DESC'; } else { if (JRequest::getVar('order', '1') == '1') { $query .= ' order by ' . JRequest::getVar('order', '1'); } else { $query .= ' order by ' . JRequest::getVar('order', '1'); } } //DBG echo $query; return $query; }
/** * Outputs frontpage HTML * * @return Nothing */ function reportGroup() { global $mainframe, $my, $acl, $mosConfig_absolute_path, $mosConfig_mailfrom, $mosConfig_fromname, $mosConfig_live_site, $Itemid, $mosConfig_sitename; $c = hwd_vs_Config::get_instance(); $db = & JFactory::getDBO(); $my = & JFactory::getUser(); $url = Jrequest::getVar( 'url', '' ); if (!$my->id) { $msg = _HWDVIDS_ALERT_LOG2FLAG; $mainframe->enqueueMessage($msg); $mainframe->redirect( $url ); } $userid = $my->id; $groupid = JRequest::getInt( 'groupid', 0 ); $where = ' WHERE a.groupid = '.$groupid; $db->SetQuery( 'SELECT count(*)' . ' FROM #__hwdvidsflagged_groups AS a' . $where ); $total = $db->loadResult(); if ( $total>0 ) { $msg = _HWDVIDS_ALERT_ALREADYFLAG; $mainframe->enqueueMessage($msg); $mainframe->redirect( $url ); } $row = new hwdvids_flaggroup($db); $_POST['userid'] = $userid; $_POST['groupid'] = $groupid; $_POST['status'] = "UNREAD"; $_POST['date'] = date('Y-m-d H:i:s'); // bind it to the table if (!$row -> bind($_POST)) { echo "<script> alert('" .$row -> getError() ."'); window.history.go(-1); </script>\n"; exit(); } // store it in the db if (!$row -> store()) { echo "<script> alert('" .$row -> getError() ."'); window.history.go(-1); </script>\n"; exit(); } // mail admin notification if ($c->mailreportnotification == 1) { $jconfig = new jconfig(); $mailbody = ""._HWDVIDS_MAIL_BODY9.$jconfig->sitename.".\n"; $mailbody .= ""._HWDVIDS_MAIL_BODY12."\n"; if (isset($groupid)) { $mailbody .= "".JURI::root()."index.php?option=com_hwdvideoshare&Itemid=".$Itemid."&task=viewgroup&group_id=".$groupid."\n\n"; } $mailbody .= ""._HWDVIDS_MAIL_BODY11."\n"; $mailbody .= JURI::root()."administrator"; JUtility::sendMail( $jconfig->mailfrom, $jconfig->fromname, $c->mailnotifyaddress, _HWDVIDS_MAIL_SUBJECT4.$jconfig->sitename.' ', $mailbody ); } $msg = _HWDVIDS_ALERT_SUCFLAGGED; $mainframe->enqueueMessage($msg); $mainframe->redirect( $url ); }
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with DJ Classifieds. If not, see <http://www.gnu.org/licenses/>. * */ defined('_JEXEC') or die('Restricted access'); if (!defined("DS")) { define('DS', DIRECTORY_SEPARATOR); } require_once dirname(__FILE__) . DS . 'helper.php'; require_once JPATH_BASE . DS . 'administrator' . DS . 'components' . DS . 'com_djclassifieds' . DS . 'lib' . DS . 'djtheme.php'; require_once JPATH_BASE . DS . 'administrator' . DS . 'components' . DS . 'com_djclassifieds' . DS . 'lib' . DS . 'djseo.php'; $params->set("cat_id", Jrequest::getVar("se_cats")); $items = modDjClassifiedsItems::getItems($params); $cfpar = JComponentHelper::getParams('com_djclassifieds'); $par_id = $params->get('mainid'); if ($params->get('show_type', '1')) { $types = modDjClassifiedsItems::getTypes(); } if ($params->get('show_default_img', '0')) { $cat_images = modDjClassifiedsItems::getCatImages(); } /*$menus = JSite::getMenu(); $menu_item = $menus->getItems('link','index.php?option=com_djclassifieds&view=items&cid=0',1); $menu_item_blog = $menus->getItems('link','index.php?option=com_djclassifieds&view=items&layout=blog&cid=0',1); $itemid = ''; if($menu_item){
$i = 0; foreach ($tax_categories as $tax_category) { $i++; echo JText::_($tax_category->category_name); if ($i < count($tax_categories)) { echo ' - '; } } } echo '</td>'; echo '<td>'; if (!$mytax->shared) { if ($tax_mode == 2) { echo ' <form name="deletetax' . $mytax->virtuemart_calc_id . '" id="deletetax' . $mytax->virtuemart_calc_id . '" method="post" >'; echo '<div class="btn-group">'; echo '<a href="' . JRoute::_('index.php?option=com_vmvendor&view=edittax&taxid=' . $mytax->virtuemart_calc_id . '&Itemid=' . Jrequest::getVar('Itemid')) . '" class="btn btn-mini btn-primary hasTooltip" title="' . JText::_('COM_VMVENDOR_DASHBOARD_TAX_EDIT') . '"> <i class="vmv-icon-edit"></i></a> '; echo '<input type="hidden" name="option" value="com_vmvendor"> <input type="hidden" name="controller" value="dashboard"> <input type="hidden" name="task" value="deletetax"> <input type="hidden" name="delete_taxid" value="' . $mytax->virtuemart_calc_id . '"> <input type="hidden" name="userid" value="' . $user->id . '"> <a title="' . JText::_('COM_VMVENDOR_DASHBOARD_TAX_DELETE') . '" class="btn btn-mini btn-danger hasTooltip" onclick="sweetConfirmDelete( document.getElementById(\'deletetax' . $mytax->virtuemart_calc_id . '\') );" > <i class="vmv-icon-trash"></i></a> </div> </form>'; } } else { echo JText::_('COM_VMVENDOR_DASHBOARD_TAX_SHARED');
$ufield .= $product_userfileds[1]; if ($product_userfileds[1] != "") { $count_no_user_field++; } $template_userfield = str_replace('{' . $userfieldArr[$ui] . '_lbl}', $product_userfileds[0], $template_userfield); $template_userfield = str_replace('{' . $userfieldArr[$ui] . '}', $product_userfileds[1], $template_userfield); } if ($ufield != "") { $hidden_userfield = "<div style='display:none;'><form method='post' action='' id='user_fields_form_" . $product->product_id . "' name='user_fields_form_" . $product->product_id . "'>" . $template_userfield . "</form></div>"; } } } $data_add = $data_add . $hidden_userfield; /************** end user fields ***************************/ $ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $product->product_id); $catidmain = Jrequest::getVar("cid"); if (count($ItemData) > 0) { $pItemid = $ItemData->id; } else { $pItemid = $objhelper->getItemid($product->product_id, $catidmain); } $data_add = str_replace("{product_id_lbl}", JText::_('COM_REDSHOP_PRODUCT_ID_LBL'), $data_add); $data_add = str_replace("{product_id}", $product->product_id, $data_add); $data_add = str_replace("{product_number_lbl}", JText::_('COM_REDSHOP_PRODUCT_NUMBER_LBL'), $data_add); $product_number_output = '<span id="product_number_variable' . $product->product_id . '">' . $product->product_number . '</span>'; $data_add = str_replace("{product_number}", $product_number_output, $data_add); $product_volume_unit = '<span class="product_unit_variable">' . DEFAULT_VOLUME_UNIT . "3" . '</span>'; $dataAddStr = $producthelper->redunitDecimal($product->product_volume) . " " . $product_volume_unit; $data_add = str_replace("{product_size}", $dataAddStr, $data_add); $product_unit = '<span class="product_unit_variable">' . DEFAULT_VOLUME_UNIT . '</span>'; $data_add = str_replace("{product_length}", $producthelper->redunitDecimal($product->product_length) . " " . $product_unit, $data_add);
/** * Outputs frontpage HTML * * @return Nothing */ function updatePlaylist() { global $Itemid, $mainframe; $db = & JFactory::getDBO(); $my = & JFactory::getUser(); $c = hwd_vs_Config::get_instance(); $playlist_id = JRequest::getInt( 'playlist_id', 0 ); $referrer = JRequest::getVar( 'referrer', JURI::root( true ) . '/index.php?option=com_hwdvideoshare&task=viewChannel&Itemid='.$Itemid.'&user_id='.$my->id.'&sort=playlists' ); $row = new hwdvids_playlist($db); $row->load( $playlist_id ); if ($row->user_id != $my->id) { $mainframe->enqueueMessage(_HWDVIDS_ALERT_NOPERM); $mainframe->redirect( $referrer ); } $playlist_name = Jrequest::getVar( 'playlist_name', _HWDPS_UNKNOWN ); $playlist_description = Jrequest::getVar( 'playlist_description', _HWDPS_UNKNOWN ); $public_private = JRequest::getWord( 'public_private' ); $_POST['id'] = $playlist_id; $_POST['playlist_name'] = $playlist_name; $_POST['playlist_description'] = $playlist_description; $_POST['public_private'] = $public_private; // bind it to the table if (!$row -> bind($_POST)) { echo "<script> alert('" .$row -> getError() ."'); window.history.go(-1); </script>\n"; exit(); } // store it in the db if (!$row -> store()) { echo "<script> alert('" .$row -> getError() ."'); window.history.go(-1); </script>\n"; exit(); } $msg = _HWDVIDS_ALERT_PLSAVED; $mainframe->enqueueMessage($msg); $mainframe->redirect( $referrer ); }
/** * Import Data */ function thirdPartyImport() { global $option; $db = & JFactory::getDBO(); $app = & JFactory::getApplication(); $c = hwd_vs_Config::get_instance(); $video_type = Jrequest::getVar( 'videotype', '5' ); $intCount = 0; $admin_import = true; require_once(JPATH_SITE.DS.'components'.DS.'com_hwdvideoshare'.DS.'models'.DS.'uploads.php'); if ($video_type == 1 || $video_type == 5) { $requestarray = JRequest::get( 'default', 2 ); $data = explode("\n", $requestarray['embeddump']); $counter = 0; for ($i=0, $n=count($data); $i < $n; $i++) { unset ($_REQUEST['embeddump']); $_REQUEST['embeddump'] = trim($data[$i]); if (hwd_vs_uploads::addConfirm($option, $admin_import)) { $counter++; } else { // error } } $app->enqueueMessage($counter." video(s) successfully imported"); } else if ($video_type == 2) { // youtube playlist $requestarray = JRequest::get( 'default', 2 ); $data = explode("\n", $requestarray['embeddump']); $embeddump_original = $data[0]; $embeddump = $data[0]; $pos = strpos($embeddump, "p="); if ($pos === false) { $app->enqueueMessage("This is not a Youtube Playlist URL. Check if the URL is for a User list or an RSS feed, then use the correct import tool."); $app->redirect( JURI::root( true ) . '/administrator/index.php?option='.$option.'&task=import' ); } else if ($pos) { $pos_srt = $pos + 2; $pos_end = strpos($embeddump, '&', $pos_srt); if ($pos_end === false) { $playlist_no = substr($embeddump, $pos_srt); } else { $length = $pos_end - $pos_srt; $playlist_no = substr($embeddump, $pos_srt, $length); } $playlist_no = strip_tags($playlist_no); $playlist_no = preg_replace("/[^a-zA-Z0-9s_-]/", "", $playlist_no); } for ($i = 0; $i <= 4; $i++) { $playlist_url = "http://www.youtube.com/view_play_list?p=".$playlist_no."&page=".$i; $playlist_url = hwd_vs_tools::get_final_url( $playlist_url ); $msg = 'Searching page: '.$playlist_url; $app->enqueueMessage($msg); $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,$playlist_url); curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2); curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1); $buffer = curl_exec($curl_handle); curl_close($curl_handle); if (empty($buffer)) { return null; } else { hwdvids_BE_imports::scanYoutubePage($buffer); } } } else if ($video_type == 3) { // youtube userlist $requestarray = JRequest::get( 'default', 2 ); $data = explode("\n", $requestarray['embeddump']); $embeddump_original = $data[0]; $embeddump = $data[0]; $pos = strpos($embeddump, "user="******"user/"); if ($pos === false) { $app->enqueueMessage("This is not a Youtube User URL. Check if the URL is for a Playlist or an RSS feed, then use the correct import tool."); $app->redirect( JURI::root( true ) . '/administrator/index.php?option='.$option.'&task=import' ); } else if ($pos) { $pos_srt = $pos + 5; $pos_end = strpos($embeddump, '&', $pos_srt); if ($pos_end === false) { $pos_end = strpos($embeddump, '#', $pos_srt); if ($pos_end === false) { $username = substr($embeddump, $pos_srt); } else { $length = $pos_end - $pos_srt; $username = substr($embeddump, $pos_srt, $length); } } else { $length = $pos_end - $pos_srt; $username = substr($embeddump, $pos_srt, $length); } $username = strip_tags($username); $username = preg_replace("/[^a-zA-Z0-9s_-]/", "", $username); } } else if ($pos) { $pos_srt = $pos + 5; $pos_end = strpos($embeddump, '&', $pos_srt); if ($pos_end === false) { $pos_end = strpos($embeddump, '#', $pos_srt); if ($pos_end === false) { $username = substr($embeddump, $pos_srt); } else { $length = $pos_end - $pos_srt; $username = substr($embeddump, $pos_srt, $length); } } else { $length = $pos_end - $pos_srt; $username = substr($embeddump, $pos_srt, $length); } $username = strip_tags($username); $username = preg_replace("/[^a-zA-Z0-9s_-]/", "", $username); } //$username_url = "http://www.youtube.com/profile?user="******"#g/u"; $username_url = "http://gdata.youtube.com/feeds/videos?author=".$username."&start-index=1&max-results=50"; $username_url = hwd_vs_tools::get_final_url( $username_url ); $msg = 'Searching page: '.$username_url; $app->enqueueMessage($msg); $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,$username_url); curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2); curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1); $buffer = curl_exec($curl_handle); curl_close($curl_handle); if (empty($buffer)) { return null; } else { hwdvids_BE_imports::scanYoutubePage($buffer); } } else if ($video_type == 4) { // youtube rss $requestarray = JRequest::get( 'default', 2 ); $data = explode("\n", $requestarray['embeddump']); $embeddump_original = $data[0]; $embeddump = $data[0]; $pos = strpos($embeddump, "http"); if ($pos === false) { $embeddump = 'http://'.$embeddump; } $pos = strpos($embeddump, "gdata"); if ($pos === false) { $feedurl = "http://www.youtube.com".parse_url($embeddump, PHP_URL_PATH)."?".parse_url($embeddump, PHP_URL_QUERY); } else { $feedurl = "http://gdata.youtube.com".parse_url($embeddump, PHP_URL_PATH)."?".parse_url($embeddump, PHP_URL_QUERY); } $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,$feedurl); curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2); curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1); $buffer = curl_exec($curl_handle); curl_close($curl_handle); if (empty($buffer)) { return null; } else { hwdvids_BE_imports::scanYoutubePage($buffer); } } if ($video_type == 1 || $video_type == 5) { $app->redirect( JURI::root( true ) . '/administrator/index.php?option='.$option.'&task=import' ); } else { $embeddump = urlencode($embeddump_original); $videotype = JRequest::getInt( 'videotype', 0 ); $category_id = JRequest::getInt( 'category_id', 0 ); $public_private = JRequest::getWord( 'public_private', 'public' ); $allow_comments = JRequest::getInt( 'allow_comments', 0 ); $allow_embedding = JRequest::getInt( 'allow_embedding', 0 ); $allow_ratings = JRequest::getInt( 'allow_ratings', 0 ); $app->redirect( JURI::root( true ) . '/administrator/index.php?option='.$option.'&task=redoListImport&embeddump='.$embeddump.'&videotype='.$videotype.'&category_id='.$category_id.'&public_private='.$public_private.'&allow_comments='.$allow_comments.'&allow_embedding='.$allow_embedding.'&allow_ratings='.$allow_ratings ); } }
<tr> <td align="right" colspan="6"> <?php echo JText::_('Display Num') . ' '; echo $this->pagination->getLimitBox(); ?> </td> </tr> <?php $jobType = Jrequest::getVar('jobType'); if ($jobType != "") { $url = "index.php?option=com_catsone&jobType=" . $jobType; } else { $url = "index.php?option=com_catsone"; } ?> <tr> <td class="catsone_content"> <table class="catsone_inner" cellpadding=0 cellspacing=0 > <tr>
/** * Grants or prevents access based on group id * * @param int $accessgroupid the group id to check against * @param string $recurse the switch for recursive access check * @param int $usersgroupid the user's group id * @return True or false */ function frontend() { global $smartyvs, $print_ulink, $print_glink, $hwdvsTemplateOverride, $hwdvsItemid, $isModerator; $c = hwd_vs_Config::get_instance(); $db = & JFactory::getDBO(); $my = & JFactory::getUser(); $acl= & JFactory::getACL(); $usersConfig = &JComponentHelper::getParams( 'com_users' ); require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'helpers'.DS.'access.php'); require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'helpers'.DS.'initialise.php'); $smartyvs->assign("JURL", JURI::root( true )); $smartyvs->assign("HWDVSURL", JURI::root( true )."/index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid); $smartyvs->assign("Itemid", $hwdvsItemid ); $searchterm = Jrequest::getVar( 'pattern', _HWDVIDS_SEARCHBAR ); $smartyvs->assign("form_search", JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=search")); $smartyvs->assign("form_tp", JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=addconfirm")); $smartyvs->assign("form_upload", JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=upload")); $smartyvs->assign("searchinput", "<input type=\"text\" name=\"pattern\" value=\"".$searchterm."\" class=\"inputbox\" onchange=\"document.adminForm.submit();\" onblur=\"if(this.value=='') this.value='"._HWDVIDS_SEARCHBAR."';\" onfocus=\"if(this.value=='"._HWDVIDS_SEARCHBAR."') this.value='';\"/>"); // define config variables if ($c->diable_nav_videos == 0 || $c->diable_nav_catego == 0 || $c->diable_nav_groups == 0 || $c->diable_nav_upload == 0) { $smartyvs->assign("print_nav", 1); } if ($c->diable_nav_search == 0) { $smartyvs->assign("print_search", 1); } if ($my->id && $c->diable_nav_user == 0 && ($c->diable_nav_user1 == 0 || $c->diable_nav_user2 == 0 || $c->diable_nav_user3 == 0 || $c->diable_nav_user4 == 0 || $c->diable_nav_user5 == 0)) { $smartyvs->assign("print_usernav", 1); } if ($c->diable_nav_videos == 0) { $smartyvs->assign("print_vlink", 1); $smartyvs->assign("vlink", "<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=frontpage")."\">"._HWDVIDS_NAV_VIDEOS."</a>"); } if ($c->diable_nav_catego == 0) { $smartyvs->assign("print_clink", 1); $smartyvs->assign("clink", "<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=categories")."\">"._HWDVIDS_NAV_CATEGORIES."</a>"); } if (hwd_vs_access::allowAccess( $c->gtree_grup, $c->gtree_grup_child, hwd_vs_access::userGID( $my->id ))) { if ($c->diable_nav_groups == 0) { $smartyvs->assign("print_glink", 1); $smartyvs->assign("glink", "<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=groups")."\">"._HWDVIDS_NAV_GROUPS."</a>"); $print_glink = true; } } if ($c->diable_nav_upload == 0) { $smartyvs->assign("print_ulink", 1); $smartyvs->assign("ulink", "<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=upload")."\">"._HWDVIDS_NAV_UPLOAD."</a>"); $print_ulink = true; } else if ($c->diable_nav_upload == 2) { if (hwd_vs_access::allowAccess( $c->gtree_upld, $c->gtree_upld_child, hwd_vs_access::userGID( $my->id )) || hwd_vs_access::allowAccess( $c->gtree_ultp, $c->gtree_ultp_child, hwd_vs_access::userGID( $my->id ))) { $smartyvs->assign("print_ulink", 1); $smartyvs->assign("ulink", "<a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=upload")."\">"._HWDVIDS_NAV_UPLOAD."</a>"); $print_ulink = true; $smartyvs->assign("print_nav", 1); } } if ($c->diable_nav_user1 == 0) { $smartyvs->assign("yv", " <a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=viewChannel&user_id=".$my->id."&sort=uploads")."\">"._HWDVIDS_NAV_YOURVIDS."</a> "); } if ($c->diable_nav_user2 == 0) { $smartyvs->assign("yf", " <a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=viewChannel&user_id=".$my->id."&sort=favourites")."\">"._HWDVIDS_NAV_YOURFAVS."</a> "); } if ($c->diable_nav_groups == 0 && $c->diable_nav_user3 == 0) { $smartyvs->assign("yg", " <a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=viewChannel&user_id=".$my->id."&sort=groups")."\">"._HWDVIDS_NAV_YOURGROUPS."</a> "); } if ($c->diable_nav_groups == 0 && $c->diable_nav_user4 == 0) { $smartyvs->assign("ym", " <a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=viewChannel&user_id=".$my->id."&sort=memberships")."\">"._HWDVIDS_NAV_YOURMEMBERSHIPS."</a> "); } if ($c->diable_nav_groups == 0 && $c->diable_nav_user5 == 0) { $smartyvs->assign("cg", " <a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=creategroup")."\">"._HWDVIDS_NAV_CREATEGROUP."</a> "); } if ($c->disable_nav_playlist == 0) { $smartyvs->assign("cp", " <a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=createPlaylist")."\">"._HWDVIDS_NAV_CREATEPL."</a> "); } if ($c->disable_nav_playlist == 0) { $smartyvs->assign("yp", " <a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=viewChannel&user_id=".$my->id."&sort=playlists")."\">"._HWDVIDS_NAV_YOURPL."</a> "); } if ($c->disable_nav_channel == 0) { $smartyvs->assign("yc", " <a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=viewChannel&user_id=".$my->id)."\">"._HWDVIDS_NAV_YOURCHANNEL."</a> "); } if ($c->showcredit == 1) { $smartyvs->assign("sc", "1"); $smartyvs->assign("cl", hwd_vs_templates::copyright_FE()); } $smartyvs->assign("help_link", "<a href=\"http://documentation.hwdmediashare.co.uk/wiki/Category:HwdVideoShare_User%27s_Manual\" target=\"_blank\">Help</a>"); $smartyvs->assign("personalise_link", "<a href=\"http://documentation.hwdmediashare.co.uk/wiki/Category:HwdVideoShare_User%27s_Manual\">Personalise</a>"); if ($c->fporder == "recent") { $smartyvs->assign("fpheader", _HWDVIDS_TITLE_RECENTUPLOADS); $smartyvs->assign("fpempty", _HWDVIDS_INFO_NRV); } else if ($c->fporder == "popular") { $smartyvs->assign("fpheader", _HWDVIDS_TITLE_POPULARVIDEOS); $smartyvs->assign("fpempty", _HWDVIDS_INFO_NVTD); } else if ($c->fporder == "viewed") { $smartyvs->assign("fpheader", _HWDVIDS_TITLE_MOSTVIEWEDVIDS); $smartyvs->assign("fpempty", _HWDVIDS_INFO_NVTD); } $smartyvs->assign("usershare1", $c->usershare1); $smartyvs->assign("usershare2", $c->usershare2); $smartyvs->assign("usershare3", $c->usershare3); $smartyvs->assign("usershare4", $c->usershare4); if ($c->usershare1 == 1 || $c->usershare2 == 1 || $c->usershare3 == 1 || $c->usershare4 == 1) { $smartyvs->assign("print_sharing", 1); } if ($c->shareoption1 == 0) { $smartyvs->assign("so1p", ""); $smartyvs->assign("so1r", " selected=\"selected\""); $smartyvs->assign("so1m", ""); $smartyvs->assign("so1w", ""); $smartyvs->assign("so1value", "registered"); } else if ($c->shareoption1 == 1) { $smartyvs->assign("so1p", " selected=\"selected\""); $smartyvs->assign("so1r", ""); $smartyvs->assign("so1m", ""); $smartyvs->assign("so1w", ""); $smartyvs->assign("so1value", "public"); } else if ($c->shareoption1 == 2) { $smartyvs->assign("so1p", ""); $smartyvs->assign("so1r", ""); $smartyvs->assign("so1m", " selected=\"selected\""); $smartyvs->assign("so1w", ""); $smartyvs->assign("so1value", "me"); } else if ($c->shareoption1 == 3) { $smartyvs->assign("so1p", ""); $smartyvs->assign("so1r", ""); $smartyvs->assign("so1m", ""); $smartyvs->assign("so1w", " selected=\"selected\""); $smartyvs->assign("so1value", "password"); } if ($c->shareoption2 == 0) { $smartyvs->assign("so21", ""); $smartyvs->assign("so20", " selected=\"selected\""); $smartyvs->assign("so2value", "0"); } else if ($c->shareoption2 == 1) { $smartyvs->assign("so21", " selected=\"selected\""); $smartyvs->assign("so20", ""); $smartyvs->assign("so2value", "1"); } if ($c->shareoption3 == 0) { $smartyvs->assign("so31", ""); $smartyvs->assign("so30", " selected=\"selected\""); $smartyvs->assign("so3value", "0"); } else if ($c->shareoption3 == 1) { $smartyvs->assign("so31", " selected=\"selected\""); $smartyvs->assign("so30", ""); $smartyvs->assign("so3value", "1"); } if ($c->shareoption4 == 0) { $smartyvs->assign("so41", ""); $smartyvs->assign("so40", " selected=\"selected\""); $smartyvs->assign("so4value", "0"); } else if ($c->shareoption4 == 1) { $smartyvs->assign("so41", " selected=\"selected\""); $smartyvs->assign("so40", ""); $smartyvs->assign("so4value", "1"); } $smartyvs->assign("categoryselect", hwd_vs_tools::categoryList(_HWDVIDS_INFO_CHOOSECAT, 0, _HWDVIDS_INFO_NOCATS, 1)); $smartyvs->assign("rss_recent", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_hwdvideoshare&task=rss&feed=recent")); if ($isModerator) { $smartyvs->assign("print_moderation", 1); $smartyvs->assign("pending", " <a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=pending")."\">"._HWDVIDS_MODPA."</a> "); $smartyvs->assign("reportedvideos", " <a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=reportedvideos")."\">"._HWDVIDS_MODRV."</a> "); $smartyvs->assign("reportedgroups", " <a href=\"".JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=reportedgroups")."\">"._HWDVIDS_MODRG."</a> "); } jimport( 'joomla.application.menu' ); $menu = &JMenu::getInstance('site'); $mparams = &$menu->getParams($hwdvsItemid); $smartyvs->assign("pageclass_sfx", $mparams->get( 'pageclass_sfx', '')); $smartyvs->assign("page_title", $mparams->get( 'page_title', '')); $smartyvs->assign("show_page_title", $mparams->get( 'show_page_title', '')); if ($c->cbint == "1") { $smartyvs->assign("url_register", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_comprofiler&task=registers")); $smartyvs->assign("url_reset", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_comprofiler&task=lostPassword")); $smartyvs->assign("url_remind", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_comprofiler&task=lostPassword")); } else { $smartyvs->assign("url_register", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_user&view=register")); $smartyvs->assign("url_reset", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_user&view=reset")); $smartyvs->assign("url_remind", JRoute::_("index.php?Itemid=".$hwdvsItemid."&option=com_user&view=remind")); } //// // here you can call any Joomla module positions you like and insert them into the hwdVideoShare template system //// // // $document = &JFactory::getDocument(); // $renderer = $document->loadRenderer('modules'); // $options = array('style' => 'xhtml'); // $position = 'left'; // $smartyvs->assign("modules_left", $renderer->render($position, $options, null)); // // now you can use the {$modules_left} tag in any template file to display this module position in hwdVideoShare // if (!isset($hwdvsTemplateOverride['show_thumbnail'])) { $hwdvsTemplateOverride['show_thumbnail'] = 1; } if (!isset($hwdvsTemplateOverride['show_title'])) { $hwdvsTemplateOverride['show_title'] = 1; } if (!isset($hwdvsTemplateOverride['show_views'])) { $hwdvsTemplateOverride['show_views'] = 1; } if (!isset($hwdvsTemplateOverride['show_category'])) { $hwdvsTemplateOverride['show_category'] = 1; } if (!isset($hwdvsTemplateOverride['show_rating'])) { $hwdvsTemplateOverride['show_rating'] = 1; } if (!isset($hwdvsTemplateOverride['show_uploader'])) { $hwdvsTemplateOverride['show_uploader'] = 1; } if (!isset($hwdvsTemplateOverride['show_description'])) { $hwdvsTemplateOverride['show_description'] = 0; } if (!isset($hwdvsTemplateOverride['show_duration'])) { $hwdvsTemplateOverride['show_duration'] = 0; } if (!isset($hwdvsTemplateOverride['show_upload_date'])) { $hwdvsTemplateOverride['show_upload_date'] = 0; } if (!isset($hwdvsTemplateOverride['show_avatar'])) { $hwdvsTemplateOverride['show_avatar'] = 1; } if (!isset($hwdvsTemplateOverride['show_comments'])) { $hwdvsTemplateOverride['show_comments'] = 0; } if (!isset($hwdvsTemplateOverride['show_tags'])) { $hwdvsTemplateOverride['show_tags'] = 0; } if (!isset($hwdvsTemplateOverride['show_timesince'])) { $hwdvsTemplateOverride['show_timesince'] = 0; } // LEGACY $smartyvs->assign("mosConfig_live_site", JURI::root( true )); $smartyvs->assign("link_home", JURI::root( true )); $smartyvs->assign("link_home_hwd_vs", JURI::root( true )."/index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid); $smartyvs->assign("thumbwidth", $c->thumbwidth); }
/** * Outputs frontpage HTML * * @return Nothing */ function addConfirm($admin_import=false) { global $Itemid, $j15, $j16; $c = hwd_vs_Config::get_instance(); $db = & JFactory::getDBO(); $my = & JFactory::getUser(); $acl= & JFactory::getACL(); $security_code = JRequest::getCmd( 'security_code', '' ); if ($c->disablecaptcha == "1") { $checksecurity = "0"; } else { $checksecurity = "1"; } if ($checksecurity == "1" && !$admin_import) { if(($_SESSION['security_code'] == $security_code) && (!empty($_SESSION['security_code'])) ) { unset($_SESSION['security_code']); } else { hwd_vs_tools::infomessage(4, 0, _HWDVIDS_TITLE_UPLDFAIL, _HWDVIDS_ALERT_ERRSC, "exclamation.png", 0); return; } } $requestarray = JRequest::get( 'default', 2 ); $embeddump = $requestarray['embeddump']; $remote_verified = null; $parsedurl = parse_url($embeddump); if (empty($parsedurl['host'])) { $parsedurl['host'] = ''; } preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $parsedurl['host'], $regs); if (empty($regs['domain'])) { $regs['domain'] = ''; } if ($j15) { if ($regs['domain'] == 'youtube.com' && file_exists(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.'youtube.php')) { require_once(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.'youtube.php'); } else if ($regs['domain'] == 'google.com' && file_exists(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.'google.php')) { require_once(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.'google.php'); } else if (file_exists(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.$regs['domain'].'.php')) { require_once(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.$regs['domain'].'.php'); } else { require_once(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.'youtube.php'); $regs['domain'] = 'remote'; } } if ($j16) { if ($regs['domain'] == 'youtube.com' && file_exists(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.'youtube'.DS.'youtube.php')) { require_once(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.'youtube'.DS.'youtube.php'); } else if ($regs['domain'] == 'google.com' && file_exists(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.'google'.DS.'google.php')) { require_once(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.'google'.DS.'google.php'); } else if (file_exists(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.'thirdpartysupportpack'.DS.$regs['domain'].'.php')) { require_once(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.'thirdpartysupportpack'.DS.$regs['domain'].'.php'); } else { require_once(JPATH_SITE.DS.'plugins'.DS.'hwdvs-thirdparty'.DS.'remote'.DS.'remote.php'); $regs['domain'] = 'remote'; } } $failures = ""; if (!isset($remote_verified)) { $cn = 'hwd_vs_tp_'.preg_replace("/[^a-zA-Z0-9s_-]/", "", $regs['domain']); $f_processc = preg_replace("/[^a-zA-Z0-9s_-]/", "", $regs['domain']).'processCode'; $f_processi = preg_replace("/[^a-zA-Z0-9s_-]/", "", $regs['domain']).'processThumbnail'; $f_processt = preg_replace("/[^a-zA-Z0-9s_-]/", "", $regs['domain']).'processTitle'; $f_processd = preg_replace("/[^a-zA-Z0-9s_-]/", "", $regs['domain']).'processDescription'; $f_processk = preg_replace("/[^a-zA-Z0-9s_-]/", "", $regs['domain']).'processKeywords'; $f_processl = preg_replace("/[^a-zA-Z0-9s_-]/", "", $regs['domain']).'processDuration'; $tp = new $cn(); $ext_v_code = $tp->$f_processc($embeddump); //check if already exists $db->SetQuery( 'SELECT count(*) FROM #__hwdvidsvideos WHERE video_id = "'.$ext_v_code[1].'"' ); $duplicatecount = $db->loadResult(); if ($duplicatecount > 0 && $admin_import == false) { hwd_vs_tools::infomessage(4, 0, _HWDVIDS_TITLE_UPLDFAIL, _HWDVIDS_ALERT_DUPLICATE, "exclamation.png", 0); return; } else if ($duplicatecount > 0 && $admin_import == true) { return false; } $ext_v_title = $tp->$f_processt($embeddump, @$ext_v_code[1]); $ext_v_descr = $tp->$f_processd($embeddump, @$ext_v_code[1]); $ext_v_keywo = $tp->$f_processk($embeddump, @$ext_v_code[1]); $ext_v_durat = $tp->$f_processl($embeddump, @$ext_v_code[1]); if ($ext_v_code[0] == "0") { require_once(JPATH_SITE.'/plugins/hwdvs-thirdparty/remote.php'); $regs['domain'] = 'remote'; $tp = new hwd_vs_tp_remote(); $ext_v_code = $tp->remoteProcessCode($embeddump); $ext_v_title = $tp->remoteProcessTitle($embeddump, @$ext_v_code[1]); $ext_v_descr = $tp->remoteProcessDescription($embeddump, @$ext_v_code[1]); $ext_v_keywo = $tp->remoteProcessKeywords($embeddump, @$ext_v_code[1]); $ext_v_durat = $tp->remoteProcessDuration($embeddump, @$ext_v_code[1]); if ($ext_v_code[0] == "0") { hwd_vs_tools::infomessage(4, 0, _HWDVIDS_TITLE_UPLDFAIL, _HWDVIDS_INFO_TPPROCESSFAIL, "exclamation.png", 0); return; } //check if already exists $db->SetQuery( 'SELECT count(*) FROM #__hwdvidsvideos WHERE video_id = "'.$ext_v_code[1].'"' ); $duplicatecount = $db->loadResult(); if ($duplicatecount > 0 && $admin_import == false) { hwd_vs_tools::infomessage(4, 0, _HWDVIDS_TITLE_UPLDFAIL, _HWDVIDS_ALERT_DUPLICATE, "exclamation.png", 0); return; } else if ($duplicatecount > 0 && $admin_import == true) { return false; } } if ($ext_v_title[0] == 0) {$failures.=_HWDVIDS_INFO_TPTITLEFAIL."<br />";} if ($ext_v_descr[0] == 0) {$failures.=_HWDVIDS_INFO_TPDESCFAIL."<br />";} if ($ext_v_keywo[0] == 0) {$failures.=_HWDVIDS_INFO_TPKWFAIL."<br />";} if ($ext_v_durat[0] == 0) {$failures.=_HWDVIDS_INFO_TPDRFAIL."<br />";} } else if ($remote_verified == 0) { $error_msg = _HWDVIDS_ERROR_UPLDERR11."<br /><br />"._HWDVIDS_INFO_SUPPTPW."<br />".hwd_vs_tools::generateSupportedWebsiteList(); hwd_vs_tools::infomessage(4, 0, _HWDVIDS_TITLE_UPLDFAIL, $error_msg, "exclamation.png", 1); return; } $title = hwd_vs_tools::generatePostTitle($ext_v_title[1]); $description = hwd_vs_tools::generatePostDescription($ext_v_descr[1]); $tags = hwd_vs_tools::generatePostTags($ext_v_keywo[1]); $category_id = JRequest::getInt( 'category_id', 0, 'post' ); $public_private = JRequest::getWord( 'public_private' ); $allow_comments = JRequest::getInt( 'allow_comments', 0, 'post' ); $allow_embedding = JRequest::getInt( 'allow_embedding', 0, 'post' ); $allow_ratings = JRequest::getInt( 'allow_ratings', 0, 'post' ); $checkform = hwd_vs_tools::checkFormComplete($title, $description, $category_id, $tags, $public_private, $allow_comments, $allow_embedding, $allow_ratings); if (!$checkform) { return; } $row = new hwdvids_video($db); $password = Jrequest::getVar( 'hwdvspassword', '' ); if (!empty($password)) { $password = md5($password); $_POST['password'] = $password; } $_POST['video_type'] = $regs['domain']; $_POST['video_id'] = $ext_v_code[1]; $_POST['title'] = $title; $_POST['description'] = $description; $_POST['category_id'] = $category_id; $_POST['tags'] = $tags; $_POST['public_private'] = $public_private; $_POST['allow_comments'] = $allow_comments; $_POST['allow_embedding'] = $allow_embedding; $_POST['allow_ratings'] = $allow_ratings; $_POST['video_length'] = $ext_v_durat[1]; $_POST['date_uploaded'] = date('Y-m-d H:i:s'); if ($admin_import) { $_POST['user_id'] = $_REQUEST['user_id']; } else { $_POST['user_id'] = $my->id; } if ($c->aa3v == 1) { $_POST['approved'] = "yes"; $_POST['published'] = "1"; } else { $_POST['approved'] = "pending"; $_POST['published'] = "0"; } // bind it to the table if (!$row->bind($_POST)) { echo "<script type=\"text/javascript\">alert('".$row->getError()."');window.history.go(-1);</script>\n"; exit(); } // store it in the db if (!$row->store()) { echo "<script type=\"text/javascript\">alert('".$row->getError()."');window.history.go(-1);</script>\n"; exit(); } include_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'helpers'.DS.'events.php'); $params->title = $title; $params->id = $row->id; $params->category_id = $row->category_id; $params->type = $row->video_type; $params->user_id = $row->user_id; hwdvsEvent::onAfterVideoUpload($params); // save remote thumbnail to disk $data = @explode(",", $row->video_id); $thumburl = hwd_vs_tools::get_final_url( @$ext_v_code[2] ); $thumbbase = "tp-".$row->id.".jpg"; $thumbpath = JPATH_SITE.DS."hwdvideos".DS."thumbs".DS.$thumbbase; $ch = curl_init ($thumburl); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_BINARYTRANSFER,1); $rawdata=curl_exec($ch); curl_close ($ch); if(file_exists($thumbpath)) { unlink($thumbpath); } $fp = fopen($thumbpath,'x'); fwrite($fp, $rawdata); fclose($fp); if(file_exists($thumbpath)) { $db->SetQuery( "UPDATE #__hwdvidsvideos SET `thumbnail` = \"$thumbbase\" WHERE id = $row->id" ); $db->Query(); } $video = new hwdvids_video($db); $video->load( $row->id ); if (!$admin_import) { hwd_vs_html::addConfirm($title, $failures, $video); } else { return true; } }
/** * save categories */ function savegroup() { global $option; $db =& JFactory::getDBO(); $app = & JFactory::getApplication(); $access_lev_u = Jrequest::getVar( 'access_lev_u', '0' ); $access_lev_v = Jrequest::getVar( 'access_lev_v', '0' ); $row = new hwdvids_group($db); $_POST['category_name'] = Jrequest::getVar( 'category_name', 'no name supplied' ); $_POST['category_description'] = Jrequest::getVar( 'category_description', 'no name supplied' ); $_POST['access_lev_u'] = @implode(",", $access_lev_u); $_POST['access_lev_v'] = @implode(",", $access_lev_v); // bind it to the table if (!$row -> bind($_POST)) { echo "<script> alert('" .$row -> getError() ."'); window.history.go(-1); </script>\n"; exit(); } // store it in the db if (!$row -> store()) { echo "<script> alert('" .$row -> getError() ."'); window.history.go(-1); </script>\n"; exit(); } $row->checkin(); // perform maintenance include(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'libraries'.DS.'maintenance_recount.class.php'); hwd_vs_recount::recountVideosInCategory(); hwd_vs_recount::recountSubcatsInCategory(); $msg = $total ._HWDVIDS_ALERT_GRPSAVED; $app->enqueueMessage($msg); $app->redirect( JURI::root( true ) . '/administrator/index.php?option='.$option.'&task=groups' ); }
/** * reset failed conversions */ function resetfconv() { global $option, $limit, $limitstart; $db =& JFactory::getDBO(); $app = & JFactory::getApplication(); $video_id = Jrequest::getInt( 'video_id', '' ); $new_status = Jrequest::getVar( 'new_status', '' ); if (!empty($video_id) && !empty($new_status)) { $db->SetQuery("UPDATE #__hwdvidsvideos SET approved = '".$new_status."' WHERE id = ".$video_id); $db->Query(); if ( !$db->query() ) { echo "<script> alert('".$db->getErrorMsg()."'); window.history.go(-1); </script>\n"; exit(); } $app->redirect( JURI::root( true ) . '/administrator/index.php?option=com_hwdvideoshare&task=videos' ); exit(); } $db->SetQuery("UPDATE #__hwdvidsvideos SET approved = 'queuedforconversion' WHERE approved LIKE 'converting_queuedforcon%'"); $db->Query(); if ( !$db->query() ) { echo "<script> alert('".$db->getErrorMsg()."'); window.history.go(-1); </script>\n"; exit(); } $db->SetQuery("UPDATE #__hwdvidsvideos SET approved = 'queuedforthumbnail' WHERE approved LIKE 'converting_queuedforthu%'"); $db->Query(); if ( !$db->query() ) { echo "<script> alert('".$db->getErrorMsg()."'); window.history.go(-1); </script>\n"; exit(); } $db->SetQuery("UPDATE #__hwdvidsvideos SET approved = 'queuedforswf' WHERE approved LIKE 'converting_queuedforswf%'"); $db->Query(); if ( !$db->query() ) { echo "<script> alert('".$db->getErrorMsg()."'); window.history.go(-1); </script>\n"; exit(); } $db->SetQuery("UPDATE #__hwdvidsvideos SET approved = 'queuedformp4' WHERE approved LIKE 'converting_queuedformp4%'"); $db->Query(); if ( !$db->query() ) { echo "<script> alert('".$db->getErrorMsg()."'); window.history.go(-1); </script>\n"; exit(); } $db->SetQuery("UPDATE #__hwdvidsvideos SET approved = 're-calculate_duration' WHERE approved LIKE 'converting_re-calculate_duration%'"); $db->Query(); if ( !$db->query() ) { echo "<script> alert('".$db->getErrorMsg()."'); window.history.go(-1); </script>\n"; exit(); } $db->SetQuery("UPDATE #__hwdvidsvideos SET approved = 're-generate_thumb' WHERE approved LIKE 'converting_re-generate_thumb%'"); $db->Query(); if ( !$db->query() ) { echo "<script> alert('".$db->getErrorMsg()."'); window.history.go(-1); </script>\n"; exit(); } $app->redirect( JURI::root( true ) . '/administrator/index.php?option='.$option.'&task=startconverter' ); exit(); }
function jombackupEmail($bkuparray,$jb_mailfrom,$jb_fromname,$Attachment,$Body,$jb_livesite) { $ToEmail = Jrequest::getVar( 'recipient', $jb_mailfrom ); $Subject = Jrequest::getVar( 'subject', 'hwdVideoShare SQL Backup' ); $Body = Jrequest::getVar( 'body', 'hwdVideoShare backup completed successfully at ' ); $Body = $Body." ".$jb_fromname; $FromName = $bkuparray['fromname']; if (empty($ToEmail)) {$ToEmail=$jb_mailfrom;} if (empty($Subject)) {$Subject="hwdVideoShare SQL Backup";} if (empty($Body)) {$Body="hwdVideoShare backup completed successfully.";} JUtility::sendMail($jb_mailfrom, $FromName, $ToEmail, $Subject.' '.$jb_livesite, $Body, $mode=0, $cc=NULL, $bcc=NULL, $Attachment); }
/** * for associated product access * * @return OBJECT. * * @since 1.6 */ public function getEventsproduct() { $db = JFactory::getDBO(); $query = "SELECT i.* FROM `#__jrob_product_xref`as x , `#__kart_items` as i\n\t\t\t\t\tWHERE x.`product_id` = i.item_id and `eventid` = '" . Jrequest::getVar('id') . "'"; $db->setQuery($query); $balance = $db->loadObjectList(); return $balance; }
/** * save categories */ function savecategories() { global $option; $db = & JFactory::getDBO(); $app = & JFactory::getApplication(); $c = hwd_vs_Config::get_instance(); $access_lev_u = Jrequest::getVar( 'access_lev_u', '0' ); $access_lev_v = Jrequest::getVar( 'access_lev_v', '0' ); $row = new hwdvids_cats($db); if (isset($_FILES['thumbnail_file']['error'])) { $file_name_org = $_FILES['thumbnail_file']['name']; $file_ext = substr($file_name_org, strrpos($file_name_org, '.') + 1); $thumbnail_url = JURI::root( true ).'/hwdvideos/thumbs/category'.$_POST['id'].'.'.$file_ext; $base_Dir = JPATH_SITE.DS.'hwdvideos'.DS.'thumbs'.DS; $thumbnail_name = 'category'.$_POST['id']; $upload_result = hwd_vs_tools::uploadFile("thumbnail_file", $thumbnail_name, $base_Dir, 2, "jpg,jpeg", 1); if ($upload_result[0] == "0") { $msg = $upload_result[1]; $app->enqueueMessage($msg); } else { include_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'libraries'.DS.'thumbnail.inc.php'); $thumb_path_s = JPATH_SITE.DS.'hwdvideos'.DS.'thumbs'.DS.$thumbnail_name.'.'.$file_ext; $twidth_s = round($c->con_thumb_n); $theight_s = round($c->con_thumb_n*$c->tar_fb); list($width, $height, $type, $attr) = @getimagesize($thumb_path_s); $ratio = $height/$width; if ($ratio < $c->tar_fb) { $resized_s = new Thumbnail($thumb_path_s); $resized_s->resize(1000, $theight_s); $resized_s->cropFromCenter($twidth_s, $theight_s); $resized_s->save($thumb_path_s); $resized_s->destruct(); } else { $resized_s = new Thumbnail($thumb_path_s); $resized_s->resize($twidth_s,1000); $resized_s->cropFromCenter($twidth_s, $theight_s); $resized_s->save($thumb_path_s); $resized_s->destruct(); } } // update db with new thumbnail $db->SetQuery("UPDATE #__hwdvidscategories SET thumbnail = '$thumbnail_url' WHERE id = ".intval($_POST['id'])); $db->Query(); if ( !$db->query() ) { echo "<script> alert('".$db->getErrorMsg()."'); window.history.go(-1); </script>\n"; exit(); } $msg = "Thumbnail was successfully uploaded"; $app->enqueueMessage($msg); $app->redirect( 'index.php?option=com_hwdvideoshare&Itemid='.$Itemid.'&task=editcatA&hidemainmenu=1&cid='.$_POST['id'] ); } else { if (intval($_POST['id']) !== 0 && (intval($_POST['id']) == intval($_POST['parent']))) { $app->enqueueMessage(_HWDVIDS_ALERT_PARENTNOTSELF); $app->redirect( JURI::root( true ) . '/administrator/index.php?option='.$option.'&task=categories' ); } $_POST['category_name'] = Jrequest::getVar( 'category_name', 'no name supplied' ); $_POST['category_description'] = Jrequest::getVar( 'category_description', 'no name supplied' ); $_POST['access_lev_u'] = @implode(",", $access_lev_u); $_POST['access_lev_v'] = @implode(",", $access_lev_v); } // bind it to the table if (!$row -> bind($_POST)) { echo "<script> alert('" .$row -> getError() ."'); window.history.go(-1); </script>\n"; exit(); } if(empty($row->category_name)) { $app->enqueueMessage(_HWDVIDS_NOTITLE); $app->redirect( JURI::root( true ) . '/administrator/index.php?option='.$option.'&task=categories' ); } // store it in the db if (!$row -> store()) { echo "<script> alert('" .$row -> getError() ."'); window.history.go(-1); </script>\n"; exit(); } $row->checkin(); // perform maintenance include(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'libraries'.DS.'maintenance_recount.class.php'); hwd_vs_recount::recountSubcatsInCategory(); $app->enqueueMessage(_HWDVIDS_ALERT_CATSAVED); $app->redirect( JURI::root( true ) . '/administrator/index.php?option='.$option.'&task=categories' ); }
function display($tpl = null) { global $mainframe, $option; $user =& JFactory::getUser(); $pathway =& $mainframe->getPathway(); $document =& JFactory::getDocument(); $model =& $this->getModel(); // Get the parameters of the active menu item $menus =& JSite::getMenu(); $menu = $menus->getActive(); $pparams =& $mainframe->getParams('com_catsone'); // Push a model into the view $modelDetails =& $this->getModel('details'); $options['joborder_id'] = Jrequest::getVar('id'); $details = $modelDetails->getDetails($options); //print_r($details); $user =& JFactory::getUser(); if ($user->guest) { $link = 'index.php?option=com_user&view=login&return=' . base64_encode('index.php?option=com_catsone&task=apply&id=' . $options['joborder_id']); } else { $link = 'index.php?option=com_catsone&task=apply&id=' . $options['joborder_id']; } ?> <table cellpadding=0 cellspacing=0 width=100%> <tr> <td width="100%" bgcolor='#efefef' height=30 style='border-bottom:1px solid gray;' colspan=2> <center> <b> Job Description </b> </center> </td> </tr> <tr> <td width=100% style='padding-top:20px;' valign="top" style='border-right:1px solid white;'> <table cellpadding="0" cellspacing="0" width="100%" valign=top> <tr> <td width=50% valign=top> <table cellpadding=0 cellspacing=0 width=100% valign=top> <tr> <td width="100%" bgcolor='#efefef' height=25 style="padding-left:20px;"> <table celllpadding=0 cellspacing=0 width=100%> <tr> <td width=40%> <b> Position : </b> </b> </td> <td width=60%> <?php echo $details->titlejob; ?> </td> </tr> </table> </td> </tr> <tr> <td width="100%" bgcolor='white' height=25 style="padding-left:20px;"> <table celllpadding=0 cellspacing=0 width=100%> <tr> <td width=40%> <b> Location : </b> </b> </td> <td width=60%> <?php echo $details->address; ?> <?php echo $details->scity; ?> , <?php echo $details->sstate; ?> </td> </tr> </table> </tr> <tr> <td width="100%" bgcolor='#efefef' height=25 style="padding-left:20px;"> <table celllpadding=0 cellspacing=0 width=100%> <tr> <td width=40%> <b> Maximum salary : </b> </b> </td> <td width=60%> <?php echo $details->rate_max; ?> </td> </tr> </table> </tr> <tr> <td width="100%" bgcolor='white' height=25 style="padding-left:20px;"> <table celllpadding=0 cellspacing=0 width=100%> <tr> <td width=40%> <b> Start Date : </b> </b> </td> <td width=60%> <?php $temp = $details->start_date; $a = explode(" ", $temp); echo $a[0]; ?> </td> </tr> </table> </tr> </table> </td> <td width=50% valign=top> <table cellpadding=0 cellspacing=0 width=100% valign=top> <tr> <td width="100%" bgcolor='#efefef' height=25 style="padding-left:20px;"> <table celllpadding=0 cellspacing=0 width=100%> <tr> <td width=40%> <b> Contract duration : </b> </b> </td> <td width=60%> <?php echo $details->duration; ?> </td> </tr> </table> </td> </tr> <tr> <td width="100%" bgcolor='white' height=25 style="padding-left:20px;"> <table celllpadding=0 cellspacing=0 width=100%> <tr> <td width=40%>Apply <b> Type of Offer : </b> </b> </td> <td width=60%> <?php if ($details->type == "H") { echo "Permanent"; } elseif ($details->type == "C2H") { echo "Contract to Hire"; } elseif ($details->type == "C") { echo "Contractor"; } elseif ($details->type == "FL") { echo "Freelancer"; } ?> </td> </tr> </table></td></tr> <tr> <td width="100%" bgcolor='#efefef' height=25 style="padding-left:20px;"> <table celllpadding=0 cellspacing=0 width=100%> <tr> <td width=40%> <b> Created : </b> </b> </td> <td width=60%> <?php echo $details->date_created; ?> </td> </tr> </table> </td> </tr> <tr> <td width="100%" bgcolor='white' height=25 style="padding-left:20px;border-bottom:1px solid #efefef;"> <table celllpadding=0 cellspacing=0 width=100%> <tr> <td width=40%> <b> Salary : </b> </b> </td> <td width=60%> <?php echo $details->salary; ?> </td> </tr> </table> </tr> </table> </td> </tr> <tr> <td colspan=2 style='border:1px solid #efefef;padding:20px;border-top:1px solid gray;border-bottom:1px solid gray;'> <b> Job Description: </b> <br> <?php echo $details->description; ?> </td> </tr> <tr> <td width=100% colspan=2 height=35> <center> <a href='javascript:history.go(-1);'>Back</a> - <a href="<?php echo $link; ?> ">Apply for a Job</a> </center> </td> </tr> </table> </td> </tr> </table> <?php // parent::display($tpl); }
function generatePostTags($raw_tags=null) { if (empty($raw_tags)) { $raw_tags = Jrequest::getVar( 'tags', _HWDVIDS_UNKNOWN ); } $tags = ''; $tag_arr_co = explode(",", $raw_tags); for ($j=0, $m=count($tag_arr_co); $j < $m; $j++) { $row_co = $tag_arr_co[$j]; $row_co = hwdEncoding::charset_decode_utf_8($row_co); $row_co = preg_replace("/[^a-zA-Z0-9s_&#; -]/", "", $row_co); $row_co = hwdEncoding::charset_encode_utf_8($row_co); $row_co = htmlspecialchars_decode($row_co); $row_co = addslashes($row_co); if (!empty($row_co)) { $tags.= $row_co.","; } } if (substr($tags, -1) == ",") {$tags = substr($tags, 0, -1);} return $tags; }
function search() { global $mainframe; jimport('joomla.database.database'); jimport('joomla.database.table'); $conf =& JFactory::getConfig(); /* $host = $conf->getValue('config.host'); $user = $conf->getValue('config.user'); $password = $conf->getValue('config.password'); $database = $conf->getValue('config.db'); $prefix = $conf->getValue('config.dbprefix'); $driver = $conf->getValue('config.dbtype'); $debug = $conf->getValue('config.debug'); $optionDb = array ( 'driver' => $driver, 'host' => $host, 'user' => $user, 'password' => $password, 'database' => 'hronline_Vope302', 'prefix' => "" ); */ /*$host = $conf->getValue('config.host'); $driver = $conf->getValue('config.dbtype'); $optionDb = array ( 'driver' => $driver, 'host' => 'localhost', 'user' => 'xxxxxxxxxx', 'password' => 'xxxxxxxxxxx', 'database' => 'xxxxxxxxxxx', 'prefix' => "" ); $db =& JDatabase::getInstance( $optionDb );*/ $keyword = Jrequest::getVar('keyword'); if ($keyword != "") { $query = "Select joborder.*,extra_field.*,user.user_id,user.last_name,company.company_id,company.name from joborder,extra_field,user,company where extra_field.data_item_id = joborder.joborder_id and joborder.status = 'active' and joborder.entered_by = user.user_id and joborder.company_id = company.company_id and joborder.public = '1' and joborder.title like '%" . $keyword . "%'"; } $this->CatsDb->setQuery($query); $total = count($this->CatsDb->loadObjectList()); $limit = JRequest::getVar('limit', $mainframe->getCfg('list_limit'), '', 'int'); $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $options['limit'] = $limit; $options['limitstart'] = $limitstart; $this->CatsDb->setQuery($query, $options['limitstart'], $options['limit']); $row = $this->CatsDb->loadObjectList(); $pathway =& $mainframe->getPathway(); jimport('joomla.html.pagination'); $pagination = new JPagination($total, $limitstart, $limit); $this->assignRef('keyword', $keyword); $this->assignRef('row', $row); $this->assignRef('pagination', $pagination); parent::display("showSearch"); }
/** * Delete videos */ function deleteVideo() { global $mainframe, $Itemid; $c = hwd_vs_Config::get_instance(); $db = & JFactory::getDBO(); $my = & JFactory::getUser(); $app = & JFactory::getApplication(); $videoid = JRequest::getInt( 'videoid', 0, 'post' ); $url = Jrequest::getVar( 'url', '' ); $row = new hwdvids_video($db); $row->load( $videoid ); // check component access settings and deny those without privileges if ($c->access_method == 0) { if (!hwd_vs_access::allowAccess( $c->gtree_mdrt, $c->gtree_mdrt_child, hwd_vs_access::userGID( $my->id ))) { if ($my->id == $row->user_id) { if ($my->id == "0") { $app->enqueueMessage(_HWDVIDS_ALERT_NOPERM); if (!empty($url)) { $app->redirect( $url ); } else { $app->redirect( JURI::root( true ) . '/index.php?option=com_hwdvideoshare&Itemid='.$Itemid ); } } if ($c->allowvidedit == "0") { $app->enqueueMessage(_HWDVIDS_ALERT_NOPERM); if (!empty($url)) { $app->redirect( $url ); } else { $app->redirect( JURI::root( true ) . '/index.php?option=com_hwdvideoshare&Itemid='.$Itemid ); } } // continue } else { $app->enqueueMessage(_HWDVIDS_ALERT_NOPERM); if (!empty($url)) { $app->redirect( $url ); } else { $app->redirect( JURI::root( true ) . '/index.php?option=com_hwdvideoshare&Itemid='.$Itemid ); } } } } $db->SetQuery("UPDATE #__hwdvidsvideos SET approved = 'deleted', published = 0, featured = 0 WHERE id = $videoid"); $db->Query(); if ( !$db->query() ) { echo "<script> alert('".$db->getErrorMsg()."'); window.history.go(-1); </script>\n"; exit(); } $app->enqueueMessage(_HWDVIDS_ALERT_ADMIN_USERVIDDEL); if (!empty($url)) { $app->redirect( $url ); } else { $app->redirect( JURI::root( true ) . '/index.php?option=com_hwdvideoshare&Itemid='.$Itemid ); } }
function display($tpl = null) { $mainframe =& JFactory::getApplication(); // ajax in event form, or standalone ? $standalone = Jrequest::getVar('standalone', 0); if (!$standalone && $this->getLayout() == 'closexref') { $this->_displayclosexref($tpl); return; } if ($standalone) { $document =& JFactory::getDocument(); $document->setTitle(JText::_('COM_REDEVENT_PAGETITLE_EDITSESSION')); $document->addStyleSheet('components/com_redevent/assets/css/redeventbackend.css'); // Set toolbar items for the page $edit = JRequest::getVar('edit', true); $text = !$edit ? JText::_('COM_REDEVENT_New') : JText::_('COM_REDEVENT_Edit'); JToolBarHelper::title(JText::_('COM_REDEVENT_SESSION') . ': <small><small>[ ' . $text . ' ]</small></small>'); JToolBarHelper::save(); JToolBarHelper::apply(); if (JPluginHelper::isEnabled('system', 'autotweetredevent')) { //If the AutoTweet NG Component is installed // Ignore warnings because component may not be installed $warnHandlers = JERROR::getErrorHandling(E_WARNING); JERROR::setErrorHandling(E_WARNING, 'ignore'); if (JComponentHelper::isEnabled('com_autotweet', true)) { JToolBarHelper::save('saveAndTwit', 'Save & twit'); } // Reset the warning handler(s) foreach ($warnHandlers as $mode) { JERROR::setErrorHandling(E_WARNING, $mode); } } if (!$edit) { JToolBarHelper::cancel(); } else { // for existing items the button is renamed `close` JToolBarHelper::cancel('cancel', 'Close'); } } //initialise variables $editor =& JFactory::getEditor(); $document =& JFactory::getDocument(); $uri =& JFactory::getURI(); $elsettings = JComponentHelper::getParams('com_redevent'); //add css and js to document //JHTML::_('behavior.modal', 'a.modal'); JHTML::_('behavior.tooltip'); JHTML::_('behavior.formvalidation'); jimport('joomla.html.pane'); $document->addScript(JURI::root() . 'components/com_redevent/assets/js/xref_recurrence.js'); $document->addScript(JURI::root() . 'components/com_redevent/assets/js/xref_roles.js'); $document->addScript(JURI::root() . 'components/com_redevent/assets/js/xref_prices.js'); $document->addScriptDeclaration('var txt_remove = "' . JText::_('COM_REDEVENT_REMOVE') . '";'); //Build the image select functionality $js = "\n\t\tfunction elSelectImage(image, imagename) {\n\t\t\tdocument.getElementById('a_image').value = image;\n\t\t\tdocument.getElementById('a_imagename').value = imagename;\n\t\t\tdocument.getElementById('sbox-window').close();\n\t\t}"; $xref = $this->get('xref'); $xref->eventid = $xref->eventid ? $xref->eventid : JRequest::getVar('eventid', 0, 'request', 'int'); $customfields =& $this->get('XrefCustomfields'); $roles =& $this->get('SessionRoles'); $prices =& $this->get('SessionPrices'); $lists = array(); // venues selector $venues = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_Select_Venue'))); $venues = array_merge($venues, $this->get('VenuesOptions')); $lists['venue'] = JHTML::_('select.genericlist', $venues, 'venueid', 'class="validate-venue"', 'value', 'text', $xref->venueid); // group selector $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_Select_group'))); $options = array_merge($options, $this->get('GroupsOptions')); $lists['group'] = JHTML::_('select.genericlist', $options, 'groupid', '', 'value', 'text', $xref->groupid); // if this is not the first xref of the recurrence, we shouldn't modify it $lockedrecurrence = $xref->count > 0; // Recurrence selector $recur_type = array(JHTML::_('select.option', 'NONE', JText::_('COM_REDEVENT_NO_REPEAT')), JHTML::_('select.option', 'DAILY', JText::_('COM_REDEVENT_DAILY')), JHTML::_('select.option', 'WEEKLY', JText::_('COM_REDEVENT_WEEKLY')), JHTML::_('select.option', 'MONTHLY', JText::_('COM_REDEVENT_MONTHLY')), JHTML::_('select.option', 'YEARLY', JText::_('COM_REDEVENT_YEARLY'))); $lists['recurrence_type'] = JHTML::_('select.radiolist', $recur_type, 'recurrence_type', '', 'value', 'text', $xref->rrules->type); // published state selector $published = array(JHTML::_('select.option', '1', JText::_('COM_REDEVENT_PUBLISHED')), JHTML::_('select.option', '0', JText::_('COM_REDEVENT_UNPUBLISHED')), JHTML::_('select.option', '-1', JText::_('COM_REDEVENT_ARCHIVED'))); $lists['published'] = JHTML::_('select.radiolist', $published, 'published', '', 'value', 'text', $xref->published); // featured state selector $options = array(JHTML::_('select.option', '0', JText::_('COM_REDEVENT_SESSION_NOT_FEATURED')), JHTML::_('select.option', '1', JText::_('COM_REDEVENT_SESSION_IS_FEATURED'))); $lists['featured'] = JHTML::_('select.booleanlist', 'featured', '', $xref->featured); $pane =& JPane::getInstance('tabs'); $rolesoptions = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_Select_role'))); $rolesoptions = array_merge($rolesoptions, $this->get('RolesOptions')); $pricegroupsoptions = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_PRICEGROUPS_SELECT_PRICEGROUP'))); $pricegroupsoptions = array_merge($pricegroupsoptions, $this->get('PricegroupsOptions')); if (JRequest::getVar('task') == 'copy') { $xref->id = null; $xref->recurrence_id = null; } //assign to template $this->assignRef('xref', $xref); $this->assignRef('editor', $editor); $this->assignRef('lists', $lists); $this->assignRef('request_url', $uri->toString()); $this->assignRef('elsettings', $elsettings); $this->assignRef('customfields', $customfields); $this->assignRef('pane', $pane); $this->assignRef('roles', $roles); $this->assignRef('rolesoptions', $rolesoptions); $this->assignRef('prices', $prices); $this->assignRef('pricegroupsoptions', $pricegroupsoptions); $this->assign('standalone', $standalone); parent::display($tpl); }
/** * edit videos */ function updateVideoSource() { global $option; $db =& JFactory::getDBO(); $my = & JFactory::getUser(); $app = & JFactory::getApplication(); $c = hwd_vs_Config::get_instance(); $video_type = Jrequest::getVar( 'videotype', '0' ); $video_id = Jrequest::getVar( 'id', '0' ); $updatedetails = Jrequest::getVar( 'updatedetails', '0' ); $admin_import = true; require_once(JPATH_SITE.DS.'components'.DS.'com_hwdvideoshare'.DS.'models'.DS.'uploads.php'); $row = new hwdvids_video($db); $row->load( $video_id ); if ($video_type == 1) { $requestarray = JRequest::get( 'default', 2 ); $embeddump = $requestarray['embeddump']; $remote_verified = null; $parsedurl = parse_url($embeddump); if (empty($parsedurl['host'])) { $parsedurl['host'] = ''; } preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $parsedurl['host'], $regs); if (empty($regs['domain'])) { $regs['domain'] = ''; } if ($regs['domain'] == 'youtube.com' && file_exists(JPATH_SITE.'/plugins/hwdvs-thirdparty/youtube.php')) { require_once(JPATH_SITE.'/plugins/hwdvs-thirdparty/youtube.php'); } else if ($regs['domain'] == 'google.com' && file_exists(JPATH_SITE.'/plugins/hwdvs-thirdparty/google.php')) { require_once(JPATH_SITE.'/plugins/hwdvs-thirdparty/google.php'); } else if (file_exists(JPATH_SITE.'/plugins/hwdvs-thirdparty/'.$regs['domain'].'.php')) { require_once(JPATH_SITE.'/plugins/hwdvs-thirdparty/'.$regs['domain'].'.php'); } else { $pos_flv = strpos($embeddump, ".flv"); if ($pos_flv === false) { $remote_verified = 0; } else { $pos_flv = $pos_flv+4; $datadump = substr($embeddump, 0, $pos_flv); $pos_http = mb_strrpos($datadump, "http://"); if ($pos_http === false) { $error_msg = _HWDVIDS_ERROR_UPLDERR11."<br /><br />"._HWDVIDS_INFO_SUPPTPW."<br />".hwd_vs_tools::generateSupportedWebsiteList(); hwd_vs_tools::infomessage(4, 0, _HWDVIDS_TITLE_UPLDFAIL, $error_msg, "exclamation.png", 1); return; } else { $url = substr($datadump, $pos_http); } $pru = parse_url($url); $remoteurl = $pru['scheme']."://".$pru['host'].$pru['path']; if(!preg_match("/^[a-zA-Z]+[:\/\/]+[A-Za-z0-9\-_]+\\.+[A-Za-z0-9\.\/%&=\?\-_]+$/i",$remoteurl)) { $remote_verified = 0; } else { $filegrab = @file_get_contents($remoteurl, null, null, 0, 16); $filecheck = @strpos($remoteurl, "flv"); if (isset($remoteurl) && !empty($remoteurl) && $filecheck !== false) { $remote_verified = 1; } else { $remote_verified = 0; } } } } $failures = ""; if (!isset($remote_verified)) { $cn = 'hwd_vs_tp_'.preg_replace("/[^a-zA-Z0-9s_-]/", "", $regs['domain']); $f_processc = preg_replace("/[^a-zA-Z0-9s_-]/", "", $regs['domain']).'processCode'; $f_processt = preg_replace("/[^a-zA-Z0-9s_-]/", "", $regs['domain']).'processTitle'; $f_processd = preg_replace("/[^a-zA-Z0-9s_-]/", "", $regs['domain']).'processDescription'; $f_processk = preg_replace("/[^a-zA-Z0-9s_-]/", "", $regs['domain']).'processKeywords'; $f_processl = preg_replace("/[^a-zA-Z0-9s_-]/", "", $regs['domain']).'processDuration'; $tp = new $cn(); $ext_v_code = $tp->$f_processc($embeddump); $ext_v_title = $tp->$f_processt($embeddump, @$ext_v_code[2]); $ext_v_descr = $tp->$f_processd($embeddump, @$ext_v_code[2]); $ext_v_keywo = $tp->$f_processk($embeddump, @$ext_v_code[2]); $ext_v_durat = $tp->$f_processl($embeddump, @$ext_v_code[2]); if ($ext_v_code[0] == "0") { hwd_vs_tools::infomessage(4, 0, _HWDVIDS_TITLE_UPLDFAIL, _HWDVIDS_INFO_TPPROCESSFAIL, "exclamation.png", 0); return; } if ($ext_v_title[0] == 0) {$failures.=_HWDVIDS_INFO_TPTITLEFAIL."<br />";} if ($ext_v_descr[0] == 0) {$failures.=_HWDVIDS_INFO_TPDESCFAIL."<br />";} if ($ext_v_keywo[0] == 0) {$failures.=_HWDVIDS_INFO_TPKWFAIL."<br />";} if ($ext_v_durat[0] == 0) {$failures.=_HWDVIDS_INFO_TPDRFAIL."<br />";} } else if ($remote_verified == 0) { $error_msg = _HWDVIDS_ERROR_UPLDERR11."<br /><br />"._HWDVIDS_INFO_SUPPTPW."<br />".hwd_vs_tools::generateSupportedWebsiteList(); hwd_vs_tools::infomessage(4, 0, _HWDVIDS_TITLE_UPLDFAIL, $error_msg, "exclamation.png", 1); return; } else if ($remote_verified == 1) { $ext_v_code[1] = $remoteurl.","; $ext_v_title[1] = _HWDVIDS_UNKNOWN; $ext_v_descr[1] = _HWDVIDS_UNKNOWN; $ext_v_keywo[1] = _HWDVIDS_UNKNOWN; $ext_v_durat[1] = "0:00:00"; $regs['domain'] = "remote"; } //check if already exists $db->SetQuery( 'SELECT count(*) FROM #__hwdvidsvideos WHERE video_id = "'.$ext_v_code[1].'"' ); $duplicatecount = $db->loadResult(); $admin_import = false; if ($duplicatecount > 0 && $admin_import == false) { hwd_vs_tools::infomessage(4, 0, _HWDVIDS_TITLE_UPLDFAIL, _HWDVIDS_ALERT_DUPLICATE, "exclamation.png", 0); return; } else if ($duplicatecount > 0 && $admin_import == true) { return false; } $title = $ext_v_title[1]; $title = stripslashes($title); $title = stripslashes($title); $title = hwdEncoding::charset_decode_utf_8($title); $title = hwdEncoding::charset_encode_utf_8($title); $title = htmlspecialchars_decode($title); $title = addslashes($title); $description = $ext_v_descr[1]; $description = stripslashes($description); $description = stripslashes($description); $description = hwdEncoding::charset_decode_utf_8($description); $description = hwdEncoding::charset_encode_utf_8($description); $description = htmlspecialchars_decode($description); $description = addslashes($description); $raw_tags = $ext_v_keywo[1]; $tags = ''; $tag_arr_co = explode(",", $raw_tags); for ($j=0, $m=count($tag_arr_co); $j < $m; $j++) { $row_co = $tag_arr_co[$j]; $tag_arr_sp = explode(" ", $row_co); for ($k=0, $p=count($tag_arr_sp); $k < $p; $k++) { $row_sp = $tag_arr_sp[$k]; $row_sp = hwdEncoding::charset_decode_utf_8($row_sp); $row_sp = preg_replace("/[^a-zA-Z0-9s_&#;-]/", "", $row_sp); $row_sp = hwdEncoding::charset_encode_utf_8($row_sp); if (!empty($row_sp)) { $tags.= $row_sp.","; } } } if (substr($tags, -2) == ", ") {$tags = substr($tags, 0, -2);} if (empty($title)) { $title = _HWDVIDS_UNKNOWN;} if (empty($description)) { $description = _HWDVIDS_UNKNOWN;} if (empty($tags)) { $tags = _HWDVIDS_UNKNOWN;} $_POST['video_type'] = $regs['domain']; $_POST['video_id'] = $ext_v_code[1]; if ($updatedetails == "on") { $_POST['title'] = $ext_v_title[1]; $_POST['description'] = $ext_v_descr[1]; $_POST['tags'] = $ext_v_keywo[1]; } // bind it to the table if (!$row -> bind($_POST)) { echo "<script> alert('" .$row -> getError() ."'); window.history.go(-1); </script>\n"; exit(); } // store it in the db if (!$row -> store()) { echo "<script> alert('" .$row -> getError() ."'); window.history.go(-1); </script>\n"; exit(); } $row->checkin(); } else if ($video_type == 2) { $data = explode(",", $row->video_id); $thumbnail = @$data[1]; $requestarray = JRequest::get( 'default', 2 ); $videourl = $requestarray['embeddump']; $validated_video_url = hwd_vs_tools::validateUrl($videourl); if (empty($validated_video_url)) { $msg = _HWDVIDS_ALERT_VURLWRONG; $app->enqueueMessage($msg); $app->redirect(JURI::root( true )."/administrator/index.php?option=com_hwdvideoshare&task=editvidsA&hidemainmenu=1&cid=".$row->id); } $new_video_id = $validated_video_url.",".$thumbnail; $_POST['video_type'] = "remote"; $_POST['video_id'] = $new_video_id; if (empty($row->thumbnail) && !empty($thumbnail)) { $_POST['thumbnail'] = $thumbnail; } // bind it to the table if (!$row->bind($_POST)) { echo "<script type=\"text/javascript\">alert('".$row->getError()."');window.history.go(-1);</script>\n"; exit(); } // store it in the db if (!$row->store()) { echo "<script type=\"text/javascript\">alert('".$row->getError()."');window.history.go(-1);</script>\n"; exit(); } $row->checkin(); } else if ($video_type == 3) { $data = explode(",", $row->video_id); $thumbnail = @$data[1]; $requestarray = JRequest::get( 'default', 2 ); $rtmpurl = $requestarray['embeddump']; $validated_rtmpurl = hwd_vs_tools::validateUrl($rtmpurl); if (empty($validated_rtmpurl)) { $msg = _HWDVIDS_ALERT_VURLWRONG; $app->enqueueMessage($msg); $app->redirect(JURI::root( true )."/administrator/index.php?option=com_hwdvideoshare&task=editvidsA&hidemainmenu=1&cid=".$row->id); } $new_video_id = $validated_rtmpurl; $_POST['video_type'] = "rtmp"; $_POST['video_id'] = $new_video_id; if (empty($row->thumbnail) && !empty($thumbnail)) { $_POST['thumbnail'] = $thumbnail; } // bind it to the table if (!$row->bind($_POST)) { echo "<script type=\"text/javascript\">alert('".$row->getError()."');window.history.go(-1);</script>\n"; exit(); } // store it in the db if (!$row->store()) { echo "<script type=\"text/javascript\">alert('".$row->getError()."');window.history.go(-1);</script>\n"; exit(); } $row->checkin(); } require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'libraries'.DS.'maintenance_recount.class.php'); hwd_vs_recount::recountVideosInCategory($row->category_id); $app->enqueueMessage(_HWDVIDS_ALERT_VIDSAVED); $app->redirect( JURI::root( true ) . '/administrator/index.php?option='.$option.'&task=editvidsA&hidemainmenu=1&cid='.$row->id ); }
/** * Outputs frontpage HTML * * @return Nothing */ function leavegroup() { global $Itemid, $mainframe; $c = hwd_vs_Config::get_instance(); $db = & JFactory::getDBO(); $my = & JFactory::getUser(); $acl= & JFactory::getACL(); if (!hwd_vs_access::checkAccess($c->gtree_grup, $c->gtree_grup_child, 4, 0, _HWDVIDS_TITLE_NOACCESS, _HWDVIDS_ALERT_REGISTERFORGRUP, _HWDVIDS_ALERT_GRUP_NOT_AUTHORIZED, "exclamation.png", 0, "core.frontend.group")) {return;} $url = Jrequest::getVar( 'url', JURI::root() ); if (!$my->id) { $mainframe->enqueueMessage(_HWDVIDS_ALERT_LOG2LEAVEG); $mainframe->redirect( $url ); } $memberid = $my->id; $groupid = JRequest::getInt( 'groupid', 0 ); $where = ' WHERE memberid = '.$memberid; $where .= ' AND groupid = '.$groupid; $db->SetQuery( 'DELETE FROM #__hwdvidsgroup_membership' . $where ); if ( !$db->query() ) { echo "<script> alert('".$db->getErrorMsg()."'); window.history.go(-1); </script>\n"; exit(); } // perform maintenance require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'libraries'.DS.'maintenance_recount.class.php'); hwd_vs_recount::recountMembersInGroup($groupid); $api_AUP = JPATH_SITE.DS.'components'.DS.'com_alphauserpoints'.DS.'helper.php'; if ( file_exists($api_AUP)) { require_once ($api_AUP); AlphaUserPointsHelper::newpoints( 'plgaup_leaveVideoGroup_hwdvs' ); } $mainframe->enqueueMessage(_HWDVIDS_ALERT_SUCLEAVE); $mainframe->redirect( $url ); }
?> " /> <input type="hidden" name="controller" value="user" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="limitstart" value="" /> <input type="hidden" name="filter_order" value="<?php echo Jrequest::getVar('filter_order', 'name'); ?> " /> <input type="hidden" name="filter_order_Dir" value="<?php echo Jrequest::getVar('filter_order_Dir', 'asc'); ?> " /> </form> <script type="text/javascript"> //<![CDATA[ function tableOrdering( order, dir, task ) { var form = document.frmcart; form.filter_order.value = order;
/** * TuiyoControllerExtensions::editApplication() * Edits an application * @return void */ public function editApplication() { $adminView =& $this->getView("tuiyo", "html"); $extView =& $this->getView("extensions", "html"); $extModel =& $this->getModel("extensions"); $appModel =& TuiyoLoader::model("applications", true); $aName = JRequest::getVar('a', null); $childDo = Jrequest::getVar('childDo', null); $aName = !empty($aName) ? strval(strtolower($aName)) : JError::raiseError(TUIYO_SERVER_ERROR, 'unspecified application'); $pData = array("params" => "", "data" => $appModel->getSingleApplication($aName)); $pageView = $extView->appEditpage($pData); $adminView->display($pageView); $this->docu->addScript("components/com_tuiyo/style/script/applications.js"); }