1
hammondr
Re: How to make initial XOOPS URL friendlier
  • 2006/5/1 0:12

  • hammondr

  • Just popping in

  • Posts: 9

  • Since: 2005/9/15


That makes sense, hyperpd. Thanks!



2
hammondr
How to make initial XOOPS URL 'friendlier'
  • 2006/4/30 20:14

  • hammondr

  • Just popping in

  • Posts: 9

  • Since: 2005/9/15


I would like the initial page my users come to to be simple, like "http://www.mydomain.com/". When I have the AMS module (or any module, I think) as the default module, references to http://www.mydomain.com/ are automatically redirected to http://www.mydomain.com/modules/AMS/.

I'd like the behavior to be similar to what https://xoops.org/ does ... no "/modules/XXXX/" in the URL. How can I do this?



3
hammondr
Re: Rendering a block _inside_ a custom module
  • 2006/4/3 4:26

  • hammondr

  • Just popping in

  • Posts: 9

  • Since: 2005/9/15


solution:
if ($block b_extcal_minical_show ($options)) {
    
$xoopsTpl->xoops_setCaching(0);
    
$xoopsTpl->assign('block'$block);
    
$xoopsTpl->display(XOOPS_ROOT_PATH."/modules/extcal/templates/blocks/extcal_block_minical.html") ;
}

<
snip>

if (
$block b_extcal_upcoming_show ($options)) {
    
$xoopsTpl->xoops_setCaching(0);
    
$xoopsTpl->assign('block'$block);
    
$xoopsTpl->display(XOOPS_ROOT_PATH."/modules/extcal/templates/blocks/extcal_block_upcoming.html") ;
}


This allows me to insert multiple blocks inline in single page.



4
hammondr
Rendering a block _inside_ a custom module
  • 2006/4/3 4:02

  • hammondr

  • Just popping in

  • Posts: 9

  • Since: 2005/9/15


Does anyone know how I can render a few blocks from one module inside a page in a custom module? Here's the scenario:

I have written a very simple custom module that has only one functional page: index.php. In this page, I want to display blocks from other modules embedded in the module body, rather than in the XOOPS left- or right-hand columns. In other words, I want to display the contents of some blocks inline, without relying on a XOOPS theme or the XOOPS admin->blocks to position blocks.

For example, I can place the following code in my module index.php to display a mini calendar from the extcal module:

require_once (XOOPS_ROOT_PATH.'/modules/extcal/blocks/extcal_blocks.php');

if (
$block b_extcal_minical_show ($options)) {
    
$GLOBALS['xoopsOption']['template_main'] = 'extcal_block_minical.html';
    
$xoopsTpl->assign('block'$block);
}


However, I can't do that again later in the same file, like so:
if ($block b_extcal_minical_show ($options)) {
    
$GLOBALS['xoopsOption']['template_main'] = 'extcal_block_upcoming.html';
    
$xoopsTpl->assign('block'$block);
}


My guess is that setting the 'template_main' key can only be done once per page. How can I modify my code to display more than one block?



5
hammondr
Re: urgent help me please : groups_users_link table was emptied!!!!!
  • 2006/3/13 13:22

  • hammondr

  • Just popping in

  • Posts: 9

  • Since: 2005/9/15


Quote:

Herko Coomans wrote:
Quote:

hammondr wrote:
I did as others have done by adding a new row to that table that puts me in the webmasters group. However, I am very concerned about this. This doesn't seem like a 'fluke' or MySQL problem, since all other tables seem unaffected.

I think you're giving the answer yourselves: all of you added a new row manually, and this somehow causes the whole table to be emptied. Why not add a user the regular way?
If preventing manually added data is a security hole, then what are we trying to protect?
Herko


Herko... I added the row to the table manually *because* it was emptied by what seems like a security flaw. If that table is empty, no one is in any permission groups, so no one is a webmaster, so no one can put users into groups via the administrative panel. Make sense?



6
hammondr
Re: urgent help me please : groups_users_link table was emptied!!!!!
  • 2006/3/13 13:08

  • hammondr

  • Just popping in

  • Posts: 9

  • Since: 2005/9/15


This phenomenon happened to me last night. I'm almost positive this is NOT caused by the custom session option. We have not used that feature, and have been running since Oct 2005.

Last night, inexplicably, the groups_users_link table was emptied. After I found the problem, I had to manually add a new row to that table that puts me in the webmasters group so I could log into the site to troublshoot. Many of your users won't know to do this.

I am very concerned about this. This doesn't seem like a 'fluke' or MySQL problem, since all other tables seem unaffected. I upgraded to 2.2.4 (by using the xoops-2.2.3a-to-2.2.4.zip patch file found on this site, I think) within the last few weeks. Server is FreeBSD.

This smells a lot like a security bug/hack to me.



7
hammondr
Re: CBB forum, big problem
  • 2005/9/15 13:06

  • hammondr

  • Just popping in

  • Posts: 9

  • Since: 2005/9/15


Oops ... I forgot to mention the other filename with that last bug. The file that uses the $indeximage_select->setExtra business is admin/admin_cat_manager.php, in the function editCategory().



8
hammondr
Re: CBB forum, big problem
  • 2005/9/15 13:01

  • hammondr

  • Just popping in

  • Posts: 9

  • Since: 2005/9/15


Update:

mainfile.php (in the XOOPS root) defines the constants XOOPS_URL and XOOPS_ROOT_PATH. Most people probably have a value in XOOPS_URL liks "/xoops/html". However, since I am using a test subdomain, which points directly to my xoops/html directory, my XOOPS_URL is '' (empty string). These problems are happening w/ newbb because XOOPS_URL is ''.

So, the problem is not exactly with the lines I pasted earlier, although that will fix the problem, too. The 'real' problem is the str_replace line just about the lines I pasted here.

The str_replace doesn't work when XOOPS_URL is empty. The newbb module is trying to provide a real pathname to file_exists() and getimagesize(), but the str_replace has no effect. Again, I think this will only cause problems when XOOPS_URL is ''.

Add some logic around your str_replace like this, and see if that works, too.

[in include/functions.php]
Quote:
.
.
.
$image .= '.'.$image_type;

// 2005-09-14: REH: added logic to test for XOOPS_URL. Without it, the str_replace has no effect when
// XOOPS_URL is empty.
if (XOOPS_URL != '') {
$imageuri=str_replace(XOOPS_URL,XOOPS_ROOT_PATH,$image);
} else {
$imageuri= XOOPS_ROOT_PATH.$image;
}

if(file_exists($imageuri)){
$size=@getimagesize($imageuri);
.
.
.


The file also has a snafu like this one. Look for the line:
Quote:
$indeximage_select->setExtra("onchange=\"showImgSelected('img', 'indeximage', '/".$imgdir."/', '', '" . XOOPS_URL . "')\"")


and replace that line with this:
Quote:
// 2005-09-14: REH: added logic to test for XOOPS_URL. Without it, the str_replace has no effect when
// XOOPS_URL is empty.
if (XOOPS_URL != '') {
$indeximage_select->setExtra("onchange=\"showImgSelected('img', 'indeximage', '/".$imgdir."/', '', '" . XOOPS_URL . "')\"")
;
} else {
$indeximage_select->setExtra("onchange=\"showImgSelected('img', 'indeximage', '/".$imgdir."/', '', '../../..')\"");
}


The magic is in that last line. Note: This only works for me since '../../..' gets me back to the XOOPS root from where I have this module installed. your mileage may vary. Hopefully the author can patch the module so we can get rid of my spaghetti code. .



9
hammondr
Re: CBB forum, big problem
  • 2005/9/15 3:57

  • hammondr

  • Just popping in

  • Posts: 9

  • Since: 2005/9/15


Ok, here is the fix. I don't know what the cause of the problem is, but at least I figured out the solution. :)

edit modules/newbb/include/functions.php

Find the lines:
if(file_exists($imageuri)){
$size=@getimagesize($imageuri);

and modify them to say:
if(file_exists(XOOPS_ROOT_PATH.$imageuri)){
$size=@getimagesize(XOOPS_ROOT_PATH.$imageuri);

I am a 2-day newbie to XOOPS and cbb, but I know this: for some reason, imageuri does not include the full XOOPS path. files_exists is crapping on the bogus path name (like '/modules/newbb/images/blah.gif') when it expects the full unix path.

Maybe someone smarter than me can find out why?




TopTop



Login

Who's Online

50 user(s) are online (19 user(s) are browsing Support Forums)


Members: 0


Guests: 50


more...

Donat-O-Meter

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

Latest GitHub Commits