Jump to content

n0sleeves

Members
  • Posts

    82
  • Joined

  • Last visited

Posts posted by n0sleeves

  1. I like the one at tectite.com but curious as to what everyone else is using. Finding any on google seems to bring up some pretty old  and unsafe techniques.  I don't like paid services like Jot Form, etc.  Ryan's form script is awesome and is what I usually use. However, sometimes I don't get to use PW on projects :( 

  2. You’re trying to specify the parent by name, but I’m pretty sure ProcessWire would much rather have a page ID or a path (meaning, wrapped with forward slashes).

    Because PW can tell “genre” is not numeric (so not an ID), it treats it like a path, as if the slashes were there, but there are no tags under “/genre/”. They’re under “/tags/genre/”. So try that and it should work. Alternatively, specify that you’re selecting by name:

    $genres = $track->tags->find("parent.name=genre");
    

    I can see how this can seem confusing, because when if you were looking for a direct child of the homepage, it would work. In that case, the path is the same as the name with slashes.

    Because you’re not really selecting “dynamic” pages here, but rather pages that are a fixed part of your site’s structure, you might want to use IDs instead. That way, if you later want to change a page name/path, you can do it comfortably in the admin, and don’t have to go around fixing your selectors.

    Providing the full parent path did not work. However, providing either  "parent=ID" or "parent.name=genre" did the trick! :)   BTW, great tip / idea on using ID's in case I ever need to change path or names. 

    Thank you so much for the solution! 

  3. I am having trouble outputting my tagging system correctly. Each music track has a Multi-Page-List-Select field-type which tags associated categories.

    Tags is a parent page with nested categories beneath. Genre, Mood, Drum Tags each contain additional categories which are ultimately the tags I am associating on the music tracks. 

    Screenshot-01162015-115618AM.jpg

     In the code below. $genres is where I am having trouble.  I think my selector is correct, but my chaining is wrong? 

     
    // Find Songs
    $tracks = $pages->get("/Music/")->find("template=track, parent.title!=Drums");
    
      foreach ($tracks as $track) {
          $track_html  = "<li>";
          $track_html .= "<a>{$track->title} </a>";
          
          // FIND GENRES EACH TRACK BELONGS TO. 
          $genres = $track->tags->find("parent=genre");
          
          // OUTPUT ONLY GENRES 
          foreach ($genres as $genre) {
            $track_html .= $genre->title . " "; 
          }
          
          $track_html .="</li>";
          echo $track_html;
      }
    
     
    
    

    Thank you 

  4. My recommendation: http://usefinch.com. Using it primarily for checking local virtual hosts on devices and inside Parallel VMs (with own hostname and no subfolders) but should be suitable for n0sleeves' use case as well.

    I've seen usefinch.com before. However, they limit you to only 2 hours of usage per month. Ngrok is free unlimited (pay what you want) and also has subdomain, password protection, etc. ability. Another tunneling service I was quite found of is https://forwardhq.com/. Their minimum pay plan is only $5 a month and what sets them apart is the ability to have a custom page your clients see when the tunnel is offline. 

    The password protected domain part sounds REALLY interesting!

    I have terribly slow (under 2Mb/s internet speed) so I am gonna guess that the tunneling would kill my internet speed. We can't even have two devices on YouTube at the same time, lol.

    Wow. That's some terrible speed :o However, I wouldn't think it would affect you since the only time it sends data is when being accessed. You could have it tunnel all day long without any data being sent. It only sends when the client accesses. 

    • Like 1
  5. What I do is setup a password protected subdomain on my website for the site version I want them to see. If they need to see what I'm working on (the development "Work In Progress" version) , I push my localhost live via a tunnel and send them the link. As long as the tunnel is open they can see my localhost.  I am using Ngrok but there are countless others. Just Google, "localhost tunneling". It definitely  made my workflow easier :)

    • Like 2
  6. How are you using ImageMagick in conjunction with Processwire to watermark / affect a specified images directory automatically?

    For my gallery page, I would like to upload images as normal then have ImageMagick watermark the output of them on the website; all this done automatically and on the fly without me having to do anything except create the script :)  Would love to hear your suggestions how this can be done or how you are using ImageMagick in general. Script examples are welcomed! :P

    Let's go!

  7. A company approached me wanting to convert their paper-based ways of collecting customer information into electronic. Reason being they want to instead use a tablet (in office) and have them fill out everything electronically in order to prevent readability / processing errors and also offer the ability to fill out on their website.

    The type of information such a company needs from their client is pretty intense and detailed. Customers are filling out multiple documents disclosing  personal information, not only about themselves, but also about the defendant - everything from vehicle registration, address / work history to personal identity to the fullest extent) - things like social security numbers, etc.  It seems there isn't a sensitive data question not being asked.  Not only that but they are also disclosing credit card info (for payment). It's pretty monumental in terms of data.

    I never accepted the project and said I'll look into what's possible but out of curiosity and being the curious type I am, I have already built a mobile-responsive / electronic version of their entire 200+ question form(s), complete with task completion status, page summary, auto-complete, validation, terms of service. It's damn beautiful but that was the easy. Even though I like getting my feet wet, I am wondering if I should continue or if it's even worth the headaches, not to mention the technical hurdles.

    The questions I am wondering are numerous (and for understandable reasons). I guess the top would be:

    • I know all this data has to be encrypted and secured to the highest extent. I don't know what's involved or how deep it can get. I do know the risks and the laws governing storage of such sensitive data and also the penalties for the company if it gets stolen. So I'm hesitant to even take on this task for that reason alone; especially since I'm still very much a PHP / programming beginner (although devoted). I don't want to major f*** up ^_^

       
    • I was thinking storage would be on the web host instead of some sort of in-office database? An online back-end would have to be created to retrieve information so that the company then could process it (they wanted it as a pdf). They need some way to retrieve the data.

       
    • They need to be able to charge / have access to the  credit card again at a later date so integration with a payment processor needs to be implemented, correct?

    I am asking more what direction / route / study material I should look into (first steps) more than specific procedures because I understand it's very involved. If I can't tackle this now, I would like to learn so I can accomplish this in the future because building, integrating and deploying things of this nature is where I would like to go.

    Just curious on your thoughts.

    Thanks everyone ^-^

  8. One Linux distro can be very different from another Linux distro in what comes pre configured or pre installed.

    Sometimes when you finish a Linux distro installation you still have to install some packages or do configurations

    for everything to work what you need. Example, I have become very fond of Linux Antix because it is both very

    user friendly and fast on cheap motherboards. After doing a Linux antix installation your wifi does not show up

    because you have to manually add the wlan card to the network configuration.

    So maybe in your case simply installing another Linux distro might solve you from difficult to find configurations

    that did not came during the Manjaro installation.

    The Manjaro distro is based on Arch Linux so I recommend to go through this Lamp page step by step:

    https://wiki.archlinux.org/index.php/LAMP

    Good point. I was using Mint a while back with no problems, but once I switched to Manjaro, I haven't looked back due to it's speed and bare  enviroment. I know it comes at a cost of high frustration for some things but I'll give it just a wee bit longer before I consider switching again :/ I'm one of those types that wants to know "why" something isn't working. Nice to see another Nix user here!

    I am working on Fedora 20.  May be this would help you. 

    <VirtualHost *:80>
       DocumentRoot "/home/user-2/dev/php/ProcessWire/pwire-2"
       ServerName pwire-2.localhost
       # This should be omitted in the production environment
       SetEnv APPLICATION_ENV development
       <Directory "/home/user-2/dev/php/ProcessWire/pwire-2">
           Options Indexes MultiViews FollowSymLinks
           AllowOverride All
           Order allow,deny
           Allow from all
           # New directive needed in Apache 2.4.3: 
           Require all granted
       </Directory>
    </VirtualHost>
    

    Thanks

    ------------------------------------------------------------------------

    Edit: Add a comment for the new directive used for Apache 2.4.3 under <Directory> tag 

    I have the same Virtual Host config. Thank you for providing this however.

    The other approach you may want to look at is installing Virtualmin/Webmin to control everything from setting up virtuals with set packages to creating samba shares and so on.

    Webmin looks like an interesting piece of software. Even though I prefer to keeping things in the command line as much as possible (I'm not even using PhpMyAdmin), I like the idea and premise. Thanks for sharing!

    This suggests to me that everything is set up ok from the apache side of things. Have you tried a fresh install of PW on this server to see if that goes ok? Maybe it will report what the problem is?

    That's what my next step is. I'll do that and let you know my results!

    What is the value of 'AllowOverride' in your apache config file?

     I changed them all to "All". Still same results :/

  9. Have you gone through the list on Nico's troubleshooting page?

    http://processwire.com/docs/tutorials/troubleshooting-guide/

    Yes. No Luck

    Thanks so much man for the links and taking the time to search for those. However, I have already been to each of those and tried everything they have said at least 5x it seems. I really have exhausted Google :/

  10. Sorry you are having such a rough time of it - it can seem like voodoo sometimes :)

    Have you tried a simple index.html file in the root of a virtual host DocumentRoot directory? Does that work? Is it just a PW install that is giving you the 500 error?

    I could be completely off, but is it possible it's the period in your site2.dev folder name?

    PW has this restriction, although it is for dirs "beginning" with a period, so probably not.

      # -----------------------------------------------------------------------------------------------
      # Access Restrictions: Keep web users out of dirs that begin with a period
      # -----------------------------------------------------------------------------------------------
    
      RewriteRule "(^|/)\." - [F]

    Thanks for responding. I removed the period just for the hell of it but that didn't work. A plain PHP or HTML file inside the directory works fine. It's just PW (all of the site) which isn't getting picked up :/ This isn't a new install - it's a git clone from my live server.

    May not be anything, however have you made a change in your config.php file to reflect the local website?

    $config->httpHosts = array('www.yourlocalwebsite.com', 'yourlocalwebsite.com');
    

    That wasn't in my config file so I added it (still no luck). You do mean the config file in my site directory, correct?

  11. I have been pulling my hair out for over a week now and frankly can not study anymore because I am exhausted and on the verge of throwing in the towel. I have switched to a Linux dev enviroment recently (Manjaro which is Arch based) and love everything about it. It's another story why I made the switch from Windows but I can tell you that I have never experienced trouble before because I was using Wamp and everything just seemed to work out the box. With setting up Apache myself on this particular Linux distro, things are a "whole lot different".

    So here goes:

    I got virtual hosts working with Apache 2.4.10 and everything is fine; PHP 5.6 works, my /etc/hosts files are pointing correctly and all that good stuff. I believe I have enabled all the required modules which Processwire needs (and then-some) : Mod_Rewrite being the most important. However, when I download my Production files (live server) onto  my Development machine, it doesn't go as smooth as the WAMP days :( I have narrowed it down to something which must not be configured correctly for .htaccess to take affect. Again, this really is my first attempt (although been at it for over a week) to get a LAMP stack installed so it's probably something I am not understanding or doing right. Btw, MySQL (MariaDB) is working correctly and all the databases have been imported from my Production .sql file.

    Here is my virtual host file: Maybe something in here isn't correct.

    <VirtualHost *:80>
        DocumentRoot /srv/http/site2.dev
        ServerName dev.site2.com
        ErrorLog /var/log/httpd/site2_log
    
        <Directory /srv/http/site2.dev>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>
    </VirtualHost>
    
    

    The .htaccess directives are for Processwire 2.3. I have never had to touch them before, but I tried commenting / un-commenting almost everything which has been reccomend thus far and nothing has worked :(  This 500 Internal Server Error will not leave me!

    Thanks so much for any help / tips you can provide.
    Thank You

     

  12. Kongondo. I am in awe!  WOW, WOW, WOW!!!  My mouth has dropped to the floor and my prayers have been answered! This has been designed so beautifully, logically, and intuitively  :'(You are super talented my friend. This is something that has been needed for quite some time. Thank you so much for this!!!

    I'm speechless.

    • Like 4
  13. Ok @n0sleeved, I think I got the solution ^-^

    Here in my office I got your same setup and, following the exact same procedure you mention, I recieve the error MySql gave you.

    To solve this I've choosen not to export through the "Rapid" option, and go for the "Custom" one. In the options panel I have then checked:

    Add instruction DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT
    

    and exported leaving all the rest with default values.

    It worked!

    Let us know!

    That worked!!!!!!! OMG - THANK YOU @3fingers!  :biggrin:  :biggrin:  :biggrin: 

    Thanks for all the other replies as well guys. It's so nice to have this forum where people are so willing to help each other. In all my experience using other "forums" across various websites, this one has proven to be the most helpful, friendly, and open. The fact, that we all use Processwire makes it even better. 

    Now I can finally get back to working on this site.    

    • Like 1
  14. Not sure how it could possibly have happened, but have you checked through the SQL file to make sure that:

    INSERT INTO `fieldgroups` ( `id` , `name` )

    is not duplicated anywhere.

    If by "not duplicated"  you mean (only showing once), then yes, it only appears once in the SQL file. 

    Can you post the first page of the SQL you are trying to import

    Sorry, my limited noob knowledge does not understand what constitutes pages :( I have one SQL file. Would you like to see the complete contents of it (it's pretty long)?

  15. Hmm, cstevensjr and 3fingers have covered exactly the ground likely to cause these issues.

    Having googled around, and please forgive me for suggesting this, are you absolutely sure that you are importing the db structure into the new db and not the old one? The reason I ask is that that is one way to guarantee duplicate keys, because they would of course already exist. (And we do all do things like that occasionally.)

    No offense taken. Yes, I am positive I am importing the old, exported, original database into the new, blank and empty db. I even created yet another db with a different name to see if that was the problem and still throwing the same error :/ 

  16. What happens when you go to your new database in PHPMyAdmin, under the "Structure" tab and click "Check All" and change "with selected" to "Drop" and then press "Go", then try the database import again?

    The new database is empty and doesn't show that. 

    It looks like you're importing your db after a new installation of processwire, which has just set some primary keys (ids) and so it gaves you an error when you're trying to overwrite them (at least I'm guessing so).

    Try to import your db before installing pw, skip it and then try to go to yoururl/processwire (or any admin url you've set).

    Just my two cents.

    When I copied the project folder to a new folder, I also copied Processwire with it. No new installation.  

  17. How did you export the database? Give us a quick description of the steps you took to export & import, with any tools used.

    Using Wamp and PhpMyAdmin (Version information: 4.0.4)

    MySQL server (Server version: 5.6.12-log)

    Here's the steps I do:

    1. Select project_v1 database (the original database). 
    2. Choose Export > Quick Export > SQL Format
    3. File saved
    1. Created a new database called project_v2, then select it
    2. Choose Import > I select previous exported file > Leave it on all default Settings

        Then this error pops up when I hit Go:

    Error
    SQL query:
    
    --
    -- Dumping data for table `fieldgroups`
    --
    INSERT INTO  `fieldgroups` (  `id` ,  `name` ) 
    VALUES ( 2,  'admin' ) , ( 3,  'user' ) , ( 4,  'role' ) , ( 5,  'permission' ) , ( 1,  'home' ) , ( 88,  'sitemap' ) , ( 83,  'basic-page' ) , ( 80,  'search' ) , ( 97,  'album' ) , ( 98,  'artist' ) , ( 99,  'artists' ) , ( 100,  'track' ) , ( 101,  'catalog' ) , ( 102,  'genres' ) , ( 103,  'genre' ) , ( 104,  'moods' ) , ( 105,  'mood' ) , ( 106, 'full-width' ) ;
    
    MySQL said: Documentation
    
    #1062 - Duplicate entry '2' for key 'PRIMARY'
  18. I'm following the FAQ post here / trying to create password protected page. The code they supplied was this: 

     

    <?php
    
    if ($_POST['awesome_password'] != $page->page_password) {
    
    echo <<<EOT
    <h1>Login</h1>
        <form name='form' method='post' action='$page->url'>
        <input type='password' title='Enter your password' name='awesome_password' />
        <br />
        <input type='submit' name='Submit' value='Login' />
    	</form>
    EOT;
    } else {
    echo "<p>This is the protected page. Content goes here.</p>";
    }
    
    ?> 
    

    That works beautifully. However, I want to spit out more than just a simple ECHO in the else statement. In fact, I want some pretty simple Html mixed with php.  Now I tried modifying the original code supplied by adding another <<< thinking that it would work but of course it didn't :P

    else {
    echo <<<EOD
    
    	
    	<!--Begin Table For Catalog Data -->
    	<table id="catalog" class="display" cellspacing="0" width="100%">
    		<thead>
    	    	<tr>
    		        <th>Artist</th>
    		        <th>Track Name</th>
    		        <th>Album</th>
    		        <th>Length</th>
    		        <th>Songwriter(s)</th>
    		        <th>Genre</th>
    		        <th><span data-tooltip class="has-tip" title="Displays the following mood / emotion / characteristic">Traits</span></th>
    		        <th><span data-tooltip class="has-tip" title="All songs are originals unless designated cover (letter C)">Type</span></th>
    		        <th></th>
    		    </tr>
    		</thead>
    
    		<tbody>
    
    		<?php //Table Loops
    		$tracks = $pages->find("has_parent=/artists/, template=track");
    
    		if($tracks) {
    		  foreach($tracks as $track) {
    		  	echo "<tr>";
    		  	echo "<td id='artistName'>" . $track->parent->parent->title . "</td>"; // artist name
    		    echo "<td id='trackTitle'>" . $track->title . "</td>";
    		    echo "<td id='albumTitle'>" . $track->parent->title . "</td>"; // this is the album name
    		    echo "<td id='trackLength'>" . $track->track_length . "</td>"; // track length
    		    echo "<td>" . $track->songwriter . "</td>"; // track songwriter
    
    		    echo "<td id='genres'>";
    		    foreach ($track->genres as $genre) {
    		    	echo $genre->title . "/";
    		    };
    		    echo "</td>";
    
    		    echo "<td id='traits'>";
    		    foreach ($track->moods as $mood) {
    		    	echo $mood->title . "/ ";
    		    }; 
    		    echo "</td>";
    
    		    echo "<td>";
    		    // determin cover song or not
    		    if($track->song_type != null) {
    		    	echo '<img id="logo" src="' . $config->urls->templates . 'img/letterC.png">';
    		    } else {
    		    	echo "";
    		    }; //end determin cover
    		    echo "</td>";
    
    		    echo "<td>" . "<a href=' " . $track->song_file->url . " ' class='sm2_button'>Play</a>" ."</td>";
    		    echo "</tr>";
    		    		
    		  }
    		}
    		?> 
    
        </tbody>
    	</table>
    	<!-- End Catalog Table -->
    
    	<!-- Initialize DataTable -->
    	<script> 
    	$(document).ready(function () {
        	$('#catalog').DataTable();
    	} );
    	</script>
    
    EOD;
    }
    ?> 
    

    I have never worked with <<< Heredoc syntax before, Apparently you can't put whatever you want between it? No? 

  19. Okay, before I say anything, I know I should be using Git. Yes. It would make my life easier, but I really don't want to right now. Plus, I want to use a new database instead of messing up the original. So, with that said:

    I have project 1 folder (contains active PW and site files). I exported the database and duplicated the folder. When I went to import the exported database into the newly created one, I get this error:

    #1062 - Duplicate entry '2' for key 'PRIMARY'

    Wtf? I thought it would be simple to just backup / import. Guess not :( I am not a SQL experienced user so I am lost. Tried googling but answers are too complicated. 

    Help please  :rolleyes:

  20. i always use the processwire ID for the code in foxycart;

    <input type='hidden' name='code' value='{$page->id}' />

    That' what I was going to do as well, however this is for digital goods and apparently the client needs a unique code(sku) for each product created in Foxycart (since digital goods needs to be created on the Foxy backend). I just noticed that the ID does show in the URL when editing in the Processwire backend so I may just tell the client to look in the URL. However, I am still open to suggestions. 

    Are you using just the ID for digital goods?
×
×
  • Create New...