Jump to content

vxda

Members
  • Posts

    169
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by vxda

  1. Ty for reply Adrian

    still not working ;/
    thing is i made some pages one of is asd@asd.pl

    and when i run this :

    $email_exists = $pages->find('asd@asd.pl');
    		if(count($email_exists) > 0){
    			echo 'error';
    		}
    

    i get error :
     

    Fatal error: Exception: Unknown Selector operator: '' -- was
    your selector value properly escaped? (in
    D:\xampp\htdocs\projects\midven\wire\core\Selectors.php line 165)

    #0 D:\xampp\htdocs\projects\midven\wire\core\Selectors.php(190):
    Selectors->create('asd', '', '@asd.pl')
    #1 D:\xampp\htdocs\projects\midven\wire\core\Selectors.php(63):
    Selectors->extractString('asd@asd.pl')
    #2 D:\xampp\htdocs\projects\midven\wire\core\Pages.php(143):
    Selectors->__construct('asd@asd.pl')
    #3 [internal function]: Pages->___find('asd@asd.pl')
    #4 D:\xampp\htdocs\projects\midven\wire\core\Wire.php(271):
    call_user_func_array(Array, Array)
    #5 D:\xampp\htdocs\projects\midven\wire\core\Wire.php(229):
    Wire->runHooks('find', Array)
    #6
    D:\xampp\htdocs\projects\midven\site\templates\global\newsletter.html(46):
    Wire->__call('find', Array)
    #7
    D:\xampp\htdocs\projects\midven\site\templates\global\newsletter.html(46):
    Pages->find('asd@asd.pl')
    #8 D:\xampp\htdocs\projects\midven\site\templates\home.php(8):
    include('D:\xampp\htdocs...')
    #9 D:\xampp\htdocs\p in D:\xampp\htdocs\projects\midven\index.php on line 214

  2. Hi guys,

    here is my code, im creating pages via form, but i want to show message when user allready submited his email. how can i achive this ?

     

    $out = '';
    $form = $modules->get("InputfieldForm");
    $form->action = "./";
    $form->method = "post";
    $form->attr("id+name",'subscribe-form');
    $field = $modules->get("InputfieldEmail");
    $field->label = "E-Mail";
    $field->attr('id+name','email');
    $field->required = 1;
    $form->append($field); // append the field
    
    $submit = $modules->get("InputfieldSubmit");
    $submit->attr("value","Subscribe");
    $submit->attr("id+name","submit");
    $form->append($submit);
    
    if($input->post->submit) {
    	$form->processInput($input->post);
    	$email = $form->get("email");
    	if($email && (strpos($email->value,'@hotmail') !== FALSE)){
            $email->error("Sorry we don't accept hotmail addresses for now.");
        }
        if($form->getErrors()) {
            $out .= $form->render();
        }else{
        	$p = new Page(); // create new page object
    		$p->template = 'newsletter'; // set template
    		$p->parent = wire('pages')->get('/newsletter/'); // set the parent 
    		$p->name = $form->get("email")->value; // give it a name used in the url for the page
    		$p->title = $form->get("email")->value; // set page title (not neccessary but recommended)\
    		$pageName = $p->name;
    		$name = $pageName;
    		$p->save();
    		$out .= "<p>You submission was completed! Thanks for your time.";
    
        }
    }
    else {
       		// render out form without processing
       		$out .= $form->render();
    	}
    echo $out;
    ?>
    
  3. Hi i need to sort pages for upcomming games. so i have this code

    <?php
    	$Match = $pages->find('parent=1022, sort=date');
    	$tab = "";
    	$button = "";
    	$i = 0;
    	foreach ($Match as $match ) {
    		$date = date("d F", $match->getUnformatted("date"));
    		$time = date("h:i", $match->getUnformatted("date"));
    		$count = count($match);
    		$selectVal = '';
    		if ($match->transmition == '1') $selectVal = 'tak';
    		else $selectVal = 'nie';
    		if ($i == 0) {
    			$button .= "<a class='active {$i}' href='#tab_{$match->id}'>Następny mecz</a>";
    			$tab .= "<div id='tab_{$match->id}' class='tab active'>";
    		}else{
    			$button .= "<a class='{$i}' href='#tab_{$match->id}'>Poprzedni mecz</a>";
    			$tab .= "<div id='tab_{$match->id}' class='tab'>";
    		}
    		if ($match->logo1) $logo1 = $match->logo1->size(77,77)->url;
    		else $logo1 ='';
    		if ($match->logo2) $logo2 = $match->logo2->size(77,77)->url;
    		else $logo2 ='';
    		if($date && $time)
    		$tab .= "<dl><dt>Kiedy?</dt><dd>{$date} {$time}</dd></dl>";
    		if($match->team_name2)
    		$tab .= "<dl class='teamname'><dt>Z kim gramy?</dt><dd>{$match->team_name2}</dd></dl>";
    		if($match->text_input)
    		$tab .= "<dl><dt>Gdzie?</dt><dd>{$match->text_input}</dd></dl>";
    		if($match->text_input2)
    		$tab .= "<dl><dt>Jaki typ rozgrywki?</dt><dd>{$match->text_input2}</dd></dl>";
    		if($match->text_input3)
    		$tab .= "<dl><dt>Jakie bilety?</dt><dd>{$match->text_input3}</dd></dl>";
    		if ($selectVal)
    		$tab .= "<dl><dt>Czy będzie transmisja?</dt><dd>{$selectVal}</dd></dl>";
    		if ($logo1 && $logo2) {
    			$tab .= "<div class='clear'></div>";
    			$tab .= "<div class='logos clearfix'>";
    			$tab .= "<div class='logo1'><img src='{$logo1}' alt='' /></div>";
    			$tab .= "<div class='vs'>VS</div><div class='logo2'><img src='{$logo2}' alt='' /></div>";
    			$tab .= "</div>";
    		}
    		$tab .= "</div>";
    		$i++;
    		if($i > 1) break;
    	}
    ?>
    <section class="next-match">
    	<div class="container">
    		<div class="span4">
    			<div class="tabs clearfix">
    				<?php echo $button; ?>
    			</div>
    			<div class="tab-wrap">
    				<?php echo $tab; ?>
    			</div>
    		</div>
    	</div>
    </section>
    

    now i need first $tab to be the closest next date from today's date,

    in the second $tab i need to display the last one played from today's date.

    The first one is working fine showing exacly what i need, just cant figure out how to dispaly the last one played.

    Any idea how can i achive this ?

    Regards

    Paweł

  4. @Wanze

    I went with 

    $pagination .= $news->renderPager();
    

    cause it does not matter what the class name is.

    Worst thing is that when u have pagination there is a problem with sort :

    sort=-date
    

    does not work

    i manage to display newes posts on my page but with a little trick.

    In admin pannel i changed sort options to date.

    and then in my template i used 

    sort=-sort
    

    Tho i dunno if there is a bug in module or i have some error ;)

    Cheers

  5. I changed it to

    'currentItemClass' => "active",
    

    and still got no result, also classes for next and prev are not workin.

    it works with default classes withour array like this :
     

    $pagination .= $news->renderPager();
    
    

    Also when i got pagination

    sort=-date
     

    does not seams to work ;/

  6. @ diogo

    Lets say i made the site for my client. My client is a company and in it there will be 5 people administrating the site.

    So after my job is finished my client have no access to thoes oryginal images, and non of thoes 5 admins can use same images on site (well meaby if they send it to eachother by email).

    Having all files in one module make things easier cause they are accessible for all users of the site.

    I would honestly donate some money for this to be developed.

    Cheers

    • Like 2
  7. Pawel,

    I think you're misunderstanding something. Have you read what adrian posted?

    You can get the images from your gallery page anywhere in any template. No need to upload them multiple times:

    $images = $pages->get('/galleries/gal1/')->images;
    //Pick second image
    $img = $images->eq(1);
    // Pick fourth image
    $img = $images->eq(3);
    

    Wanze but can you do it from admin panel ?

    Its exacly what onjegolders says. :)

    I don't think it is the same thing. It's great what Soma has done but

    I think we're talking more about an image field which brings up an

    interface to select an image from the repository.

  8. lets say i have page gallery 1 and in it i have img1,img2,img3,img4.

    on my other page i want to use same some images, lets say img2 and img4 to do that i need to find the files on my disk instead of just picking them up from server where they already are uploaded.

    same goes with files, lets say i got 20 files i need on my website but on diffrent pages, now each time i need same file for a diffrent page i have to upload it again.

    Best way of saying what i mean is this plugin for EE:
    http://devot-ee.com/add-ons/assets

  9. Hi everyone,

    somehow current class wont work for me here is my code :

    <?php
    				$news = $pages->find("parent=1009, limit=2");
    				$out ="";
    				$options = array(
    					'upscaling' => false,
    					 'cropping' => "0,0"
    				);
    					foreach($news as $newsitem){
    						$newsimg = $newsitem->images->first;
    						$out .= "<li><a href='{$newsitem->url}'><div>";
    						if ($newsimg) {
    							$newsimg = $newsimg->size(313,177,$options)->url;
    							$out .= "<img src='{$newsimg}' alt='' />";
    						}else{
    							$out .="<div class='noImg'></div>";
    						}
    						$out .= "<div class='name'>{$newsitem->title}</div>";
    						$out .= "<div class='date'>".date("j.m.Y", $newsitem->created)."</div>";
    						$out .= "</div></a></li> ";
    					}
    					$pagination .="<nav class='pagination'>";
    					$pagination .= $news->renderPager(array(
    								    'nextItemLabel' => "Next",
    								    'previousItemLabel' => "Prev",
    								    'currrentItemClass' => "active",
    								    'listMarkup' => "<ul>{out}</ul>",
    								    'itemMarkup' => "<li>{out}</li>",
    								    'linkMarkup' => "<a href='{url}'>{out}</a>"
    									));
    					$pagination .= "</nav>";
    				 ?>
    			<?php echo $pagination; ?>
    			<ul class="news-list">
    				<?php echo $out; ?>
    				 <li class="fill"></li>
    				 <li class="fill"></li>
    			</ul>
    
    

    every thing else works without problem. Any sugestions ?

×
×
  • Create New...