xoops forums

Forum Index


Board index » All Posts (geekwright)




geekwright

Quite a regular
Posted on: 6/12 16:31
geekwright
geekwright (Show more)
Quite a regular
Posts: 218
Since: 2010/10/15
#1

Re: XOOPS 2.5.9 Notes for Theme Creators

We do accept offers of help

Quote:

aerograf wrote:
Thanks for the answer.
It's a pity that there is not. Will wait.


geekwright

Quite a regular
Posted on: 6/12 16:28
geekwright
geekwright (Show more)
Quite a regular
Posts: 218
Since: 2010/10/15
#2

Re: Default title for the news comments ?

Appears to be a small issue in XoopsModules25x/publisher

Quote:

Bleekk wrote:
Yes you are right.
I hope some of the other developers can help me here


geekwright

Quite a regular
Posted on: 6/12 14:52
geekwright
geekwright (Show more)
Quite a regular
Posts: 218
Since: 2010/10/15
#3

Re: XOOPS 2.5.9 Notes for Theme Creators

Not yet, just this change notification.

Quote:

aerograf wrote:
Is there an updated XOOPS documentation describing the built-in codes and functions?


geekwright

Quite a regular
Posted on: 6/7 11:08
geekwright
geekwright (Show more)
Quite a regular
Posts: 218
Since: 2010/10/15
#4

Re: XOOPS 2.5.9 Notes for Theme Creators

Quote:

Bleekk wrote:
...
Is it possible to create a way so users can add blocks to a module without changing the module itself.
...


That sounds very useful. I'll give that some thought, and see what we could do to implement that.


geekwright

Quite a regular
Posted on: 6/6 14:51
geekwright
geekwright (Show more)
Quite a regular
Posts: 218
Since: 2010/10/15
#5

Re: Language in js

There are several ways you might accomplish this, depending on the exact requirements.

Here is an example from XOOPS 2.5.9, where the image manager code sets up to use the fine-uploader javascript. To do this, we used javascript in a script tag in a Smarty template to initialize the library code, passing in all the required language constants. In the template we can use the language constants as normal -- Smarty will do the substitution in the script code just like it will in HTML.

See the code here, on GitHub:
https://github.com/geekwright/XoopsCor ... tem_imagemanager2.tpl#L52


geekwright

Quite a regular
Posted on: 6/6 12:39
geekwright
geekwright (Show more)
Quite a regular
Posts: 218
Since: 2010/10/15
#6

XOOPS 2.5.9 Notes for Theme Creators

This is a quick overview of some new things that are introduced in XOOPS 2.5.9 that Theme Creators should know about.

Form Renderer

In XOOPS 2.5.9 we have added a XoopsFormRenderer class, and a XoopsFormRendererInterface interface. The XoopsFormRendererInterface defines the final stage of form rendering, allowing the elements to be tailored to better adapt to the theme. XOOPS 2.5.9 ships with two implementations, XoopsFormRendererLegacy which matches the traditional XOOPS form rendering, and XoopsFormRendererBootstrap3 which uses Bootstrap classes to declare the form elements.

By default, XOOPS 2.5.9 will use the Legacy renderer. A theme can choose to use the Bootstrap3 renderer by including a file named theme_autorun.php in its top directory, as is done in the xbootstrap theme, containing the following:

<?php
xoops_load
('XoopsFormRendererBootstrap3');
XoopsFormRenderer::getInstance()->set(new XoopsFormRendererBootstrap3());


New Smarty variables added in XOOPS 2.5.9


$xoops_page contains a condensed version of the current page name. For example, for http://myurl/index.php, $xoops_page would be "index". For http://myurl/modules/profile/edituser.php, $xoops_page would be "profile/edituser".

$xoops_startpage contains the module configured as the start page, or "system" if no module is selected.

A "rendered" key is now set by XoopForm assign() method

Some scripts use the assign() method as an alternative to the display() method. This method assigns the form details to a stem variable named with the form's name. This assignment is done with code that looks like this:

$form->assign($GLOBALS['xoopsTpl']);

This technique has often been done to give the theme more control over the display of the form. It requires the template to loop through the individual form elements, and decide how to display it. This level of control is good if you need it, but can be a nuisance if you just want to position the form inside the page, and you would prefer the system to handle the details.

As of XOOPS 2.5.9, when the program uses the $form->assign() method, an additional stem variable, 'rendered', will be available. Instead of iterating over the 'elements' portion to build the form from pieces, you can simply display 'rendered' to use the system provided rendering:

<{$form_item.rendered}>



Compatibility Breaks

Changes needed to existing profile module override templates

In the profile module, the profile_userinfo.tpl template creates an entire form to provide an activate/deactivate user button. Unfortunately, this form should have a security token. You can see an example of this in the XOOPS 2.5.9 htdocs/modules/profile/templates/profile_userinfo.tpl file at line 54:

<{securityToken}>


Without this change, the button will not work in XOOPS 2.5.9. We try to avoid this kind of compatibility break, but in this case it is necessary.


geekwright

Quite a regular
Posted on: 5/22 21:39
geekwright
geekwright (Show more)
Quite a regular
Posts: 218
Since: 2010/10/15
#7

Re: Google structured data - search box code modification

Schema.org linked data separated from the HTML -- very interesting stuff.


geekwright

Quite a regular
Posted on: 5/1 11:54
geekwright
geekwright (Show more)
Quite a regular
Posts: 218
Since: 2010/10/15
#8

Re: enable https ssl for entire site

First, Chrome 56 is discontinued. Chrome 58 is current for all platforms. I cannot replicate the problem you reported using a current version of Chrome. I recall seeing a notice in the past that came from a "post" (rather than "get") method search box, but that no longer seems to be an issue. Perhaps that was one of the numerous issues fixed since version 56.

Second, the change you suggest does not improve the security/risk potential in any way. The field still exists, and is still is being transported the same way.


geekwright

Quite a regular
Posted on: 4/25 21:16
geekwright
geekwright (Show more)
Quite a regular
Posts: 218
Since: 2010/10/15
#9

Switching to https

Switching the scheme an existing XOOPS installation from http to https is a common concern. XOOPS developers have been investigating ways we can assist in making this transition easier for the XOOPS webmasters everywhere. In this post we will introduce two new tools that can help us in achieving that goal.

Let's review the basic recommended process for switching a site from http to https:

Before you make any changes, make a backup! It may take a few minutes to download a copy of your site and its database, but those minutes are nothing compared to the hours it may take to recover from a mistake, or even worse losing all of your content. Do backups for safety before changing anything.

1) Enable SSL on your domain. To achieve this, you typically need to work with (or possibly change) your hosting provider to adjust the configuration and install the needed certificate. We really cannot help much with this layer, but it is a prerequisite to achieving the change to the https scheme.

2) Review the files that make up your site, both PHP code and templates, looking for explicit "http://" references. This may be easiest with an editor/IDE intended for developers - examples are any IntelliJ product, Eclipse, Sublime Text, Kate, Notepad++. The hardcore geek may find grep, sed and vi to be the best tools, but most of us will appreciate the GUI based search and replace across multiple files that these editors make available.

You need to identify and change (to https) any direct links into your site using http as well as any assets such as js, css or similar files directly loaded with an http URL. These can easily creep in with things such as CDN, sharing services, font servers. All these will need to be changed to https. Remember, what we want to change are links to our own site, and any assets which may be included when our site builds its pages. We don't need to change things like links to pages on other websites.

3) Update the XOOPS_URL definition in your site's mainfile.php to start with "https://" This will cause any URL's generated by XOOPS to start using the https scheme.

At this point, your site should be trying to use SSL, but will in all likelihood have issues -- broken images, errors and warnings in the browser console, etc. Don't worry, this is normal at this point.

4) Update any http links to resources on your site in your database. This can be a huge effort, and this is the focus of one of our new tools.

Interconnect/it has a product called Search-Replace-DB which can help with this. It comes with awareness of Wordpress and Drupal environments built in. As is, this tool can be very helpful, but it is even better when it is aware of your XOOPS. You can find a XOOPS aware version at https://github.com/geekwright/srdb

Follow the instructions in the README.md file to download and temporarily install this utility on your site. In step 3, we changed the XOOPS_URL define. When you run this tool, you want to replace the original XOOPS_URL definition with the new definition, i.e replace http://example.com with https://example.com

Enter your old and new URLs, and choose the dry run option. Review the changes, and if everything looks good, go for the live run option. This step will catch configuration items and links inside your content that refer to your site using http.

Another way to accomplish this step without the srdb tool would be to dump your database, edit the dump in a text editor changing the http URLs to https, and then reloading the database from your edited dump. Yes, that process is involved enough and carries enough risk that people were motivated to create specialized tools such as Search-Replace-DB.

5) Redirect any http traffic to your website to the https version. Since you can't go out and change everyone's bookmarks and links to your site, you will need to redirect these requests as they reach your site. Your webserver usually has the best tools to accomplish that. Your sever has the ability to establish rewrite rules that will redirect the traffic as appropriate. These will vary according to your exact server configuration. There are many tutorials and quick fix recipes out there.

If for some reason, you cannot use rewrite rules, there is a way to do the required redirection in XOOPS. We can accomplish this by adding some code to your mainfile.php file. The code we will be adding can be found at https://gist.github.com/geekwright/5cc0b93b41b9515b3f06ad3d6b9dd772

Add the code from that Gist (without the opening php tag) directly under the line in your mainfile.php that defines XOOPS_URL. Then, if the scheme of the current transaction does not match the scheme specified in XOOPS_URL, the current transaction will result in a 301 (Permanently Moved) redirect to the URL with the appropriate scheme.

With the 301 status return, search engine crawlers will quickly re-index your content, and existing indexed links will still lead to the correct content.

6) Clear caches in XOOPS and your browser, then test and enjoy your new SSL enabled site. Don't forget to remove srdb once you have verified everything is working.

7) Please share your experiences with the community so we can continue to make this easier for XOOPS webmasters!

XOOPS Resources:
srdb - https://github.com/geekwright/srdb
301 redirects in mainfile - https://gist.github.com/geekwright/5cc0b93b41b9515b3f06ad3d6b9dd772

Rewrite rules:
Apache - http://httpd.apache.org/docs/2.4/rewrite/
Nginx - https://www.nginx.com/blog/creating-nginx-rewrite-rules/
IIS - https://www.iis.net/learn/extensions/u ... or-the-url-rewrite-module


geekwright

Quite a regular
Posted on: 4/21 18:42
geekwright
geekwright (Show more)
Quite a regular
Posts: 218
Since: 2010/10/15
#10

Re: Profile module translation?

There is an example in xswatch in XOOPS 2.5.9 that you could adapt to what you need:
https://github.com/XOOPS/XoopsCore25/b ... atch/tpl/nav-menu.tpl#L16



TopTop
(1) 2 3 4 ... 13 »