| 1 |
<?php |
<?php |
| 2 |
/** |
/** |
|
* @version $Id: content.php,v 1.7 2005/11/24 04:28:51 csouza Exp $ |
|
| 3 |
* @package Mambo |
* @package Mambo |
| 4 |
* @subpackage Content |
* @subpackage Content |
| 5 |
* @copyright (C) 2000 - 2005 Miro International Pty Ltd |
* @copyright Refer to copyright.php |
| 6 |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
| 7 |
* Mambo is Free Software |
* @author Mambo Foundation Inc see README.php |
| 8 |
*/ |
*/ |
| 9 |
|
|
| 10 |
/** ensure this file is being included by a parent file */ |
/** ensure this file is being included by a parent file */ |
| 144 |
$params =& new mosParameters( $menu->params ); |
$params =& new mosParameters( $menu->params ); |
| 145 |
$orderby_sec = $params->def( 'orderby_sec', '' ); |
$orderby_sec = $params->def( 'orderby_sec', '' ); |
| 146 |
$orderby_pri = $params->def( 'orderby_pri', '' ); |
$orderby_pri = $params->def( 'orderby_pri', '' ); |
| 147 |
|
$header = $params->def( 'header', $menu->name ); |
| 148 |
|
$page_title = $params->def( 'page_title', 0 ); |
| 149 |
// Ordering control |
// Ordering control |
| 150 |
$order_sec = _orderby_sec( $orderby_sec ); |
$order_sec = _orderby_sec( $orderby_sec ); |
| 151 |
$order_pri = _orderby_pri( $orderby_pri ); |
$order_pri = _orderby_pri( $orderby_pri ); |
| 152 |
|
|
| 153 |
$now = date( "Y-m-d H:i:s", time()+$mosConfig_offset*60*60 ); |
$now = date( "Y-m-d H:i:s", time()+$mosConfig_offset*60*60 ); |
| 154 |
|
|
| 155 |
|
// temporary workaround for special access - alwarren 20070207 |
| 156 |
|
global $acl; |
| 157 |
|
$viewAccess = ($gid >= $acl->get_group_id( 'Registered', 'ARO' ) ? 1 : 0) + ($gid >= $acl->get_group_id( 'Author', 'ARO' ) ? 1 : 0); |
| 158 |
|
// end special access workaround |
| 159 |
// query records |
// query records |
| 160 |
$query = "SELECT a.*, ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups" |
$query = "SELECT a.*, ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups" |
| 161 |
. "\n FROM #__content AS a" |
. "\n FROM #__content AS a" |
| 162 |
. "\n INNER JOIN #__content_frontpage AS f ON f.content_id = a.id" |
. "\n INNER JOIN #__content_frontpage AS f ON f.content_id = a.id" |
| 163 |
. "\n INNER JOIN #__categories AS cc ON cc.id = a.catid" |
. "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" |
| 164 |
. "\n INNER JOIN #__sections AS s ON s.id = a.sectionid" |
. "\n LEFT JOIN #__sections AS s ON s.id = a.sectionid" |
| 165 |
. "\n LEFT JOIN #__users AS u ON u.id = a.created_by" |
. "\n LEFT JOIN #__users AS u ON u.id = a.created_by" |
| 166 |
. "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" |
. "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" |
| 167 |
. "\n LEFT JOIN #__groups AS g ON a.access = g.id" |
. "\n LEFT JOIN #__groups AS g ON a.access = g.id" |
| 169 |
. ( $noauth ? "\n AND a.access <= '". $my->gid ."'" : '' ) |
. ( $noauth ? "\n AND a.access <= '". $my->gid ."'" : '' ) |
| 170 |
. "\n AND ( publish_up = '0000-00-00 00:00:00' OR publish_up <= '$now' )" |
. "\n AND ( publish_up = '0000-00-00 00:00:00' OR publish_up <= '$now' )" |
| 171 |
. "\n AND ( publish_down = '0000-00-00 00:00:00' OR publish_down >= '$now' )" |
. "\n AND ( publish_down = '0000-00-00 00:00:00' OR publish_down >= '$now' )" |
| 172 |
|
// temporary workaround for special access - alwarren 20070207 |
| 173 |
|
. "\n AND a.access <= ". $viewAccess |
| 174 |
|
// end special access workaround |
| 175 |
. "\n ORDER BY ". $order_pri . $order_sec |
. "\n ORDER BY ". $order_pri . $order_sec |
| 176 |
; |
; |
| 177 |
// $database->setQuery( $query ); |
// $database->setQuery( $query ); |
| 179 |
$rows = $database->doSQLget($query, 'mosExtendedContent'); |
$rows = $database->doSQLget($query, 'mosExtendedContent'); |
| 180 |
|
|
| 181 |
// Dynamic Page Title |
// Dynamic Page Title |
| 182 |
$mainframe->SetPageTitle( $menu->name ); |
$mainframe->SetPageTitle( $header ); |
| 183 |
|
|
| 184 |
BlogOutput( $rows, $params, $gid, $access, $pop, $menu ); |
BlogOutput( $rows, $params, $gid, $access, $pop, $menu ); |
| 185 |
} |
} |
| 212 |
$params->def( 'empty_cat', 0 ); |
$params->def( 'empty_cat', 0 ); |
| 213 |
$params->def( 'cat_items', 1 ); |
$params->def( 'cat_items', 1 ); |
| 214 |
$params->def( 'cat_description', 1 ); |
$params->def( 'cat_description', 1 ); |
| 215 |
|
$params->def( 'description', 1 ); |
| 216 |
|
$params->def( 'description-image', 1 ); |
| 217 |
$params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); |
$params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); |
| 218 |
$params->def( 'pageclass_sfx', '' ); |
$params->def( 'pageclass_sfx', '' ); |
| 219 |
|
|
| 313 |
$params->def( 'empty_cat', 0 ); |
$params->def( 'empty_cat', 0 ); |
| 314 |
$params->def( 'cat_items', 1 ); |
$params->def( 'cat_items', 1 ); |
| 315 |
$params->def( 'cat_description', 0 ); |
$params->def( 'cat_description', 0 ); |
| 316 |
|
$params->def( 'description', 1 ); |
| 317 |
|
$params->def( 'description-image', 1 ); |
| 318 |
$params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); |
$params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); |
| 319 |
$params->def( 'pageclass_sfx', '' ); |
$params->def( 'pageclass_sfx', '' ); |
| 320 |
$params->def( 'headings', 1 ); |
$params->def( 'headings', 1 ); |
| 332 |
$sectionid = $category->section; |
$sectionid = $category->section; |
| 333 |
} |
} |
| 334 |
|
|
| 335 |
$pathway = mosPathway::getInstance(); |
$pathway =& mosPathway::getInstance(); |
| 336 |
$pathway->addItem($category->title, categoryURL($sectionid, $id)); |
$pathway->addItem($category->title, categoryURL($sectionid, $id)); |
| 337 |
|
|
| 338 |
if ( $access->canEdit ) { |
if ( $access->canEdit ) { |
| 376 |
|
|
| 377 |
// get the total number of published items in the category |
// get the total number of published items in the category |
| 378 |
// filter functionality |
// filter functionality |
| 379 |
$filter = trim( mosGetParam( $_POST, 'filter', '' ) ); |
$_and = ''; |
| 380 |
|
if ($filter = mosGetParam($_POST, 'filter', '')) { |
| 381 |
$filter = strtolower( $filter ); |
$filter = strtolower( $filter ); |
| 382 |
$and = ''; |
$filter = $database->getEscaped($filter); |
|
if ( $filter ) { |
|
| 383 |
if ( $params->get( 'filter' ) ) { |
if ( $params->get( 'filter' ) ) { |
| 384 |
switch ( $params->get( 'filter_type' ) ) { |
switch ( $params->get( 'filter_type' ) ) { |
| 385 |
case 'title': |
case 'title': |
| 386 |
$and = "\n AND LOWER( a.title ) LIKE '%". $filter ."%'"; |
$_and = "\n AND LOWER( a.title ) LIKE '%". $filter ."%'"; |
| 387 |
break; |
break; |
| 388 |
case 'author': |
case 'author': |
| 389 |
$and = "\n AND ( ( LOWER( u.name ) LIKE '%". $filter ."%' ) OR ( LOWER( a.created_by_alias ) LIKE '%". $filter ."%' ) )"; |
$_and = "\n AND ( ( LOWER( u.name ) LIKE '%". $filter ."%' ) OR ( LOWER( a.created_by_alias ) LIKE '%". $filter ."%' ) )"; |
| 390 |
break; |
break; |
| 391 |
case 'hits': |
case 'hits': |
| 392 |
$and = "\n AND a.hits LIKE '%". $filter ."%'"; |
$_and = "\n AND a.hits LIKE '%". $filter ."%'"; |
| 393 |
break; |
break; |
| 394 |
} |
} |
| 395 |
} |
} |
| 412 |
. "\n WHERE a.catid='". $category->id ."' ". $xwhere |
. "\n WHERE a.catid='". $category->id ."' ". $xwhere |
| 413 |
. ( $noauth ? "\n AND a.access<='". $gid ."'" : '' ) |
. ( $noauth ? "\n AND a.access<='". $gid ."'" : '' ) |
| 414 |
. "\n AND '". $category->access ."'<='". $gid ."'" |
. "\n AND '". $category->access ."'<='". $gid ."'" |
| 415 |
. $and |
. $_and |
| 416 |
. "\n ORDER BY ". $orderby ."" |
. "\n ORDER BY ". $orderby ."" |
| 417 |
; |
; |
| 418 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 432 |
. "\n WHERE a.catid='". $category->id ."' ". $xwhere |
. "\n WHERE a.catid='". $category->id ."' ". $xwhere |
| 433 |
. ( $noauth ? "\n AND a.access<='". $gid ."'" : '' ) |
. ( $noauth ? "\n AND a.access<='". $gid ."'" : '' ) |
| 434 |
. "\n AND '". $category->access ."'<='". $gid ."'" |
. "\n AND '". $category->access ."'<='". $gid ."'" |
| 435 |
. $and |
. $_and |
| 436 |
. "\n ORDER BY ". $orderby ."" |
. "\n ORDER BY ". $orderby ."" |
| 437 |
. "\n LIMIT ". $limitstart .", ". $limit |
. "\n LIMIT ". $limitstart .", ". $limit |
| 438 |
; |
; |
| 587 |
|
|
| 588 |
$noauth = !$mainframe->getCfg( 'shownoauth' ); |
$noauth = !$mainframe->getCfg( 'shownoauth' ); |
| 589 |
|
|
| 590 |
// Paramters |
// Parameters |
| 591 |
$year = mosGetParam( $_REQUEST, 'year', date( 'Y' ) ); |
$year = mosGetParam( $_REQUEST, 'year', date( 'Y' ) ); |
| 592 |
$month = mosGetParam( $_REQUEST, 'month', date( 'm' ) ); |
$month = mosGetParam( $_REQUEST, 'month', date( 'm' ) ); |
| 593 |
|
|
| 663 |
echo '<input type="hidden" name="Itemid" value="'. $Itemid .'" />'; |
echo '<input type="hidden" name="Itemid" value="'. $Itemid .'" />'; |
| 664 |
echo '<input type="hidden" name="task" value="archivesection" />'; |
echo '<input type="hidden" name="task" value="archivesection" />'; |
| 665 |
echo '<input type="hidden" name="option" value="com_content" />'; |
echo '<input type="hidden" name="option" value="com_content" />'; |
| 666 |
|
echo '<input type="hidden" name="module" value="1" />'; |
| 667 |
echo '</form>'; |
echo '</form>'; |
| 668 |
} |
} |
| 669 |
|
|
| 745 |
echo '<input type="hidden" name="Itemid" value="'. $Itemid .'" />'; |
echo '<input type="hidden" name="Itemid" value="'. $Itemid .'" />'; |
| 746 |
echo '<input type="hidden" name="task" value="archivecategory" />'; |
echo '<input type="hidden" name="task" value="archivecategory" />'; |
| 747 |
echo '<input type="hidden" name="option" value="com_content" />'; |
echo '<input type="hidden" name="option" value="com_content" />'; |
| 748 |
|
echo '<input type="hidden" name="module" value="1" />'; |
| 749 |
echo '</form>'; |
echo '</form>'; |
| 750 |
} |
} |
| 751 |
|
|
| 995 |
; |
; |
| 996 |
} |
} |
| 997 |
|
|
| 998 |
|
// temporary workaround for special access - alwarren 20070207 |
| 999 |
|
global $acl; |
| 1000 |
|
$viewAccess = ($gid >= $acl->get_group_id( 'Registered', 'ARO' ) ? 1 : 0) + ($gid >= $acl->get_group_id( 'Author', 'ARO' ) ? 1 : 0); |
| 1001 |
|
// end special access workaraound |
| 1002 |
$query = "SELECT a.*, ROUND(v.rating_sum/v.rating_count) AS rating, v.rating_count, u.name AS author, u.usertype, cc.name AS category, s.name AS section, g.name AS groups" |
$query = "SELECT a.*, ROUND(v.rating_sum/v.rating_count) AS rating, v.rating_count, u.name AS author, u.usertype, cc.name AS category, s.name AS section, g.name AS groups" |
| 1003 |
. "\n FROM #__content AS a" |
. "\n FROM #__content AS a" |
| 1004 |
. "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" |
. "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" |
| 1007 |
. "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" |
. "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" |
| 1008 |
. "\n LEFT JOIN #__groups AS g ON a.access = g.id" |
. "\n LEFT JOIN #__groups AS g ON a.access = g.id" |
| 1009 |
. "\n WHERE a.id='". $uid ."' ". $xwhere |
. "\n WHERE a.id='". $uid ."' ". $xwhere |
| 1010 |
. "\n AND a.access <= ". $gid |
// temporary workaround for special access - alwarren 20070207 |
| 1011 |
|
. "\n AND a.access <= ". $viewAccess |
| 1012 |
|
// . "\n AND a.access <= ". $gid // original code |
| 1013 |
|
// end special access workaraound |
| 1014 |
; |
; |
| 1015 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 1016 |
// $row = NULL; |
// $row = NULL; |
| 1017 |
$row = new mosExtendedContent(); |
$row = new mosExtendedContent(); |
| 1018 |
|
|
| 1019 |
if ( $database->loadObject( $row ) ) { |
if ( $database->loadObject( $row ) ) { |
| 1020 |
$pathway = mosPathway::getInstance(); |
$pathway =& mosPathway::getInstance(); |
| 1021 |
$pathway->addItem($row->category, categoryURL($row->sectionid, $row->catid)); |
$pathway->addItem($row->category, categoryURL($row->sectionid, $row->catid)); |
| 1022 |
$pathway->addItem($row->title, ''); |
$pathway->addItem($row->title, ''); |
| 1023 |
$params =& new mosParameters( $row->attribs ); |
$params =& new mosParameters( $row->attribs ); |
| 1035 |
. "\n WHERE a.catid = ". $row->catid."" |
. "\n WHERE a.catid = ". $row->catid."" |
| 1036 |
. "\n AND a.state = $row->state AND ordering < $row->ordering" |
. "\n AND a.state = $row->state AND ordering < $row->ordering" |
| 1037 |
. ($access->canEdit ? "" : "\n AND a.access <= '". $gid ."'" ) |
. ($access->canEdit ? "" : "\n AND a.access <= '". $gid ."'" ) |
| 1038 |
|
. "\n AND ( a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '". $now ."' )" |
| 1039 |
|
. "\n AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '". $now ."' )" |
| 1040 |
. "\n ORDER BY a.ordering DESC" |
. "\n ORDER BY a.ordering DESC" |
| 1041 |
. "\n LIMIT 1" |
. "\n LIMIT 1" |
| 1042 |
; |
; |
| 1048 |
. "\n WHERE a.catid = ". $row->catid."" |
. "\n WHERE a.catid = ". $row->catid."" |
| 1049 |
. "\n AND a.state = $row->state AND ordering > $row->ordering" |
. "\n AND a.state = $row->state AND ordering > $row->ordering" |
| 1050 |
. ($access->canEdit ? "" : "\n AND a.access <= '". $gid ."'" ) |
. ($access->canEdit ? "" : "\n AND a.access <= '". $gid ."'" ) |
| 1051 |
|
. "\n AND ( a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '". $now ."' )" |
| 1052 |
|
. "\n AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '". $now ."' )" |
| 1053 |
. "\n ORDER BY a.ordering" |
. "\n ORDER BY a.ordering" |
| 1054 |
. "\n LIMIT 1" |
. "\n LIMIT 1" |
| 1055 |
; |
; |
| 1129 |
if ( $params->get( 'section_link' ) ) { |
if ( $params->get( 'section_link' ) ) { |
| 1130 |
$query = "SELECT a.id" |
$query = "SELECT a.id" |
| 1131 |
. "\n FROM #__menu AS a" |
. "\n FROM #__menu AS a" |
| 1132 |
. "\n WHERE a.componentid = ". $row->sectionid."" |
. "\n WHERE a.componentid = '". $row->sectionid."'" |
| 1133 |
|
. "\n AND a.type = 'content_section'" |
| 1134 |
|
. "\n AND a.published = 1" |
| 1135 |
; |
; |
| 1136 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 1137 |
$_Itemid = $database->loadResult(); |
$_Itemid = $database->loadResult(); |
| 1138 |
|
if (!intval($_Itemid)) |
| 1139 |
|
$_Itemid = intval($Itemid) ? intval($Itemid) : 1; |
| 1140 |
$link = sefRelToAbs( 'index.php?option=com_content&task=section&id='. $row->sectionid .'&Itemid='.$_Itemid ); |
$link = sefRelToAbs( 'index.php?option=com_content&task=section&id='. $row->sectionid .'&Itemid='.$_Itemid ); |
| 1141 |
$row->section = '<a href="'. $link .'">'. $row->section .'</a>'; |
$row->section = '<a href="'. $link .'">'. $row->section .'</a>'; |
| 1142 |
} |
} |
| 1146 |
$query = "SELECT a.id" |
$query = "SELECT a.id" |
| 1147 |
. "\n FROM #__menu AS a" |
. "\n FROM #__menu AS a" |
| 1148 |
. "\n WHERE a.componentid = ". $row->catid."" |
. "\n WHERE a.componentid = ". $row->catid."" |
| 1149 |
|
. "\n AND a.type = 'content_category'" |
| 1150 |
|
. "\n AND a.published = 1" |
| 1151 |
; |
; |
| 1152 |
$database->setQuery( $query ); |
$database->setQuery( $query ); |
| 1153 |
$_Itemid = $database->loadResult(); |
$_Itemid = $database->loadResult(); |
| 1154 |
|
if (!intval($_Itemid)) |
| 1155 |
|
$_Itemid = intval($Itemid) ? intval($Itemid) : 1; |
| 1156 |
|
$link = sefRelToAbs( 'index.php?option=com_content&task=section&id='. $row->sectionid .'&Itemid='.$_Itemid ); |
| 1157 |
$link = sefRelToAbs( 'index.php?option=com_content&task=category&sectionid='. $row->sectionid .'&id='. $row->catid .'&Itemid='.$_Itemid ); |
$link = sefRelToAbs( 'index.php?option=com_content&task=category&sectionid='. $row->sectionid .'&id='. $row->catid .'&Itemid='.$_Itemid ); |
| 1158 |
$row->category = '<a href="'. $link .'">'. $row->category .'</a>'; |
$row->category = '<a href="'. $link .'">'. $row->category .'</a>'; |
| 1159 |
} |
} |
| 1270 |
$row->frontpage = 0; |
$row->frontpage = 0; |
| 1271 |
} |
} |
| 1272 |
|
|
|
|
|
| 1273 |
// calls function to read image from directory |
// calls function to read image from directory |
| 1274 |
$pathA = $mosConfig_absolute_path .'/images/stories'; |
$pathA = $mosConfig_absolute_path .'/images/stories'; |
| 1275 |
$pathL = $mosConfig_live_site .'/images/stories'; |
$pathL = $mosConfig_live_site .'/images/stories'; |
| 1297 |
. "\n ORDER BY ordering" |
. "\n ORDER BY ordering" |
| 1298 |
; |
; |
| 1299 |
$lists['ordering'] = mosAdminMenus::SpecificOrdering( $row, $uid, $query, 1 ); |
$lists['ordering'] = mosAdminMenus::SpecificOrdering( $row, $uid, $query, 1 ); |
|
|
|
| 1300 |
// build list of categories |
// build list of categories |
| 1301 |
$lists['catid'] = mosAdminMenus::ComponentCategory( 'catid', $sectionid, intval( $row->catid ) ); |
$lists['catid'] = mosAdminMenus::ComponentCategory( 'catid', $sectionid, intval( $row->catid ) ); |
| 1302 |
// build the select list for the image positions |
// build the select list for the image positions |
| 1320 |
echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n"; |
echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n"; |
| 1321 |
exit(); |
exit(); |
| 1322 |
} |
} |
| 1323 |
|
// sanitize |
| 1324 |
|
$row->id = intval($row->id); |
| 1325 |
|
$row->catid = intval($row->catid); |
| 1326 |
|
$row->sectionid = intval($row->sectionid); |
| 1327 |
$isNew = $row->id < 1; |
$isNew = $row->id < 1; |
| 1328 |
if ( $isNew ) { |
if ( $isNew ) { |
| 1329 |
// new record |
// new record |
| 1401 |
if ( $isNew ) { |
if ( $isNew ) { |
| 1402 |
// messaging for new items |
// messaging for new items |
| 1403 |
require_once( $mosConfig_absolute_path .'/components/com_messages/messages.class.php' ); |
require_once( $mosConfig_absolute_path .'/components/com_messages/messages.class.php' ); |
|
|
|
| 1404 |
$database->setQuery( "SELECT id FROM #__users WHERE sendEmail = '1'" ); |
$database->setQuery( "SELECT id FROM #__users WHERE sendEmail = '1'" ); |
| 1405 |
$users = $database->loadResultArray(); |
$users = $database->loadResultArray(); |
| 1406 |
|
if ($users) { |
| 1407 |
foreach ($users as $user_id) { |
foreach ($users as $user_id) { |
| 1408 |
$msg = new mosMessage( $database ); |
$msg = new mosMessage( $database ); |
| 1409 |
$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 ) ); |
$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 ) ); |
| 1410 |
} |
} |
| 1411 |
} |
} |
| 1412 |
|
} |
| 1413 |
$Itemid = mosGetParam( $_POST, 'Returnid', '0' ); |
$Itemid = mosGetParam( $_POST, 'Returnid', '0' ); |
| 1414 |
$msg = $isNew ? T_('Thanks for your submission; it will be reviewed before being posted to the site.') : T_('Item saved successfully.'); |
$msg = $isNew ? T_('Thanks for your submission; it will be reviewed before being posted to the site.') : T_('Item saved successfully.'); |
| 1415 |
mosRedirect( 'index.php', $msg ); |
mosRedirect( 'index.php', $msg ); |
| 1425 |
|
|
| 1426 |
$row = new mosContent( $database ); |
$row = new mosContent( $database ); |
| 1427 |
$row->bind( $_POST ); |
$row->bind( $_POST ); |
| 1428 |
|
// sanitize |
| 1429 |
|
$row->id = intval($row->id); |
| 1430 |
|
|
| 1431 |
if ( $access->canEdit || ( $access->canEditOwn && $row->created_by == $my->id ) ) { |
if ( $access->canEdit || ( $access->canEditOwn && $row->created_by == $my->id ) ) { |
| 1432 |
$row->checkin(); |
$row->checkin(); |
| 1434 |
|
|
| 1435 |
$Itemid = mosGetParam( $_POST, 'Returnid', '0' ); |
$Itemid = mosGetParam( $_POST, 'Returnid', '0' ); |
| 1436 |
|
|
|
if ( $Itemid ) { |
|
|
mosRedirect( 'index.php?option=com_content&task=view&id='. $row->id .'&Itemid='. $Itemid ); |
|
|
} else { |
|
| 1437 |
mosRedirect( 'index.php' ); |
mosRedirect( 'index.php' ); |
| 1438 |
} |
} |
|
} |
|
| 1439 |
|
|
| 1440 |
/** |
/** |
| 1441 |
* Shows the email form for a given content item. |
* Shows the email form for a given content item. |
| 1474 |
$subject_default = sprintf(T_('Item sent by %s'), $yourname); |
$subject_default = sprintf(T_('Item sent by %s'), $yourname); |
| 1475 |
$subject = trim( mosGetParam( $_POST, 'subject', $subject_default ) ); |
$subject = trim( mosGetParam( $_POST, 'subject', $subject_default ) ); |
| 1476 |
|
|
| 1477 |
|
session_start(); |
| 1478 |
$form_check = mosGetParam( $_POST, 'form_check', '' ); |
$form_check = mosGetParam( $_POST, 'form_check', '' ); |
| 1479 |
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']) { |
| 1480 |
// the form hasn't been generated by the server on this session |
// the form hasn't been generated by the server on this session |
| 1492 |
// link sent in email |
// link sent in email |
| 1493 |
$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 ); |
| 1494 |
// message text |
// message text |
| 1495 |
$msg = sprintf( T_(' The following page from the "%s" website has been sent to you by %s ( %s ). |
$msg = sprintf( T_(' The following page from the \"%s\" website has been sent to you by %s ( %s ).\n\nYou can access it at the following url:\n%s'), $mosConfig_sitename, $yourname, $youremail, $link ); |
|
|
|
|
You can access it at the following url: |
|
|
%s'), $mosConfig_sitename, $yourname, $youremail, $link ); |
|
| 1496 |
|
|
| 1497 |
// mail function |
// mail function |
| 1498 |
mosMail( $mosConfig_mailfrom, $mosConfig_fromname, $email, $subject, $msg ); |
mosMail( $mosConfig_mailfrom, $mosConfig_fromname, $email, $subject, $msg ); |