1
npetreley
Several requests!
  • 2002/12/17 20:49

  • npetreley

  • Just popping in

  • Posts: 15

  • Since: 2002/12/9


1. When you save a submitted article, I'd like it if the code returns you to the module/news/index.php?op=newarticle

Just change the redirect at the end of the save (in the case statement) to this:

redirect_header("index.php?op=newarticle",1,_AM_DBUPDATED);

That way you can continue to preview/approve articles (and if the next suggestion is adopted, move them around). There are probably other places where it would be better to have an operation return you to a more convenient admin location so you don't have to keep navigating the admin menus.

2. Ability to move article positions in the TOC (Table of Contents, or news module home page). I implemented a way to do this in my hacked version of Xoops, but if there's a better way, go for it!

3. Main menu that only shows options available to the group viewing the page. Again, if you like this idea, my hacked version of dynamenu does this (and includes the pretty icons, although some people justifiably don't like icons), so feel free to use that code or if there's a better way, ignore that code.

4. A top_news module that lists the X most recent stories in order of popularity. This avoids the problem of really old articles staying at the top of the counter list. I modified the news_top.php to do this, but I recently realized I could simply have created a new module and left the original code undisturbed. I'll do that and submit it in case anyone wants the same feature.

5. Pass an object to the theme handlers instead of variables. That way people can customize things to a greater extent without breaking existing themes. In other words, suppose you pass the object $article to themenews($article). Your standard themes would access the variables through $article->title, $article->morelink, etc. Now, if I decide to add $article->storyurl as a property, the old themes will simply ignore it and continue to work, but new themes can make use of the additional information. All the themes can coexist happily on the same site. (Yes, I know you can add parameters at the end of the list to get approximately the same behavior, but IMO that's a sloppier and more error-prone way to do it.)

6. Indeed, pass objects (or arrays) whenever possible to make backward compatibility easier at all levels.

2
Boobtoob
Re: Several requests!
  • 2002/12/17 21:30

  • Boobtoob

  • Friend of XOOPS

  • Posts: 202

  • Since: 2001/12/22


Thanks, I've stick'd this for future reference.

3
npetreley
Theme writing revisited
  • 2002/12/19 15:42

  • npetreley

  • Just popping in

  • Posts: 15

  • Since: 2002/12/9


Here's another thing that occurred to me re: passing the objects to themes. Perhaps there's already such a document (I apologize if I missed it somewhere), but it might be nice to have theme guidelines that require you to test for the existence of a property before using it.

Here's an example problem: Theme 1 uses $story->title, $story->morelink, etc., which are all standard. Theme 2 uses the field I added to the table as $story->storyurl. At this point, only those people who had my modified code could use my theme. If they used my theme with their unhacked Xoops, my theme would barf when it tries to access $story->storyurl and couldn't find it.

But if I wrote the theme with that in mind (and according to the suggested guidelines), the code would test for the existence of $story->storyurl before trying to use it. That would (or should) make my theme compatible with unhacked versions of Xoops.

Obviously, my example is about hacked versions, but this same principle would apply to prior and future official versions.

4
onokazu
Re: Theme writing revisited
  • 2002/12/19 17:33

  • onokazu

  • XOOPS Founder

  • Posts: 617

  • Since: 2001/12/13


Yes, I like your idea about passing an object as the parameter of theme functions. However, in XOOPS2, there will be no theme functions at all, but all the values for presentation are assigned to template variables via the Smarty global object like $smarty->assign('name', $value);.

Yes, the old themes will still work fine in XOOPS2, but since the Smarty template system will be the primary theme system we will be using, it is unlikely that we will be doing any modifications on the current theme system.

5
npetreley
Re: Theme writing revisited
  • 2002/12/19 17:53

  • npetreley

  • Just popping in

  • Posts: 15

  • Since: 2002/12/9


I'd love to have a look at Xoops2. Is it available in anonymous CVS or anything? I apologize that I haven't looked for it yet, so if it's obvious where to get the code, just say so and I'll find it.

6
Mithrandir
Re: Theme writing revisited

https://xoops.org/

Welcome to XOOPS official website!
(See top of front page)

7
Herko
Re: Theme writing revisited
  • 2003/11/22 10:04

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Quote:

MithyT2 wrote:
https://xoops.org/

Welcome to XOOPS official website!
(See top of front page)


Eh? is this a way to increase your post count or what? This thread was active over 11 months ago.... And your reply doesn't make any sense in this thread. Don't let me catch you in silly comments

Herko

8
Mithrandir
Re: Theme writing revisited

Quote:

Herko Coomans wrote:
Quote:

MithyT2 wrote:
https://xoops.org/

Welcome to XOOPS official website!
(See top of front page)


Eh? is this a way to increase your post count or what? This thread was active over 11 months ago.... And your reply doesn't make any sense in this thread. Don't let me catch you in silly comments

Herko

Not at all... for some reason it showed up in recent topics or something. I was a bit puzzled that anyone would ask for directions towards XOOPS 2 like that, but hey - the world is full of funny people.

My reply makes sense in the fact that the download links for 2.0.5 are in the "Welcome..." block.

And believe me if I wanted to increase my postcount, I wouldn't do it by digging up old threads and post gibberish.

9
ManXP
Re: Several requests!
  • 2004/9/22 21:19

  • ManXP

  • Quite a regular

  • Posts: 231

  • Since: 2003/8/14


Ok, i have one (very important) request too.

XOOPS must include good url rewrite engine, which replaces all links such as http://domain.com/modules/mod_name/st ... ore_numbers_always=565696 to "normal" HTML URLs.

It was promised a lot of time ago, but... We never got this

10
chanman
Re: Several requests!
  • 2005/12/24 6:49

  • chanman

  • Just popping in

  • Posts: 3

  • Since: 2005/12/23


wow thats pretty cool

Login

Who's Online

70 user(s) are online (44 user(s) are browsing Support Forums)


Members: 0


Guests: 70


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