| 12 |
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); |
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); |
| 13 |
|
|
| 14 |
require_once( $mainframe->getPath( 'front_html', 'com_content' ) ); |
require_once( $mainframe->getPath( 'front_html', 'com_content' ) ); |
| 15 |
|
require_once($mainframe->getPath('class')); |
| 16 |
|
|
| 17 |
$id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); |
$id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); |
| 18 |
$sectionid = intval( mosGetParam( $_REQUEST, 'sectionid', 0 ) ); |
$sectionid = intval( mosGetParam( $_REQUEST, 'sectionid', 0 ) ); |
| 320 |
$sectionid = $category->section; |
$sectionid = $category->section; |
| 321 |
} |
} |
| 322 |
|
|
| 323 |
|
$pathway = mosPathway::getInstance(); |
| 324 |
|
$pathway->addItem($category->title, categoryURL($sectionid, $id)); |
| 325 |
|
|
| 326 |
if ( $access->canEdit ) { |
if ( $access->canEdit ) { |
| 327 |
$xwhere = ''; |
$xwhere = ''; |
| 328 |
$xwhere2 = "\n AND b.state >= '0'"; |
$xwhere2 = "\n AND b.state >= '0'"; |
| 429 |
|
|
| 430 |
$check = 0; |
$check = 0; |
| 431 |
if ( $params->get( 'date' ) ) { |
if ( $params->get( 'date' ) ) { |
| 432 |
$order[] = mosHTML::makeOption( 'date', _ORDER_DROPDOWN_DA ); |
$order[] = mosHTML::makeOption( 'date', T_('Date Asc') ); |
| 433 |
$order[] = mosHTML::makeOption( 'rdate', _ORDER_DROPDOWN_DD ); |
$order[] = mosHTML::makeOption( 'rdate', T_('Date Desc')); |
| 434 |
$check .= 1; |
$check .= 1; |
| 435 |
} |
} |
| 436 |
if ( $params->get( 'title' ) ) { |
if ( $params->get( 'title' ) ) { |
| 437 |
$order[] = mosHTML::makeOption( 'alpha', _ORDER_DROPDOWN_TA ); |
$order[] = mosHTML::makeOption( 'alpha', T_('Title Asc') ); |
| 438 |
$order[] = mosHTML::makeOption( 'ralpha', _ORDER_DROPDOWN_TD ); |
$order[] = mosHTML::makeOption( 'ralpha', T_('Title Desc') ); |
| 439 |
$check .= 1; |
$check .= 1; |
| 440 |
} |
} |
| 441 |
if ( $params->get( 'hits' ) ) { |
if ( $params->get( 'hits' ) ) { |
| 442 |
$order[] = mosHTML::makeOption( 'hits', _ORDER_DROPDOWN_HA ); |
$order[] = mosHTML::makeOption( 'hits', T_('Hits Asc') ); |
| 443 |
$order[] = mosHTML::makeOption( 'rhits', _ORDER_DROPDOWN_HD ); |
$order[] = mosHTML::makeOption( 'rhits', T_('Hits Desc') ); |
| 444 |
$check .= 1; |
$check .= 1; |
| 445 |
} |
} |
| 446 |
if ( $params->get( 'author' ) ) { |
if ( $params->get( 'author' ) ) { |
| 447 |
$order[] = mosHTML::makeOption( 'author', _ORDER_DROPDOWN_AUA ); |
$order[] = mosHTML::makeOption( 'author', T_('Author Asc') ); |
| 448 |
$order[] = mosHTML::makeOption( 'rauthor', _ORDER_DROPDOWN_AUD ); |
$order[] = mosHTML::makeOption( 'rauthor', T_('Author Desc') ); |
| 449 |
$check .= 1; |
$check .= 1; |
| 450 |
} |
} |
| 451 |
$order[] = mosHTML::makeOption( 'order', _ORDER_DROPDOWN_O ); |
$order[] = mosHTML::makeOption( 'order', T_('Ordering') ); |
| 452 |
$lists['order'] = mosHTML::selectList( $order, 'order', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $selected ); |
$lists['order'] = mosHTML::selectList( $order, 'order', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $selected ); |
| 453 |
if ( $check < 1 ) { |
if ( $check < 1 ) { |
| 454 |
$lists['order'] = ''; |
$lists['order'] = ''; |
| 639 |
|
|
| 640 |
if ( !$archives ) { |
if ( !$archives ) { |
| 641 |
// if no archives for category, hides search and outputs empty message |
// if no archives for category, hides search and outputs empty message |
| 642 |
echo '<br /><div align="center">'. _CATEGORY_ARCHIVE_EMPTY .'</div>'; |
echo '<br /><div align="center">'. T_('There are currently no Archived Entries for this Category') .'</div>'; |
| 643 |
} else { |
} else { |
| 644 |
BlogOutput( $rows, $params, $gid, $access, $pop, $menu, 1 ); |
BlogOutput( $rows, $params, $gid, $access, $pop, $menu, 1 ); |
| 645 |
} |
} |
| 719 |
|
|
| 720 |
if ( !$archives ) { |
if ( !$archives ) { |
| 721 |
// if no archives for category, hides search and outputs empty message |
// if no archives for category, hides search and outputs empty message |
| 722 |
echo '<br /><div align="center">'. _CATEGORY_ARCHIVE_EMPTY .'</div>'; |
echo '<br /><div align="center">'. T_('There are currently no Archived Entries for this Category') .'</div>'; |
| 723 |
} else { |
} else { |
| 724 |
BlogOutput( $rows, $params, $gid, $access, $pop, $menu, 1 ); |
BlogOutput( $rows, $params, $gid, $access, $pop, $menu, 1 ); |
| 725 |
} |
} |
| 771 |
$i = $limitstart; |
$i = $limitstart; |
| 772 |
|
|
| 773 |
// needed to reduce queries used by getItemid |
// needed to reduce queries used by getItemid |
| 774 |
$ItemidCount['bs'] = $mainframe->getBlogSectionCount(); |
require_once(mamboCore::get('mosConfig_absolute_path').'/components/com_content/content.class.php'); |
| 775 |
$ItemidCount['bc'] = $mainframe->getBlogCategoryCount(); |
$handler =& new contentHandler(); |
| 776 |
$ItemidCount['gbs'] = $mainframe->getGlobalBlogSectionCount(); |
$ItemidCount['bs'] = $handler->getBlogSectionCount(); |
| 777 |
|
$ItemidCount['bc'] = $handler->getBlogCategoryCount(); |
| 778 |
|
$ItemidCount['gbs'] = $handler->getGlobalBlogSectionCount(); |
| 779 |
|
|
| 780 |
// used to display section/catagory description text and images |
// used to display section/catagory description text and images |
| 781 |
// currently not supported in Archives |
// currently not supported in Archives |
| 817 |
|
|
| 818 |
if ( $archive ) { |
if ( $archive ) { |
| 819 |
// Search Success message |
// Search Success message |
| 820 |
$msg = sprintf( _ARCHIVE_SEARCH_SUCCESS, $params->get( 'month' ), $params->get( 'year' ) ); |
$msg = sprintf( T_('Here are the Archived entries for %s %s'), $params->get( 'month' ), $params->get( 'year' ) ); |
| 821 |
echo "<br /><br /><div align='center'>". $msg ."</div><br /><br />"; |
echo "<br /><br /><div align='center'>". $msg ."</div><br /><br />"; |
| 822 |
} |
} |
| 823 |
echo '<table class="blog' . $params->get( 'pageclass_sfx' ) . '" cellpadding="0" cellspacing="0">'; |
echo '<table class="blog' . $params->get( 'pageclass_sfx' ) . '" cellpadding="0" cellspacing="0">'; |
| 951 |
|
|
| 952 |
} else if ( $archive && !$total ) { |
} else if ( $archive && !$total ) { |
| 953 |
// Search Failure message for Archives |
// Search Failure message for Archives |
| 954 |
$msg = sprintf( _ARCHIVE_SEARCH_FAILURE, $params->get( 'month' ), $params->get( 'year' ) ); |
$msg = sprintf( T_('There are no Archived entries for %s %s'), $params->get( 'month' ), $params->get( 'year' ) ); |
| 955 |
echo '<br /><br /><div align="center">'. $msg .'</div><br />'; |
echo '<br /><br /><div align="center">'. $msg .'</div><br />'; |
| 956 |
} else { |
} else { |
| 957 |
// Generic blog empty display |
// Generic blog empty display |
| 958 |
echo _EMPTY_BLOG; |
echo T_('There are no items to display'); |
| 959 |
} |
} |
| 960 |
|
|
| 961 |
// Back Button |
// Back Button |
| 991 |
$row = NULL; |
$row = NULL; |
| 992 |
|
|
| 993 |
if ( $database->loadObject( $row ) ) { |
if ( $database->loadObject( $row ) ) { |
| 994 |
|
$pathway = mosPathway::getInstance(); |
| 995 |
|
$pathway->addItem($row->category, categoryURL($row->sectionid, $row->catid)); |
| 996 |
|
$pathway->addItem($row->title, ''); |
| 997 |
$params =& new mosParameters( $row->attribs ); |
$params =& new mosParameters( $row->attribs ); |
| 998 |
$params->set( 'intro_only', 0 ); |
$params->set( 'intro_only', 0 ); |
| 999 |
$params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); |
$params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); |
| 1158 |
|
|
| 1159 |
// fail if checked out not by 'me' |
// fail if checked out not by 'me' |
| 1160 |
if ( $row->checked_out && $row->checked_out <> $my->id ) { |
if ( $row->checked_out && $row->checked_out <> $my->id ) { |
| 1161 |
echo"<script>alert('The module [ ".$row->title." ] is currently being edited by another person.'); window.history.go(-1); </script>"; |
echo"<script>alert('".sprintf(T_('The module [ %s ] is currently being edited by another person.'), $row->title)."'); window.history.go(-1); </script>"; |
| 1162 |
exit; |
exit; |
| 1163 |
} |
} |
| 1164 |
|
|
| 1238 |
$images = array(); |
$images = array(); |
| 1239 |
$folders = array(); |
$folders = array(); |
| 1240 |
$folders[] = mosHTML::makeOption( '/' ); |
$folders[] = mosHTML::makeOption( '/' ); |
| 1241 |
|
require_once($mosConfig_absolute_path.'/administrator/includes/mosAdminMenus.php'); |
| 1242 |
mosAdminMenus::ReadImages( $pathA, '/', $folders, $images ); |
mosAdminMenus::ReadImages( $pathA, '/', $folders, $images ); |
| 1243 |
// list of folders in images/stories/ |
// list of folders in images/stories/ |
| 1244 |
$lists['folders'] = mosAdminMenus::GetImageFolders( $folders, $pathL ); |
$lists['folders'] = mosAdminMenus::GetImageFolders( $folders, $pathL ); |
| 1248 |
$lists['imagelist'] = mosAdminMenus::GetSavedImages( $row, $pathL ); |
$lists['imagelist'] = mosAdminMenus::GetSavedImages( $row, $pathL ); |
| 1249 |
|
|
| 1250 |
// make the select list for the states |
// make the select list for the states |
| 1251 |
$states[] = mosHTML::makeOption( 0, _CMN_UNPUBLISHED ); |
$states[] = mosHTML::makeOption( 0, T_('Unpublished') ); |
| 1252 |
$states[] = mosHTML::makeOption( 1, _CMN_PUBLISHED ); |
$states[] = mosHTML::makeOption( 1, T_('Published') ); |
| 1253 |
$lists['state'] = mosHTML::selectList( $states, 'state', 'class="inputbox" size="1"', 'value', 'text', intval( $row->state ) ); |
$lists['state'] = mosHTML::selectList( $states, 'state', 'class="inputbox" size="1"', 'value', 'text', intval( $row->state ) ); |
| 1254 |
|
|
| 1255 |
// build the html select list for ordering |
// build the html select list for ordering |
| 1365 |
$users = $database->loadResultArray(); |
$users = $database->loadResultArray(); |
| 1366 |
foreach ($users as $user_id) { |
foreach ($users as $user_id) { |
| 1367 |
$msg = new mosMessage( $database ); |
$msg = new mosMessage( $database ); |
| 1368 |
$msg->send( $my->id, $user_id, "New Item", sprintf( _ON_NEW_CONTENT, $my->username, $row->title, $section, $category ) ); |
$msg->send( $my->id, $user_id, T_("New Item"), sprintf( T_('A new content item has been submitted by [ %s ] titled [ %s ] from section [ %s ] and category [ %s ]'), $my->username, $row->title, $section, $category ) ); |
| 1369 |
} |
} |
| 1370 |
} |
} |
| 1371 |
|
|
| 1372 |
$Itemid = mosGetParam( $_POST, 'Returnid', '0' ); |
$Itemid = mosGetParam( $_POST, 'Returnid', '0' ); |
| 1373 |
$msg = $isNew ? _THANK_SUB : _E_ITEM_SAVED; |
$msg = $isNew ? T_('Thanks for your submission; it will be reviewed before being posted to the site.') : T_('Item saved successfully.'); |
| 1374 |
mosRedirect( 'index.php', $msg ); |
mosRedirect( 'index.php', $msg ); |
| 1375 |
} |
} |
| 1376 |
|
|
| 1403 |
*/ |
*/ |
| 1404 |
function emailContentForm( $uid ) { |
function emailContentForm( $uid ) { |
| 1405 |
global $database, $mainframe, $my; |
global $database, $mainframe, $my; |
|
|
|
| 1406 |
$row = new mosContent( $database ); |
$row = new mosContent( $database ); |
| 1407 |
$row->load( $uid ); |
$row->load( $uid ); |
| 1408 |
|
|
| 1432 |
$email = trim( mosGetParam( $_POST, 'email', '' ) ); |
$email = trim( mosGetParam( $_POST, 'email', '' ) ); |
| 1433 |
$yourname = trim( mosGetParam( $_POST, 'yourname', '' ) ); |
$yourname = trim( mosGetParam( $_POST, 'yourname', '' ) ); |
| 1434 |
$youremail = trim( mosGetParam( $_POST, 'youremail', '' ) ); |
$youremail = trim( mosGetParam( $_POST, 'youremail', '' ) ); |
| 1435 |
$subject_default = _EMAIL_INFO ." $yourname"; |
$subject_default = sprintf(T_('Item sent by %s'), $yourname); |
| 1436 |
$subject = trim( mosGetParam( $_POST, 'subject', $subject_default ) ); |
$subject = trim( mosGetParam( $_POST, 'subject', $subject_default ) ); |
| 1437 |
|
|
|
|
|
| 1438 |
$form_check = mosGetParam( $_POST, 'form_check', '' ); |
$form_check = mosGetParam( $_POST, 'form_check', '' ); |
| 1439 |
if (empty($_SESSION['_form_check_']['com_content']) || $form_check != $_SESSION['_form_check_']['com_content']) { |
if (empty($_SESSION['_form_check_']['com_content']) || $form_check != $_SESSION['_form_check_']['com_content']) { |
| 1440 |
// the form hasn't been generated by the server on this session |
// the form hasn't been generated by the server on this session |
| 1441 |
exit; |
exit; |
| 1442 |
} |
} |
|
|
|
| 1443 |
if ( !$email || !$youremail || ( is_email( $email ) == false ) || ( is_email( $youremail ) == false ) ) { |
if ( !$email || !$youremail || ( is_email( $email ) == false ) || ( is_email( $youremail ) == false ) ) { |
| 1444 |
echo "<script>alert (\""._EMAIL_ERR_NOINFO."\"); window.history.go(-1);</script>"; |
echo "<script>alert (\"".T_('You must enter valid e-mail addresses for both yourself and your recipient.')."\"); window.history.go(-1);</script>"; |
| 1445 |
exit(0); |
exit(0); |
| 1446 |
} |
} |
| 1447 |
|
|
| 1451 |
|
|
| 1452 |
// link sent in email |
// link sent in email |
| 1453 |
$link = sefRelToAbs( $mosConfig_live_site .'/index.php?option=com_content&task=view&id='. $uid .'&Itemid='. $_Itemid ); |
$link = sefRelToAbs( $mosConfig_live_site .'/index.php?option=com_content&task=view&id='. $uid .'&Itemid='. $_Itemid ); |
|
|
|
| 1454 |
// message text |
// message text |
| 1455 |
$msg = sprintf( _EMAIL_MSG, $mosConfig_sitename, $yourname, $youremail, $link ); |
$msg = sprintf( T_(' The following page from the "%s" website has been sent to you by %s ( %s ). |
| 1456 |
|
|
| 1457 |
|
You can access it at the following url: |
| 1458 |
|
%s'), $mosConfig_sitename, $yourname, $youremail, $link ); |
| 1459 |
|
|
| 1460 |
// mail function |
// mail function |
| 1461 |
mosMail( $mosConfig_mailfrom, $mosConfig_fromname, $email, $subject, $msg ); |
mosMail( $mosConfig_mailfrom, $mosConfig_fromname, $email, $subject, $msg ); |
| 1503 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 1504 |
$database->query() or die( $database->stderr() ); |
$database->query() or die( $database->stderr() ); |
| 1505 |
} else { |
} else { |
| 1506 |
mosRedirect ( $url, _ALREADY_VOTE ); |
mosRedirect ( $url, T_('You already voted for this poll today!') ); |
| 1507 |
} |
} |
| 1508 |
} |
} |
| 1509 |
mosRedirect ( $url, _THANKS ); |
mosRedirect ( $url, T_('Thanks for your vote!') ); |
| 1510 |
} |
} |
| 1511 |
} |
} |
| 1512 |
|
|
| 1619 |
|
|
| 1620 |
return $where; |
return $where; |
| 1621 |
} |
} |
| 1622 |
|
|
| 1623 |
|
function sectionURL ($sectionid) { |
| 1624 |
|
global $Itemid; |
| 1625 |
|
return "index.php?option=com_content&task=section&id=$sectionid&Itemid=$Itemid"; |
| 1626 |
|
} |
| 1627 |
|
|
| 1628 |
|
function categoryURL ($sectionid, $catid) { |
| 1629 |
|
global $Itemid; |
| 1630 |
|
return "index.php?option=com_content&task=category§ionid=$sectionid&id=$catid&Itemid=$Itemid"; |
| 1631 |
|
} |
| 1632 |
|
|
| 1633 |
?> |
?> |