You are not logged in. Please login or register.

Post new reply

ochiba forum → Support → Sticky → Post new reply

Post new reply

Compose and post your new reply

You may use: BBCode

All fields with bold label must be completed before the form is submitted.

Required information for guests

Required information

(delete this if you are not)

Topic review (newest first)


Just a warning: this is a bit uglier than I'd like:

Out of the box, ochiba will escape (htmlspecialchars) the description of a category, but if you "disable" that, you can use any HTML you desire. Since most likely it will be just you editing this, it should be safe from attack as long as you know what you're doing (ie basic HTML).

To disable the escaping, you would make the following change to includes/images.php:

--- includes/images.php    3 Feb 2006 02:37:38 -0000    1.48
+++ includes/images.php    14 Jul 2009 01:39:23 -0000
@@ -361,7 +361,7 @@
 if($category == "Stats") {
     $vars["category"] = "Top " . LIMIT . " Most Viewed Images";
-$vars["description"] = $category == "Stats" ? "" : htmlspecialchars(stripslashes($categories[0]["description"]));
+$vars["description"] = $category == "Stats" ? "" : stripslashes($categories[0]["description"]);
 if (!is_numeric($category) && count($images)>=1) {
     $vars["pager_top"] = $pager;
     $vars["pager_bottom"] = $pager;

In other words, on line 364, remove the htmlspecialchars() call.

The other place the description appears is as a tooltip (title attribute) in the menu of categories. Since you are using these descriptions for more than just "my cat pics", you should probably just disable those. In includes/functions.php:

--- includes/functions.php    30 Aug 2005 08:06:08 -0000    1.42
+++ includes/functions.php    14 Jul 2009 01:41:41 -0000
@@ -99,10 +99,9 @@
     $result = $db->query($sql);
     $menu = "";
     while($row = $result->fetchRow()) {
-        $menu .= sprintf('<a href="%s/%s" title="%s">%s</a>%s',
+        $menu .= sprintf('<a href="%s/%s">%s</a>%s',
-                            $row["description"],

In other words, remove the references that display the description.

After those two changes, you should be able to edit the description using HTML. Hope this helps.


hmmmm... is there any specific markup language that I can use in the description? like to break lines, change font size, weight, colour?


I'm afraid there isn't a "sticky" feature currently in ochiba, but it's on my to-do list for ochiba v2.

One way you can perhaps hack this in is to use the "description" field for your category - of course, this doesn't give you the same look/feel/flexibility of a regular post, but if it's just an announcement you'd like to put at the top, this might work for you.


How do I generate sticky posts? Like for example a post which is always shown at the top of my category?

ochiba forum → Support → Sticky → Post new reply

Generated in 0.024 seconds (73% PHP - 27% DB) with 9 queries