Jump to content

davo

Members
  • Posts

    283
  • Joined

  • Last visited

Posts posted by davo

  1. Ryan, this module is working really well for me on everything but one currency; mexian peso MXN. When parsing it reports this error:

    Error: Exception: Can't find target currency. (in /var/www/clients/client2/web37/web/site/modules/ServiceCurrencyConversion/ServiceCurrencyConversion.module line 295)
    
    #0 /var/www/clients/client2/web37/web/site/modules/ServiceCurrencyConversion/ServiceCurrencyConversion.module(310): ServiceCurrencyConversion->convertAdvanced('GBP', 'MXN', 250, 0, -1)
    #1 /var/www/clients/client2/web37/web/site/templates/currency.php(16): ServiceCurrencyConversion->convert('GBP', 'MXN', 250)
    #2 /var/www/clients/client2/web37/web/wire/core/TemplateFile.php(140): require('/var/www/client...')
    #3 [internal function]: TemplateFile->___render()
    #4 /var/www/clients/client2/web37/web/wire/core/Wire.php(359): call_user_func_array(Array, Array)
    #5 /var/www/clients/client2/web37/web/wire/core/Wire.php(317): Wire->runHooks('render', Array)
    #6 /var/www/clients/client2/web37/web/wire/modules/PageRender.module(337): Wire->__call('render', Array)
    #7 /var/www/clients/client2/web37/web/wire/modules/PageRender.module(337): TemplateFile->render()
    #8 [in
    

    I'm using this to  code:

    $cc = $modules->get('ServiceCurrencyConversion');
    $dollars  = 250;   // this is what we're going to convert   -- ignore dollar naming convention
    $currency = $page->symbol;   // 
    $symbol = $cc->getSymbol("$currency");
    $euros = $cc->convert('GBP', "$currency", $dollars);  //again, please ignore dodgy naming convention
    $simple = $cc->convert('GBP', "$currency", '1');
    
    ?>
    
    <div class="container">
    	<div class="row">
    		<div class="col-md-6">
    		<?php echo "<h2> £1 = $symbol$simple .</h2>"; ?>
    		</div>
    
    	        <div class="col-md-6">
                    <?php echo "<h3>That means £$dollars is going to buy you {$symbol}{$euros} .</3>"; ?>
                    </div>
    
    
    
    	</div>
    </div>
    

    please ignore my dodgy variable names.

    Any idea why it has a problem with MXN please?

  2. Sometimes reverse DNS is used by mail servers to authenticate that the sending IP address actually matches the domain it proclaims to come from. The issue you may have is you're using shared hosting one IP address may be used to host multiple domains making reverse DNS difficult. You can look to see if it is set up on a site like this:

    http://mxtoolbox.com/ReverseLookup.aspx

    but for shared hosting this may not be the answer.

    I've not seen it but I can probably assume horst's module uses a separate mailing provider to send the mail rather than the site's own php.

    Not sure I've really helped much but it does as least give another avenue to explore.

  3. Just to add my two pennies worth...

    I'm not a coder by trade, but used to make many joomla sites for hobby money. But, by virtue of not being a coder I  was restricted to what modules and components other more competent people created. This only caused me more problems when the core upgraded  etc leaving me with out of date components and a vulnerable site. (and some egg on my face)

    I switched to PW after recommendation by a friend which turned out to be the best thing I could have done. With practically personal tutoring by members here (Adrian, Ryan, Joss, Pete, sinnut etc (sorry for missing out so many)), I've become competent in using the api and basic php.  I now don't need a component to make a blog, photo gallery, complex database, I make my own. The biggest advantage of this is I know exactly how they work, I know how to adapt it and I most of all it won't become obsolete when the core gets upgraded.

    What makes a coder?

    $x = "any";

    $y = 1;

    $z = "you";

    echo "$x" . "$y";

    $y = $y+$y;

    echo "$z" . $y;

    Would that even work? lol

    WP/Joomla and drupal all have a targeted audience... but I belong here lol.

    • Like 8
  4. The short answer is yes and no.

    What you can't do is run PHP or mySQL on a phone, but you can create an app that pulls data from an online database. You would likely be developing in HTML and Javascript if using Phonegap though and using AJAX requests to fetch the data from the website.

    The alternative is to create a static HTML site and package that as a phone app using PhoneGap or some other program, but that's a bit limiting.

    Setting up Phonegap took me ages as there are a lot of other things you also need to set up and the documentation can be a bit unhelpful in places (out of date instructions or bits missing when I last followed the instructions), but it can be fun once you get going - not something you would do unless you enjoy a challenge though in my opinion.

    The real question is: if this is a normal website then why have an app unless there is something special you want to do with the app? Making the website layout responsive would work just as well on mobile with less hassle, so I think we need to know a bit more about why you want it to be an app before being able to help further.

    Thanks Pete

    That makes a lot of sense.

    Ajax and json isn't something I'm proficient in yet.

    I suppose I could make a slimmed down version of the site, and then use something like httrack to clone the site to html and then package that using phone gap. Of course, as data gets updated, the app wouldn't, unless of course the static app had regular updates. Doesn't sound viable yet.

    Completely agree with Pete - having an app that replicates the functionality of a website is sometimes what clients want, but it really makes no sense. Honestly I think a lot of apps out there would work just fine as responsive sites instead. That said, there are obviously great benefits to the app approach when appropriate and the functionality is targeted. One way to make the phonegap experience a little less daunting is to use "phonegap build" which allows you to avoid a lot of unpleasant steps, although the Apple provisioning stuff is still a PITA.

    You can't just convert a website with phonegap unless the site is very basic and non-interactive. Once the user has the ability to query a database of changing content, you need to provide a mechanism for that content to be pulled into the app. The css, html, and js files are installed to the device (via the phonegap process). The content can be a mix of static content as part of the html and then the dynamic stuff that is pulled from a database via ajax and usually JSON.

    For web developers with a strong jquery skillset, jquerymobile is an ok approach to get going, although it can quickly become a painful process and I don't think I'll do it again. There are a lot of other frameworks and tools out there that can help. One that I think is worth taking a serious look at is ionic (http://ionicframework.com/). It makes use of AngularJS which, once you get over the learning curve, gives a lot of power and the apps feel much more native than with jquerymobile.

    Google around for "mobile app html5 framework" to see what else is out there and looks like it will work for you.

    If you don't have strong javascript/ajax experience, it will be a struggle to get going as you need to rethink how things are done. Good luck!

    Thank you. I'll have a look at those links. I do also agree, seems little point turning a dynamic site into an app... But sometimes I'm driven by a clients whim.

  5. Success on playground site -

    Deleted module

    Upgraded pw to dev branch

    installed new user email module

    installed import pages from CSV

    edited the module to include additional protected fields

    successfully imported user from CSV and welcome email sent!

    Thank you. When I do the live site I'll try and video the process for others.

    Cheers!

    • Like 1
  6. That's odd, on my playground site the module installed, but on the live site i got this error when installing it:

    Error: Class EmailNewUser contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Module::getModuleInfo) (line 215 of /var/www/clients/client2/web37/web/site/modules/EmailNewUser/EmailNewUser.module) 
    

    The site still functions but won't let me into the modules section without that message.

    actually, happens on both upon install...

  7. Thanks so much.

    I don't need to pre populate the passwords so I'm happy to have them generated by your module.

    Yes, I did get the roles to import in the end.  It looks like this for me:

    	protected $fieldtypes = array(
    		'FieldtypePageTitle',
    		'FieldtypeText',
    		'FieldtypeTextarea',
    		'FieldtypeInteger',
    		'FieldtypeFloat',
    		'FieldtypeEmail',
    		'FieldtypeURL',
    		'FieldtypeCheckbox',
    		'FieldtypeFile',
    		'FieldtypePassword', // add this line for passwords
    		'FieldtypePage', // add this line for the roles
    		);
    

    I had to call the columns in the roles 'roles' and reference the role by ID rather than name

  8. Hi David,

    There is definitely the possibility to do this, but depending on how you are doing the import I might need to tweak some things for you because the module is currently restricted to the admin template only. I did a test with creating a user via the API and the everything works as expected, so we should be good there.

    How are you planning on importing? I tried Ryan's CSV importer, but it doesn't look like it will work for creating users because it doesn't have access to the name field of a page. Instead it uses the title, but user pages don't have a title field, so not sure how you could make it work. Also the issue of assigning roles to the imported users - again another strike for the CSV importer. So I think you'll need to write your own CSV import / user creation script - which should be fairly easy to do.

    So anyway, once you have that up and running, let me know the exact mechanism and I'll do whatever might be needed to make this module play nicely for you.

    It should also work well with the automatic password generation and combined with Force Password Change (http://modules.processwire.com/modules/password-force-change/) you should have a pretty easy method of setting up a large number of new users.

    Anyway, let me know what you need.

    Ok, it's there!

    Used Ryan's import users from CSV module. Added title to the users template which seems to duplicate in to the name field.My test csv looks like this:

    title,pass,email,roles,,,,,

    james,james,james@james.com,2107,,,,,

    What's next?

  9. Adrian, i think this may be what I'm after through I've not had a chance yet to try it. I need to bulk import a number of users to become registered users. Could I import these users with csv to page and have this module email them their details?

    Thanks

    David

  10. This sort of thing is rather easy to set up using mod_rewrite too, and if there's a lot of content, that's often only sensible option. This thread might be of help to you, the problem is essentially the same. Note, though, that you should be careful with 301 redirects -- since in theory they're "permanent" browsers can cache them for a very long time. For temporary, short-term solution use 302's instead.

    RESULT! Cheers

    This is only a temporary solution until all content from the old site have been migrated.

  11. Soma handles documents with a special setup and a template so you could easy setup pdf's with a field "old-path" and check for this so the "old" links should work:

    here is his tutorial:

    https://processwire.com/talk/topic/4602-flexible-downloads-using-pages/

    http://soma.urlich.ch/posts/flexible-downloads-using-pages/

    this is really great!

    I use it on a page with some pdf's to count downloads - so your file could have a different name/url and adding an "old-url" field should be no problem.

    And since a pdf-download is a page you can redirect it via your normal methode, too without need of additional fields and changing the PDF!!

    Hope this helps - mr-fan

    Thank you MF; that does look good for future use but I don't think it will achieve what I'm trying to do today.

  12. In previous posts I've dealt with redirecting individual pages from an old site location to a new one.

    But this is slightly different.

    On the old non pw site there were a fair number of PDFs with a link to other PDFs all stored in a FTP share.

    I can't easily move all the files across because the links are hard coded into other PDFs.

    Long term I will move the files across and slowly change the PDFs.

    What I need to do is redirect any traffic to

    http://www.dudmc.com/newsletter/******

    to the old site

    http://www.dudmc.co.uk/newsletter/*******

    This is an example

    http://www.dudmc.com/newsletter/Prague_Hotels.pdf

    Unless anyone can think of a better or different way I think the only answer could be is to use apache rewrite in the htaccess file..... But I'm fairly useless with that. Could anyone help please?

    This is only a short term solution.

  13. Can't work out why my thumbnail resizing here doesn't work. It's probably something very obvious (as usual)

    <?php 
    
    /**
     * Page template
     *
     */
    
    include("./head.inc"); 
    
    echo $page->body;
    
    $contestantarray = $pages->find("template=user"); //get all the users
    
    $contestants = $contestantarray->findRandom(2); //grab two contestants
    
    foreach ($contestants as $contestant) {
    		$lineup = $contestant->profile_image;        //create the contestant
    		$thumb_contest = $lineup->size(50, 50);      //create a thumbnail
    		echo "<img src='{$thumb_contest->url}{$thumb_contest}'><br /> " ; //output the thumbnail
    }
    
    include("./foot.inc"); 
    

    errror:

    Error: Exception: Method Pageimages::size does not exist or is not callable in this context (in /var/www/clients/client15/web43/web/wire/core/Wire.php line 320)
    
    #0 /var/www/clients/client15/web43/web/site/templates/contest.php(19): Wire->__call('size', Array)
    #1 /var/www/clients/client15/web43/web/site/templates/contest.php(19): Pageimages->size(50, 50)
    #2 /var/www/clients/client15/web43/web/wire/core/TemplateFile.php(140): require('/var/www/client...')
    #3 [internal function]: TemplateFile->___render()
    #4 /var/www/clients/client15/web43/web/wire/core/Wire.php(359): call_user_func_array(Array, Array)
    #5 /var/www/clients/client15/web43/web/wire/core/Wire.php(317): Wire->runHooks('render', Array)
    #6 /var/www/clients/client15/web43/web/wire/modules/PageRender.module(337): Wire->__call('render', Array)
    #7 /var/www/clients/client15/web43/web/wire/modules/PageRender.module(337): TemplateFile->render()
    #8 [internal function]: PageRender->___renderPage(Object(HookEvent))
    #9 /var/www/clients/client15/web43/web/wire/core/Wire
    
    This error message was shown because you are logged in as a Superuser. Error has been logged. 
    
  14. The twitterbar and the slider on the frontpage would need some extra work for big screens. They float to the left on an 27" iMac, while everything else is centered.

    Thank you. Unfortunately I only have a small laptop :( i understand the banner images also only expand to their native resolution, so unless I used very large images I'm not sure how I'd get around this.

  15. I think this site makes a nice use of bootstrap framework. Looks good!

    In the contact section everything seems to be made with FormBuilder and with its default styles. I just wanted to ask is it not that easy to apply Bootstrap styles to forms or are the defaults just better? Planning to use FormBuilder for the 1st time and am interested in opinion from someone who has been there.

    Thank you. I'm not a great designer so bootstrap 3 serves me very well.

    Applying bootstrap 3 styles to the form builder forms is something I'd also like to achieve. I believe this can be done but will require slow more learning and reading for me. Changing the styles to one of the pre mades is easy. It also looks easy to create new ones from theme roller, but a little more complicated to use bootstrap; but possible I understand.

    • Like 1
  16. destinations UNLIMITED

    This site is a conversion from an old Joomla site that is far better suited to processwire due to the 100s of facts and figures about the destinations.

    Many of the facts from each of the destinations help to form other content such as blurbs on the video content hopefully adding quality content for google to index. It's also got a growing number of features for registered users such as being able to add personal comments to destinations which collate into a personal notebook.

    Hope you enjoy having a look around. Although the site is now live, I don't think it will ever be finished!

    ..not to forget a thank you to everyone who has helped me with the project along the way!

    • Like 7
×
×
  • Create New...