Skip to header Skip to main navigation Skip to main content Skip to footer

User account menu

  • Log in
Home
Blog

Main navigation

  • Forum
  • Home

MosModule: Show MosCom latest 5?

Breadcrumb

  • Home
  • MosModule FAQ
  • MosModule: Show MosCom latest 5?
By ongetc | 9:44 PM MDT, Sat October 10, 2009

It is very easy with MosModule, you just create an article to contain the snippet then another article to execute it.

Here are the steps:

First you create an article that contain this snippet code:


# Code snippet listing for MosCom latest 5, let say this is article ID=232
global $database;
$qry="SELECT name, entry, `date` FROM `mos_content_comments`";
$qry.="WHERE published='1' ORDER BY `id` DESC LIMIT 5 ";
$database->setQuery($qry);
$rows = $database->loadObjectList();
foreach ($rows as $row) {
echo nl2br($row->entry);
echo '';
echo '';
echo 'Posted by: '.$row->name;
echo ' on '.$row->date.'';
echo '';
}

Then in another article just enter this: {mosmodule snippet=232}

The above line will execute the snippet and show MosCom latest 5 comments

You can apply the principle of this sample code but replace with your own logic to make it do anything you want in Mambo. The beauty of this way of doing thing is you have access to all Mambo API, variables, etc. You don't have to develop a module and worry about xml, etc.

With this method you can quickly hack up something that tailor or extend the function that you want without needing to spend the time to develop a plugin, addons, etc.

Enjoy with MosModule snippet!

Here is the running sample: http://support.ongetc.com/index.php?option=com_content&task=view&id=227…

Book traversal links for MosModule FAQ

  • ‹ MosModule: How to use snippet?
  • Up
  • MosModule: Show content in a module ›
  • Printer-friendly version

Reseller hosting (free)

Hosting24 (w/ ssh)

A2 Hosting

Popular content

MosDashBoard4SB
COAddOns
MosModule: How to show contact form in content?
MosModule: How to use snippet?
MosModule: Can MosModule be used in custom HTML module?
MosModule
MosCom
MoseCMS
MosPrayerLatestX
MosNewsWriter
Pagination
  • Current page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
  • …
  • Next page next ›
  • Last page »
more
Subscribe to Syndicate

Copyright © 2026 OngETC - All rights reserved

Developed and Designed by CO