Activity Stream
48,167 MEMBERS
6963 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 20
  1.     
    #1
    (╯?□?)╯︵ ┻━┻
    Website's:
    Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.com

    Default WCDDL - 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'));

    Request Mapping

    You can now map requests like so:

    PHP Code: 
    $downloads Core::mapRequest('Downloads', array('page''type''query')); 
    The above example will return a 'Downloads' instance.
    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
    How to Hook

    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 
    Complete Hooking Example

    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: 5
    Projects:
    WCDDL - The Professional DDL Script
    Top Secret Project: In Development - ZOMG
    ImgTrack - Never Have Dead Images Again!

  2.   Sponsored Links

  3.     
    #2
    It begins...
    Stuckified

  4.     
    #3
    Member
    Website's:
    mygamegalaxy.com
    Great Work Mate I Cant Wait For WCDDLV3

    1SearchEngine you can choose where you want to search.

  5.     
    #4
    Banned
    Website's:
    cloudcache.cc
    1 more day to go

  6.     
    #5
    Respected Developer
    Website's:
    wrzc.org
    lol 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

  7.     
    #6
    Respected Developer
    Website's:
    wrzc.org
    Hook 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

  8.     
    #7
    (╯?□?)╯︵ ┻━┻
    Website's:
    Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.com
    Added 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!

  9.     
    #8
    Member
    rating missing in downloads table


  10.     
    #9
    Respected Developer
    Website's:
    wrzc.org
    Quote Originally Posted by jomasaco View Post
    rating missing in downloads table
    Rating isn't added by default. It's a module. I've created a module and just need another while to modify it to use the new code structure.
    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

  11.     
    #10
    (╯?□?)╯︵ ┻━┻
    Website's:
    Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.com
    He 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!

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Similar Threads

  1. WCDDL Modules, Plugins and Extensions
    By Mr Happy in forum Webmaster Resources
    Replies: 151
    Last Post: 15th Nov 2012, 04:54 PM
  2. [For Hire] Python Development | xChat Plugin Development
    By Gaurav in forum Completed Transactions
    Replies: 5
    Last Post: 5th Oct 2011, 08:12 AM
  3. WCDDL Modules
    By Peach in forum Forum and DDL Discussion
    Replies: 3
    Last Post: 21st Jun 2011, 01:19 PM
  4. 2x Custom modules, black/whitelist WcDDL
    By Chris2k in forum Webmaster Resources
    Replies: 0
    Last Post: 21st May 2011, 01:01 AM
  5. IPB 3.x - Moving hooks
    By Golden Falcon in forum IP.Board
    Replies: 1
    Last Post: 20th Mar 2010, 04:24 PM

Tags for this Thread

BE SOCIAL