Форумы / Cotonti / Support / How to turn off the expire of the page

this thing drives me mad

SunChase
#1 06.07.2009 23:36
Is there a way to turn off the Page Expire?It drives me crazy
[url=http://ka13.orgfree.com]KA13[/url] - The essence of creativity
biro
#2 06.07.2009 23:39
set it to ----
Be sure to check out<br /><br /><br />
My site-<a href="http://www.iso-center.co.cc">http://www.iso-center.co.cc</a><br />
My plugins;TPL Editior 1.2 &amp; Mobile site
SunChase
#3 06.07.2009 23:45
lets try another way.HOW to turn it off once so it wont bug in the future and to completely erase that field from the page.add and page.edit?
[url=http://ka13.orgfree.com]KA13[/url] - The essence of creativity
gamer24.7
#4 07.07.2009 00:05
Look in the support section for a thread called "News not showing..."

You will find your answer there
[b][color=#000000]Click [/color][url=http://www.design-studio.netau.net][color=#EF2929][u]Here[/u][/color][/url] [color=#F57900]For All You Design [/color][color=#756745]Related Needs.[/color][/b]
pieter
#5 07.07.2009 00:56
As far as I know it is not used.

It is there for those who wants to use it, but they need to write a plugin for it.
... can we help you ...
gamer24.7
#6 07.07.2009 03:35
In news.php delete or hide 2 lines:

#     $sql
#  = sed_sql_query("SELECT p.*, u.user_name, user_avatar FROM $db_pages AS p
#     LEFT JOIN $db_users AS u ON u.user_id=p.page_ownerid
#     WHERE page_state=0 AND page_cat NOT LIKE 'system'
#     /* AND    page_begin<'"
.$sys['now_offset']."' AND page_expire>'".$sys['now_offset']."' */
# #     AND page_cat IN ('"
.implode("','", $catsub)."') ORDER BY page_".$sed_cat[$c]['order']." ".$sed_cat[$c]['way']." LIMIT $d,".$cfg['plugin']['news']['maxpages']); 
# #     $sql2
#  = sed_sql_query("SELECT COUNT(*) FROM $db_pages WHERE page_state=0
#     AND page_cat NOT LIKE 'system'
# /*    AND    page_begin<'"
.$sys['now_offset']."' AND page_expire>'".$sys['now_offset']."' */
# #     AND page_cat IN ('"
.implode("','", $catsub)."')");

AND page_begin<'".$sys['now_offset']."' AND page_expire>'".$sys['now_offset']."'
AND page_begin<'".$sys['now_offset']."' AND page_expire>'".$sys['now_offset']."'
[b][color=#000000]Click [/color][url=http://www.design-studio.netau.net][color=#EF2929][u]Here[/u][/color][/url] [color=#F57900]For All You Design [/color][color=#756745]Related Needs.[/color][/b]
pieter
#7 07.07.2009 04:39
Nice, i didn't know it was used.
In Seditio it wasn't used.
... can we help you ...
SunChase
#8 07.07.2009 07:34
I'm using non-standart news plugin.
gamer24.7 could you please do what you did in youre last post.

Here is the news.php file : news.index.tags_425.rar

----------------------
found it
[url=http://ka13.orgfree.com]KA13[/url] - The essence of creativity
Отредактировано: SunChase (08.07.2009 01:35, 16 лет назад)
KillerSneak
#9 13.07.2009 18:47
uhh the info is there but the core system doesn't use expire dates does it? If so I'm screwed and the Cotonti dev team should have described / noted it? (if Cotonti indeed makes use of it by default)
Lombi
#10 13.07.2009 19:04
No, this is only related to news.
<a href="http://www.domenlo.com">Surreal Art</a>
SunChase
#11 13.07.2009 23:20
I have deleted the page_expire field from the news.php.The original reason was that i have corrupted something while i was editing the page.add and edit php trying to change the experation date.
After this the news plug stoped to show all the new pages.
I think i have made some mistake.
How to check the system's time?

Cause i think i will be have to return the expiration date to the news plugin..
[url=http://ka13.orgfree.com]KA13[/url] - The essence of creativity
gamer24.7
#12 14.07.2009 00:39
I'm Not really Sure But:
<?PHP
/* ====================
Seditio - Website engine
Copyright Neocrome
http://www.neocrome.net

[BEGIN_SED]
File=plugins/news/news.php
Version=122
Updated=2008-feb-18
Type=Plugin
Author=Neocrome
Description=
[END_SED]

[BEGIN_SED_EXTPLUGIN]
Code=news
Part=homepage
File=news
Hooks=index.tags
Tags=index.tpl:{INDEX_NEWS}
Minlevel=0
Order=10
[END_SED_EXTPLUGIN]

==================== */

if (!defined('SED_CODE')) { die('Wrong URL.'); }

if ($cfg['plugin']['news']['maxpages']>0 && !empty($cfg['plugin']['news']['category']) && !empty($sed_cat[$cfg['plugin']['news']['category']]['order']))
{
	$jj = 0;
	$mtch = $sed_cat[$cfg['plugin']['news']['category']]['path'].".";
	$mtchlen = mb_strlen($mtch);
	$catsub = array();
	$catsub[] = $cfg['plugin']['news']['category'];

	foreach($sed_cat as $i => $x)
	{
		if (mb_substr($x['path'], 0, $mtchlen)==$mtch && sed_auth('page', $i, 'R'))
		{ $catsub[] = $i; }
	}

	$sql = sed_sql_query("SELECT p.*, u.user_name, user_avatar FROM $db_pages AS p
	LEFT JOIN $db_users AS u ON u.user_id=p.page_ownerid
	WHERE page_state=0 AND page_cat NOT LIKE 'system'
	AND page_cat IN ('".implode("','", $catsub)."') ORDER BY page_".$sed_cat[$cfg['plugin']['news']['category']]['order']." ".$sed_cat[$cfg['plugin']['news']['category']]['way']." LIMIT ".$cfg['plugin']['news']['maxpages']);

	// Extra field - getting 
	$extrafields = array(); $number_of_extrafields = 0; 
	$fieldsres = sed_sql_query("SELECT * FROM $db_extra_fields WHERE field_location='pages'"); 
	while($row = sed_sql_fetchassoc($fieldsres)) { $extrafields[] = $row; $number_of_extrafields++; } 
	
	$news = new XTemplate(sed_skinfile('news'));

	while ($pag = sed_sql_fetcharray($sql))
	{
		$jj++;
		$catpath = sed_build_catpath($pag['page_cat'], "<a href=\"%1\$s\">%2\$s</a>");
		$pag['page_pageurl'] = (empty($pag['page_alias'])) ? sed_url('page', 'id='.$pag['page_id']) : sed_url('page', 'al='.$pag['page_alias']);
		$pag['page_fulltitle'] = $catpath." ".$cfg['separator']." <a href=\"".$pag['page_pageurl']."\">".sed_cc($pag['page_title'])."</a>";

		$item_code = 'p'.$pag['page_id'];
		list($pag['page_comments'], $pag['page_comments_display']) = sed_build_comments($item_code, $pag['page_pageurl'], FALSE);

		$news-> assign(array(
			"PAGE_ROW_URL" => $pag['page_pageurl'],
			"PAGE_ROW_ID" => $pag['page_id'],
			"PAGE_ROW_TITLE" => $pag['page_fulltitle'],
			"PAGE_ROW_SHORTTITLE" => sed_cc($pag['page_title']),
			"PAGE_ROW_CAT" => $pag['page_cat'],
			"PAGE_ROW_CATTITLE" => sed_cc($sed_cat[$pag['page_cat']]['title']),
			"PAGE_ROW_CATPATH" => $catpath,
			"PAGE_ROW_CATDESC" => sed_cc($sed_cat[$pag['page_cat']]['desc']),
			"PAGE_ROW_CATICON" => $sed_cat[$pag['page_cat']]['icon'],
			"PAGE_ROW_KEY" => sed_cc($pag['page_key']),
			"PAGE_ROW_DESC" => sed_cc($pag['page_desc']),
			"PAGE_ROW_AUTHOR" => sed_cc($pag['page_author']),
			"PAGE_ROW_OWNER" => sed_build_user($pag['page_ownerid'], sed_cc($pag['user_name'])),
			"PAGE_ROW_AVATAR" => sed_build_userimage($pag['user_avatar'], 'avatar'),
			"PAGE_ROW_DATE" => @date($cfg['formatyearmonthday'], $pag['page_date'] + $usr['timezone'] * 3600),
			"PAGE_ROW_FILEURL" => $pag['page_url'],
			"PAGE_ROW_SIZE" => $pag['page_size'],
			"PAGE_ROW_COUNT" => $pag['page_count'],
			"PAGE_ROW_FILECOUNT" => $pag['page_filecount'],
			"PAGE_ROW_COMMENTS" => $pag['page_comments'],
			"PAGE_ROW_RATINGS" => "<img src=\"skins/".$usr['skin']."/img/system/vote".round($pag['rating_average'],0).".gif\" alt=\"\" />",
			"PAGE_ROW_ODDEVEN" => sed_build_oddeven($jj)
		));

		switch($pag['page_type'])
		{
			case '1':
				$news->assign("PAGE_ROW_TEXT", $pag['page_text']);
				break;

			case '2':

				if ($cfg['allowphp_pages'])
				{
					ob_start();
					eval($pag['page_text']);
					$news->assign("PAGE_ROW_TEXT", ob_get_clean());
				}
				else
				{
					$news->assign("PAGE_ROW_TEXT", "The PHP mode is disabled for pages.<br />Please see the administration panel, then \"Configuration\", then \"Parsers\".");
				}
				break;

			default:
				if($cfg['parser_cache'])
				{
					if(empty($pag['page_html']))
					{
						$pag['page_html'] = sed_parse(sed_cc($pag['page_text']), $cfg['parsebbcodepages'], $cfg['parsesmiliespages'], 1);
						sed_sql_query("UPDATE $db_pages SET page_html = '".sed_sql_prep($pag['page_html'])."' WHERE page_id = " . $pag['page_id']);
					}
					$readmore = mb_strpos($pag['page_html'], "<!--more-->");
					if($readmore > 0)
					{
						$pag['page_html'] = mb_substr($pag['page_html'], 0, $readmore)."<br />";
						$pag['page_html'] .= "<a href=\"".$pag['page_pageurl']."\">".$L['ReadMore']."</a>";
					}

					sed_news_strip_newpage($pag['page_html']);

					$cfg['parsebbcodepages'] ? $news->assign('PAGE_ROW_TEXT', sed_post_parse($pag['page_html'], 'pages'))
					: $news->assign('PAGE_ROW_TEXT', sed_cc($pag['page_text']));
				}
				else
				{
					$readmore = mb_strpos($pag['page_text'], "[more]");
					$pag['page_text'] = sed_parse(sed_cc($pag['page_text']), $cfg['parsebbcodepages'], $cfg['parsesmiliespages'], 1);
					if ($readmore>0)
					{
						$pag['page_text'] = mb_substr($pag['page_text'], 0, $readmore)."<br />";
						$pag['page_text'] .= "<a href=\"".$pag['page_pageurl']."\">".$L['ReadMore']."</a>";
					}

					sed_news_strip_newpage($pag['page_text']);

					$pag['page_text'] = sed_post_parse($pag['page_text'], 'pages');
					$news->assign('PAGE_ROW_TEXT', $pag['page_text']);
				}
				break;
		}
		
		// Extra fields 
		if($number_of_extrafields > 0) foreach($extrafields as $row) $news->assign('PAGE_ROW_'.strtoupper($row['field_name']), $pag['page_'.$row['field_name']]);
		
		$news->parse("NEWS.PAGE_ROW");
	}
	$news->parse("NEWS");
	$t->assign("INDEX_NEWS", $news->text("NEWS"));

}

/**
 * Cuts the news page after the first page (if multipage)
 * 
 * @param string $html Page body
 */
function sed_news_strip_newpage(&$html)
{
	$newpage = mb_strpos($html, '[newpage]');

	if ($newpage !== false)
	{
		$html = mb_substr($html, 0, $newpage);
	}

	$html = preg_replace('#\[title\](.*?)\[/title\][\s\r\n]*(<br />)?#i', '', $html);
}

?>
[/][/][/]
[b][color=#000000]Click [/color][url=http://www.design-studio.netau.net][color=#EF2929][u]Here[/u][/color][/url] [color=#F57900]For All You Design [/color][color=#756745]Related Needs.[/color][/b]
KillerSneak
#13 20.07.2009 21:24
# Lombi : No, this is only related to news.
Aren't we talking about news here? pages? So wtf? Half my site will expire now (end of this month)?? Why was a feature activated while this was never documented? As Sedetio/LDu never had this activated.. I'm getting lost in this topic (as usuall) as no one can seem to give a straight forward YES or NO answer. Is it so hard for the DEV's here to give an answer that the community can accept/understand? YES or NO !! simple as that.
Kilandor
#14 21.07.2009 08:31
Pages default to a year ahead of time. Lombi gave an answer, that page expire only effects news.

Not ever little thing can be documented. Page expire has been activated since 0.0.1. If you feel you have to know every little thing done, then start reading the Revision messages. http://trac.cotonti.com/timeline?changeset=on&update=Update
And there was an answer in post #6 On how to fix it.
Отредактировано: Kilandor (21.07.2009 08:37, 16 лет назад)