History: UserPagericks99
Preview of version: 10
- «
- »
Hi, I'm a new Tiki user, just getting my site http://www.keycontent.org started. Tell me what you think.
In the meantime, here's my contribution to the Tiki community:
Table of contents
Things You Won't Find in the Tiki Docs
or
Several Things I Wish I Could Have Discovered on my Own Instead of Having to Clog the Forums with Numerous Postings and Looking Like an Idiot
While I am far from a Tiki expert, here are some things I've discovered...
Last "X" Comments from Anything
I wanted to modify the mod-wiki_last_commentsmodule to display comments from my site's articles as well as wiki. Here's how I did it:
1. Modify mod-wiki_last_comments.php as follows:
- Change the $query to include the article objectType:

$query = "select `object`,`title`,`commentDate`,`userName`,`objectType`,`threadId` from `tiki_comments` where `objectType`='wiki page' or `objectType`='article' order by `commentDate` desc";
- Set two new variables (we'll use them later, in the TPL):

$aux["type"] = $res["objectType"]; $aux["thread"] = $res["threadId"];
2. Modify mod-wiki_last_comments.tpl as follows:

{if $comments[ix].type eq 'wiki page'} <a class="linkmodule" href="tiki-index.php?page={$comments[ix].page|escape}" title="{$comments[ix].commentDate|tiki_short_datetime}, {tr}by{/tr} {$comments[ix].user}{if $moretooltips eq 'y'} on page {$comments[ix].page}{/if}"> {$comments[ix].title} {else} {* if not a wiki, must be an article *} <a class="linkmodule" href="tiki-read_article.php?articleId={$comments[ix].page}#threadId{$comments[ix].thread}" title="{$comments[ix].commentDate|tiki_short_datetime}, {tr}by{/tr} {$comments[ix].user}"> {$comments[ix].title} {/if}
To also include comments from blogs, faqs, and forums, simply add additional OR statements in the query, and additional IF statements in the TPL.
Reading a Single DB Value
I needed a way to grab a single value from database a database and display it on a TPL page in Tiki. In this example, I displayed the value of the lastModif field for blog with ID 1 on my custom-home.tpl page.
Here's what I did:
1. Edit the TPL's associated PHP file to:
- Include the necessary library:
Copy to clipboardinclude_once ('lib/blogs/bloglib.php'); - Assign the necessary value.
Copy to clipboard$blog_data = $tikilib->get_blog(1); $smarty->assign('lastModif', $blog_data["lastModif"]);
2. #Simply call the lastModif in from the TPL file as: {$lastModif}
To get the date to display properly, i added {$lastModif|tiki_short_date}.
Directory Notifications
- Want to get an automatic email everytime someone submits a new directory item? Simply add this code in your tiki-directory_add_site.php file:

// send notification $mailto = 'youremail@foo.bar' ; $subject = "Directory submission notification" ; $messageproper = "The following directory item has been submitted and is awaiting your approval:\n\n" . "\n\n" . "Name: ". $_REQUEST['name'] . "\n\n" . "Description: " . $_REQUEST['description'] . "\n\n" . "URL: " . $_REQUEST['url'] . "\n\n" ; @mail($mailto, $subject, $messageproper, "From: your site name Automated Mailer\r\nContent-type: text/plain;charset=utf-8\r\n");
Search Function
- The search function will return results regardless of group or security settings. This means that the first few lines of every page are avaialbe to any user who searches. See this forum posting for details). Hopefully this will be included in 1.9.
- Searching the Entire Site doesn't. Or rather, HTML pages are not shown in the search results. You must manually re-do the search routine. (See this forum posting for more information).
- Searching the Entire Site will find text in modules and features you have disabled. (See this forum posting for more information.) Hopefully to be fixed in 1.9?
QuickTags
- Want to logically group the QuickTag links together by function (for example, keep all the text formatting buttons together)? Tiki orders the links by inverse Z-A, based on the description. See this forum posting for more information.
Stats
- Despite its inclusion in the
tiki-stats.tpl
page, the usage chart is not functional. See this forum posting for more information.
Tiki Emails
- Instead of having the emails that your Tiki sends out using a subject such as "Tiki information", you can change it to fit your specific site. See this forum posting for more information. Hopefully will be fixed in 1.9.
Templates
- When you select the Edit Templates Admin function, you can only edit the TPL files in the base templates directory — not the templates of the style you're currently using. See this forum posting for more information. 😑
Articles
- If an anonymous (or un-logged in) user submits an article, after aproval,the article "disappears." The only solution is to ensure that users are logged in before submitting an article. See this form posting for more information. My solution? I added this code to tiki-edit_submission.tpl:

{if $user} . . . {else} Please <a href="tiki-page.php?pageName=KC+Login" title="Login now (members)." class="wiki">login</a> before submitting a Key Article.
Here's my site if you want to see it in action.