81
zyspec
Re: PHP code in blocks
  • 2017/7/18 16:32

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Which version of XOOPS are you using?

If you're using XOOPS 2.5.8 or 2.5.9 you should be able to go to:
http://<yoursite.com>/modules/system/admin.php?fct=blocksadmin&op=add
and see the following fields: Block Type, Weight,, Visible, Visible in, Title, Content, Content Type, Cache lifetime, and Groups.



82
zyspec
Re: PHP code in blocks
  • 2017/7/18 14:27

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Yes, you can do this. Just create a custom block (go to Admin->Modules->System->Blocks in the admin control panel). Select 'Add Block' button. Near the bottom of the page just change Content Type to PHP Script. You can enter your PHP script in the Content field.



83
zyspec
Re: Our Website is on PHP 7.1
  • 2017/7/6 17:51

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


There are currently some "hidden" functions in SMARTFAQ since the main menu isn't being used. For example there's no way to submit a new question:
https://xoops.org/modules/smartfaq/request.php?op=add

or to provide an answer:
https://xoops.org/modules/smartfaq/open_index.php



84
zyspec
Re: Our Website is on PHP 7.1
  • 2017/7/1 16:28

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Thanks Michael,

One of the things that would help is if some of the links at the bottom of the page were updated so they 'work'. It's difficult to tell what modules, etc. don't work since we can't get to many of the features.



85
zyspec
Re: MastopGo2 & XOOPS 2.5.9
  • 2017/6/22 21:48

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


This is caused because MastopGo2 uses the PHP4 class construct method(s) instead of using the PHP5 __construct() method. The PHP4 access method was removed in the XoopsFormSelect class in XOOPS 2.5.9. This particular problem can be resolved by replacing line 38 in ./class/formimage.php.
Change from:
$this->XoopsFormSelect($caption$name$value);

with:
parent::__construct($caption$name$value);



86
zyspec
Re: Comments per page / News
  • 2017/6/12 23:00

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


@Hadesteam,

I think this changes the rendering of comments in FLAT mode to only show the number of comments based on the setting in System Config...

In ./include/comment_view.php change lines 75-81 from:
if ($com_mode == 'flat') {
    
$comments $comment_handler->getByItemId($xoopsModule->getVar('mid'), $com_itemid$com_dborder);
    include_once 
$GLOBALS['xoops']->path('class/commentrenderer.php');
    
$renderer =& XoopsCommentRenderer::instance($xoopsTpl);
    
$renderer->setComments($comments);
    
$renderer->renderFlatView($admin_view);
} elseif (
$com_mode == 'thread') {


to:
if ($com_mode == 'flat') {
    
$module_handler xoops_getHandler('module');
    
$sys_module     $module_handler->getByDirname('system');
    
$config_handler xoops_getHandler('config');
    
$sys_config     $config_handler->getConfigsByCat(0$sys_module->getVar('mid'));
    
$comments $comment_handler->getByItemId($xoopsModule->getVar('mid'), $com_itemid$com_dbordernull, (int)$sys_config['comments_pager']);
    include_once 
$GLOBALS['xoops']->path('class/commentrenderer.php');
    
$renderer =& XoopsCommentRenderer::instance($xoopsTpl);
    
$renderer->setComments($comments);
    
$renderer->renderFlatView($admin_view);
} elseif (
$com_mode == 'thread') {


Hopefully we got it fixed this time.



87
zyspec
Re: Comments per page / News
  • 2017/5/27 16:27

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Thanks @Hadesteam...

I will look into this a little further although I'm only able to look at this a little bit as I'll be "out of touch" for most of the next 10 days.



88
zyspec
Re: Comments per page / News
  • 2017/5/26 16:19

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Hmmm, would it be possible for you to do the following?
* Temporarily turn on the inline debugger (Administration->Preferences->System Options->General Settings and then set 'Debug Mode' to 'Enable Debug (inline mode)')
* Load the page and then click 'Queries' at the bottom of the page.
* Copy the query text and either post it here or send me a PM so I can see what database queries are being run.
* Also look at the 'Errors' tab at the bottom of the page to make sure that there aren't any PHP errors being displayed.
* Turn debug off again



89
zyspec
Re: user management - change username to realname ?
  • 2017/5/26 14:17

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Quote:

blackrx wrote:
yes its working

thank you zyspec

will be great if the search box can search name instead of username

i'm using XOOPS in an Intranet environment in my small office

it is a closed site with manual registration and all user are registered using their staff ID...

hopefully XOOPS can implement change username to real name in setting so we dont have to changes files manually...


@blackrx,

Note: I haven't actually tried this but this should work.

You can try to modify the search box by changing lines 788 - 793 in ./modules/system/admin/users/main.php from:
$user_uname = (!isset($_REQUEST['user_uname'])) ? '' $_REQUEST['user_uname'];
//Form tris
$form '<form action="admin.php?fct=users" method="post">
          ' 
_AM_SYSTEM_USERS_SEARCH_USER '<input type="text" name="user_uname" value="' myts->htmlSpecialChars($user_uname) . '" size="15">
        <select name="selgroups">
        <option value="" selected>' 
_AM_SYSTEM_USERS_ALLGROUP '</option>';

to replace 'user_uname' with 'user_name' like:
$user_name = (!isset($_REQUEST['user_name'])) ? '' $_REQUEST['user_name'];
//Form tris
$form '<form action="admin.php?fct=users" method="post">
          ' 
_AM_SYSTEM_USERS_SEARCH_USER '<input type="text" name="user_name" value="' $myts->htmlSpecialChars($user_name) . '" size="15">
        <select name="selgroups">
        <option value="" selected>' 
_AM_SYSTEM_USERS_ALLGROUP '</option>';


Once again, don't forget to flush the template cache or you won't see the results immediately.



90
zyspec
Re: user management - change username to realname ?
  • 2017/5/26 1:49

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Since I'm not sure which version of XOOPS you're using here's an example of what you would do for XOOPS 2.5.9

in ./modules/system/templates/admin/system_users.tpl - line 46 should look like:
Quote:
<td class="txtcenter"><a title="<{$users.uname}>" href="<{$xoops_url}>/userinfo.php?uid=<{$users.uid}>"><{$users.uname}></a></td>


just replace both occurances of $users.uname with $users.name - like:
Quote:
<td class="txtcenter"><a title="<{$users.name}>" href="<{$xoops_url}>/userinfo.php?uid=<{$users.uid}>"><{$users.name}></a></td>


Don't forget - after you make the change you'll need to clear the template cache or else you won't see the change take affect until after the cache expires. The change above also does not change the "Search User" box so it will still try and find the uname (nickname) and not the real name. I'd have to dig a little deeper to see what it would take to change the search box too.




TopTop
« 1 ... 6 7 8 (9) 10 11 12 ... 100 »



Login

Who's Online

235 user(s) are online (156 user(s) are browsing Support Forums)


Members: 0


Guests: 235


more...

Donat-O-Meter

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

Latest GitHub Commits