User Tools

Site Tools


dr:classified

This is an old revision of the document!


Classified

This is a rebuild of the original http://drupal.org/project/ed_classified module for Drupal 6 (and later), dropping any 4.x/5.x remnants.

Download or clone from http://bit.ly/cIBtcN

OK Paths

  • admin/content/node/ed-classified: ed_classified_admin_overview() = an admin page listing ads: redundant with admin/content
  • admin/content/ed-classified: ed_classified_admin_overview() = an admin page listing ads (duplicate): idem
  • ed-classified: ed_classified_page() = a page listing ads
  • user/%user/ed-classified: ed_classified_by_user() now at user/%user/classified = per-user ads list
  • admin/settings/ed-classified: dgf/ed_classified_admin_settings() = settings form
    • ad duration
      • default
      • per-ad_term override
    • grace period from expiration to purge
    • expiration notification
      • activation
      • pre-expiration period
      • message subject/body, with tokens
    • max body length
    • ad site contact link on posts: useless
    • In lists, show ad teaser OR body
    • rename field attachments: useless
    • New: activate modr8 on updates
  • admin/ed-classified/purge: _ed_classified_user_purge() = scheduled expiration: separated purge / expiration / notification
    • classified/scheduled/purge: purge expired node beyond the grace period
    • classified/scheduled/expire: unpublish nodes past their expiration date
    • classified/scheduled/notify/[half-life|pre-expire|pre-purge]: notify pre-expiration/purge
  • cron.php:
    • expire ads
    • purge expired ads
    • send pre-expiration mails
    • send expiration mails

New: Drush commands

  • OK classified-purge / cl-p: trigger a purge
  • OK classified-expire / cl-e: trigger expiration
  • classified-notify [half-life|pre-expire|pre-purge] / cl-n (same): trigger notifications

OK Blocks

  • popular: ed_classified_get_popular_ads_list()
  • latest: ed_classified_get_latest_ads_list()
  • statistics: ed_classified_get_ad_stats()

OK Alterations

  • HFA classified node form: rename uploads as images.: doesn't seem worth keeping, imagefield/emfield is better
  • HF classified node form:
    • add JS ad size checker/blocker: non-jQuery ⇒ Reimplemented on jQuery
    • add hidden field to keep expire date: can be overriden in the browser, inserted in the submit handler instead
    • Add checkbox if user permissions allow it to reset expiration. Ignores administer ads: should be honored. Redone differently, with 3 update modes.
    • submit handler does validation job on expiration reset: moved to validation handler instead
  • classified node links:
    • HL add link to ad author page: redundant with author info on node
    • HL add link to contact : titled as a way to suggest new categories, duplicates the normal contact link
    • HLA replace taxonomy/term/<tid> links with ed_classified/<tid> when <tid> belongs in the module vocabulary, in order to have a specific page take over instead of the default taxonomy term page for these. Done with hook_term_path() instead, for more generality.
  • HV build breadcrumbs trail

New: jQuery

  • jQuery for textarea content
  • jQuery to hide date selection unles forced expiration update is selected

OK Security

Permissions

  • 'create classified ads'
  • 'edit own classified ads'
  • 'reset classified ad expiration'
  • 'administer classified ads'
  • Missing, to match node.module
    • “edit any classified ad”
    • “delete any classified ad”
    • “delete own classified ad”

Note that “administer” right should include “reset expiration” and all the other rights.

Access

  • hook_access as a simple check on perms vs uid
  • administer classified ads does not grant read/update/delete rights on ads: contrary to standard Drupal practice

OK Views 2 integration

  • default Views: 2 created, then replaced by custom code. Still in the repository, but nothing specific to learn from them.
  • 1 “time remaining” data definition, for field, argument, filter and sort, defining 2 distinct fields (date or duration)
  • add 1 field handler definition for purge date

Future features

  • add “remaining” format to both fields
  • create a better display plugin, or style the existing one better

New features

  • OK Active modr8 integration: resend updated nodes to moderation
  • -1 on grace means never delete
  • 0 on grace means delete upon expire

Themeing

  • OK 'ed_classified_body' ⇒ array('arguments' ⇒ array('node')),: unneeded, use theme(node)
  • OK 'ed_classified_teaser' ⇒ array('arguments' ⇒ array('node')),: unneeded, use theme(node)
  • OK 'ed_classified_ending_date' ⇒ array('arguments' ⇒ array('ad_expiration_date')), ⇒ classified_expires($node)
  • 'ed_classified_ads_block' ⇒ array('arguments' ⇒ array('ads', 'display_timestamp' ⇒ TRUE, 'display_counter' ⇒ FALSE, 'display_ad_category' ⇒ FALSE)),: theme_item_list used instead
  • 'ed_classified_taxonomy' ⇒ array('arguments' ⇒ array('cats' ⇒ NULL, 'ads' ⇒ NULL)),
  • 'ed_classified_adcount' ⇒ array('arguments' ⇒ array('count' ⇒ NULL)),
  • 'ed_classified_taxonomy_catlist' ⇒ array('arguments' ⇒ array('cats' ⇒ NULL)),
  • 'ed_classified_category_list_row' ⇒ array('arguments' ⇒ array('cat' ⇒ NULL, 'row_count' ⇒ NULL)),
  • 'ed_classified_taxonomy_ads' ⇒ array('arguments' ⇒ array('ads' ⇒ NULL)),
  • 'ed_classified_category_list_ad_row' ⇒ array('arguments' ⇒ array('ad' ⇒ NULL, 'rowcount' ⇒ NULL)),
  • 'ed_classified_category_name' ⇒ array('arguments' ⇒ array('cat' ⇒ NULL)),
  • 'ed_classified_category_description' ⇒ array('arguments' ⇒ array('cat' ⇒ NULL)),
  • 'ed_classified_ads_stats' ⇒ array(): theme_table used instead

All currently as themeable functions, redo as templates

New

  • A “ad list” CCK build mode, used by lists generated by the module
  • Lifetimes in settings form formatted as a table
dr/classified.1284755059.txt.gz · Last modified: 2020/11/23 17:23 (external edit)