NewslettersUtility Class Reference

List of all members.

Static Public Member Functions

  • static CheckNewsId ($newsid)
    load newsletter call by id
  • static UpNewsId ($newsid, $custid, $key, $value='now()')
    increment date view / clic
  • static load_modele ($ID)
    call modele dispo for newsletter
  • static UseModele ($modele_id=0)
    check if use model db or gabarit .tpl
  • static ApplModele ($txt, $modele_id=0)
    applic model or return content

Static Public Attributes

  • static $replace = array('[ID]', '[GENDER]', '[LASTNAME]', '[POSTNAME]', '[EMAIL]', '[DATE_CREATED]', '[LAST_LOGON]', '[FIDELITY_POINTS]' )
  • static $ModeleInfo

Detailed Description

Definition at line 12 of file NewslettersUtility.php.


Member Function Documentation

NewslettersUtility::ApplModele ( txt,
modele_id = 0 
) [static]

applic model or return content

Parameters:
$txt string content newletters
$modele_id int l'id du modele or 0
Returns:
string content

Definition at line 85 of file NewslettersUtility.php.

00085                                                        {
00086     $res=self::load_modele($modele_id);
00087     return (is_object($res) && isset($res->nmodele_content) )
00088               ? str_replace('[CONTENT_NEWS]',$txt, (string)$res->nmodele_content)
00089               : $txt ;
00090   }

static NewslettersUtility::CheckNewsId ( newsid  )  [static]

load newsletter call by id

Parameters:
$newsid integer
Returns:
object

Definition at line 28 of file NewslettersUtility.php.

00028                                              {
00029     $DB=Database::getInstance();
00030     $query=$DB->query($sql="SELECT * FROM ".TABLE_NEWSLETTERS."  WHERE newsletters_id='".(int)$newsid."' LIMIT 1;");
00031     $result = $query->fetchAssoc();
00032 
00033 //     $query=$DB->query($sql="SELECT * FROM ".TABLE_NEWSLETTERS_EXTRA."  WHERE newsletters_id='".(int)$newsid."' ;");
00034 //     while($r=$query->fetchAssoc($query)){
00035 //       $result[$r['newsletters_extra_key']]=$r['newsletters_extra_value'];
00036 // //       $result['extra'][]=$result[$r['newsletters_extra_key']];
00037 //     }
00038 
00039     return $result;
00040   }

static NewslettersUtility::load_modele ( ID  )  [static]

call modele dispo for newsletter

Definition at line 56 of file NewslettersUtility.php.

Referenced by ApplModele(), and UseModele().

00056                                          {
00057     $DB=Database::getInstance();
00058 
00059     $query_raw ="select nmodele_id, status,title,  nmodele_content , nmodele_id  as modele_id from " . TABLE_NEWSLETTERS_MODELES . " WHERE status='1' and nmodele_id='".(int)$ID."' ORDER BY  last_update, date_added DESC ";
00060     $query = $DB->query($query_raw);
00061 
00062     return self::$ModeleInfo=new objectInfo($query->fetchAssoc());
00063   }

static NewslettersUtility::UpNewsId ( newsid,
custid,
key,
value = 'now()' 
) [static]

increment date view / clic

Parameters:
$newsid integer
$custid integer
$ket string date_opened / date_click

Definition at line 48 of file NewslettersUtility.php.

00048                                                                         {
00049     $DB=Database::getInstance();
00050     return $DB->query("UPDATE ".TABLE_NEWSLETTERS_SENT." SET ".(string)$key."=".$value." WHERE newsletters_id='".$newsid."' AND customers_id='".$custid."' LIMIT 1;");
00051   }

static NewslettersUtility::UseModele ( modele_id = 0  )  [static]

check if use model db or gabarit .tpl

Parameters:
$modele_id integer
Returns:
boolean

Definition at line 70 of file NewslettersUtility.php.

00070                                                 {
00071 // error_reporting(E_ALL);
00072     if($modele_id===0) return true;
00073     self::load_modele($modele_id);
00074     if( isset(self::$ModeleInfo->nmodele_id) && self::$ModeleInfo->nmodele_id > 0) return false;
00075     return true;
00076   }


Member Data Documentation

NewslettersUtility::$ModeleInfo [static]

Definition at line 21 of file NewslettersUtility.php.

NewslettersUtility::$replace = array('[ID]', '[GENDER]', '[LASTNAME]', '[POSTNAME]', '[EMAIL]', '[DATE_CREATED]', '[LAST_LOGON]', '[FIDELITY_POINTS]' ) [static]

Definition at line 16 of file NewslettersUtility.php.


The documentation for this class was generated from the following file: