• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.

XenWord Development in March 2016

Status
Not open for further replies.

LPH

Flight Director
Flight Instructor
This month has started off with a bang.

@RLL and I met yesterday and discussed how to complete the Comments.php file. We decided too much code was being placed in the file. We created a new directory called Comments and added four new files.

I had a brainstorm this morning regarding a desired feature for several years. After spending the morning coding, the WordPress Toolbar login now works. The CSS code is not perfect but it's a start for developers and website creators.

Here is a short look at the Work.


Third, I worked on some of the annoying static bugs stopping some people. This was completely my error for remaining in PHP 7 during development. I apologize for the mistake.

This code is being buttoned up for 3.0.2.04. It should be ready and uploaded after a little more testing.
 

LPH

Flight Director
Flight Instructor
After lots of fussing for the day / evening ...

The list links properly but there is only the single column. Since I stink at CSS, my attempts for two columns failed. A quick Google search didn't turn anything up either for getting submenus in the WordPress Toolbar to be two columns.

The Inbox and Alerts link but do not open up to pull downs.

Screen Shot 2016-03-05 at 9.55.29 PM.png

A developer explained tonight that &$this in the add_action can lead to problems for people using PHP 5.4. All 50 locations were changed to $this for the hooks.
 

LPH

Flight Director
Flight Instructor
The Toolbar CSS is now showing two columns below the opening under the username. It does not match the XenForo drop down in terms of showing an avatar but it's better than a single column. Next up is trying to figure out how to get the Inbox to drop down conversations. That should be an interesting trick in which I have no idea how to code it.

Screen Shot 2016-03-06 at 8.41.50 PM.png
 

LPH

Flight Director
Flight Instructor
Grading period ended Friday and most of my attention has focused on getting students their grades. However, I spent a little time setting up Dreamweaver to see if my CSS could be improved. It's pretty much a little detour but I wanted to get the login portion of the new Toolbar code looking better. Unfortunately, DW interpreting things hasn't been smooth.

Work on the popular widget also started. It needs to be updated to match the look of the forum widget (avatars, etc).
 

LPH

Flight Director
Flight Instructor
I've finally recovered from "Open House" on Thursday and the Friday "Pep Rally" that has kept me from being on this site.

Version 3.0.2.05 is on a local environment:

Code:
Upgraded Redux Framework v3.5.9
Tested with WordPress 4.5-beta3
Improved Popular Thread Widget; now shows avatars
Cleaned up XenWord Settings panel for WordPress Toolbar settings 
Code changes to Toolbar Login; double column under username. 
Placed Toolbar CSS code into xenword-admin.css

This code isn't being released yet until uploaded and tested on this site.
 

LPH

Flight Director
Flight Instructor
Featured Forum Widget needed lots of attention. Styling is now in the xenword-public.css and the correct information is being added to match the forums.

Below is an image of the widget sitting on the front page of Tux Reports.

Screen Shot 2016-03-12 at 11.18.16 PM.png
 

LPH

Flight Director
Flight Instructor
Turned on debug and two widgets were tossing undefined index errors and the display.php code was returning a notice if a variable returned NULL. All notices were fixed in 3.0.2.07. You shouldn't see these unless you turn on debug.

The last week has been very challenging regarding people not checking their domain settings. This has cost hours of tech support, and frustrated many new plugin owners. I'm thinking of adding code to check if the domains match, and if not, then not allow the plugin to be activated. I'm not sure how to proceed on it.

Update: Just before going to bed, I found an article on how to build Tabbed areas using CSS. This was built using the CSS provided in the article. The widget needs adjustment, and the code for putting in the latest and popular threads. Still -- it has possibilities.

Screen Shot 2016-03-15 at 10.41.29 PM.png
 
Last edited:

LPH

Flight Director
Flight Instructor
Can you try to mimic the way it is done on the XenForo side?

This is the goal but the widget was stripped out and restarted. The CSS is still the main issue. I may have to learn jQuery after all.

Today was spent on the PHP / CSS of the Featured Forum Widget. This took lots of time to insert in new span classes.

Screen Shot 2016-03-19 at 4.45.10 PM.png

I'm stopping for the evening and going to watch some CSS video tutorials.
 

LPH

Flight Director
Flight Instructor
Decided to rip apart the Tab Widget and try another approach. This one uses jQuery.

Code:
        <script>
            jQuery(document).ready(function(){
                jQuery(".widget.widget_tabs#<?php echo $args['widget_id']; ?> .tab_container").hide();
                jQuery(".widget.widget_tabs#<?php echo $args['widget_id']; ?> ul.tabs_nav li:first").addClass("active").show();
                jQuery(".widget.widget_tabs#<?php echo $args['widget_id']; ?> .tab_container:first").show();
                jQuery(".widget.widget_tabs#<?php echo $args['widget_id']; ?> ul.tabs_nav li").click(function() {
                    jQuery(".widget.widget_tabs#<?php echo $args['widget_id']; ?> ul.tabs_nav li").removeClass("active");
                    jQuery(this).addClass("active");
                    jQuery(".widget.widget_tabs#<?php echo $args['widget_id']; ?> .tab_container").hide();
                    var activeTab = jQuery(this).find("a").attr("href");
                    jQuery(activeTab).fadeIn('fast');
                    return false;
                });
            });
        </script>

This is the result of the widget after some tweaking of the CSS. The PHP needs a little more work, and the backend form is not built properly for the webmaster to choose options.

 

LPH

Flight Director
Flight Instructor
Ended the weekend putting together some changes in the "Online Users Widget." Added some CSS as well as avatars.

Here is a look at the widget on Tux Reports.

Screen Shot 2016-03-20 at 11.54.04 PM.png

The CSS isn't perfect if there is only one member online and I haven't tested this beyond a few people being on at the same time.
 

LPH

Flight Director
Flight Instructor
Spent the evening watching the first parts of the the video Making Sense of the CSS Box Model. On a scale of 1-10, with 1 being unacceptable, my CSS skills are negative 10. After watching an hour of the tutorial, it's becoming more clear how div, span, id and class elements need to be inserted into XenWord widgets so that the design is easier.

Next, I keep revisiting the idea that the CSS needs to be editable from within the XenWord panel. This would allow the CSS to be placed in a database and not lost during plugin upgrades. I have no idea how this would be done.

https://docs.reduxframework.com/core/advanced/updating-a-css-file-dynamically/
 

LPH

Flight Director
Flight Instructor
It was surprisingly easy to make a "Top Posters" widget. This has been added to the 3.0.3.01 alpha. Two options are in the backend: limit the number of members to show and show the number of days. The CSS is the same as the online users widget.

Both the online users widget and top posters widget link the avatars to the member's profile.

Screen Shot 2016-03-25 at 10.54.16 PM.png
 

LPH

Flight Director
Flight Instructor
Decided to make a Staff Online widget. This uses to is_admin field from XenForo. CSS is the same as the online users widget.

Screen Shot 2016-03-25 at 11.47.30 PM.png
 

LPH

Flight Director
Flight Instructor
One last change before going to bed. The order in the featured forum widget was changed to 'last_post_date' and the relative time is now being used.

Featured Forum Change Sort Order.png

Time for sleep.
 

LPH

Flight Director
Flight Instructor
Twelve hours of sitting in front of PhpStorm and my eyes hurt. Let's start with the major focus of the day. The bug report on display.php has been bothering me for quite some time but I kept focusing on the array_diff. It turns out multiple issues were happening.

Using the WordPress Database Reset plugin, I wiped out the WordPress development database and started over. This helped identify some issues.

It turns out there were several issues in the file:

1. The conditional to check on comments with XF_post_id needed to be properly updated to the commentmeta table. The conditional was wrong and caused an overwriting of the comment meta post_id to zero. This was found yesterday but confirmed after my combing through the code and trying different variations.

2. I named a variable the same in two places but it had two different meanings. This caused all types of confusion. It also meant the WP comments array wouldn't show. It's also why the array_diff was never working properly and why older comments weren't showing !

-- I need to figure out how to name the variables in display.php so they have meaning. $comments and $comment are too common. There needs to be better clarity.

3. I left out the merge and forgot to record it. After thinking about it, the plan during Christmas break was to write those comments to XenForo if a thread existed. This is still the plan but see my approach caused issues, bad planning on my part.

4. The conditional strtotime for $this_comment->comment_date_gmt was written wrong. The end parenthesis was in the wrong place. This meant older comments done prior to installing the bridge didn't show even after fixing my variable naming mess.

5. This leaves the count.php written incorrectly because a count of zero will show whenever there is an older WP comment.

The current status of display.php file is now ripped apart. It functions on my local drive and I have to figure out if it is better to bundle up the bug fixes into 3.0.3.02 and get it out to everyone or keep working on the display.php tomorrow. Personally, this error is pretty severe and I'm favoring a bug fix release.
 
Status
Not open for further replies.
Top