User Login    
 + Register
Bookmark and Share
  • Main navigation
Login
Username:

Password:

Remember me



Lost Password?

Register now!

Find A Code Snippet | Snippets

Find A Code Snippet | Submit A New Snippet | Create A Snippet Package

Title - Click to viewCreator
 
Snippets
Creating Thumbnails Predator
Here's one I use throughout my WFSections hack. It handles the creation and storage of thumbnails created from a larger source file. Catz, I believe I already gave this to you but I'll post it here for others. I use this in both my blocks and module pages. Since all I need to do is include one large version of the image on the "create article" page, this function then creates all the varying sizes throughout my site. It first checks to see if the thumbnail has already been created, if so, it returns the path to the saved file (To improve performance, this way the function is only called once for each creation.) Anyways, enjoy. Draven  
Hits: 4819 Rating: 10.00 (2 votes)
Rate this Snippet | Tell a Friend | Comments (2)
Select in your Smarty Template Predator
I had a little function, I called every time, I wanted a Team selection box in my Team Module. When I went Smarty, I couldn't take the function over, but had to make one for Smarty. While making that, I thought "why make it too specific?" so I made it very simple and generic. It is saved in a file called select.html and called in a smarty template through this line: <{include file='db:select.html' title=$lang_selecttitle caption=$lang_selectcaption submit=$lang_submit name=$lang_teamid options=$teams selected=$selected}> Where: $lang_selectttitle is the form title $lang_selectcaption is the caption next to the select box $lang_submit is the text to display on the submit button $lang_teamid is the name of the variable contained in the select box (should probably be renamed to $variable_name or something) $teams is an array of options (1 => option1, 2 => option2 etc.) $selected is the value of the selected option All these should of course be set in a $xoopsTpl->assign('name', $value); line in your php document - personally, I have it in my Team class, so I just have a $team->select(); line in my php document and the above mentioned line in the smarty template. So basically, what this function does is take some language constants, a GET variable name, an array of options, a selected value and then makes a form with a single select drop-down menu, which returns to the SAME page. Hope you can use this /Mithy  
Hits: 5788 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (0)
Reorder Category or articles Catzwolf
A class to easily change the oder of a category or article.  
Hits: 5214 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (0)
Highlight PHP Code in Contents Predator
This function highlight PHP Code as you can see below...  
Hits: 5052 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (5)
Category Drop Down lykoszine
A quick not on the drop down script for categories. Probably so simple that everyone apart from me already knows this, but... You need to call [php]ob_end_clean();[/php] if you are adding this to a variable, not just outputting it where called.  
Hits: 2735 Rating: 8.00 (1 vote)
Rate this Snippet | Tell a Friend | Comments (0)
Page Navigation Catzwolf
How to add page Navigation to you Module  
Hits: 58825 Rating: 7.50 (2 votes)
Rate this Snippet | Tell a Friend | Comments (288)
Module Admin Menu Catzwolf
This class/function will allow you to easily render a module menu like the one in the system admin and also the modules I have been currently writing at the moment. I would like this to be used within all modules and you are quite welcome to improve on the code.  
Hits: 34991 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (151)
Dynamic Templates in xoops_version.php fatman
I stole this from wfsection and made only a slight modification. This little snippet when used in xoops_version.php will add any templates in the defined folders to the xoops db on update. This is handy if your module has lots of template files.  
Hits: 3291 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (1)
Admin Menu for the Core Modules Predator
This Function is for the Menubar in the Admin Backend of the Core Modules.  
Hits: 49681 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (192)
Group Membership Add/Delete Mithrandir
This snippet explains how to add a user to a usergroup as well as remove a user from a usergroup  
Hits: 5333 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (2)
Create a select box for users Ted
I keep having to write this stuff every project over and over again, just copy & paste and call it. $name will be the name of the option list and the default user will be selected if you set it in $defuser.  
Hits: 2687 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (0)
How to find a module's option herve
Sometimes you can't use the $moduleConfig array because it is not defined or it's not yours. This code retreive a module's option in all the cases, from a normal page or from a block. A static array is used to reduce the queries count. Parameters : Option's name Module's name  
Hits: 6321 Rating: 8.00 (2 votes)
Rate this Snippet | Tell a Friend | Comments (88)
Check database connection Dave_L
A simple script that tests to see whether you can connect to a MySQL database. Intended for diagnosing database connection failures.  
Hits: 3788 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (1)
Assign rank to user intel352
This code is a sample, showing a method to assign a new rank to a user.  
Hits: 2500 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (0)
Parse CSV file intel352
Found this snippet in a snippet repository on some *other* website awhile back, dunno where. It's a set of functions with instructions, useful for parsing a CSV (comma separated) file.  
Hits: 2716 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (0)
A User Info Shortcut using 404 error xoops
This is my first PHP Code. Use 404 error to create a friendly userinfo. Changes in [i].htaccess[/i] [code]ErrorDocument 404 /404.php[/code] Put 404.php in xoops root directory. [b]Using[/b]: http://dev.xoops.org/Valker or http://dev.xoops.org/Valker/ redirects to http://dev.xoops.org/userinfo.php?uid=446 . Enjoy it and send me suggestions. Valcilon Silva AKA Valker  
Hits: 2594 Rating: 10.00 (2 votes)
Rate this Snippet | Tell a Friend | Comments (0)
Extended Object Handler Mithrandir
This class can be extended to ease the object handling. The XoopsObjectHandler is really not more than an interface, whereas this class implements the "interface" and more methods that can be used in child classes directly. With extending this class, you just need a corresponding object class, a database table and a primary key and you will be able to use insert, delete, get, getObjects, create and updateAll methods to manipulate the objects  
Hits: 5013 Rating: 10.00 (2 votes)
Rate this Snippet | Tell a Friend | Comments (8)
How to verify that a field exists inside a mysql table ? herve
This function will enable you to verify that a field exists inside an existing mysql table.  
Hits: 2845 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (1)
How to verify that a sql table exists ? herve
Use this code to verify that a sql table exists.  
Hits: 3548 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (0)
Image Uploader for a XOOPS module hyperpod
This is example code that will allow you to add an image uploader. It uses the XOOPS class /class/uploader.php This can also be used for other types of file uploads, doesnt have to be images. Just change the mime-types, etc, etc. 8-)  
Hits: 30543 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (136)
Add Live Help to Xoops and monitor by username csyntax
This code will allow you to monitor logged in users by username if you have crafty Syntax installed. http://craftysytnax.com.  
Hits: 2557 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (0)
Xoopscode to html converter godzilla
Converts db table data created by xoops default text editor to real html. eg: converts [b] to <b> or [url] to <a href>. This example reads data from xDirectory's description table and outputs to readable html. Hope this of some use to everyone...thx... enjoy  
Hits: 2450 Rating: 0.00 (0 votes)
Rate this Snippet | Tell a Friend | Comments (0)
Top Downloaded Release
· Proyecto eÑe (21624)
· CBB (newbb) (17590)
· SmartFAQ (16248)
· SmartMedia (15900)
· xcGallery (13464)
· XOOPS Workflow Module (11590)
· Xoops Translations (11440)
· WYSIWYG editors for XOOPS (10585)
· SmartClient (7699)
· SuoloItalico Translating Team (7336)