971
BigKev73
Re: NewBB 5.01 Beta 3 (XOOPS 2.5.11, PHP 7.2 - 8.0)
  • 2021/2/15 15:24

  • BigKev73

  • Just popping in

  • Posts: 13

  • Since: 2021/1/26


You're welcome. Downloading now and will run a compare to my base to see if I missed any changes I needed to commit.



972
alain01
Re: PR Add two new events (#941)
  • 2021/2/15 12:34

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


Ok, for flexibility, nice !
Let me know in this subject when you will use this fonction in a module (other than mtools).

This is very interesting!



973
Mamba
Re: PR Add two new events (#941)
  • 2021/2/15 11:47

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


Reg. the (2) - core.class.template.new event

Till now, in order to use Smarty plugins, they had to be placed in the Core:

htdocs/class/smarty/xoops_plugins /

Now, you'll be able to place your custom Smarty plugins in your module directly, so it will allow for more flexibility, as the users won't need to copy the plugin manually to the Core. As Richard stated:

Quote:
This event is triggered when a new XoopsTpl (an extended Smarty object) is created. This allows customization of the Smarty environment from within a module.

MTools was just a module where I wanted to use this particular plugin, but now you will be able to use any custom Smarty plugin in any of your modules.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



974
alain01
PR Add two new events (#941)
  • 2021/2/15 8:48

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


"Add two new events": https://github.com/XOOPS/XoopsCore25/pull/941
Please could you give more explanation ?

1 - First event : core.include.common.auth.success
Quote:
Event is triggered when the establishment, or re-establishment, of the current user is complete.
At this point valid security decisions can be made based on the state of the current user.

Does it means, after that, you could launch action for the user ?
An example please ?
How XOOPS did it before ?

2 - core.class.template.new event
Quote:
This event is triggered when a new XoopsTpl (an extended Smarty object) is created. This allows customization of the Smarty environment from within a module.

One possible use would be to support a module based plugin library. An simplified example event listener:

public static function eventCoreClassTemplateNew($arg)
{
    
$smartyObject $arg[0];
    
$smartyObject->plugins_dir[] = __DIR__;
}

and Mamba continues with this :
Smarty Translate function: https://github.com/XOOPS/XoopsCore25/pull/840/files

function smarty_function_translate($params$smarty)
{
    function 
smarty_function_translate($params$smarty)
    {
            
$key     = isset($params['key']) ? $params['key'] : '';
            
$dirname = isset($params['dir']) ? $params['dir'] : ''//Mtools
            
$utility '\Xoopsmodules\' ucfirst($dirname) . '\Utility';
            return     
$utility::translate($key$dirname);
    }
}


I read "Mtools", so it's a method to use plugin from Mtools in modules ?
Like XMF, but it's another thing, another way ?

Please, could you explain that for a non developper like me ?
Thank you !

Alain



975
Mamba
NewBB 5.01 Beta 3 (XOOPS 2.5.11, PHP 7.2 - 8.0)
  • 2021/2/15 3:05

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


Resized Image

The NewBB 5.01 Beta 3 is now available for testing, forking, and improvement contributions! You can help us with testing and improvements.

Big THANK YOU to BigKev73 for his several improvements/fixes!

DOWNLOAD: https://github.com/XoopsModules25x/newbb/releases

FORK: You can fork it from GitHub: https://github.com/XoopsModules25x/newbb/

Note: After download, rename the folder from "newbb-master" to "newbb"

WARNING: Do NOT use it in production installation, this is only for testing

Minimum requirements:
XOOPS 2.5.10 (for testing we recommend the upcoming XOOPS 2.5.11)
PHP 5.7.2+ (tested with PHP 8)
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



976
Mamba
xForms 2.0 Alpha 3 Released for Testing
  • 2021/2/15 0:09

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


Resized Image

xForms 2.0 Alpha 1 released for testing/contributions!

This module is used to create forms to collect user input.

It's an Alpha release, so expect bugs, but you can help us in discovering and fixing them!

DOWNLOAD: https://github.com/XoopsModules25x/xforms/releases

FORK: https://github.com/XoopsModules25x/mycredits/

ISSUES/BUGS: Please report all issues on GitHub

REQUIREMENTS:
- XOOPS 2.5.10
- PHP 7+

It was tested on PHP 8.02 and MySQL 8.0.23
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



977
Mamba
myCredits 2.0 Beta 1 Released for Testing
  • 2021/2/12 20:37

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


Resized Image


myCredits 2.0 Beta 1 released for testing/contributions!

This module allows to automatically display the list of all the modules installed on your site, and so, display the recognition to each and every developer who has directly or indirectly contributed to your web project.

DOWNLOAD: https://github.com/mambax7/mycredits/releases

FORK: https://github.com/mambax7/mycredits/

ISSUES/BUGS: Please report all issues on GitHub

REQUIREMENTS:
- XOOPS 2.5.10
- PHP 7+

Tested on PHP 7.4.15 and PHP 8.02
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



978
alain01
Re: Changing Site Logo and Welcome Message with the Holiday
  • 2021/2/12 9:58

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


Hi Kev,
2 remarks,

- Add a directory images in the theme, better than in the root theme directory
- If we want to generalize your code, we should take into account the international and geographic aspect of the dates.
Example 1:The holidays are not all at the same time depending on the country, depending on the region (3 different zones in France),
Example 2: certain holidays do not exist in certain countries (July 4 in the United States, July 14 in France)

I dont find xoops smarty date to transform your php code in template files with smarty tests but I'm not a specialist.

Alain01



979
Mamba
Re: Changing Site Logo and Welcome Message with the Holiday
  • 2021/2/11 4:36

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


Very cool!

I hope, one of our theme designers will be able to use it.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs



980
BigKev73
Changing Site Logo and Welcome Message with the Holiday
  • 2021/2/10 22:59

  • BigKev73

  • Just popping in

  • Posts: 13

  • Since: 2021/1/26


I made this change awile ago, but thought I would share it. This is pretty much a change to the default theme header. This is the change I made to theme.tpl to the header section.


<
table cellspacing="0">
    <
tr id="header">
        <
td id="headerlogo"><a href="<{xoAppUrl /}>" title="<{$xoops_sitename}>"><{php}>
                  
//This is used to calculate the various holidays and change the main Banner Logo Appropriately
                    
$currentYear date("Y");
                
$day date("j");
                
$mnth date("n");
                
                              
//Used to Calculate floating Holidays
                
$easterday date("j"easter_date($currentYear));  
                
$eastermnth date("n"easter_date($currentYear));  
                
$edaystart = ($easterday 7);
                
$edaystop = ($easterday 2);
                if (
$edaystart<) {$edaystart 1;}
                if (
$edaystop>31 ) {$edaystop 31;}
                
                
$turkeyDay date('j'strtotime("november $currentYear fourth thursday"));
                
$turkeyStart = ($turkeyDay 7);
                
$turkeyStop = ($turkeyDay 2);
                
                               
//Normal Image
                                
$HolidayMsg "Hello";
                
$logofile $this->_tpl_vars['xoops_imageurl']. "logo_normal.jpg";
                
                
//XMAS
                
if ($mnth == "12" AND $day <= 29){
                    
$logofile $this->_tpl_vars['xoops_imageurl']. "logo_xmas.jpg";
                    
$HolidayMsg "Merry Christmas";
                }else if (
$mnth == "11" AND $day $turkeyStop ) {
                       
$logofile $this->_tpl_vars['xoops_imageurl']. "logo_xmas.jpg";
                    
$HolidayMsg "Merry Christmas";
                
                               
//NYE    
                
}else if ($mnth == "12" AND $day 29) {
                       
$logofile $this->_tpl_vars['xoops_imageurl']. "logo_newyears.jpg";
                    
$HolidayMsg "Happy New Years";
                }else if (
$mnth == "1" AND $day 7) {
                    
$logofile $this->_tpl_vars['xoops_imageurl']. "logo_newyears.jpg";
                    
$HolidayMsg "Happy New Years";
                
                               
//St Pattys Day
                
}else if ($mnth == "3" AND $day 10 AND $day <= 19){
                         
$logofile $this->_tpl_vars['xoops_imageurl']. "logo_stpattys.jpg";
                    
$HolidayMsg "Happy St. Patty's Day";
                
                               
//Easter
                
}else if ($mnth == $eastermnth AND $day >= $edaystart and $day <= $edaystop){
                    
$logofile $this->_tpl_vars['xoops_imageurl']. "logo_easter.jpg";
                    
$HolidayMsg "Happy Easter";
                
                               
//4th July
                
}else if ($mnth == "6" AND $day >= 28){
                    
$logofile $this->_tpl_vars['xoops_imageurl']. "logo_4thjuly.jpg";
                    
$HolidayMsg "Happy 4th of July";
                }else if (
$mnth == "7" AND $day <= 6){
                    
$logofile $this->_tpl_vars['xoops_imageurl']. "logo_4thjuly.jpg";
                    
$HolidayMsg "Happy 4th of July";
                
                               
//THANKSGIVING
                
}else if ($mnth == "11" AND $day >= $$turkeyStart AND $day <= $turkeyStop ) {
                       
$logofile $this->_tpl_vars['xoops_imageurl']. "logo_turkey.jpg";
                    
$HolidayMsg "Happy Thanksgiving";
                
                               
//Default Normal Logo
                
}else{
                    
$logofile $this->_tpl_vars['xoops_imageurl']. "logo_normal.jpg";
                     }
                echo 
'$logofile '"';    
<{/
php}> alt="<{$xoops_sitename}>"/>a>td>
        <
td id="headerbanner"><{$xoops_banner}>td>
    tr>
    <
tr>
        <
td id="headerbar" colspan="2" height="25" style="vertical-align: middle;"><FONT COLOR #0066FF> <{if $xoops_isuser}> <{php}>echo $HolidayMsg;<{/php}> <{$xoops_name}> and Welcome Back!  <{else}> <{php}>echo $HolidayMsg;<{/php}>! If you're new here, please register for a free account <{/if}> 
    
tr>
table>


This looks at the date, then changes the img src to the appropriate logo depending on the holiday. It changes a few days before the holiday and reset a few days after the holiday. It also changes the welcome message that appears in the header bar. Each of those images are basically my same site logo, with a different holiday theme added to it.

Hopefully, someone else finds this useful. I am sure there is a more SMARTY way of doing this. I just figured it was easier for me to inject PHP to handle it.




TopTop
« 1 ... 95 96 97 (98) 99 100 101 ... 29425 »



Login

Who's Online

680 user(s) are online (542 user(s) are browsing Support Forums)


Members: 0


Guests: 680


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits