Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

teez

Użytkownik
  • Postów

    2 077
  • Dołączył

  • Ostatnia wizyta

  • Wygrane w rankingu

    10

Odpowiedzi opublikowane przez teez

  1. Hej. Chcę zrobić dodatkową opcję w mailingu dla mojej aplikacji. Coś próbuję, kombinuję - szkielet jako taki mam. Chodzi mi teraz o ostatnią funkcję, a dokładniej getMembers, która nie do końca się spisuje - nic się nie dzieje ( nie ważne, czy wybieram opcję, która powinna skutkować brakiem odbiorców, czy nie ).

    <?php
    class bulkMailFilters_region
    {
    	public $filters = array( 'region' );
    }
    
    class bulkMailFilter_region_region extends bulkMailFilter
    {
    	/** 
    	 * Get Setting Field
    	 *
    	 * @param	mixed	Value as returned by the save method
    	 * @return	string	HTML to show in ACP when adding a reminder that will allow admins to set up a reminder
    	 */
    	public function getSettingField( $criteria )
    	{
    		$regions_id = array('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16');
    		foreach($regions_id as $regions_id)
    		{
    			$regions[] = array( $regions_id, $regions_id );
    		}	
    		
    
            $selectBox = ipsRegistry::getClass('output')->formMultiDropdown( 'bmf_members_region[]', $regions, isset( $criteria['region'] ) ? explode( ',', $criteria['region'] ) : $_POST['bmf_members_region'] );
    		return "{$selectBox}";
    	}
    	/**
    	 * Save Setting Field
    	 *
    	 * @param	array		POST data from the form using the form elements provided in the getSettingField method
    	 * @return	mixed		If this criteria should be ignored, return FALSE. Otherwise, return whatever data you will need in your
    	 *						getMembers method to fetch members that match the chosen criteria
    	 * @throws	Exception	You can throw an Exception with the message being the error to display if the user has provided invalid data
    	 */
    	public function save( $post )
    	{
    		if ( !$post['bmf_members_regions'] )
    		{
    			return false;
    		}
    		else
    		{
    			return array( 'region' => implode( ',', $post['bmf_members_regions'] ));
    		}
    
    	}
    	
    	/**
    	 * Get Members
    	 *
    	 * @param	mixed	Whatever data was returned by save method
    	 * @return	array	Array with two elements:
    	 *						'joins' should be an array of any additional tables to join (as per ipsRegistry::DB()->build)
    	 *						'where' should be an array of where clauses
    	 *					The table 'members' is already available with the prefix 'm'
    	 */
    	public function getMembers( $data )
    	{
    		print_r($data);
    		if ( $data['region'] )
    		{
    			foreach($data as $regions)
    			{
    				$add_join = array(
    									array( 
    																'select' => 'l.member_id',
    																'from'	 => array( 'l' => 'my_regions' ),
    																'where'	 => 'l.member_id = '.$regions,
    																'type'	 => 'left'
    															)
    														);
    			}
    			$where = array( "m.member_id=l.member_id" );
    			
    			return array( 'add_join' => array( $return ), $where = array( $where ) );
    		}
    	}
    }
    

    Mailing powinien iść do osób w następujący sposób:

     

    Multiselect od 1 do 16 ID -> Wybieram np. 2,3,4,5,6 -> Wyszukuje member_id z tabeli my_regions gdzie ktoś ma jedno z tych ID -> wysyła mailing do tych osób

     

    Jakieś pomysły? Myślałem też użyć DB->buildWherePermission, ale wydaje mi się, że w tej sekcji oddziałowuje ona wyłącznie na tabelę members, więc nic mi to nie da.

  2. I jeszcze ten cytat:

     


    Moim zdaniem wgrywanie standardow nic nie da. Najlepiej jakby ktos zrobil dla nas unikalny styl mysle ze  50 zl to nie pieniadz a zawsze sie jakos odroznimy.

    A jesteś w stanie wydać takie pieniądze na styl? Jeśli jesteś, to bez żadnego problemu mogę dogadać się z ludźmi zajmującymi się tym i załatwić taki unikalny styl tylko dla Nas, z konkretnymi dodatkami w stylu. wink.png Bo to kwota, za którą można dostać na prawdę fajny styl.

     

    :crazy:

     

    ps. dzięki za zostawienie stopki autora w gamehubie. :mad:

×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.