Results 1 to 10 of 20
-
30th Apr 2011, 09:24 PM #1OP(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comWCDDL - Development How-To (Modules, Hooks, etc)
A fork of the other sticky specifically for development information to help you write modules and such.
THIS THREAD IS ONLY VALID FOR WCDDL3
AS OF NOW WCDDL3 IS IN DEVELOPMENT BUT WILL BE RELEASED TOMORROW MOST LIKELY
Click Here for Main Thread
Modules
Modules are PHP files stored in the WCDDL modules folder, prefixed with 'wcddl_'.
The modules directory is defined in the WCDDL configuration, the default being 'modules/'.
Core
In WCDDL2 you would interact with the core by making a global, $core, and calling methods on that.
In WCDDL3 you retrieve the current Core instance and call methods as required:
PHP Code:function myFunction() {
$core = Core::load();
header("X-JmZ: " . $core->config('someEpicVariable'));
}
You can now map requests like so:
PHP Code:$downloads = Core::mapRequest('Downloads', array('page', 'type', 'query'));
If either of 'page', 'type' or 'query' are set by the user (via _GET or _POST), they will be set in the 'Downloads' instance.
Meaning if I set ?page=5, then $downloads->page will be 5.
Available Classes & Methods
Please see the source, there's way too many to list, especially with info on how they work.
Hooks
WCDDL3 uses a hooking system for modules. You generally write a module in such a way that it consists of only functions and/or classes then hook these functions/classes into the WCDDL core.
For example, you can hook a custom function to be executed when downloads are retrieved, allowing you to modify data before it is returned.
Hook List
WAY TOO MANY HOOKS TO LIST AND EXPLAIN, CHECK THE SOURCE TO SEE WHAT THEY DO.
Complete list of hooks in WCDDL3 is as follows:
Code:init DatabaseColumn, (&$query, &$args) DatabaseRowObject, (&$class, &$query, &$args) DatabaseRowObjects, (&$class, &$query, &$args) DatabaseExecute, (&$query, &$args) DatabaseRow, (&$query, &$args) DatabaseRows, (&$query, &$args) CoreGetModules, (&$modulesArray) DownloadsPreGet, (&$downloadsInstance) DownloadsGetQuery, (&$sqlQuery) DownloadsGetWhere, (&$whereClause, &$whereParams) DownloadsGetFullQuery, (&$sqlQuery) DownloadsGetRows, (&$rowsArray) DownloadsPostGet, (&$downloadsInstance) LogQueryPre, (&$query) ShowQueriesPost, (&$downloadQueryArray) CommonFormatUrl, (&$string) CommonIsEmail, (&$email) CommonIsUrl, (&$url) CommonUrlHost, (&$host) CommonDisplayStr, (&$string) PagesPre, (&$map) PagesPost, (&$pageArray) DownloadQueuePre, (&$downloadInstance) DownloadDeQueuePre, (&$downloadInstance) DownloadDeletePre, (&$downloadInstance) DownloadSavePre, (&$query, &$params) DownloadAddView, (&$downloadInstance) DownloadShowTitle, (&$title) SubmitConstruct, (&$submitInstance) SubmitPre, (&$submitInstance) SubmitValidation, (&$submitInstance) SubmitDownload, (&$download) SubmitFilterPre, (&$submitInstance) SubmitFilterValidate, (&$valid) SiteSavePre, (&$siteInstance) SiteSave, (&$query, &$params) SiteGetListPre, (&$siteInstance) SiteGetList, (&$query) SiteWhitelist, (&$url) SiteWhitelistRemove, (&$url) SiteBlacklistRemove, (&$url) SiteBlacklist, (&$url) SiteIsWhitelisted, (&$url) SiteIsBlacklisted, (&$url) AdminInit, (&$adminInstance) AdminHandleContent, (&$go) AdminAuthenticatePre AdminAuthenticateFailure AdminAuthenticateSuccess
Hook your custom function/method using the Core::hook method.
Example:
PHP Code:Core::load()->hook('SomeHook', 'myFunction'); // To hook a function
Core::load()->hook('SomeHook', array('myClass', 'someMethod'); // To hook a method of a class
// See the hooklist to know how many params your method/func needs to take
Example:
PHP Code:function JmZ($mapping) {
// $mapping is an array of page link pattern maps
// e.g. array('type', '<a href="/index.php?type=#type#&page=#page#">#page#</a>')
// meaning if _GET/_POST 'type' is set, this html will be used for page links
// You could SEO it here or have the user alter their wcfg.php
// wcfg.php contains constants such as WCDDL_PAGES_TYPE with the above html
foreach($mapping as $mapKey => $map) {
if($map[0] == 'type')
$mapping[$mapKey][1] = '<a href="/#type#-downloads-#page#.html">#page#</a>';
}
// NOTICE we don't return, $mapping is passed by reference so alters the original when changed
}
Core::load()->hook('PagesPre', 'JmZ');
JmZ Reviewed by JmZ on . WCDDL - Development How-To (Modules, Hooks, etc) A fork of the other sticky specifically for development information to help you write modules and such. http://warezcoders.com/images/logo.jpg THIS THREAD IS ONLY VALID FOR WCDDL3 AS OF NOW WCDDL3 IS IN DEVELOPMENT BUT WILL BE RELEASED TOMORROW MOST LIKELY Click Here for Main Thread Rating: 5Projects:
WCDDL - The Professional DDL Script
Top Secret Project: In Development - ZOMG
ImgTrack - Never Have Dead Images Again!
-
30th Apr 2011, 09:30 PM #2It begins...
Stuckified
-
30th Apr 2011, 11:44 PM #3MemberWebsite's:
mygamegalaxy.com
-
30th Apr 2011, 11:58 PM #4BannedWebsite's:
cloudcache.cc1 more day to go
-
3rd May 2011, 12:11 AM #5Respected DeveloperWebsite's:
wrzc.orglol my bad. I was replying in the other stickie thread looking for info not knowing this thread existed. This has a list of all the hooks and is far more what I was after. I can't believe I didn't see this thread before confusing all the kids in the other thread with php talk.
Tutorial How to SEO your Warez Site a guide to help you increase your organic traffic
Huge list of Warez Sites and free Multiposter Templates
-
6th May 2011, 01:11 PM #6Respected DeveloperWebsite's:
wrzc.orgHook Request:
AdmnLogin - can be used to call check for messages, brute force login prevention or failed login attempts for security, recording last login etc.
Called just after the password is checked.Tutorial How to SEO your Warez Site a guide to help you increase your organic traffic
Huge list of Warez Sites and free Multiposter Templates
-
6th May 2011, 02:47 PM #7OP(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comAdded 3 hooks for that.
AdminAuthenticatePre
Called within authenticate() before anything else.
AdminAuthenticateFailure
Called when authentication fails, nothing is passed.
AdminAuthenticateSuccess
Called when authentication succeeds, nothing is passed.Projects:
WCDDL - The Professional DDL Script
Top Secret Project: In Development - ZOMG
ImgTrack - Never Have Dead Images Again!
-
7th May 2011, 04:54 PM #8
-
7th May 2011, 05:09 PM #9Respected DeveloperWebsite's:
wrzc.orgTutorial How to SEO your Warez Site a guide to help you increase your organic traffic
Huge list of Warez Sites and free Multiposter Templates
-
7th May 2011, 05:13 PM #10OP(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comHe means i forgot to delete it from the query.
Fixed that now.Projects:
WCDDL - The Professional DDL Script
Top Secret Project: In Development - ZOMG
ImgTrack - Never Have Dead Images Again!
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
WCDDL Modules, Plugins and Extensions
By Mr Happy in forum Webmaster ResourcesReplies: 151Last Post: 15th Nov 2012, 04:54 PM -
[For Hire] Python Development | xChat Plugin Development
By Gaurav in forum Completed TransactionsReplies: 5Last Post: 5th Oct 2011, 08:12 AM -
WCDDL Modules
By Peach in forum Forum and DDL DiscussionReplies: 3Last Post: 21st Jun 2011, 01:19 PM -
2x Custom modules, black/whitelist WcDDL
By Chris2k in forum Webmaster ResourcesReplies: 0Last Post: 21st May 2011, 01:01 AM -
IPB 3.x - Moving hooks
By Golden Falcon in forum IP.BoardReplies: 1Last Post: 20th Mar 2010, 04:24 PM
themaLeecher - leech and manage...
Version 4.94 released. Open older version (or...