Jump to content

rushy

Members
  • Posts

    57
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Bourne, Lincolnshire
  • Interests
    Motorcycles, music, meteorology, vintage radio restoration, computer chess programming, tech. in general

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

rushy's Achievements

Full Member

Full Member (4/6)

13

Reputation

  1. Hi. I have set up a 301 redirect in the host webspace to redirect to a pw site on to my other host server. I simply have these 2 lines in .htaccess and nothing else. (There is no pw on this webspace) RewriteEngine On RewriteRule (.*) https://my-otherdomain.com/mysub [R=301,L] On this other server I have pw installed in a folder www/mysub This works in so far the home page is shown as expected but internal links give internal server error. I suspect because url slugs are referencing the wrong server. Do I need to add rules for this and any idea what rules to add ? Thanks for any help-
  2. I added the ProcessWire namespace as shown below. This seems to have fixed the wireRenderFile not found and the page now displays. I do not know why it works without that on my localhost. Perhaps it could be something to do with this forum post I found that gave me the idea to try adding the namespace? https://processwire.com/talk/topic/11815-undefined-variable-pw-3-wirerenderfile-use-compiled-file/#comment-109884 <?php namespace ProcessWire; ?> <div id="ajax-content" pw-replace> <?=wireRenderFile('_ajax-home.php', array('id' => $page->id))?> </div>
  3. Sorry for confusion Soma. I meant that post on Tuesday was my first for a long time. Everything has been running fine with my PW sites for years so I haven't been here and that's what I meant. But now I have this problem ..and others. But for now I am concentrating on solving this one I posted above on Tuesday. I'm going back to basics and trying to find out why it works on my localhost but not on the live server. A clean install of the latest PW 3.0.255 blank site profile does work on the live server. During that I saw that the SQL storage engine is innoDB by default (good thing) but my sites were always myISAM but I think you're right - it shouldn't matter when importing a d.b. The wireRenderFile undefined is strange because I can find the function in the core files on the live server so file is not missing. I will continue playing and report back any progress. Thank you Soma for your interest.
  4. Thanks Soma. I've been away from this for a while! Has ProcessWire changed to use other than myISAM ? I just noticed during the install it sets innoDB by default. Would this matter if importing an old d.b saved as myISAM ? I'm getting some very strange problems on all my old projects now
  5. Hi. I've recently moved a long standing site to a new server and now I get wireRenderFile is undefined on home page. So I checked on my localhost server and it is running fine on there. I'm using Markup Regions and the home page is just like all my pages using : <div id="ajax-content" pw-replace> <?=wireRenderFile('_ajax-home.php', array('id' => $page->id))?> </div> I did a clean install of 3.0.255 and it runs ok. Replaced site files and imported my d.b as usual but gives red error screen - The error I'm getting : Hmm… Fatal Error: Uncaught Error: Call to undefined function wireRenderFile() in site/templates/home.php:3 #0 wire/core/TemplateFile.php (328): require() #1 wire/core/Wire.php (413): TemplateFile->___render() #2 wire/core/WireHooks.php (1018): Wire->_callMethod('___render', Array) #3 wire/core/Wire.php (484): WireHooks->runHooks(Object(TemplateFile), 'render', Array) #4 wire/modules/PageRender.module (547): Wire->__call('render', Array) #5 wire/core/Page.php (3152): PageRender->render(Object(HomePage), Array) #6 wire/core/Wire.php (416): Page->___renderPage(Array) #7 wire/core/WireHooks.php (1018): Wire->_callMethod('___renderPage', Array) #8 wire/core/Wire.php (484): WireHooks->runHooks(Object(HomePage), 'renderPage', Array) #9 wire/core/Page.php (3097): Wire->__call('renderPage', Array) #10 wire/core/Wire.php (413): Page->___render() #11 wire/core/WireHooks.php (1018): Wire->_callMethod('___render', Array) #12 wire/core/Wire.php (484): WireHooks->runHooks(Object(HomePage), 'render', Array) #13 wire/modules/Process/ProcessPageView.module (193): Wire->__call('render', Array) #14 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage(Object(HomePage), Object(PagesRequest)) #15 wire/core/Wire.php (416): ProcessPageView->___execute(true) #16 wire/core/WireHooks.php (1018): Wire->_callMethod('___execute', Array) #17 wire/core/Wire.php (484): WireHooks->runHooks(Object(ProcessPageView), 'execute', Array) #18 index.php (55): Wire->__call('execute', Array) #19 {main} thrown (line 3 of site/templates/home.php) I can login to admin on back end ok. Any attempt to view a page from admin gives the error above as they all use basic-page template with the same markup region. Like I said it all works fine on my localhost on 3.0.229 Any ideas? Thanks .
  6. Thank you for the suggestion. Investigating further I have found out that PW has a useful trick up it's sleeve (as usual!). One can define a template named after an existing field by prepending the template name with field- e.g for the images field in my site, I made a template (without a file) called field-images and in that template I defined a new text field called imgDescription. Now every instance of an image also has a text field associated with like this: $image->imgDescription and this works as expected, for multiple images too. I think I will proceed with this as see how I get on... !
  7. I'm wondering if the 'built in' description field of the Image Fieldtype can be used in front end editing? I presume not, as usually one would set front end editing in the input tab when defining a field in the back end but the description text field is included with the Image type. But I thought I'd check here in case any one know for sure. My case is I have a textarea field where multi line text is entered and stored like an article about the image, so I used the description field, and this works fine for plain text. Now I realise this may have been a mistake, as I would like to use TinyMCE editor and front end edit to create and edit these articles and I don't think it can work with the built in description, probably I should use a user defined image-field attached to the image field. Any comments welcome.
  8. I have made a photo gallery using PW and I'm quite pleased with myself as it works pretty much as I want and I consider myself a basic programmer. Basically my templates use Pageimages field to hold uploaded images. Now I want to make a template to share some of my images online. I intend to cherry pick a bunch of my images and store the selection in a WireArray. Then I want to be able to send a link to someone which will use this to display the selection of images. The bit that I don't know is how to save this WireArray of selected images. I don't want to use Pageimages because it will store again the image on disc, what I want is a reference to the already saved images so that I can use that in my template field, but I'm not sure what field to use. Is it one of the Page Reference fields in the drop list for fields? I've tried looking this up in the forums but most of it seems to be to map things to front end (AsmSelect etc. which I don't really understand!) whereas I just want to save my list of selected image references to the database. I could probably use the cache class to save the WireArray as it says it can save arrays... but any pointers in the right direction would help. Many thanks!
  9. I'm having a problem with writing data in the back end from time to time. On my front end I have a login form that authenticates a user and if login is successful certain commands are exposed in the front end, such as add, delete and rename which are not visible to guest users. I simply use the api function $user->isLoggedin() and to determine whether to show the commands or not. In the back end I have a kind of web service page that handles these commands and will only act on them if $user->isLoggedin() is also true there. I also set a $session timeout in my config.php. This works fine, if the session has timed out the command is still shown on home page but will fail in back end and will then say session timeout and refresh home page by session redirect. BUT sometimes when session is still active a command is actioned by back end but times out.... if I try again the action then always succeeds. Any ideas what could cause this. I note that exceptions.txt log file shows SQLSTATE[HY000]: General error: 2006 MySQL server has gone away (in /wire/core/WireDatabasePDO.php line 583 !! but I have no idea why it would "go away" and then work next time. Thanks for any pointers...
  10. Machine learning is quite an amazing thing and I have recently looked at what happened with the Google Alpha Zero program using neural networks. In board games like Chess and Go the machine was given only the rules of the game and objective and then given huge amounts of historical games to learn from. It was also playing itself millions of times and learning from this. Apparently after 4 hours it became stronger than the strongest program (Stockfish) and plays in a radically different way compared to previous Non AI programs, even showing moves that seemed alien to human grand masters but when analysed were found to be previously undiscovered winning strategies. This completely amazed me. So I think that AI will be very powerful organising a database into very pertinent and relevant responses and will only get better and more accurate over time with the neural networks they are using now. Of course humans will intervene and make corrections but the program will "learn" from this.
  11. Just giving AIOM a try and installed it and it works on my JS files but not my CSS files. In my home index page I am using a pattern like this :- <?php namespace ProcessWire; include_once("./_func.php"); if(!$config->ajax){ include("./_init.php"); } ?> ..HTML / Ajax here ... <?php if(!$config->ajax){ include("./_main.php"); } ?> and my _init.php has simply the Doctype, <html> opening <head> and my css declarations, closing </head> and opening <body> my _main.php has my JS includes, closing </body> and </html> Without AIOM it all works as I expect and validates correctly on W3. But when I add the AIOM to my css in my _init.php as below, I get Class 'ProcessWire\AllInOneMinify' not found. <link rel="stylesheet" type="text/css" href="<?php echo AllInOneMinify::CSS('css/stylesheet.css'); ?>"> If I remove it from the css files it works fine on the JS files in the _main.php. I can't understand why it won't work on the css in the head of my project. Any ideas? Next day: As a test, I moved one of my css links from the _init.php to the _main.php and hey presto it worked! I don't want it in the body part of my project as that's not the correct place for css files is it? I just wonder why when it's included in the head by my _init.php it doesn't know what AllInOneMinify is?
  12. SOLVED! My custom image field was working fine, I simply did not realise that Adminer truncates long text at 200 chars! It has to limit the display at some point and I should have guessed that. Anyway it seems to be storing my long text fields correctly as I just stored and then retrieved 612 char text so this bodes well.
  13. Hello. I have an image field on my page and was using the default description field to hold some text relating to the image. However I decided that I would sometimes like to store a longer text description such as an article about the image, for example a text several 1000 characters long. So I defined an image_fields template and added to it a text_article field of type textarea and tried to store long text there but it gets truncated around 200 chars, I can see that in Adminer. Any tips on how I should go about this? Thinking some more about this, perhaps I should just store a text document somewhere and reference it from PW, rather than store the text in the database, store a link to a document. Any comments on this? Many thanks - Paul
  14. Thank you Andreas. That is very slick and impressive! I hadn't thought of creating a hidden page for selections and time limiting the page. I think it could work for my images too. I'll have to explore Page References too as I never used them before. Paul Thanks for the heads up. I will take a look at this. Paul
  15. Hello. I've made an online photo gallery with albums and like to share some of the albums from time to time by providing a link that I email to selected people. I've made a page that acts as what I call an external viewer for this purpose. It takes a url with parameters to build a gallery from it. Now I'd like to be able to make this link time limited and what has come to mind is to generate a token and date/time that is stored as a field and may be compared to the link when someone attempts to view the shared link. If the token is valid then the date/time is checked to see if it's still current and access is allowed or not. Do you think this is a good way to handle this feature and is there anything in ProcessWire that can help me implement this that would help me? Many thanks for all your knowledge here! Paul
×
×
  • Create New...