Jump to content

vxda

Members
  • Posts

    169
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by vxda

  1. Hi
    on my site users can post new articles, and withing them upload images i made this:

     

    $pic= new WireUpload('fileUploadInput');
    			$pic->setMaxFiles(1);
    			$pic->setOverwrite(false);
    			$pic->setDestinationPath($upload_path);
    			$pic->setValidExtensions(array('jpg', 'jpeg', 'png', 'gif'));
    
    			$files = $pic->execute();
    			if(!count($files)) {
    				$pic->error("Sorry, but you need to add a photo!");
    				return false;
    			}
    

    The above works with <input type="file"/>

    Is there a way to upload files thru url ?
     

    exaple :
    <input type="text" value="http://processwire.com/site/assets/files/1/fields.jpg">

  2. prev and next look for a the prev and next pages inside any pageArray, if you use it with the same array that you used to build your posts list, it will respect that order.

    Yes i noticed that, its all good i want ot use that but only when inside category. On home page i want to be able to click next nad prev and stay within "home page array",

    Something like?:

    //populate a PageArray

    $articleList = $pages->find("template=article, limit=25")

    //next

    $page->next($articleList)

    //prev

    $page->prev($articleList)

    This assumes your articles have their own template. You can put more options, like sort, in the page selector. The http://cheatsheet.processwire.com/ is always a nice thing to check for options available.

    I think thats what i was looking for :) i will test it once im back from work.

    Thank alot, as allways i can count on your help here. :) thx very much !!

  3. Hi, im making a website with alot of articles, my structure looks like this

    NEWS

         CATEGORY

                   article item

         CATEGORY
                   article item

         CATEGORY

                   article item

         CATEGORY

                   article item

         CATEGORY

    On home page im listing all articles from all categories - 25 articles per page.

    Im opening them in Fancybox
    Insite article i have next and previous buttons, on click im loading content of article via ajax, replacing content in fancybox. and i change history via history api for seo reasons.

    My question is:

    Is there a way to make next and prev buttons change thru articles but listed on my home page (included next pages) instead of picking next or prev from category the article is nested in ?

    Would be grateful for some tips on that.

    Cheers

    • Like 1
  4. Awesome, thank you guys.

    Are there other reasons they need to register with your site?

    Yes, users will be able to create their own topics ( pages ).

    I think i will go with PW comments, but will try disqus aswell. will see what will fit my needs better. :)

    Ty again

  5. The PW system is a proper commenting system.

    The advantage of something like Disqus is that they dont have to register with the site or with Disqus as they can use their twitter, facebook (and a couple of other) logins.

    About PW comments, i would love to use it, but i need to have nested comments, is this is possible to do?

    About Disqus, i will have register/login with facebook button on my site. I dont want users to register multiple times.

  6. Thx for replay, Im considering disqus aswell, but i dont want users have to register with the site and then with disqus to post comments.
    Is PW comments system allow users to reply to their comments ? like facebook comments system can ?

    About facebook comments ... i cant use it since i want anonymous comments to be avaible.


    If you want self hosted and PHP there's this one https://github.com/jacobwb/hashover

    The introduction post he links to is quite old, but it seems that they are preparing something new here https://github.com/jacobwb/hashover-next

    That looks nice, thx

  7. Hi, im starting kind of a social website, and im looking for a good way to enable comments on my site.
    i need comments to be editable, deletable for admin, and also for user within 10 minutes after posting it.

    Users can replay to other comments, and comments are also avaible to guests (posting anonymous).

    I was searching for a good tool to do this and i found this http://posativ.org/isso/.
    Thing is that im begginer with php, and i get confused after reading 1st line of instalation guide.

    Did any one did this before and can help me aout a bit ? or is there any other good solution for comments that u recommend.

    Cheers.

  8. Hi guys, is there a way to translate hardcoded html text for example:

     

    <div class="tabs">
    <a href="#">Tab name in some language</a>
    <a href="#">Tab name in some language2</a>
    <a href="#">Tab name in some language3</a>
    </div>
    

    i know that we can do something like

    <?php
    
    if ($lang == 'en') {
    echo "<a href="#">Tab name in English languge</a>"
    }
    if ($lang == "other ") {
    echo "<a href="#">Tab name in other languge</a>"
    }
    

    I was thinking about module of some kind working like "Process Language Translator" or

    in code u use variable tags like : {lang-TabNameInSomeLanguage}

    <div class="tabs">
    <a href="#">{lang-TabNameOne}</a>
    <a href="#">{lang-TabNameTwo}</a>
    <a href="#">{lang-TabNameThree}</a>
    </div>
    

    in Admin some sort of table like this with translation for each language we create.

    Varialbe                              ENG                       DEU                                POL

    TabNameThree         this is tab one            dies ist einer Tab           To jest jedna zakladka

    Or there is totaly other easy way that im not aware of ?

    Cheers

    Paul.

  9. Hi guys, im searching for an easy to use solution of a newsletter for a PW.

    Preferably create pages as email addresses thru API for users.

    I dunno what would be easyer for me, (im not php magician) use some api ? or is there any other easy solutuion?

    If api then which one. and how to integrade it with PW so it will use my user base.

    Ty

    Paweł

  10. If u can install forget password module on your destination server then its easy.


    if u cant u have to install module on your local, then export it to your destination server when u do that, just try to login in on your destination server and use module to reset password. That allways works for me, and this is how im doing it.

    Meaby someone have better solution.

  11. Got same problem, thing is i downloaded newes dev version of pw, and now forget password plugin dont work. Usualy i just reseted password and it worked.

    If u have stable version of PW then all u need to do is reset your password when logging in.

    EDITED,

    Ok it works its my bad, previously  you had to enter email address now system asking you for username.

    So ye best way to do this is to reset your password with this plugin, if u dont have it installed then i propose to install it on your local then copy database again to your destination server along with the module files. then when loging in u will have forget password button, enter email address or username (depends on your PW version). and wait for email. Change your password and thats it.

    I had same problem once now i allways isntall forget password module (its in core)

  12. I just update PW to dev version and it stopped working ;(

    and im still with the problem. I used this method to not show children of thoes parents:

    'selector' => '!parent=1034|1015',
    

    but there is page id 1090 within 1015 which i need exceptionally show. is there some method to overrule selector ?
     

  13. i dont want to show a children of this template, and honestly it works.

    here is a full code i use for my nav.
    u can also view the page here: midven.avenueagency.eu
     

    Page is still in building process

    <?php
    
    	$rootPage = $pages->get("/");
        $treeMenu = $modules->get("MarkupSimpleNavigation"); // load the module
        $options = array(
    		'parent_class' => 'parent',
    		'current_class' => 'current',
    		'has_children_class' => 'has_children',
    		'levels' => true,
    		'levels_prefix' => 'level-',
    		'max_levels' => 2,
    		'firstlast' => false,
    		'collapsed' => false,
    		'show_root' => true,
    		'selector' => '!children.dont_show=1',
    		'outer_tpl' => '||',
    		'inner_tpl' => '<ul>||</ul>',
    		'list_tpl' => '<li%s>||</li>',
    		'list_field_class' => '',
    		'item_tpl' => '<a href="{url}"><span>{title}</span></a>',
    		'item_current_tpl' => '<a href="{url}"><span>{title}</span></a>',
    		'item_root_tpl' => '<a href="{url}"><span>{title}</span></a>',
    		'xtemplates' => '',
    		'xitem_tpl' => '<span>{title}</span>',
    		'xitem_current_tpl' => '<span>{title}</span>'
    		);
        function hookGetListClass(HookEvent $event){
    	    $child = $event->arguments('page'); // current rendered child page
    	    $class = $event->arguments('class'); // the class string already present
    
    	    // any API check on that child
            $event->return .= " id_".$child->id; // add your custom class to the existing
    	}
    	$treeMenu->addHookAfter('getListClass', null, 'hookGetListClass');
    ?>
    
    <nav id="main-nav">
    	<div class="header"><a href="#side-nav" class="dropDown">Menu</a></div>
    	<div class="wrap" data-target="#side-nav">
    		<ul>
    			<?php echo $treeMenu->render($options, $page, $rootPage); ?>
    		</ul>
    	</div>
    </nav>
    
    
  14. any reason my

    foreach($pages->find("dont_show=1") as $p) {
        $p->nav_selector = "parent!=$p->id";
    }
    

    shows only one result

    parent!=1034 
    

    where there should be id 1015 also??

    c)


    Alternatively this could also work using the options "selector".


    "selector" => "parent.dont_show=0";

    ye this is not working ;/

    i can just choose template as a selector but this checkbox is so nice :P



×
×
  • Create New...