Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit aa7abe6
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/* ==================== | ||
[BEGIN_COT_EXT] | ||
Hooks=global | ||
[END_COT_EXT] | ||
==================== */ | ||
|
||
defined('COT_CODE') or die('Wrong URL'); | ||
|
||
require_once cot_incfile('page', 'module'); | ||
|
||
/** | ||
* Returns parsed page_text for a given page | ||
* @param int $id Page ID | ||
* @return string | ||
*/ | ||
function pagetextbyid($id) | ||
{ | ||
global $db, $db_pages, $cfg; | ||
$res = $db->query("SELECT page_text, page_parser FROM $db_pages WHERE page_id = ?", array((int) $id)); | ||
if ($res->rowCount() > 0) | ||
{ | ||
$row = $res->fetch(); | ||
return cot_parse($row['page_text'], $cfg['page']['markup'], $row['page_parser']); | ||
} | ||
else | ||
{ | ||
return ''; | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/* ==================== | ||
[BEGIN_COT_EXT] | ||
Code=pagetextbyid | ||
Name=Page Text by ID | ||
Description=Use this plugin to fetch page text by id using global tags like {PHP|pagetextbyid(123)} where 123 is an ID of a page | ||
Version=2.0 | ||
Date=2012-01-14 | ||
Author=Trustmaster | ||
Copyright=Copyright (c) Vladimir Sibirov 2012 | ||
Auth_guests=R | ||
Lock_guests=W12345A | ||
Auth_members=R | ||
Lock_members= | ||
Requires_modules=page | ||
[END_COT_EXT] | ||
==================== */ | ||
|
||
defined('COT_CODE') or die('Wrong URL'); | ||
?> |