v4.0.x YouTube / Pedigree Modules

Discussion in 'Modules / Plugins / Modifications' started by HorseOptions, Mar 5, 2009.

  1. HorseOptions New Member

    Can the You Tube Module be for certain ad packages only (featured and not free etc)?

    Can the Pedigree Module be fore certain categories only (horses and not trailers etc)?

    Please advise. Thanks.

    Rob Shurtleff
    HorseOptions.com

    PS. What do you think of the website so far?
  2. Mike-N-Tosh Developer & Moderator

    You would need to contact lhotch for definitive answers to your questions, however as I have done a review of the You Tube module I understand how it works.

    For the You Tube module to work, it is based off of an extra field. Since extra fields are tied to specific categories, the You Tube module availability is therefore also tied to the specific category(ies) that the extra field assigned to the module is. As far as being specific to a listing package, that is not a built in feature, however I believe that lhotch has some additional code available to make this possible.

    The pedigree module is also based on extra fields, so again this is tied to the same category(ies) that the extra fields are tied to.

    Hope that helps,
    -Mike
  3. Lhotch curmudgeon

    Rob,Ive already answered this question a couple other times when it has been tacked onto other threads but apparently you have missed it.

    Mike pretty much nailed it. My modules make use of extra fields and extra fields are tied to a category, not a package. That is how 68C works and has nothing to do with my modules.

    That being said however if you have the developer edition you can modify a couple functions that selectivly hide specific extra fields based on the package an ad belongs to which results in the modules only applying to certain packages.
  4. HorseOptions New Member

    RE

    LHotch,

    Yes I know. I was hoping for additional inforamtion (which I may have missed also).

    So what you're saying is I would (in the case of You Tube) is #1 add the extra field such as URL Link, #2 modify the code to hide the extra field from certain ad packages, and #3 simply install the new module. Is this right? Have you said this before in this same way? If so I apologize for missing it.

    Could you provide simple instructions on how to modify the code to hide extra fields from certain ad packages? I think this may work. If there is anything specific that pertains to the You Tube module & Pedigree Modules, please let me know so I know how to modify those extra fields. Thank you for all your help.

    Rob Shurtleff
  5. Lhotch curmudgeon

    If you wanted additional info the best thing to do is be VERY specific in what kind of info you are looking for, asking the same question the same way multiple times generally results in the same answer.

    Just to reiterate, many of my modules use client entered data to perform a task. In the specific case of the you tube module, the module needs to know what video to display inline with the ad. You, as site admin create an extra field in the 68C admin and part of that extra field creation step is specifying what category the extra field applies to.

    Then a user comes along and places an ad. They chose the category for their ad and then they are presented with the ad packages which you have created and after that the ad fields, which include all the extra fields you have defined that are valid for the category in question. One of those would be an extra field to hold the you tube video ID (please note this is not a URL to the video, its the ID of the video).

    After the ad is placed the module dynamically builds the your tube embed code using the video ID the client entered for their ad, along with the admin specified variables for video size etc and places that embed inline with the ad when it is viewed and the video is displayed.

    The core functionality of 68C ties extra fields to categories. There is no mechanism built into 68C to associate extra fields with ad packages. My module is only concerned with the extra field where it gets the video ID so any time that field is displayed in an ad and it contains a valid ID a video will be displayed.

    Controlling what extra fields are displayed based on the ad package that was chosen to place an ad has absolutely nothing to do with the module and even if I included code in the module to check for certain packages and only display the video for admin specified packages the extra fields the module uses would still be displayed.

    68C builds a list of extra field names and values and places the HTML to display them in a variable and the variable is passed to the template where the html is displayed which includes ALL defined extra fields for that ad.

    The best way to get around this is to alter the php function that queries the database and collects the names and values of the extra fields. You will need to manually identify the field ID's and the package ID's where you want to control the display of the extra fields which can be done by looking at the debug details. These ID's are added with additional control login into the functions that build the html and if an ad package is one where you want to hide the extra field holding the video ID, then that field is skipped when the variable is being loaded with the html of the extra fields so it is not presented to the viewer and thus no video is displayed.

    Yep, in a nutshell thats how it works. If the user cant see an extra field and in turn cant fill it in the video wont display.

    "Simple" is open to interpretation. Its likely also 68C version dependant. It involves tweaking the existing functions in a couple places and as I mentioned above its very specific to each site based on that sites packages and extra fields.
  6. HorseOptions New Member

    RE

    Thank you for your time and help. Forgive me for repeating the same question. My better half is actually the webmast - I just post the questions here and do the marketing. The dilema she faces is that she is reading and understanding what you are saying but is unsure how to begin writing the code. Again my apologies.

    Rob

Share This Page