Search

Hi, I'm trying to create a classified ads system where users who come to the site can 'place an ad', they then get sent an email with an authorization/access code. They go to a 'login' page and enter their email address and their access code and then they can edit or delete that one ad.

They wont have an account with all the ads they have created, they can only edit one ad at a time and each ad has its own access code.

Is it possibly to do this with Rev5?

I've set up a section with everything I need in it but I'm not sure if I can filter that data with an event. Any help is much appreciated.

Cheers - E

I see two obstacles to overcome:

  1. User management - you'll have to either create symphony users for all these entries or create some kind of authorization setup for your own user/ad Section. I think that is do-able with the extensions available (session & cookie monster etc.).

  2. The trickier aspect is the email, since rev5 does not have an extendable email function. You'll have to edit /symphony/lib/toolkit/events/event.section.php to add email behavior that you'll require.

good luck!

Hi again, how exactly do the cookie/session monster extensions work, I'm thinking they add parameters to allow the datasource to filter by (hoping) but I dont really understand it. Can anyone explain?

I've created an event to add the form values I want to the XML, how do I filter my datasource with these values? Anybody?

<?php

  require_once(TOOLKIT . '/class.event.php');

  Class eventauthorize_login extends Event
  {

    const ROOTELEMENT = 'authorize-login';

    public $eParamFILTERS = array();

    public static function about()
    {
      return array
      (
        'name' => 'Authorize Login',
          'author' => array
          (
            'name' => 'Developer Name',
            'website' => 'http://www.example.com/',
            'email' => 'example [a t] example [d o t] com'
          ),
          'version' => '1.0',
          'release-date' => '2008-09-02T15:11:13+00:00',
          'trigger-condition' => 'action[authorize-login]'
      );    
    }

    public function load(){
      if(is_array($_GET) && !empty($_GET)) return $this->__trigger();
      return NULL;
    }

    public static function documentation()
    {   
      return '';
    }

    protected function __trigger()
    {
      session_start();

      $xml = new XMLElement('authorize-login');
      $xml->appendChild(new XMLElement('email', $_POST['fields']['email']));
      $xml->appendChild(new XMLElement('access-code', $_POST['fields']['access-code']));

      return $xml;
    }

}

?>

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details