11
Venezia
Re: Fix for: js calendar - first popup showing start date from setrange()
  • 2004/5/13 7:05

  • Venezia

  • Just popping in

  • Posts: 36

  • Since: 2003/6/24


Herko,

Should fixes such as these be posted directly to the XOOPS project tracker, or should they be posted here first? Or does it matter?

Venezia



12
Venezia
Re: categories and subcategories
  • 2004/5/13 4:39

  • Venezia

  • Just popping in

  • Posts: 36

  • Since: 2003/6/24


Nice to know there are other hapless deers out there besides myself :)



13
Venezia
xoopstree.php selbox - subcategories not ordered
  • 2004/5/13 3:42

  • Venezia

  • Just popping in

  • Posts: 36

  • Since: 2003/6/24


From the original post:

https://xoops.org/modules/newbb/viewtopic.php?topic_id=19822&forum=28

Bug: Selbox items are only ordered at root level.

Fix:

File:xoopstree.php,
Function: function makeMySelBox($title,$order="",$preset_id=0, $none=0, $sel_name="", $onchange="")

~line 170

Change from:

$arr = $this->getChildTreeArray($catid);

to:

$arr = $this->getChildTreeArray($catid, $order);

Explanation: Pass on the $order parameter to the getChildTreeArray() call.

Venezia







14
Venezia
Re: categories and subcategories
  • 2004/5/13 3:30

  • Venezia

  • Just popping in

  • Posts: 36

  • Since: 2003/6/24


It looks like the culprit is in the file XoopsTree.php. Take a look at the function makeMySelBox(). It uses the $order parameter to query the database for the root items but doesn't pass on the $order param to the getChildTreeArray() function.

So to fix it change the line ~170

from:

$arr = $this->getChildTreeArray($catid);

to:

$arr = $this->getChildTreeArray($catid, $order);

and it works nicely.

I'll also post this in the Bug Report forum.

Venezia



15
Venezia
Fix for: js calendar - first popup showing start date from setrange()
  • 2004/5/13 2:47

  • Venezia

  • Just popping in

  • Posts: 36

  • Since: 2003/6/24


At present the js Calendar used by XoopsFormTextDateSelect and XoopsFormDateTime pops up the first time showing the date for January 2000. Subsequent popups show the correct date.

FIX:

Filename: /include/calendarjs.php
Function: function showCalendar(id)

Suggested Code:

function showCalendar(id) {
var el = xoopsGetElementById(id);
if (calendar != null) {
calendar.hide();
} else {
var cal = new Calendar(true, <?php if (isset($jstime)) { echo 'new Date('.$jstime.')'; } else { echo 'null';}?>, selected, closeHandler);
calendar = cal;
cal.setRange(2000, 2015);
calendar.create();
}
calendar.sel = el;
calendar.parseDate(el.value);
calendar.showAtElement(el);
Calendar.addEvent(document, "mousedown", checkCalendar);
return false;
}

Explanation:
The only change is to move the parseDate() call to after the calendar has been set to point to the function's element id parameter.

The calendar's selected date is then set correctly whether the calendar is being created for first time or not.


Venezia



16
Venezia
Re: Travel in Australia
  • 2004/5/4 22:45

  • Venezia

  • Just popping in

  • Posts: 36

  • Since: 2003/6/24


No link.



17
Venezia
Re: WebLog - duplicated options check boxes
  • 2004/5/4 22:21

  • Venezia

  • Just popping in

  • Posts: 36

  • Since: 2003/6/24


Yes, there is a bug in the code.

The $checkbox variable must be unset() before being used a second time. To work properly the code should read:

// options check box
$checkbox_tray = new XoopsFormElementTray(_BL_OPTIONS ,'<br />');
$checkbox = new XoopsFormCheckBox('', 'nohtml', !$entry->doHtml());
$checkbox->addOption('nohtml', _BL_DISABLEHTML);
$checkbox_tray->addElement($checkbox);
unset($checkbox); //destroy first instance
$checkbox = new XoopsFormCheckBox('', 'private', $entry->isPrivate());
$checkbox->addOption('private', _BL_PRIVATE);
$checkbox_tray->addElement($checkbox);
$blog_form->addElement($checkbox_tray);



18
Venezia
Re: xoopstopic.php - getNiceTopicPathFromId() not working - typo fix
  • 2004/4/30 3:24

  • Venezia

  • Just popping in

  • Posts: 36

  • Since: 2003/6/24


Anyone using these or similar functions from within News module will need to search/replace the returned path to change the querysting params topic_id to storytopic



19
Venezia
Re: xoopstopic.php - getNiceTopicPathFromId() not working - typo fix
  • 2004/4/30 3:16

  • Venezia

  • Just popping in

  • Posts: 36

  • Since: 2003/6/24


Same typo in the next function:

function getAllChildTopicsId()



20
Venezia
xoopstopic.php - getNiceTopicPathFromId() not working - typo fix
  • 2004/4/30 3:07

  • Venezia

  • Just popping in

  • Posts: 36

  • Since: 2003/6/24


Typo fix:

File: xoopstopic.php
Function: getNiceTopicPathFromId($funcURL)

Error in line: $ret = $xt->getNicePathFromId($this->topic_id, "toppic_title", $funcURL);

Should read: $ret = $xt->getNicePathFromId($this->topic_id, "topic_title", $funcURL);




TopTop
« 1 (2) 3 4 »



Login

Who's Online

155 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 155


more...

Donat-O-Meter

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

Latest GitHub Commits