Cheetah
ChSitesModule.php
Go to the documentation of this file.
1 <?php
2 
8 function ch_sites_import ($sClassPostfix, $aModuleOverwright = array())
9 {
11  $a = $aModuleOverwright ? $aModuleOverwright : $aModule;
12  if (!$a || $a['uri'] != 'sites') {
13  $oMain = ChWsbModule::getInstance('ChSitesModule');
14  $a = $oMain->_aModule;
15  }
16  ch_import ($sClassPostfix, $a) ;
17 
18 }
19 
21 {
22  $sUri = preg_replace('/[^a-zA-Z0-9]/', ' ', $sTitle);
23  $sUri = preg_replace('/ +/', '_', trim($sUri));
24 
25  return $sUri;
26 }
27 
28 ch_import('ChWsbTwigModule');
29 
30 require_once('ChSitesPrivacy.php');
31 
91 {
92  var $_sPrefix = 'ch_sites';
93  var $oPrivacy;
94  var $iOwnerId;
95 
96  // BEGIN STW INTEGRATION
97 
98  var $sHomeUrl;
101 
104 
105  // END STW INTEGRATION
106 
111  {
112  parent::__construct($aModule);
113  $this->_oConfig->init($this->_oDb);
114  $this->oPrivacy = new ChSitesPrivacy($this);
115  $this->iOwnerId = isLogged() ? getLoggedId() : 0;
116  $GLOBALS['oChSitesModule'] = &$this;
117 
118  // BEGIN STW INTEGRATION
119  $this->sHomeUrl = $this->_oConfig->getHomeUrl();
120  $this->sHomePath = $this->_oConfig->getHomePath();
121  $this->sModuleUrl = CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri();
122 
123  $sThumbSuffix = 'data/images/thumbs/';
124  $this->sThumbPath = $this->sHomePath.$sThumbSuffix;
125  $this->sThumbUrl = $this->sHomeUrl.$sThumbSuffix;
126  // END STW INTEGRATION
127  }
128 
129  function actionHome()
130  {
131  ch_sites_import ('PageMain');
132  $oPage = new ChSitesPageMain ($this);
133  $this->_oTemplate->addCss(array('main.css', 'block_percent.css'));
134  $this->_oTemplate->pageStart();
135  echo $oPage->getCode();
136  $this->_oTemplate->pageCode(_t('_ch_sites_caption_home'), false, false);
137  }
138 
139  function actionCalendar($iYear = '', $iMonth = '')
140  {
141  ch_sites_import('Calendar');
142  $oCalendar = new ChSitesCalendar($iYear, $iMonth, $this);
143  $this->_oTemplate->pageStart();
144  echo $oCalendar->display();
145  $this->_oTemplate->pageCode(_t('_ch_sites_caption_browse_calendar'), true, false);
146  }
147 
148  function actionDelete($iSiteId)
149  {
150  $iSiteId = (int)$iSiteId;
151  if (!($aSite = $this->_oDb->getSiteById($iSiteId))) {
152  $this->_oTemplate->displayPageNotFoundExt (_t('_ch_sites_action_title_delete'));
153  return;
154  }
155 
156  header('Content-Type: text/html; charset=utf-8');
157  if (!$this->isAllowedDelete($aSite)) {
158  echo MsgBox(_t('_ch_events_msg_access_denied')) . genAjaxyPopupJS($iSiteId, 'ajaxy_popup_result_div');
159  exit;
160  }
161 
162  if ($this->deleteSite($iSiteId)) {
163  $sRedirect = CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'browse/my';
164  $sJQueryJS = genAjaxyPopupJS($iSiteId, 'ajaxy_popup_result_div', $sRedirect);
165  echo MsgBox(_t('_ch_sites_site_was_deleted')) . $sJQueryJS;
166  exit;
167  }
168 
169  echo MsgBox(_t('_ch_sites_error_occured')) . genAjaxyPopupJS($iSiteId, 'ajaxy_popup_result_div');
170  exit;
171  }
172 
173  function actionEdit($iSiteId)
174  {
175  $iSiteId = (int)$iSiteId;
176 
177  if (!($aSite = $this->_oDb->getSiteById($iSiteId))) {
178  $this->_oTemplate->displayPageNotFoundExt (_t('_ch_site_caption_edit'));
179  return;
180  }
181 
182  if (!$this->isAllowedEdit($aSite)) {
183  $this->_oTemplate->displayAccessDeniedExt (_t('_ch_site_caption_edit'));
184  return;
185  }
186 
187  ch_sites_import('FormEdit');
188  $oForm = new ChSitesFormEdit($this, $aSite);
189  $oForm->initChecker($aSite);
190 
191  $this->_oTemplate->addCss(array('main.css'));
192 
193  if ($oForm->isSubmittedAndValid ()) {
194  $sStatus = $this->_oDb->getParam('ch_sites_autoapproval') == 'on' || $this->isAdmin() ? 'approved' : 'pending';
195  $sCategories = implode(';', array_unique(explode(';', $oForm->getCleanValue('categories'))));
196  unset($oForm->aInputs['categories']);
197  $aValsAdd = array (
198  'photo' => $oForm->checkUploadPhoto(),
199  'categories' => $sCategories,
200  'status' => $sStatus
201  );
202 
203  if ($oForm->update($iSiteId, $aValsAdd)) {
204  $this->isAllowedEdit($aSite, true);
205  $this->onSiteChanged($iSiteId, $sStatus);
206  if ($sStatus == 'approved')
207  header('Location:' . CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aSite['entryUri']);
208  else
209  header('Location:' . CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri());
210  } else {
211  $this->_oTemplate->pageStart();
212  echo MsgBox(_t('_ch_sites_err_edit_site'));
213  }
214  } else {
215  $this->_oTemplate->pageStart();
216  echo $oForm->getCode();
217  }
218 
219  $this->_oTemplate->pageCode(_t('_ch_site_caption_edit'));
220  }
221 
222  function actionView($mixedVar)
223  {
224  $GLOBALS['oTopMenu']->setCustomSubHeader(_t('_ch_sites'));
225 
226  $aSite = is_numeric($mixedVar) ? $this->_oDb->getSiteById((int)$mixedVar) : $this->_oDb->getSiteByEntryUri(process_db_input($mixedVar));
227 
228  if (empty($aSite)) {
229  $this->_oTemplate->displayPageNotFoundExt (_t('_ch_sites'));
230  return;
231  }
232 
233  if (!$this->isAllowedView($aSite)) {
234  $this->_oTemplate->displayAccessDeniedExt($aSite['title']);
235  return;
236  }
237 
238  if ($aSite['status'] == 'pending' && !$this->isAdmin() && !($aSite['ownerid'] == $this->iOwnerId && $aEvent['ownerid'])) {
239  $this->_oTemplate->displayAccessDeniedExt($aSite['title']);
240  return;
241  }
242 
243  if ($aSite['Status'] == 'pending') {
244  $this->_oTemplate->displayPendingApproval($aSite['title']);
245  return;
246  }
247 
248  ch_sites_import ('PageView');
249  $oPage = new ChSitesPageView ($this, $aSite);
250  $this->_oTemplate->addJsTranslation(array('_Are_you_sure'));
251  $this->_oTemplate->addCss(array('main.css', 'cmts.css'));
252  $this->_oTemplate->pageStart();
253  echo $oPage->getCode();
254  $GLOBALS['oTopMenu']->setCustomSubHeader($aSite['title']);
255  $GLOBALS['oTopMenu']->setCustomSubHeaderUrl(CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aSite['entryUri']);
256  $GLOBALS['oTopMenu']->setCustomBreadcrumbs(array(
257  _t('_ch_sites') => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'home/',
258  $aSite['title'] => '',
259  ));
260  $this->_oTemplate->pageCode($aSite['title'], false, false);
261 
262  ch_import ('ChWsbViews');
263  new ChWsbViews('ch_sites', $aSite['id']);
264 
265  $this->isAllowedView($aSite, true);
266  }
267 
268  function actionFeatured($iSiteId)
269  {
270  $iSiteId = (int)$iSiteId;
271 
272  if (!($aSite = $this->_oDb->getSiteById($iSiteId))) {
273  $this->_oTemplate->displayPageNotFoundExt (_t('_ch_sites_featured_top_menu_sitem'));
274  return;
275  }
276 
277  header('Content-Type: text/html; charset=utf-8');
278  if (!$this->isAllowedMarkAsFeatured($aSite)) {
279  echo MsgBox(_t('_ch_events_msg_access_denied')) . genAjaxyPopupJS($iSiteId, 'ajaxy_popup_result_div');
280  exit;
281  }
282 
283  if ($this->_oDb->markFeatured($iSiteId)) {
284  $this->isAllowedMarkAsFeatured($aSite, true);
285  $sRedirect = CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aSite['entryUri'];
286  $sJQueryJS = genAjaxyPopupJS($iSiteId, 'ajaxy_popup_result_div', $sRedirect);
287  echo MsgBox($aSite['featured'] ? _t('_ch_sites_msg_removed_from_featured') : _t('_ch_sites_msg_added_to_featured')) . $sJQueryJS;
288  exit;
289  }
290 
291  echo MsgBox(_t('_ch_sites_error_occured')) . genAjaxyPopupJS($iSiteId, 'ajaxy_popup_result_div');
292  exit;
293  }
294 
295  function actionShare($iSiteId)
296  {
297  }
298 
299  function actionHon()
300  {
301  ch_sites_import('PageHon');
302  $oPage = new ChSitesPageHon($this);
303  $this->_oTemplate->addCss(array('main.css', 'block_percent.css'));
304  $this->_oTemplate->pageStart();
305  echo $oPage->getCode();
306  $this->_oTemplate->pageCode(_t('_ch_sites_hon'), false, false);
307  }
308 
309  function actionSearch()
310  {
311  if (!$this->isAllowedSearch()) {
312  $this->_oTemplate->displayAccessDeniedExt(_t('_ch_sites_caption_browse_search'), false);
313  return;
314  }
315 
316  ch_sites_import ('FormSearch');
317  $oForm = new ChSitesFormSearch($this->_oConfig);
318  $oForm->initChecker();
319 
320  $this->_oTemplate->addCss(array('main.css'));
321 
322  if ($oForm->isSubmittedAndValid ()) {
323 
324  ch_sites_import('SearchResult');
325  $o = new ChSitesSearchResult('search', $oForm->getCleanValue('Keyword'));
326 
327  if ($o->isError) {
328  $this->_oTemplate->displayPageNotFoundExt (_t('_ch_sites_caption_browse_search'));
329  return;
330  }
331 
332  if ($s = $o->processing()) {
333  $this->_oTemplate->pageStart();
334  echo $s;
335  } else {
336  $this->_oTemplate->displayNoDataExt (_t('_ch_sites_caption_browse_search'));
337  return;
338  }
339 
340  $this->isAllowedSearch(true);
341  $this->_oTemplate->pageCode($o->aCurrent['title'], false, false);
342 
343  } else {
344  $this->_oTemplate->pageStart();
345  echo $oForm->getCode ();
346  $this->_oTemplate->pageCode(_t('_ch_sites_caption_browse_search'));
347  }
348  }
349 
350  function actionBrowse($sMode = '', $sValue = '', $sValue2 = '', $sValue3 = '')
351  {
352  $bAjaxMode = isset($_SERVER['HTTP_X_REQUESTED_WITH']) and $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' ? true : false;
353 
354  if (('user' == $sMode || 'my' == $sMode) && $this->iOwnerId > 0) {
355  $aProfile = getProfileInfo($this->iOwnerId);
356  if (0 == strcasecmp($sValue, $aProfile['NickName']) || 'my' == $sMode) {
357  $this->browseMy ($aProfile, process_db_input($sValue));
358  return;
359  }
360  }
361 
362  if (!$this->isAllowedBrowse() || ('my' == $sMode && $this->iOwnerId == 0)) {
363  $this->_oTemplate->displayAccessDeniedExt(_t('_ch_sites'), $bAjaxMode);
364  return;
365  }
366 
367  ch_sites_import ('SearchResult');
368  $o = new ChSitesSearchResult(
370  process_db_input($sValue),
371  process_db_input($sValue2),
372  process_db_input($sValue3)
373  );
374 
375  if ($o->isError) {
376  $this->_oTemplate->displayNoDataExt($o->aCurrent['title'], $bAjaxMode);
377  return;
378  }
379 
380  if(ch_get('rss') !== false && ch_get('rss')) {
381  echo $o->rss();
382  exit;
383  }
384 
385  $s = $bAjaxMode ? $o->displayResultBlock(true, true) : $o->processing();
386 
387  if ($s) {
388  if (!$bAjaxMode) {
389  $this->_oTemplate->pageStart();
390  echo $s;
391  $this->_oTemplate->pageCode($o->aCurrent['title'], false, false);
392  } else
393  echo $s;
394  } else
395  $this->_oTemplate->displayNoDataExt($o->aCurrent['title'], $bAjaxMode);
396  }
397 
399  {
400  $iProfileId = (int)$iProfileId;
401 
402  if (!$iProfileId || !defined('CH_SITES_ON_PROFILE_DELETE'))
403  return;
404 
405  $aSites = $this->_oDb->getSitesByAuthor($iProfileId);
406  foreach ($aSites as $aSiteRow)
407  $this->deleteSite($aSiteRow['id']);
408  }
409 
410  function actionSharePopup ($iSiteId)
411  {
412  parent::_actionSharePopup ($iSiteId, _t('_ch_sites_caption_share_site'), true);
413  }
414 
415  function actionIndex()
416  {
417  echo $this->_getSitesIndex();
418  }
419 
420  function actionProfile($sNickName)
421  {
422  echo $this->_getSitesProfile($sNickName);
423  }
424 
426  {
427  if (!$this->isAdmin()) {
428  $this->_oTemplate->displayAccessDeniedExt (_t('_ch_sites'));
429  return;
430  }
431 
432  $aMenu = array(
433  'home' => array(
434  'title' => _t('_ch_sites_pending_approval'),
435  'href' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'administration/home',
436  '_func' => array ('name' => '_actionAdministrationManage', 'params' => array(false)),
437  ),
438  'admin_entries' => array(
439  'title' => _t('_ch_sites_administration_admin_sites'),
440  'href' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'administration/admin_entries',
441  '_func' => array ('name' => '_actionAdministrationManage', 'params' => array(true)),
442  ),
443  'add' => array(
444  'title' => _t('_ch_sites_administration_add_site'),
445  'href' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'administration/add',
446  '_func' => array ('name' => '_actionAdministrationAdd', 'params' => array()),
447  ),
448  'settings' => array(
449  'title' => _t('_ch_sites_administration_settings'),
450  'href' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'administration/settings',
451  '_func' => array ('name' => '_actionAdministrationSettings', 'params' => array()),
452  ),
453  );
454 
455  if (empty($aMenu[$sUrl]))
456  $sUrl = 'home';
457 
458  $aMenu[$sUrl]['active'] = 1;
459  $sContent = call_user_func_array(array($this, $aMenu[$sUrl]['_func']['name']), $aMenu[$sUrl]['_func']['params']);
460 
461  $this->_oTemplate->pageStart();
462  echo $this->_oTemplate->adminBlock ($sContent, _t('_ch_sites_administration'), $aMenu);
463  $this->_oTemplate->addCssAdmin(array('forms_adv.css', 'main.css', 'twig.css'));
464  $this->_oTemplate->pageCodeAdmin (_t('_ch_sites_administration'));
465  }
466 
467  function actionAdd()
468  {
469  if (!$this->isAllowedAdd()) {
470  $this->_oTemplate->displayAccessDeniedExt(_t('_ch_sites'));
471  return;
472  }
473 
474  $this->_oTemplate->addCss(array('main.css'));
475  $this->_oTemplate->pageStart();
476  echo $this->_addSiteForm();
477  $this->_oTemplate->pageCode(_t('_ch_sites_bcaption_site_add'), true, false);
478  }
479 
480  function actionTags()
481  {
482  ch_import('ChTemplTagsModule');
483  $aParam = array(
484  'type' => 'ch_sites',
485  'orderby' => 'popular'
486  );
487  $oTags = new ChTemplTagsModule($aParam, '', CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'tags');
488  $this->_oTemplate->pageStart();
489  echo $oTags->getCode();
490  $this->_oTemplate->pageCode(_t('_ch_sites_caption_browse_tags'), false, false);
491  }
492 
493  function actionCategories()
494  {
495  ch_import('ChTemplCategoriesModule');
496  $aParam = array(
497  'type' => 'ch_sites'
498  );
499  $oCateg = new ChTemplCategoriesModule($aParam, '', CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'categories');
500  $this->_oTemplate->pageStart();
501  echo $oCateg->getCode();
502  $this->_oTemplate->pageCode(_t('_ch_sites_caption_browse_categories'), false, false);
503  }
504 
508  function serviceIndexBlock()
509  {
510  return $this->_getSitesIndex();
511  }
512 
513  function serviceProfileBlock($sNickName)
514  {
515  return $this->_getSitesProfile($sNickName);
516  }
517 
519  {
520  $aDataEntry = $this->_oDb->getSiteById($iEntryId);
521  if (empty($aDataEntry) || $aDataEntry['status'] != 'approved') {
522  return array('skip' => true);
523  }
524 
525  $aActionList = array(
526  'commentPost' => '_ch_sites_sbs_comment'
527  );
528 
529  $sActionName = isset($aActionList[$sAction]) ? ' (' . _t($aActionList[$sAction]) . ')' : '';
530  return array (
531  'skip' => false,
532  'template' => array (
533  'Subscription' => $aDataEntry['title'] . $sActionName,
534  'ViewLink' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aDataEntry['entryUri'],
535  ),
536  );
537  }
538 
539  function serviceGetWallPost ($aEvent)
540  {
541  if (!($aProfile = getProfileInfo($aEvent['owner_id'])))
542  return '';
543 
544  $aObjectIds = strpos($aEvent['object_id'], ',') !== false ? explode(',', $aEvent['object_id']) : array($aEvent['object_id']);
545  rsort($aObjectIds);
546 
547  $iDeleted = 0;
548  $aItems = array();
549  foreach($aObjectIds as $iId) {
550  $aItem = $this->_oDb->getSiteById($iId);
551  if(empty($aItem))
552  $iDeleted++;
553  else if($aItem['status'] == 'approved' && $this->oPrivacy->check('view', $aItem['id'], $this->iOwnerId))
554  $aItems[] = $aItem;
555  }
556 
557  if($iDeleted == count($aObjectIds))
558  return array('perform_delete' => true);
559 
560  $iOwner = 0;
561  if(!empty($aEvent['owner_id']))
562  $iOwner = (int)$aEvent['owner_id'];
563 
564  $iDate = 0;
565  if(!empty($aEvent['date']))
566  $iDate = (int)$aEvent['date'];
567 
568  $bItems = !empty($aItems) && is_array($aItems);
569  if($iOwner == 0 && $bItems && !empty($aItems[0]['ownerid']))
570  $iOwner = (int)$aItems[0]['ownerid'];
571 
572  if($iDate == 0 && $bItems && !empty($aItems[0]['date']))
573  $iDate = (int)$aItems[0]['date'];
574 
575  if($iOwner == 0 || !$bItems)
576  return '';
577 
578  $sCss = '';
579  $sCssPrefix = str_replace('_', '-', $this->_sPrefix);
580  $sBaseUrl = CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/';
581  if($aEvent['js_mode'])
582  $sCss = $this->_oTemplate->addCss(array('wall_post.css', 'main.css', 'twig.css'), true);
583  else
584  $this->_oTemplate->addCss(array('wall_post.css', 'main.css', 'twig.css'));
585 
586  $iItems = count($aItems);
587  $sOwner = getNickName($iOwner);
588 
589  ch_import('ChTemplVotingView');
590  $oVoting = new ChTemplVotingView ('ch_sites', 0, 0);
591 
592  //--- Grouped events
593  if($iItems > 1) {
594  if($iItems > 4)
595  $aItems = array_slice($aItems, 0, 4);
596 
597  $aTmplItems = array();
598  foreach($aItems as $aItem)
599  $aTmplItems[] = array(
600  'unit' => $this->_oTemplate->unit ($aItem, 'unit_wall', $oVoting),
601  );
602 
603  return array(
604  'owner_id' => $iOwner,
605  'title' => _t('_ch_sites_wall_added_new_title_items', $sOwner, $iItems),
606  'description' => '',
607  'content' => $sCss . $this->_oTemplate->parseHtmlByName('modules/cheetah/wall/|timeline_post_twig_grouped.html', array(
608  'mod_prefix' => $sCssPrefix,
609  'mod_icon' => 'link',
610  'cpt_user_name' => $sOwner,
611  'cpt_added_new' => _t('_ch_sites_wall_added_new_items', $iItems),
612  'ch_repeat:items' => $aTmplItems,
613  'post_id' => $aEvent['id']
614  )),
615  'date' => $iDate
616  );
617  }
618 
619  //--- Single public event
620  $sTxtWallObject = _t('_ch_sites_wall_object');
621 
622  $aItem = $aItems[0];
623  return array(
624  'owner_id' => $iOwner,
625  'title' => _t('_ch_sites_wall_added_new_title', $sOwner, $sTxtWallObject),
626  'description' => $aItem['description'],
627  'content' => $sCss . $this->_oTemplate->parseHtmlByName('modules/cheetah/wall/|timeline_post_twig.html', array(
628  'mod_prefix' => $sCssPrefix,
629  'mod_icon' => 'link',
630  'cpt_user_name' => $sOwner,
631  'cpt_added_new' => _t('_ch_sites_wall_added_new'),
632  'cpt_object' => $sTxtWallObject,
633  'cpt_item_url' => $sBaseUrl . $aItem['entryUri'],
634  'post_id' => $aEvent['id'],
635  'content' => $this->_oTemplate->unit ($aItem, 'unit_wall', $oVoting),
636  )),
637  'date' => $iDate
638  );
639  }
640 
641  function serviceGetWallPostOutline($aEvent)
642  {
643  $sIcon = 'link';
644  $sBaseUrl = CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/';
645 
646  $aOwner = db_assoc_arr("SELECT `ID` AS `id`, `NickName` AS `username` FROM `Profiles` WHERE `ID`='" . (int)$aEvent['owner_id'] . "' LIMIT 1");
647 
648  $aObjectIds = strpos($aEvent['object_id'], ',') !== false ? explode(',', $aEvent['object_id']) : array($aEvent['object_id']);
649  rsort($aObjectIds);
650 
651  $iItems = count($aObjectIds);
652  $iItemsLimit = 3;
653  if($iItems > $iItemsLimit)
654  $aObjectIds = array_slice($aObjectIds, 0, $iItemsLimit);
655 
656  $aContent = array();
657  if(!empty($aEvent['content']))
658  $aContent = unserialize($aEvent['content']);
659 
660  $iDeleted = 0;
661  $aItems = $aTmplItems = array();
662  foreach($aObjectIds as $iId) {
663  $aItem = $this->_oDb->getSiteById($iId);
664  if(empty($aItem))
665  $iDeleted++;
666  else if($aItem['status'] == 'approved' && $this->oPrivacy->check('view', $aItem['id'], $this->iOwnerId)) {
667  $aItem['thumb_file'] = '';
668  if($aItem[$this->_oDb->_sFieldThumb]) {
669  $aImage = ChWsbService::call('photos', 'get_entry', array($aItem[$this->_oDb->_sFieldThumb], 'browse'), 'Search');
670  $aItem['thumb_file'] = $aImage['no_image'] || empty($aImage) ? '' : $aImage['file'];
671  }
672 
673  $aItem[$this->_oDb->_sFieldUri] = $sBaseUrl . $aItem[$this->_oDb->_sFieldUri];
674  $aItem['url'] = strncasecmp($aItem['url'], 'http://', 7) !== 0 && strncasecmp($aItem['url'], 'https://', 8) !== 0 ? 'http://' . $aItem['url'] : $aItem['url'];
675  $aItems[] = $aItem;
676 
677  // BEGIN STW INTEGRATION
678  if ($aItem['thumb_file'] == '' && getParam('ch_sites_account_type') != 'No Automated Screenshots') {
679  ch_sites_import('STW');
680  $sThumbHTML = getThumbnailHTML($aItem['url'], array());
681  }
682  // END STW INTEGRATION
683 
684  $aTmplItems[] = array(
685  'mod_prefix' => $this->_sPrefix,
686  'item_title' => $aItem[$this->_oDb->_sFieldTitle],
687  // BEGIN STW INTEGRATION
688  'ch_if:is_image' => array(
689  'condition' => $sThumbHTML == false,
690  'content' => array('item_page' => $aItem[$this->_oDb->_sFieldUri], 'image' => $aImage['file'] ? $aImage['file'] : $this->_oTemplate->getImageUrl('no-image-thumb.png'))
691  ),
692  'ch_if:is_thumbhtml' => array(
693  'condition' => $sThumbHTML != '',
694  'content' => array('item_page' => $aItem[$this->_oDb->_sFieldUri], 'thumbhtml' => $sThumbHTML)
695  ),
696  // END STW INTEGRATION
697  );
698  }
699  }
700 
701  if($iDeleted == count($aObjectIds))
702  return array('perform_delete' => true);
703 
704  if(empty($aOwner) || empty($aItems))
705  return "";
706 
707  $sCss = '';
708  if($aEvent['js_mode'])
709  $sCss = $this->_oTemplate->addCss(array('wall_outline.css'), true);
710  else
711  $this->_oTemplate->addCss(array('wall_outline.css'));
712 
713  $aResult = array();
714  $iOwner = (int)$aEvent['owner_id'];
715  $sOwner = getNickName($iOwner);
716  $sOwnerLink = getProfileLink($iOwner);
717 
718  //--- Grouped events
719  $iItems = count($aItems);
720  if($iItems > 1) {
721  $aResult['content'] = $sCss . $this->_oTemplate->parseHtmlByName('wall_outline_grouped.html', array(
722  'mod_prefix' => $this->_sPrefix,
723  'mod_icon' => $sIcon,
724  'user_name' => $sOwner,
725  'user_link' => $sOwnerLink,
726  'ch_repeat:items' => $aTmplItems,
727  'album_url' => '',
728  'album_title' => '',
729  'album_description' => '',
730  'album_comments' => 0 ? _t('_wall_n_comments', 0) : _t('_wall_no_comments'),
731  'album_comments_link' => '',
732  'post_id' => $aEvent['id'],
733  'post_ago' => $aEvent['ago']
734  ));
735 
736  return $aResult;
737  }
738 
739  //--- Single public event
740  $aItem = $aItems[0];
741  $aTmplItem = $aTmplItems[0];
742 
743  $aResult['content'] = $sCss . $this->_oTemplate->parseHtmlByName('wall_outline.html', array_merge($aTmplItem, array(
744  'mod_prefix' => $this->_sPrefix,
745  'mod_icon' => $sIcon,
746  'user_name' => $sOwner,
747  'user_link' => $sOwnerLink,
748  'item_page' => $aItem[$this->_oDb->_sFieldUri],
749  'item_title' => $aItem[$this->_oDb->_sFieldTitle],
750  'item_description' => $this->_formatSnippetText($aItem, 200),
751  'item_site_url' => $aItem['url'],
752  'item_site_url_title' => $this->_oTemplate->_getDomain($aItem['url']),
753  'item_comments' => (int)$aItem['commentsCount'] > 0 ? _t('_wall_n_comments', $aItem['commentsCount']) : _t('_wall_no_comments'),
754  'item_comments_link' => $aItem[$this->_oDb->_sFieldUri] . '#cmta-' . $this->_sPrefix . '-' . $aItem['id'],
755  'post_id' => $aEvent['id'],
756  'post_ago' => $aEvent['ago']
757  )));
758 
759  return $aResult;
760  }
761 
762  function serviceGetWallAddComment($aEvent)
763  {
764  $iId = (int)$aEvent['object_id'];
765  $iOwner = (int)$aEvent['owner_id'];
766  $sOwner = $iOwner != 0 ? getNickName($iOwner) : _t('_Anonymous');
767 
768  $aContent = unserialize($aEvent['content']);
769  if(empty($aContent) || empty($aContent['object_id']))
770  return '';
771 
772  $iItem = (int)$aContent['object_id'];
773  $aItem = $this->_oDb->getSiteById($iItem);
774  if(empty($aItem) || !is_array($aItem))
775  return array('perform_delete' => true);
776 
777  if(!$this->oPrivacy->check('view', $iItem, $this->iOwnerId))
778  return;
779 
780  ch_import('Cmts', $this->_aModule);
781  $oCmts = new ChSitesCmts('ch_sites', $iItem);
782  if(!$oCmts->isEnabled())
783  return '';
784 
785  $aComment = $oCmts->getCommentRow($iId);
786  if(empty($aComment) || !is_array($aComment))
787  return array('perform_delete' => true);
788 
789  $sImage = '';
790  if($aItem['photo']) {
791  $a = array('ID' => $aItem['id'], 'Avatar' => $aItem['photo']);
792  $aImage = ChWsbService::call('photos', 'get_image', array($a, 'browse'), 'Search');
793  $sImage = $aImage['no_image'] ? '' : $aImage['file'];
794  }
795 
796  $sCss = '';
797  $sCssPrefix = str_replace('_', '-', $this->_sPrefix);
798  $sBaseUrl = CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/';
799  if($aEvent['js_mode'])
800  $sCss = $this->_oTemplate->addCss(array('wall_post.css', 'main.css', 'twig.css'), true);
801  else
802  $this->_oTemplate->addCss(array('wall_post.css', 'main.css', 'twig.css'));
803 
804  ch_import('ChTemplVotingView');
805  $oVoting = new ChTemplVotingView ('ch_sites', 0, 0);
806 
807  $sTextWallObject = _t('_ch_sites_wall_object');
808  return array(
809  'title' => _t('_ch_sites_wall_added_new_title_comment', $sOwner, $sTextWallObject),
810  'description' => $aComment['cmt_text'],
811  'content' => $sCss . $this->_oTemplate->parseHtmlByName('modules/cheetah/wall/|timeline_comment.html', array(
812  'mod_prefix' => $sCssPrefix,
813  'cpt_user_name' => $sOwner,
814  'cpt_added_new' => _t('_ch_sites_wall_added_new_comment'),
815  'cpt_object' => $sTextWallObject,
816  'cpt_item_url' => $sBaseUrl . $aItem['entryUri'],
817  'cnt_comment_text' => $aComment['cmt_text'],
818  'snippet' => $this->_oTemplate->unit ($aItem, 'unit_wall', $oVoting),
819  ))
820  );
821  }
822 
826  function serviceGetWallPostComment($aEvent)
827  {
828  $iId = (int)$aEvent['object_id'];
829  $iOwner = (int)$aEvent['owner_id'];
830  $sOwner = getNickName($iOwner);
831 
832  $aItem = $this->_oDb->getSiteById($iId);
833  if(empty($aItem) || !is_array($aItem))
834  return array('perform_delete' => true);
835 
836  if(!$this->oPrivacy->check('view', $iId, $this->iOwnerId))
837  return;
838 
839  $aContent = unserialize($aEvent['content']);
840  if(empty($aContent) || !isset($aContent['comment_id']))
841  return '';
842 
843  ch_import('Cmts', $this->_aModule);
844  $oCmts = new ChSitesCmts('ch_sites', $iId);
845  if(!$oCmts->isEnabled())
846  return '';
847 
848  $aComment = $oCmts->getCommentRow((int)$aContent['comment_id']);
849  if(empty($aComment) || !is_array($aComment))
850  return array('perform_delete' => true);
851 
852  $sImage = '';
853  if($aItem['photo']) {
854  $a = array('ID' => $aItem['id'], 'Avatar' => $aItem['photo']);
855  $aImage = ChWsbService::call('photos', 'get_image', array($a, 'browse'), 'Search');
856  $sImage = $aImage['no_image'] ? '' : $aImage['file'];
857  }
858 
859  $sCss = '';
860  $sBaseUrl = CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/';
861  if($aEvent['js_mode'])
862  $sCss = $this->_oTemplate->addCss(array('wall_post.css', 'main.css', 'twig.css'), true);
863  else
864  $this->_oTemplate->addCss(array('wall_post.css', 'main.css', 'twig.css'));
865 
866  ch_import('ChTemplVotingView');
867  $oVoting = new ChTemplVotingView ('ch_sites', 0, 0);
868 
869  $sTextWallObject = _t('_ch_sites_wall_object');
870  return array(
871  'title' => _t('_ch_sites_wall_added_new_title_comment', $sOwner, $sTextWallObject),
872  'description' => $aComment['cmt_text'],
873  'content' => $sCss . $this->_oTemplate->parseHtmlByName('modules/cheetah/wall/|timeline_comment.html', array(
874  'mod_prefix' => str_replace('_', '-', $this->_sPrefix),
875  'cpt_user_name' => $sOwner,
876  'cpt_added_new' => _t('_ch_sites_wall_added_new_comment'),
877  'cpt_object' => $sTextWallObject,
878  'cpt_item_url' => $sBaseUrl . $aItem['entryUri'],
879  'cnt_comment_text' => $aComment['cmt_text'],
880  'snippet' => $this->_oTemplate->unit ($aItem, 'unit_wall', $oVoting),
881  ))
882  );
883  }
884 
885  function serviceGetSpyData ()
886  {
887  return array(
888  'handlers' => array(
889  array('alert_unit' => 'ch_sites', 'alert_action' => 'add', 'module_uri' => 'sites', 'module_class' => 'Module', 'module_method' => 'get_spy_post'),
890  array('alert_unit' => 'ch_sites', 'alert_action' => 'change', 'module_uri' => 'sites', 'module_class' => 'Module', 'module_method' => 'get_spy_post'),
891  array('alert_unit' => 'ch_sites', 'alert_action' => 'rate', 'module_uri' => 'sites', 'module_class' => 'Module', 'module_method' => 'get_spy_post'),
892  array('alert_unit' => 'ch_sites', 'alert_action' => 'commentPost', 'module_uri' => 'sites', 'module_class' => 'Module', 'module_method' => 'get_spy_post')
893  ),
894  'alerts' => array(
895  array('unit' => 'ch_sites', 'action' => 'add'),
896  array('unit' => 'ch_sites', 'action' => 'change'),
897  array('unit' => 'ch_sites', 'action' => 'rate'),
898  array('unit' => 'ch_sites', 'action' => 'delete'),
899  array('unit' => 'ch_sites', 'action' => 'commentPost'),
900  array('unit' => 'ch_sites', 'action' => 'commentRemoved')
901  )
902  );
903  }
904 
905  function serviceGetSpyPost($sAction, $iObjectId, $iSenderId, $aExtraParams = array())
906  {
907  $aRet = array();
908 
909  switch($sAction) {
910  case 'add' :
911  case 'change' :
912  case 'rate' :
913  case 'commentPost' :
914  $aSite = $this->_oDb->getSiteById($iObjectId);
915  if (!empty($aSite))
916  $aRet = array(
917  'lang_key' => '_ch_sites_poll_' . $sAction,
918  'params' => array(
919  'profile_link' => $iSenderId ? getProfileLink($iSenderId) : 'javascript:void(0)',
920  'profile_nick' => $iSenderId ? getNickName($iSenderId) : _t('_Guest'),
921  'site_url' => !empty($aSite) ? $this->_oConfig->getBaseUri() . 'view/' . $aSite['entryUri'] : '',
922  'site_caption' => !empty($aSite) ? $aSite['title'] : ''
923  ),
924  'recipient_id' => $aSite['ownerid'],
925  'spy_type' => 'content_activity',
926  );
927  break;
928 
929  }
930 
931  return $aRet;
932  }
933 
935  {
936  return parent::_serviceGetMemberMenuItem (_t('_ch_sites'), _t('_ch_sites'), 'link');
937  }
938 
940  {
941  if (!$this->isAllowedAdd())
942  return '';
943  return parent::_serviceGetMemberMenuItem (_t('_ch_sites_site'), _t('_ch_sites_site'), 'link', false, 'add');
944  }
945 
946  function browseMy($aProfile, $sValue = '')
947  {
948  ch_sites_import ('PageProfile');
949  if (strlen($sValue))
950  $sTitle = _t('_ch_sites_caption_browse_' . $sValue);
951  else
952  $sTitle = _t('_ch_sites_caption_browse_my');
953  $oPage = new ChSitesPageProfile($this, $aProfile, $sValue);
954  $this->_oTemplate->addCss(array('main.css'));
955  $this->_oTemplate->pageStart();
956  echo $oPage->getCode();
957  $this->_oTemplate->pageCode($sTitle, false, false, true);
958  }
959 
960  function isAdmin()
961  {
962  return isAdmin($this->iOwnerId);
963  }
964 
965  function isAllowedEdit($aSite, $isPerformAction = false)
966  {
967  if ($this->isAdmin() || ($GLOBALS['logged']['member'] && $aSite['ownerid'] == $this->iOwnerId && isProfileActive($this->iOwnerId)))
968  return true;
969  $this->_defineActions();
970  $aCheck = checkAction($this->iOwnerId, CH_SITES_EDIT_ANY_SITE, $isPerformAction);
972  }
973 
974  function isAllowedAdd ($isPerformAction = false)
975  {
976  if ($this->isAdmin())
977  return true;
978  if (!$GLOBALS['logged']['member'])
979  return false;
980  $this->_defineActions();
981  $aCheck = checkAction($this->iOwnerId, CH_SITES_ADD, $isPerformAction);
983  }
984 
985  function isAllowedMarkAsFeatured($aSite, $isPerformAction = false)
986  {
987  if ($this->isAdmin())
988  return true;
989  $this->_defineActions();
990  $aCheck = checkAction($this->iOwnerId, CH_SITES_MARK_AS_FEATURED, $isPerformAction);
992  }
993 
994  function isAllowedDelete(&$aSite, $isPerformAction = false)
995  {
996  if ($this->isAdmin() || ($GLOBALS['logged']['member'] && $aSite['ownerid'] == $this->iOwnerId && isProfileActive($this->iOwnerId)))
997  return true;
998  $this->_defineActions();
999  $aCheck = checkAction($this->iOwnerId, CH_SITES_DELETE_ANY_SITE, $isPerformAction);
1001  }
1002 
1003  function isAllowedShare(&$aDataEntry)
1004  {
1005  if($aDataEntry['allowView'] != CH_WSB_PG_ALL)
1006  return false;
1007 
1008  return true;
1009  }
1010 
1011  function isAllowedView ($aSite, $isPerformAction = false)
1012  {
1013  // admin and owner always have access
1014  if ($this->isAdmin() || $aSite['ownerid'] == $this->iOwnerId)
1015  return true;
1016 
1017  // check admin acl
1018  $this->_defineActions();
1019  $aCheck = checkAction($this->iOwnerId, CH_SITES_VIEW, $isPerformAction);
1021  return false;
1022 
1023  // check user group
1024  return $this->oPrivacy->check('view', $aSite['id'], $this->iOwnerId);
1025  }
1026 
1027  function isAllowedBrowse ($isPerformAction = false)
1028  {
1029  if ($this->isAdmin()) return true;
1030  $this->_defineActions();
1031  $aCheck = checkAction($this->iOwnerId, CH_SITES_BROWSE, $isPerformAction);
1033  }
1034 
1035  function isAllowedSearch ($isPerformAction = false)
1036  {
1037  if ($this->isAdmin())
1038  return true;
1039  $this->_defineActions();
1040  $aCheck = checkAction($this->iOwnerId, CH_SITES_SEARCH, $isPerformAction);
1042  }
1043 
1044  function deleteSite($iSiteId)
1045  {
1046  $aSite = $this->_oDb->getSiteById($iSiteId);
1047 
1048  if (count($aSite) > 0 && $this->_oDb->deleteSiteById($iSiteId)) {
1049  if ($aSite['photo'] != 0)
1050  ChWsbService::call('photos', 'remove_object', array($aSite['photo']), 'Module');
1051 
1052  // BEGIN STW INTEGRATION
1053  ch_sites_import('STW');
1054  deleteThumbnail($aSite['url']);
1055  // END STW INTEGRATION
1056 
1057  $this->isAllowedDelete($aSite, true);
1058  $this->onSiteDeleted($iSiteId);
1059 
1060  return true;
1061  }
1062 
1063  return false;
1064  }
1065 
1066  // BEGIN STW INTEGRATION
1067 
1068  function refreshSiteThumb($iSiteId)
1069  {
1070  $aSite = $this->_oDb->getSiteById($iSiteId);
1071 
1072  if (count($aSite) > 0) {
1073  $aSTWOptions = array(
1074  'RefreshOnDemand' => true,
1075  );
1076 
1077  ch_sites_import('STW');
1078  deleteThumbnail($aSite['url']);
1079  $sThumbHTML = getThumbnailHTML($aSite['url'], $aSTWOptions);
1080 
1081  return $sThumbHTML;
1082  }
1083 
1084  return false;
1085  }
1086 
1088  {
1089  if (!($rHandler = opendir($this->sThumbPath)))
1090  return 0;
1091 
1092  while (($sFile = readdir($rHandler)) !== false)
1093  @unlink($this->sThumbPath . $sFile);
1094 
1095  closedir($rHandler);
1096 
1097  return 1;
1098  }
1099 
1100  // END STW INTEGRATION
1101 
1102  function setStatusSite($iSiteId, $sStatus)
1103  {
1104  $this->_oDb->setStatusSite($iSiteId, $sStatus);
1105  $this->onSiteChanged($iSiteId, $sStatus);
1106  }
1107 
1108  function _defineActions ()
1109  {
1110  defineMembershipActions(array('sites view', 'sites browse', 'sites search', 'sites add', 'sites edit any site', 'sites delete any site', 'sites mark as featured', 'sites approve'));
1111  }
1112 
1113  // ================================== tags/cats reparse functions
1114 
1115  function reparseTags ($iSiteId)
1116  {
1117  ch_import('ChWsbTags');
1118  $o = new ChWsbTags ();
1119  $o->reparseObjTags('ch_sites', $iSiteId);
1120  }
1121 
1122  function reparseCategories ($iSiteId)
1123  {
1124  ch_import('ChWsbCategories');
1125  $o = new ChWsbCategories ();
1126  $o->reparseObjTags('ch_sites', $iSiteId);
1127  }
1128 
1129  // ================================== events
1130 
1131  function onSiteCreate ($iSiteId, $sStatus)
1132  {
1133  if ('approved' == $sStatus) {
1134  $this->reparseTags ($iSiteId);
1135  $this->reparseCategories ($iSiteId);
1136  }
1137 
1138  ch_import('ChWsbAlerts');
1139  $oAlert = new ChWsbAlerts('ch_sites', 'add', $iSiteId, $this->iOwnerId, array('Status' => $sStatus));
1140  $oAlert->alert();
1141  }
1142 
1143  function onSiteChanged ($iSiteId, $sStatus)
1144  {
1145  $this->reparseTags ($iSiteId);
1146  $this->reparseCategories ($iSiteId);
1147 
1148  ch_import('ChWsbAlerts');
1149  $oAlert = new ChWsbAlerts('ch_sites', 'change', $iSiteId, $this->iOwnerId, array('Status' => $sStatus));
1150  $oAlert->alert();
1151  }
1152 
1153  function onSiteDeleted ($iSiteId)
1154  {
1155  // delete associated tags and categories
1156  $this->reparseTags ($iSiteId);
1157  $this->reparseCategories ($iSiteId);
1158 
1159  // delete sites votings
1160  ch_import('ChWsbVoting');
1161  $oVotingProfile = new ChWsbVoting ('ch_sites', 0, 0);
1162  $oVotingProfile->deleteVotings ($iSiteId);
1163 
1164  // delete sites comments
1165  ch_import('ChWsbCmts');
1166  $oCmts = new ChWsbCmts ('ch_sites', $iSiteId);
1167  $oCmts->onObjectDelete ();
1168 
1169  // delete views
1170  ch_import ('ChWsbViews');
1171  $oViews = new ChWsbViews('ch_sites', $iSiteId, false);
1172  $oViews->onObjectDelete($iSiteId);
1173 
1174  //delete all subscriptions
1176  $oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => 'ch_sites', 'object_id' => $iSiteId));
1177 
1178  // arise alert
1179  ch_import('ChWsbAlerts');
1180  $oAlert = new ChWsbAlerts('ch_sites', 'delete', $iSiteId, $this->iOwnerId);
1181  $oAlert->alert();
1182  }
1183 
1184  function onSiteMarkAsFeatured ($aSite)
1185  {
1186  // arise alert
1187  ch_import('ChWsbAlerts');
1188  $oAlert = new ChWsbAlerts('ch_sites', 'mark_as_featured', $aSite['id'], $aSite['Featured']);
1189  $oAlert->alert();
1190  }
1191 
1192  // private functions
1193 
1194  function _actionAdministrationManage($isAdminEntries, $sKeyBtnDelete = '', $sKeyBtnActivate = '', $sUrl = false)
1195  {
1196  if ($_POST['action_activate'] && is_array($_POST['entry'])) {
1197  foreach ($_POST['entry'] as $iSiteId)
1198  $this->setStatusSite($iSiteId, 'approved');
1199  } elseif ($_POST['action_delete'] && is_array($_POST['entry'])) {
1200  foreach ($_POST['entry'] as $iSiteId)
1201  $this->deleteSite($iSiteId);
1202  }
1203  // refresh sites thumbnail
1204  if ($_POST['action_refresh_thumb'] && is_array($_POST['entry']))
1205  foreach ($_POST['entry'] as $iSiteId)
1206  $this->refreshSiteThumb($iSiteId);
1207 
1208  $aButtons = array(
1209  'action_delete' => '_ch_sites_admin_delete',
1210  );
1211 
1212  if (getParam('ch_sites_redo') == 'on' && getParam('ch_sites_account_type') == 'Enabled') {
1213  $aButtons['action_refresh_thumb'] = '_ch_sites_admin_refresh_thumb';
1214  }
1215 
1216  if (!$isAdminEntries)
1217  $aButtons['action_activate'] = '_ch_sites_admin_activate';
1218 
1219  $sForm = $this->_manageSites($isAdminEntries ? 'admin' : 'adminpending', '', $aButtons);
1220  return $this->_oTemplate->parseHtmlByName('my_sites_manage.html', array('form' => $sForm));
1221  }
1222 
1224  {
1225  return $GLOBALS['oSysTemplate']->parseHtmlByName('default_padding.html', array('content' => $this->_addSiteForm()));
1226  }
1227 
1228  function _actionAdministrationSettings($sSettingsCatName = 'Sites')
1229  {
1230  $iId = $this->_oDb->getSettingsCategory($sSettingsCatName);
1231  if(empty($iId))
1232  return MsgBox(_t('_sys_request_page_not_found_cpt'));
1233 
1234  ch_import('ChWsbAdminSettings');
1235 
1236  $mixedResult = '';
1237  if(isset($_POST['save']) && isset($_POST['cat'])) {
1239  $mixedResult = $oSettings->saveChanges($_POST);
1240  }
1241 
1242  if (!empty($_POST['clear_cache'])) {
1243  $this->clearSiteThumbCache();
1244  }
1245 
1246  ch_sites_import('STW');
1247 
1248  if (getParam('ch_sites_key_id') != '' && getParam('ch_sites_secret_key') != '') {
1249  $aResponse = saveAccountInfo();
1250  if ($aResponse['stw_response_status'] == 'Success') {
1251  $sCodeSTW = MsgBox(_t('_ch_sites_administration_stw_acc_success'), 5);
1252  } else {
1253  $sCodeSTW = MsgBox(_t('_ch_sites_administration_stw_acc_failed'), 5);
1254  }
1255  } else {
1256  $sCodeSTW = MsgBox(_t('_ch_sites_administration_stw_acc_no_data'), 5);
1257  }
1258 
1260  $sForm = $oSettings->getForm();
1261 
1262  $aAccInfo = $this->_oDb->getAccountInfo(getParam('ch_sites_key_id'));
1263  $aVars = array (
1264  'actual_url' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'administration/settings',
1265  'response_status' => $aResponse['stw_response_status'] == 'Success' ? 1 : 0,
1266  'account_level' => $aAccInfo['account_level'] != 0 ? $aAccInfo['account_level'] : 0,
1267  'inside_pages' => $aAccInfo['inside_pages'] == 1 ? 1 : 0,
1268  'custom_size' => $aAccInfo['custom_size'] == 1 ? 1 : 0,
1269  'full_length' => $aAccInfo['full_length'] == 1 ? 1 : 0,
1270  'refresh_ondemand' => $aAccInfo['refresh_ondemand'] == 1 ? 1 : 0,
1271  'custom_delay' => $aAccInfo['custom_delay'] == 1 ? 1 : 0,
1272  'custom_quality' => $aAccInfo['custom_quality'] == 1 ? 1 : 0,
1273  'custom_resolution' => $aAccInfo['custom_resolution'] == 1 ? 1 : 0,
1274  'custom_messages' => $aAccInfo['custom_messages'] == 1 ? 1 : 0,
1275  );
1276  $sCode = $this->_oTemplate->parseHtmlByName('settings_info.html', $aVars);
1277 
1278  $sResult = $sCodeSTW;
1279  if($mixedResult !== true && !empty($mixedResult))
1280  $sResult .= $mixedResult;
1281  $sResult .= $sCode . $sForm;
1282 
1283  $aVars = array (
1284  'content' => $sResult
1285  );
1286 
1287  return $this->_oTemplate->parseHtmlByName('default_padding.html', $aVars);
1288  }
1289 
1290  function _addSiteForm()
1291  {
1292  global $dir;
1293 
1294  ch_sites_import('FormAdd');
1295  $oForm = new ChSitesFormAdd($this);
1296  $sMsgBox = '';
1297 
1298  if (isset($_POST['url'])) {
1299  if (isset($_POST['title'])) {
1300  $aParam = array('url' => process_pass_data($_POST['url']));
1301  if (isset($_POST['thumbnail_html']))
1302  $this->_addThumbToForm($_POST['thumbnail_html'], $aParam);
1303  $oForm = new ChSitesFormAdd($this, $aParam);
1304  $oForm->initChecker();
1305  if ($oForm->isSubmittedAndValid()) {
1306  $sCategories = implode(';', array_unique(explode(';', $oForm->getCleanValue('categories'))));
1307  $sEntryUri = getEntryUri($_POST['title']);
1308  unset($oForm->aInputs['categories']);
1309  $aValsAdd = array (
1310  'date' => time(),
1311  'entryUri' => $oForm->generateUri(),
1312  'status' => $this -> _oConfig -> _bAutoapprove || $this->isAdmin() ? 'approved' : 'pending',
1313  'categories' => $sCategories
1314  );
1315 
1316  //TODO: Continue from here
1317  if (isset($_FILES['photo']['tmp_name']) && $_FILES['photo']['tmp_name'])
1318  $aValsAdd['photo'] = $oForm->uploadPhoto($_FILES['photo']['tmp_name']);
1319  else {
1320  $aSiteInfo = getSiteInfo($aParam['url'], array(
1321  'thumbnailUrl' => array('tag' => 'link', 'content_attr' => 'href'),
1322  'OGImage' => array('name_attr' => 'property', 'name' => 'og:image'),
1323  ));
1324 
1325  $sSiteThumbnailUrl = '';
1326  if(!empty($aSiteInfo['thumbnailUrl']))
1327  $sSiteThumbnailUrl = $aSiteInfo['thumbnailUrl'];
1328  else if(!empty($aSiteInfo['OGImage']))
1329  $sSiteThumbnailUrl = $aSiteInfo['OGImage'];
1330 
1331  $bImage = false;
1332  $aHeaders = get_headers($sSiteThumbnailUrl);
1333  foreach ($aHeaders as $sHeader) {
1334  $aMatches = array();
1335  if(preg_match("/^Content-Type:\s*([a-z]*)\/([a-z]*)$/i", $sHeader, $aMatches))
1336  if($aMatches[1] == 'image' && in_array($aMatches[2], array('png', 'jpeg', 'gif'))) {
1337  $bImage = true;
1338  break;
1339  }
1340  }
1341 
1342  if($bImage)
1343  $aValsAdd['photo'] = $oForm->uploadPhoto($sSiteThumbnailUrl, true);
1344  }
1345 
1346  $aValsAdd['ownerid'] = $this->iOwnerId;
1347 
1348  if ($iSiteId = $oForm->insert($aValsAdd)) {
1349  $this->isAllowedAdd(true);
1350  $this->onSiteCreate($iSiteId, $aValsAdd['status']);
1351  header('Location:' . CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'browse/my');
1352  } else
1353  $sMsgBox = MsgBox(_t('_ch_sites_error_occured'));
1354  }
1355  } else {
1356  $oForm->initChecker();
1357  if ($oForm->isSubmittedAndValid()) {
1358  $sUrl = process_pass_data($_POST['url']);
1359  $sUrlFull = strncasecmp($sUrl, 'http://', 7) !== 0 && strncasecmp($sUrl, 'https://', 8) !== 0 ? 'http://' . $sUrl : $sUrl;
1360  $aSite = $this->_oDb->getSiteByUrl(process_db_input($sUrl, CH_TAGS_STRIP));
1361 
1362  if (empty($aSite) || !is_array($aSite)) {
1363  $aInfo = getSiteInfo($sUrlFull);
1364 
1365  if (!empty($aInfo)) {
1366  $aParam = array(
1367  'url' => $sUrl,
1368  'title' => $aInfo['title'],
1369  'description' => $aInfo['description']
1370  );
1371 
1372  // BEGIN STW INTEGRATION
1373  if (getParam('ch_sites_account_type') != 'No Automated Screenshots') {
1374  $aSTWOptions = array(
1375  );
1376 
1377  ch_sites_import('STW');
1378  $sThumbHTML = getThumbnailHTML($sUrlFull, $aSTWOptions, false, false);
1379  if ($sThumbHTML)
1380  $this->_addThumbToForm($sThumbHTML, $aParam);
1381  }
1382  // END STW INTEGRATION
1383 
1384  $oForm = new ChSitesFormAdd($this, $aParam);
1385  } else {
1386  $sMsgBox = MsgBox(_t('_ch_sites_site_link_error'));
1387  $oForm->aInputs['url']['value'] = $sUrl;
1388  }
1389  } else
1390  header('Location:' . CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aSite['entryUri']);
1391  }
1392  }
1393  }
1394 
1395  return $sMsgBox . $this->_oTemplate->parseHtmlByName('form.html', array('form' => $oForm->getCode()));
1396  }
1397 
1398  // BEGIN STW INTEGRATION
1399 
1400  function _addThumbToForm($sThumbHTML, &$aParam)
1401  {
1402  $aParam['thumbnail'] = process_pass_data($sThumbHTML);
1403  $aParam['thumbnail_html'] = process_pass_data($sThumbHTML);
1404  }
1405 
1406  // END STW INTEGRATION
1407 
1408  function _getSitesIndex()
1409  {
1410  require_once(CH_DIRECTORY_PATH_MODULES . '/cheetah/sites/classes/ChSitesSearchResult.php');
1411  $this->_oTemplate->addCss(array('main.css'));
1412  $o = new ChSitesSearchResult('index');
1413 
1414  return $o->displayResultBlock(true, true);
1415  }
1416 
1417  function _getSitesProfile($sNickName)
1418  {
1419  require_once(CH_DIRECTORY_PATH_MODULES . '/cheetah/sites/classes/ChSitesSearchResult.php');
1420  $this->_oTemplate->addCss(array('main.css'));
1421  $o = new ChSitesSearchResult('profile', $sNickName);
1422 
1423  return $o->displayResultBlock(true, true);
1424  }
1425 
1426  function _manageSites($sMode, $sValue, $aButtons)
1427  {
1428  ch_sites_import('SearchResult');
1429  $oSearchResult = new ChSitesSearchResult($sMode, $sValue);
1430  $oSearchResult->sUnitTemplate = 'unit_admin';
1431  $sActionsPanel = '';
1432 
1433  $sFormName = 'manageSitesForm';
1434 
1435  if ($sContent = $oSearchResult->displayResultBlock(true))
1436  $sActionsPanel = $oSearchResult->showAdminActionsPanel($sFormName, $aButtons);
1437  else
1438  $sContent = MsgBox(_t('_Empty'));
1439 
1440  $aVars = array(
1441  'form_name' => $sFormName,
1442  'content' => $sContent,
1443  'actions_panel' => $sActionsPanel
1444  );
1445 
1446  return $this->_oTemplate->parseHtmlByName('manage.html', $aVars);
1447  }
1448 
1449 }
process_db_input
process_db_input($sText, $iStripTags=0)
Definition: utils.inc.php:256
header
</code > Be careful enabling this directive if you have a redirector script that does not use the< code > Location</code > HTTP header
Definition: URI.MungeResources.txt:10
$oSettings
$oSettings
Definition: advanced_settings.php:20
ChWsbTwigModule
Definition: ChWsbTwigModule.php:14
ChSitesModule\onSiteMarkAsFeatured
onSiteMarkAsFeatured($aSite)
Definition: ChSitesModule.php:1184
ChSitesPageMain
Definition: ChSitesPageMain.php:11
$bAjaxMode
$bAjaxMode
Definition: categories.php:21
ChSitesModule\actionHome
actionHome()
Definition: ChSitesModule.php:129
true
if(!defined("TRUE_VAL")) define("TRUE_VAL" true
Definition: constants.inc.php:8
db_assoc_arr
db_assoc_arr($query, $bindings=[])
Definition: db.inc.php:86
$sMode
else $sMode
Definition: antispam.php:362
ChTemplTagsModule
Definition: ChTemplTagsModule.php:11
ChSitesModule\deleteSite
deleteSite($iSiteId)
Definition: ChSitesModule.php:1044
MsgBox
MsgBox($sText, $iTimer=0)
Definition: design.inc.php:175
isProfileActive
isProfileActive($iId=0)
Definition: profiles.inc.php:236
ChSitesModule\serviceGetMemberMenuItem
serviceGetMemberMenuItem()
Definition: ChSitesModule.php:934
ChWsbModule\getInstance
static getInstance($sClassName)
Definition: ChWsbModule.php:89
getSiteInfo
getSiteInfo($sSourceUrl, $aProcessAdditionalTags=array())
Definition: utils.inc.php:1460
ChSitesModule\$iOwnerId
$iOwnerId
Definition: ChSitesModule.php:94
ChWsbModule\isLogged
isLogged()
Definition: ChWsbModule.php:113
$sCode
$sCode
Definition: explanation.php:19
CHECK_ACTION_RESULT_ALLOWED
const CHECK_ACTION_RESULT_ALLOWED
Definition: membership_levels.inc.php:60
$sResult
$sResult
Definition: advanced_settings.php:26
ChSitesModule\isAdmin
isAdmin()
Definition: ChSitesModule.php:960
$aModule
$aModule
Definition: classifieds.php:21
ChSitesModule\_getSitesProfile
_getSitesProfile($sNickName)
Definition: ChSitesModule.php:1417
ChSitesFormEdit
Definition: ChSitesFormEdit.php:13
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
$aResult
$aResult
Definition: index.php:19
ch_get
ch_get($sName)
Definition: utils.inc.php:1664
$oAlert
$oAlert
Definition: embed.php:15
CHECK_ACTION_RESULT
const CHECK_ACTION_RESULT
Definition: membership_levels.inc.php:54
ChSitesModule\setStatusSite
setStatusSite($iSiteId, $sStatus)
Definition: ChSitesModule.php:1102
ChSitesModule\serviceGetWallPostComment
serviceGetWallPostComment($aEvent)
Definition: ChSitesModule.php:826
$sUrl
$sUrl
Definition: cart.php:15
php
ChSitesModule\$_sPrefix
$_sPrefix
Definition: ChSitesModule.php:92
ChWsbTags
Definition: ChWsbTags.php:15
ChSitesModule\reparseTags
reparseTags($iSiteId)
Definition: ChSitesModule.php:1115
ChWsbVoting
Definition: ChWsbVoting.php:90
$iId
$iId
Definition: license.php:15
ChSitesModule\$sModuleUrl
$sModuleUrl
Definition: ChSitesModule.php:100
ChSitesModule\_getSitesIndex
_getSitesIndex()
Definition: ChSitesModule.php:1408
ChSitesModule\$sThumbUrl
$sThumbUrl
Definition: ChSitesModule.php:103
$oPage
$oPage
Definition: search_home.php:83
ChSitesModule\actionShare
actionShare($iSiteId)
Definition: ChSitesModule.php:295
ChSitesModule\_manageSites
_manageSites($sMode, $sValue, $aButtons)
Definition: ChSitesModule.php:1426
ChSitesModule\$sThumbPath
$sThumbPath
Definition: ChSitesModule.php:102
ChWsbSubscription\getInstance
static getInstance()
Definition: ChWsbSubscription.php:67
ChSitesSearchResult
Definition: ChSitesSearchResult.php:11
ChTemplCategoriesModule
Definition: ChTemplCategoriesModule.php:11
ChSitesModule\actionDeleteProfileSites
actionDeleteProfileSites($iProfileId)
Definition: ChSitesModule.php:398
ChWsbCategories
Definition: ChWsbCategories.php:13
ChSitesModule\__construct
__construct($aModule)
Definition: ChSitesModule.php:110
ChSitesModule\isAllowedEdit
isAllowedEdit($aSite, $isPerformAction=false)
Definition: ChSitesModule.php:965
ChSitesModule\onSiteDeleted
onSiteDeleted($iSiteId)
Definition: ChSitesModule.php:1153
ChSitesModule\clearSiteThumbCache
clearSiteThumbCache()
Definition: ChSitesModule.php:1087
ChSitesModule\_actionAdministrationManage
_actionAdministrationManage($isAdminEntries, $sKeyBtnDelete='', $sKeyBtnActivate='', $sUrl=false)
Definition: ChSitesModule.php:1194
ChSitesModule\_addSiteForm
_addSiteForm()
Definition: ChSitesModule.php:1290
ChSitesModule\serviceGetSubscriptionParams
serviceGetSubscriptionParams($sAction, $iEntryId)
Definition: ChSitesModule.php:518
ChSitesModule\serviceGetWallAddComment
serviceGetWallAddComment($aEvent)
Definition: ChSitesModule.php:762
ChSitesModule\serviceGetSpyPost
serviceGetSpyPost($sAction, $iObjectId, $iSenderId, $aExtraParams=array())
Definition: ChSitesModule.php:905
ChWsbCmts
Definition: ChWsbCmts.php:99
ChSitesModule\actionTags
actionTags()
Definition: ChSitesModule.php:480
$aInfo
$aInfo
Definition: constants.inc.php:21
$oForm
$oForm
Definition: host_tools.php:42
ChSitesModule\onSiteChanged
onSiteChanged($iSiteId, $sStatus)
Definition: ChSitesModule.php:1143
ChSitesModule\$oPrivacy
$oPrivacy
Definition: ChSitesModule.php:93
ChSitesModule\actionBrowse
actionBrowse($sMode='', $sValue='', $sValue2='', $sValue3='')
Definition: ChSitesModule.php:350
ChSitesModule\_defineActions
_defineActions()
Definition: ChSitesModule.php:1108
ChWsbAlerts
Definition: ChWsbAlerts.php:39
ChSitesModule\actionAdministration
actionAdministration($sUrl='')
Definition: ChSitesModule.php:425
exit
exit
Definition: cart.php:21
ChSitesModule\isAllowedView
isAllowedView($aSite, $isPerformAction=false)
Definition: ChSitesModule.php:1011
$sFile
$sFile
Definition: index.php:20
ChSitesModule\serviceGetSpyData
serviceGetSpyData()
Definition: ChSitesModule.php:885
ChSitesModule\actionCalendar
actionCalendar($iYear='', $iMonth='')
Definition: ChSitesModule.php:139
ChSitesCalendar
Definition: ChSitesCalendar.php:11
and
and
Definition: license.txt:18
ChSitesPageProfile
Definition: ChSitesPageProfile.php:11
getParam
getParam($sParamName, $bUseCache=true)
Definition: db.inc.php:130
ChSitesFormAdd
Definition: ChSitesFormAdd.php:11
ChSitesPrivacy
Definition: ChSitesPrivacy.php:11
getLoggedId
getLoggedId()
Definition: profiles.inc.php:32
ChSitesModule\$sHomeUrl
$sHomeUrl
Definition: ChSitesModule.php:98
$sTitle
$sTitle
Definition: actions.inc.php:13
ChSitesModule\isAllowedMarkAsFeatured
isAllowedMarkAsFeatured($aSite, $isPerformAction=false)
Definition: ChSitesModule.php:985
$aProfile
$aProfile
Definition: flash.php:14
getNickName
getNickName( $ID='')
Definition: profiles.inc.php:461
$sJQueryJS
$sJQueryJS
Definition: list_pop.php:32
ChWsbViews
Definition: ChWsbViews.php:38
ChSitesModule\refreshSiteThumb
refreshSiteThumb($iSiteId)
Definition: ChSitesModule.php:1068
ChSitesModule\isAllowedAdd
isAllowedAdd($isPerformAction=false)
Definition: ChSitesModule.php:974
ChSitesModule\isAllowedSearch
isAllowedSearch($isPerformAction=false)
Definition: ChSitesModule.php:1035
ChSitesModule\_actionAdministrationAdd
_actionAdministrationAdd()
Definition: ChSitesModule.php:1223
ChSitesModule\_actionAdministrationSettings
_actionAdministrationSettings($sSettingsCatName='Sites')
Definition: ChSitesModule.php:1228
ChSitesModule\actionCategories
actionCategories()
Definition: ChSitesModule.php:493
ChSitesModule\actionSharePopup
actionSharePopup($iSiteId)
Definition: ChSitesModule.php:410
ChSitesModule\onSiteCreate
onSiteCreate($iSiteId, $sStatus)
Definition: ChSitesModule.php:1131
ChSitesModule\actionIndex
actionIndex()
Definition: ChSitesModule.php:415
global
if(!defined("GLOBAL_MODULE")) define("GLOBAL_MODULE" global
Definition: header.inc.php:25
$sContent
$sContent
Definition: bottom_menu_compose.php:169
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
ChSitesModule\_addThumbToForm
_addThumbToForm($sThumbHTML, &$aParam)
Definition: ChSitesModule.php:1400
time
that in the case of a Adaptation or at a minimum such credit will if a credit for all contributing authors of the Adaptation or Collection then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors For the avoidance of You may only use the credit required by this Section for the purpose of attribution in the manner set out above by exercising Your rights under this You may not implicitly or explicitly assert or imply any connection sponsorship or endorsement by the Original Licensor and or Attribution as of You or Your use of the without the express prior written permission of the Original Licensor and or Attribution Parties Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable if You Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or You must not modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author s honor or reputation Licensor agrees that in those in which any exercise of the right granted in modification or other derogatory action prejudicial to the Original Author s honor and the Licensor will waive or not as this to the fullest extent permitted by the applicable national to enable You to reasonably exercise Your right under Warranties and Disclaimer UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN LICENSOR OFFERS THE WORK AS IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE STATUTORY OR WITHOUT WARRANTIES OF FITNESS FOR A PARTICULAR OR THE ABSENCE OF LATENT OR OTHER OR THE PRESENCE OF ABSENCE OF WHETHER OR NOT DISCOVERABLE SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED SO SUCH EXCLUSION MAY NOT APPLY TO YOU Limitation on Liability EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES Termination This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License Individuals or entities who have received Adaptations or Collections from You under this will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses and will survive any termination of this License Subject to the above terms and the license granted here is Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time
Definition: license.txt:56
CH_WSB_PG_ALL
const CH_WSB_PG_ALL
Definition: ChWsbPrivacy.php:12
$iDate
$iDate
Definition: cron.php:130
ChSitesModule\serviceIndexBlock
serviceIndexBlock()
Definition: ChSitesModule.php:508
getProfileLink
getProfileLink( $iID, $sLinkAdd='')
Definition: profiles.inc.php:484
ChSitesModule\actionSearch
actionSearch()
Definition: ChSitesModule.php:309
$aMenu
$aMenu
Definition: categories.php:257
ChWsbAdminSettings
Definition: ChWsbAdminSettings.php:35
ChSitesModule\$sHomePath
$sHomePath
Definition: ChSitesModule.php:99
ChSitesModule\actionFeatured
actionFeatured($iSiteId)
Definition: ChSitesModule.php:268
checkAction
checkAction($iMemberId, $actionID, $performAction=false, $iForcedProfID=0, $isCheckMemberStatus=true)
Definition: membership_levels.inc.php:313
CH_TAGS_STRIP
const CH_TAGS_STRIP
Definition: utils.inc.php:22
ChSitesModule\actionEdit
actionEdit($iSiteId)
Definition: ChSitesModule.php:173
$aVars
$aVars
Definition: license.php:101
ChSitesModule\browseMy
browseMy($aProfile, $sValue='')
Definition: ChSitesModule.php:946
getEntryUri
getEntryUri($sTitle)
Definition: ChSitesModule.php:20
defineMembershipActions
defineMembershipActions($aActionsAll, $sPrefix='CH_')
Definition: membership_levels.inc.php:744
ch_sites_import
ch_sites_import($sClassPostfix, $aModuleOverwright=array())
Definition: ChSitesModule.php:8
$s
$s
Definition: embed.php:13
ChSitesPageView
Definition: ChSitesPageView.php:14
getThumbnailHTML
getThumbnailHTML($sUrl, $aOptions, $sAttribAlt=false, $sAttribClass=false, $sAttribStyle=false)
Definition: ChSitesSTW.php:34
genAjaxyPopupJS
genAjaxyPopupJS($iTargetID, $sDivID='ajaxy_popup_result_div', $sRedirect='')
Definition: design.inc.php:242
process_pass_data
process_pass_data($text, $strip_tags=0)
Definition: utils.inc.php:290
ChSitesModule\actionView
actionView($mixedVar)
Definition: ChSitesModule.php:222
ChSitesModule\isAllowedBrowse
isAllowedBrowse($isPerformAction=false)
Definition: ChSitesModule.php:1027
ChSitesModule\actionProfile
actionProfile($sNickName)
Definition: ChSitesModule.php:420
ChSitesModule\isAllowedShare
isAllowedShare(&$aDataEntry)
Definition: ChSitesModule.php:1003
ChSitesCmts
Definition: ChSitesCmts.php:11
getProfileInfo
getProfileInfo($iProfileID=0, $checkActiveStatus=false, $forceCache=false)
Definition: profiles.inc.php:249
ChSitesModule\actionAdd
actionAdd()
Definition: ChSitesModule.php:467
$sForm
$sForm
Definition: forgot.php:118
$sAction
$sAction
Definition: categories.php:274
saveAccountInfo
saveAccountInfo()
Definition: ChSitesSTW.php:49
ChSitesModule\serviceGetMemberMenuItemAddContent
serviceGetMemberMenuItemAddContent()
Definition: ChSitesModule.php:939
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7
$o
$o
Definition: cmd.php:193
ChSitesModule\actionHon
actionHon()
Definition: ChSitesModule.php:299
ChSitesPageHon
Definition: ChSitesPageHon.php:11
ChWsbService\call
static call($mixed, $sMethod, $aParams=array(), $sClass='Module')
Definition: ChWsbService.php:32
ChSitesModule\serviceGetWallPostOutline
serviceGetWallPostOutline($aEvent)
Definition: ChSitesModule.php:641
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
ChSitesModule\serviceProfileBlock
serviceProfileBlock($sNickName)
Definition: ChSitesModule.php:513
$sStatus
$sStatus
Definition: actions.inc.php:11
ChSitesFormSearch
Definition: ChSitesFormSearch.php:9
ChSitesModule\actionDelete
actionDelete($iSiteId)
Definition: ChSitesModule.php:148
ChSitesModule\reparseCategories
reparseCategories($iSiteId)
Definition: ChSitesModule.php:1122
deleteThumbnail
deleteThumbnail($sUrl, $aOptions=array())
Definition: ChSitesSTW.php:68
$iProfileId
if( $sMembersList) $iProfileId
Definition: communicator.php:29
ChTemplVotingView
Definition: ChTemplVotingView.php:14
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10
ChSitesModule
Definition: ChSitesModule.php:91
ChSitesModule\isAllowedDelete
isAllowedDelete(&$aSite, $isPerformAction=false)
Definition: ChSitesModule.php:994
ChSitesModule\serviceGetWallPost
serviceGetWallPost($aEvent)
Definition: ChSitesModule.php:539
$dir
$dir
Definition: config.php:10
$oSubscription
$oSubscription
Definition: notifies.php:28