Jump to content

cstevensjr

PW-Moderators
  • Posts

    1,250
  • Joined

  • Last visited

  • Days Won

    5

Community Answers

  1. cstevensjr's post in Automatic Page Name Format Not Working for PageTable (PW 3.0.21) was marked as the answer   
    @ryan, committed an update this morning that I can confirm fixes this problem.  Now works great on an updated 3.0.23 commit. 
  2. cstevensjr's post in upgrading Processwire from 2.x.x to 3.x.x is it Safe ? was marked as the answer   
    Please review the following information
    https://github.com/ryancramerdesign/ProcessWire/tree/devns
  3. cstevensjr's post in Session Handler Database - No sessions shown was marked as the answer   
    You can change the amount of minutes to show.  If you add more minutes, it will likely show some information.

  4. cstevensjr's post in Field greyed out was marked as the answer   
    The Title field should already be on the template you are trying to add fields to (that's why it's greyed out).
  5. cstevensjr's post in https redirection not working / ingnored was marked as the answer   
    You have the option of using the .htaccess file take care of the SSL redirection.  
    Some related links that talk about this are:
    https://processwire.com/talk/topic/9782-htaccess-optional-redirect-to-https/
    https://github.com/ryancramerdesign/ProcessWire/pull/1128
    https://perishablepress.com/stupid-htaccess-tricks/#sec13
  6. cstevensjr's post in Install problem - superuser has never logged in was marked as the answer   
    First make sure you are using at least PHP 5.3.8 
  7. cstevensjr's post in Incomplete page loading was marked as the answer   
    You may need to look at and possibly increase the max_allowed_packet variable in MySQL.
  8. cstevensjr's post in Formbuilder not sending email with MAMP setup was marked as the answer   
    You may want to ensure that your PW installation uses a SMTP relay versus PHPMailer.  That would be the first thing I would check.
    I would suggest using either the Wire Mail SMTP or Swift Mailer modules for sending out emails.
  9. cstevensjr's post in ProcessWire Install on GoDaddy Hosting Can't Find the MySQL Database was marked as the answer   
    Have you tried using the actual hostname or ip address?
  10. cstevensjr's post in Pharma Hack was marked as the answer   
    The quick answer, Regardless of the hack, if you are using shared, VPS or even dedicated server hosting, even ProcessWire can be affected.  
    If the site that you manage is using the same user account and/or on the same virtual/physical server as a compromised WordPress or Joomla site, any compromise  can indeed affect the ProcessWire installation.
    If there are no old/new WordPress or Joomla  installations under the situations I described and you are having this problem, then yes there may be an issue with ProcessWire.  Please let us know if this is the case, however I doubt if it is, since we would have already seen this occur in other ProcessWire installations worldwide.  PHARMA is an old hack, but it doesn't mean it hasn't been updated.
    Either way, you need to work with the security team at your webhost to identify and mitigate any issues.  Please keep us informed on your progress clearing this issue up.  
    Best Regards,
    Charles
  11. cstevensjr's post in Displaying the Title when using Repeaters and Page Reference Fields was marked as the answer   
    Sometimes I look at a problem and get consumed with a particular way of trying to solve the issue.  I had to step back and rethink about how I was going to solve the issue of the "Priority" field not displaying as I wanted.
    When I rested, I actually thought "Hey, you already know what the answer is, why not work from that position?
    Problem
    I have a Priority field within a note form where the choices are "Not Applicable", "Urgent", "Important", "Routine" or "Low".  I chose to use the Page relation field.  The only problem I ended having is that I was dealing with a repeater to create the notes within the page.  Not normally a bad problem, but I couldn't get the singular page reference field to display it's content.
    Solution
    Since I already know what I wanted to display, I worked out a way to make it happen.   I modified the repeater_sd_note.php file to accomplish this.  The contents of the updated file is shown below.
    <?php echo "<h4>$page->title</h4>"; echo "<p><strong>Date:</strong> $page->sd_date</p>"; echo "<p><strong>Note:</strong> $page->sd_body</p>"; echo "<strong>Type:</strong>"; foreach($page->sd_type as $type){ echo " | $type->title"; } echo "</p>"; echo "<strong>Priority:</strong>"; $priority = $page->sd_priority; $p = "1098"; if ( strcmp ( $priority, $p) == 0 ){ echo " | Not Applicable |"; } $q = "1099"; if ( strcmp ( $priority, $q) == 0 ){ echo " | Urgent |"; } $r = "1100"; if ( strcmp ( $priority, $r) == 0 ){ echo " | Important |"; } $s = "1101"; if ( strcmp ( $priority, $s) == 0 ){ echo " | Routine |"; } $t = "1102"; if ( strcmp ( $priority, $t) == 0 ){ echo " | Low |"; } echo "</p>"; echo "<strong>Status:</strong>"; foreach($page->sd_status as $status){ echo " | $status->title"; } echo "</p>"; echo "<p><strong>Attached Documents:</strong> [ $page->sd_documents ] </p>"; ?> I'm no coding wizard, however I knew if I could compare the known page IDs of the choices to value of the sd_priority variable I could do the rest easily.  It took awhile but I eventually thought about doing a string compare, which gave me logic needed to display the data on the website.
    It's not elegant, but it works!  Thanks once again to Soma for setting me straight on the foreach on the array.  I'm still learning after all these years.  Thanks also to Valery for getting my mind working by providing me with a detailed start and tutorial on creating custom modules.  Good Day.
×
×
  • Create New...