Jump to content

MilenKo

Members
  • Content Count

    434
  • Joined

  • Last visited

Community Reputation

114 Excellent

1 Follower

About MilenKo

  • Rank
    Sr. Member
  • Birthday September 17

Contact Methods

  • ICQ
    99982787
  • Skype
    mikemastercorp

Profile Information

  • Gender
    Male
  • Location
    Montreal, Canada
  • Interests
    Web development, coding, Network infrastructures, Linux, BSD, Windows, Cisco, Photography, Cooking

Recent Profile Visitors

2,128 profile views
  1. Hey,@Robin S thank you very much for the quick and useful info. I was playing with some ifs to have a name in the sorting and then convert it to the actual sorting form, however the 'case' switch seems much cleaner and simpler than my code. I will run a test with it and see how it would come out, but I am sure it would be perfect.
  2. Hey @Robin S I've been playing this weekend with HannaCode + Dialogue and was wondering, would you know a way to provide a label for the attribute options? Presently I have the following list of attributes: Post_sorting_order Post_sorting_order__options=date|-date|title|-title|phits|-phits|recipe_comments.count|-recipe_comments.count Post_sorting_order__description=Negative sign means reverse order and I am trying to presend the options in a more human readable form (eg. "-date" to become "Date - asscending") etc. It is not much to leave it as it is, however presently to sort by comments count I am using the fieldname.count instead of something like: Comments count (ascending/descending). I've tried to modify the module to have a value of the options like: Post_sorting_order__options=date*Date(Ascending)|-date*Date(Descending) etc. but so far I was not able to modify the code to make it work..
  3. MilenKo

    Hanna Code

    Nevermind, looking at the code, I found the answer - every time I called the hanna code, the tabs were having identical names, so this was causing the issue. To fix it I've added a simple random string to the tab names and it is all working fine now. $permitted_chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $rand = substr(str_shuffle($permitted_chars), 0, 10); $tab_name = "Tab" . $count . "-" . $rand; This gives me an alphanumeric string of 10 chars length which aims to avoid a chance of duplicating again the tab names. I know it might be an overkil, but just don't want to take the risk of generating random number and have them matching πŸ˜‰ As of now, the tab ID is something like: #Tab1-wrf7te0Y2x
  4. MilenKo

    Hanna Code

    Hello gents. I've been experimenting a lot lately with Hanna Code and Hanna dialogue which lead me to a full "News Block" code that can be inserted easily using CKEditor. My idea was to build a few similar news blocks and allow the admin to select the categories (represented by pages) for every block tabs etc. Attached is a screen cast of what I have so far and it is working perfectly fine and as expected. As usual, there is one HOWEVER πŸ™‚ After some experimenting and adding few news pages (in my case as it is obvious some recipes), I was glad to see it all happening. The problem came, when I tried to insert the same Hanna Code block with the idea to show some different categories. What has happened is that the second block tabs came empty, but clicking on them started changing the navigation of the first one. From my humble experience with PHP I would guess that since Hanna code is using the same attributes, it affects the appearance of any other than the first block. So has any one ever came to a similar use and have found a solution that would allow to have multiple blocks inserted without an overlapping of the code of every one? I am thinking about experimenting with inserting a random number after the block name which would be used for the tab number and tab content, however am not sure if there is a simpler or more elegant solution that I am missing yet... Maybe it is important to mention that I am trying to accomplish a page builder using Hanna Code and Dialogue to allow selection of pages, add some limitations etc.
  5. Hey gents, for your information, I just upgraded my profile to 3.0.143 and it is all back to normal (at least with the error 500 I had). Thanks to all of you and especially Ryan for fixing the issue.
  6. @adrian, you were perfectly right, using the commit before the latest upgrade did fix the issue. Will post a report to Ryan to fix it.
  7. Will try to use the earlier commit you've pointed me to and submit an issue report for Ryan.
  8. Hey @adrian thank you very much. Would you know where can I find 3.0.141 core eventually to see if that would be the latest version to upgrade to? I will change the selector code in the home.php to see if that would fix it, but for sure it is a needed selection of the pages to avoid some drafts etc. to be listed πŸ˜‰ P.S. I've tried to remove the status selector, but am still getting the same error. Any page that I browse even if I create a template with simple phpinfo() in it and assign it to a page shows the error 500. One thing I am thinking I could do is to try to export the profile and import it on a fresh install to see if that would help...
  9. Hello fellas. I've been working on a profile that has been almost completted but I had to focus on some other tasks which caused me to stuck with PW dev version 3.0.137. This morning I went to upgrade all the old module versions as well as the core to 3.0.142 and I got an error 500 while trying to browse the frontent. The admin works perfectly fine, but the frontend fails to load. To troubleshoot the issue, I've taken these steps so far: 1. compared the old index.php and .htaccess files with the new one, but got them perfectly matching so the issue is not coming from there. 2. Tried to switch back to the old dev version by renaming the wire folder to .wire-3.0.142 and renaming the backed up folder to wire. As a result, the website came back as it should. 3. As far as I've used some of the Profields Module components, went and manually upgraded all those to make sure it is not part of the upgrade issue. With the old 3.0.137 core it all works fine as well. 4. Cleared the cache by manually deletting the content of /site/cache folder - still got the same error. 5. Did a module refresh to make sure that all the upgrades has been properly indexed - the issue got not fixed. 6. Enabled the debugging and checked the Tracy logs to find out the following error (file attached with the exception details from tracy): [2019-10-25 12-39-03] ProcessWire\PageFinderSyntaxException: Operator '&' is not supported for 'status'. in C:\OSPanel\domains\compurox.pw\wire\core\PageFinder.php:2211 @ http://compurox.pw/ @@ exception--2019-10-25--12-31--a55174700b.html 7. Tried to grab the PageFinder.php from the old core to check if the issue is within some changes with the latest core/cores. The error still showed which leads me to the conclusion that it is not related to PageFinder module even though it is mentioned. So does anyone has other suggestions or something that I have missed besides starting to disable modules all at once or one by one to figure out which one might be causing the problem? P.S. One other Idea I have, but am struggling to find an archive of the old dev cores from 3.0.138 to 142 to see if the profile would work with some of them. At least this could have pointed me to some core changes in that specific version which I should be addressing. Unfortunately I was not able to find any archive of the afore mentioned versions and as I've been away from PW community, I did not keep a copy of them as well as I usually do... exception--2019-10-25--12-40--edade40c59.html
  10. Great share, @Edison I will definitely test this in my next profile. How would I add the honeypot if I am using custom forms and modifying the module placing it in /site/modules/FieldTypeComments ?
  11. Hello there. I know this is a quite old topic, however I was facing the same issue and fount an easy way to handle the browser errors: in my form I had the following: $first_name_error = translate('Missing first name'); I've added my translation string to _strings.php: _x('Missing first name', 'General'); And then in my HTML markup I had the following code showing the translation: <div class="form-group col-lg-6 col-md-12 col-sm-12"> <input type="text" name="first_name" placeholder="{$first_name}" required="" oninvalid="this.setCustomValidity('{$first_name_error}')" oninput="this.setCustomValidity('')"> </div> Btw, the same approach was taken for the placeholder as well so $first_name was translated as well in my _strings.php For sure, @soma suggested long time ago, one can disable all the error messages, however if you would prefer to have the tooltip active, this is a nice and easy way to achieve it. It took me a few hours to find the right approach, so hopefully the next one won't have to spend that much time. So far it worked with Opera, IE, Edge, Chrome. I did not test with Safari, but doubt it won't work as well πŸ˜‰
  12. I had a similar issue, but in my scenario (with no module modifications) the line causing it was 58 if(count($values)){ I can confirm that changing the line to @Macrura correction eliminated the error in my logs.
  13. @Kai2000 Hello Kai and welcome to the PW Forum. I remember having a battle with my comments list and comments form the first time I needed to implement those and I was able to manage it with ratings, custom styling and inline replies. Here is the topic for you in case you haven't found it. With your own custom markup for the comments list and/or comment form I would suggest as the easiest way to copy the FieldType Comments module from /wire/modules to /site/modules and apply all the custom styling to this version. As I see, @Edison beat me on this and he also helped me to show comments based on the user/site language. Just follow the steps to select your new module copy from the admin (listed in one of the links of Edison and you would have your markup in no time. It seemed a bit confusing for me at the beginning, but you will get used to it and be able to manage any complexity of your comments. Should you have some difficulties understanding the code or adding a copy of the module, feel free to reach back to me and I will be glad to help πŸ˜‰
  14. Hey everyone, I got some great news about the proper date showing of ProcessWire in Russian. There are different approaches depending on the format to present the date. Here are the two best fitting the purpose: Approach 1: Approach 2: Even though I personally liked the second approach better since it just use the proper month number that would return the same value in any language, for the Russian proper date appearance I took much simpler solution where all I had to do was to swap the day and the month since plenty of websites were using it already. In a scenario where the month is first and then the date, there is ABSOLUTELY NO NEED to conjugate the month name and the date is appearing still gramatically and esthetically correct: Июль 31, 2019 To allow different date formatting per language (the default way of setting the locales did not work on my server) I've modified a bit the code I've added earlier to my header.inc: And was able to finally have the date properly showing in all selected languages by calling it inside the HTML markup: <?php // STRFTIME FUNCTION DATE FORMAT: // https://www.php.net/manual/en/function.strftime.php // $date_format - defined in /sites/includes/head.php for every language // $l->published/created shows the date the page was published/created // $locale - defined in head.php as well setting the proper locale for every language echo strf_time("{$date_format}", $l->published, $locale); ?> Please note that this approach would work for date() and strftime and there is actually no need of adding the extra DateTime field nor is necessary the code at /site/ready.php , however I've decided to leave it as it is for the learning curve and if a need be, to have a better option to manipulate the date. As far as the head.inc is included in every template of the profile but I would only need it to a few that would show the creation/publishing date, I might add a check for the page ID and include the header to only those templates that need it, however these things are some simple steps so I won't go any deeper there. Hope it helps to anyone needing to present a date in Russian or any other language that would require some names that differ from the standart PHP date/time function result. Case closed now! P.S. Forgot to mention that the strf_time is a function that I've used to my _func.php to convert the month name to utf-8 which I use by default in my profile: /** * Convert date/time stamp from different characters to utf-8 */ function strf_time($format, $timestamp, $locale) { $date_str = strftime($format, $timestamp); if (strpos($locale, '1251') !== false) { return iconv('cp1251', 'utf-8', $date_str); } else { return $date_str; } }
  15. OK, folks. I got a prototype of fully working month names Russian ranslation that works perfectly by creating an array with the proper month names and then showing the array result for the number of the present month. Simple and elegant, but I decided to go further now and create an unified version of translation function which would check the user selected language, set the proper locale and echo the month name either from the array for the Russian translation or directly. I am surprised that I did not see any solutions for that here yet πŸ™‚ Having a universal function would allow me to use it over and over again for any websites that would have the Russian in the languages list simply by inserting it to my _functions.php πŸ˜‰
Γ—
Γ—
  • Create New...