EzDevInfo.com

ProcessWire

ProcessWire 2.6. PHP 5 based CMS and CMF (content management system and framework). See the dev branch for the latest development version (new versions weekly). Open source CMS with a great API–ProcessWire CMF/CMS

Setting directives in Vagrant (and ProcessWire)

I'm having a problem where it seems like my Vagrant VirtualBox isn't reading the .htaccess file for a site I have mapped out. (a proccesswire site) I've don't know enough about Vagrant to find where I should be editing the directives so that my .htaccess file will be read. As far as I've gathered from searching I need to set a directive like so:

<Directory /var/www>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

It seems the primary offender is the AllowOverride is typically set to "None" and needs to be "All". But I have put this in a httpd.conf file in apache and I'm guessing that isn't correct.

A bit more information: When I installed PW in the site root I got this error: " Unable to determine if Apache mod_rewrite (required by ProcessWire) is installed. ". As a result when I try to access a part of the CMS, that is usually handled by rewrite rules, the url (/admin or /processwire by default) just reroutes me to the homepage.

Also, I can delete everything in .htacess or add garbage to it and no errors occur. This tells me that .htacess isn't even being read.

I appreciate the help.


Source: (StackOverflow)

ProcessWire install.php not removed after installation

Processwire installer does not delete install.php and site/assets/install/. Note that ProcessWire forms warn that the installer will only delete the install files if it can.

System

  • ubuntu 12.04
  • vhost pointing to a symlink on the user file structure to source of index
  • ProcessWire 5.2
  • apache 2.2.22
  • php 5.4

I Tried

  • chmod 777 on the files
  • chown www-data the files

I expect the installer to delete the file and folder if it says it can, since I am running a generator for the project boot, some setup can be done but not allot. The install of processwire is done manually after the generator, therefore checking deletion and handling it is not highly plausible. I am looking for any suggestions to solve the issue or a full fledged solution.


Source: (StackOverflow)

Advertisements

How to run a processwire site on my mac?

I have an existing site, using processwire framework, sitting on a godaddy server and working fine. I want to run a version of it on my mac. I've downloaded the whole site folder to my mac and tried to open the home.php page through the browser with the php listener, but I'm getting an HTML page with a bit of code and than the following error:

<b>Fatal error</b>:  Call to a member function get() on a non-object in <b>/Users/yotamhacohen/Downloads/ProcessWire-master/site/templates/home.php</b> on line <b>13</b><br />

I'm kind of new into web developing (especially DB) so if you give any instructions regarding that, please be specific. Thanks.


Source: (StackOverflow)

ProcessWire foreach loop to show 4 colums in each row

I've been working on the website for quite a while now and stumbled upon a problem in creating specific foreach loop. I am using ProcessWire to create CMS for the website. I want to display 4 columns in each row, but I am baffled. Here is my code so far;

<div class="container">
<? $count == 0; ?>      
        <? foreach($page->events_tickets as $cols): ?>
        <!-- portfolio item -->
        <? if ($count % 4 == 0)
            echo "<div class='row'>";
        ?>
            <? for($count = 0; $count < 4; $count++) { ?>
            <div class="span3  project-item graphics box">
                <div class="thumbnail" >
                    <!-- IMAGE CONTAINER-->
                    <a rel="prettyPhoto[gallery]" rel='nofollow' href="<?=$cols->event_url;?>" title="portfolio image">
                        <img src="<?=$cols->event_img->url;?>" alt="<?=$cols->event_img->description;?>" /> 
                    </a>
                    <!--END IMAGE CONTAINER-->
                    <!-- CAPTION --> 
                    <div class="caption">
                        <h4 class=""><?=$cols->event_title;?></h4>
                            <p class="caption-descr" id="opening-reception" style="height: 190px; overflow:auto;">
                            <?=$cols->event_desc;?> <a rel='nofollow' href="<?=$cols->event_url;?>" target="_blank" style="" title=""> BUY TICKETS</a> 
                            </p>    
                    </div><!--END CAPTION --> 
                </div><!-- END: THUMBNAIL -->
            </div><!-- END: portfolio item -->
            <? if($count % 1 = 1 ) break;} ?>
            </div>  <!--END OF ROW-->
        <? endforeach; ?>

Source: (StackOverflow)

Processwire pagination

I'm developing a news section and it's my first time working with ProcessWire. I have the following code:

                <?php
                $articles           = $page->children("limit=2");

                if(!empty($articles)):        
                    foreach($articles as $article):
            ?>

                <div class="news-article">

                    <div class="row">
                        <div class="small-12 medium-12 large-9 columns">
                            <a rel='nofollow' href="<?php echo $article->url;?>"><h3 style="padding-bottom: 15px;"><?php echo $article->title;?></h3></a>
                            <?php echo substr($article->body, 0, 375); ?>...
                            <p><a rel='nofollow' href="<?php echo $article->url;?>">Read full story &gt;</a></p>
                        </div>
                        <div class="small-12 medium-12 large-3 columns">
                            <img src="<?php echo $article->images->url . $article->images; ?>" style="margin: 20px 0 20px 0;" />
                        </div>
                        <div style="clear: both;"></div>
                    </div>

                </div>

                <style>
                .news-article {
                    padding:                20px 0 0 0;
                    margin:                 20px 0 20px 0;
                }
                </style>

            <?php 
                    endforeach;
                else:
                    echo "<h3>No articles found</h3>";
                endif;

                $pagination = $articles->renderPager();
                echo $pagination;
            ?>

My problem is the pagination correctly displays 2 page links, but clicking the second page displays page 2 with the first 2 articles.

I'm assuming I have to modify my article display code to factor in what page I'm on, but I'm unsure how to do so.

Does anyone have any ideas?

Thanks, Graham


Source: (StackOverflow)

PayPal: _notify-validate always returns INVALID

I'm having trouble getting a script to return the correct value from PayPal. I'm trying to verify a payment but I cannot seem to get a VERIFIED response from PayPal (either live or in the sandbox). Here is the contents of my script:

$verify_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_notify-validate&' . http_build_query( $_POST );
$response = file_get_contents( $verify_url );

I don't know how to check that the $_POST data being added to the query is valid so I have no idea what is going wrong. I have tried the code from the PayPal GitHub repository and receive the same result (and it seems to be accessing the same address). I have also tried

$vars = array();
$vars[] = 'cmd=_notify-validate';
foreach ($_POST as $key=>$field) {
    if(!empty($field))
        $vars[] = "$key=".urlencode(stripslashes($field));
}
$verify_url2 = 'https://www.sandbox.paypal.com/cgi-bin/webscr?'.implode('&',$vars);
$response2 = file_get_contents( $verify_url2 );

and

$raw_post_data = file_get_contents('php://input');
$verify_url3 = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_notify-validate&' . $raw_post_data;
$response3 = file_get_contents( $verify_url3 );

And seem to receive the same response from the same resulting URL. Is there somewhere I can test the IPN messages to ensure that I am at the very least getting the right variables in the first place? I've just about reached the limit of what I can do to test this script and haven't made a shred of progress in over 2 days now.

Also, are there any specific settings in PayPal that I may need to set in order for this script to work as intended? I've never had to set anything before for other sites but I did read a few posts that netioned setting the Character Encoding for IPN messages (I have since set this to UTF-8).

Thanks.


Source: (StackOverflow)