21
zer0fill
*RESOLVED* Specific censor replacement (making include() in "module.textsanitizer.php")
  • 2004/7/2 7:19

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


I'm trying to make my customized text replacement in an external file so there is only need to edit 1 line of code, the include() statement in the list of $patterns/$replacements but can't seem to get it working.

"module.textsanitizer.php"
$patterns[] = "/[u](.*)[/u]/sU";
$replacements[] = '<u>\1</u>';
$patterns[] = "/[d](.*)[/d]/sU";
$replacements[] = '<del>\1</del>';
include_once(
'custom_text_replacement.php');
...


"custom_text_replacement.php"
<?php
$patterns
[] = "/bub/isU";
$replacements[] = 'yo[u]';
?>


If I move the contents of custom_text_replacement into the include_once() line, it'll work fine.

my file was mis-spelled



22
zer0fill
Re: Most extensive module you can think of (I'm going to attempt at a tutorial)
  • 2004/6/23 18:11

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Quote:

sottwell wrote:
...As soon as I figure out how to get forms to work in a simple demo module I'll write up a basic tutorial similar to the "greeter" module.


Thanks. Unfortunately, this project of mine is being put on a lower priority since work has me on something new that'll take up a lot of my free time.



23
zer0fill
Re: Giving individual users permission to a module's category. Is there builtin like group permissio
  • 2004/6/12 23:21

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


so you're saying, to set specific user permissions, the group_permissions table would be set like:

gperm_groupid = uid
gperm_itemid = topic_id
gperm_modid = mid
gperm_name = xjokes_cat_user

and normal groups are set as

gperm_groupid = gid
gperm_itemid = topic_id
gperm_modid = mid
gperm_name = xjokes_cat_group



24
zer0fill
Re: Most extensive module you can think of (I'm going to attempt at a tutorial)
  • 2004/6/12 23:05

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Thanks for the tip about XOOPS topics, I'll be using that and renaming the category table & its fields to be compatible with topics

I've been trying to follow the way the news module uses this in combination with XoopsTree. Is it XT that's responsible for using recursion to keep every sub-cat sorted alpha-numeric?




25
zer0fill
Re: Most extensive module you can think of (I'm going to attempt at a tutorial)
  • 2004/6/12 21:12

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


I've started the program requirements and would like some feedback about the current feature list. Ignore the layout as I'm just typing it out in word and converting it to html (so more people can view it).



26
zer0fill
Giving individual users permission to a module's category. Is there builtin like group permissions?
  • 2004/6/12 18:27

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


In the process of building a new module (xJokes) I was wondering if there was a built-in function/api/class that can give individual users access to a module's category much like the existing abilibity used with group permissions. Is there any way to do this or would I have to create a linker table with different types of permissions (eg: bb_forum_access)?

For example, in the jokes module, there will be groups for voting, submitting, and authorizing jokes. I'd like to do the same for users using a built-in method XOOPS already has, if any.



27
zer0fill
Re: Advanced Search
  • 2004/6/12 10:04

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Quote:

Mithrandir wrote:
... soon...

Scary. Looks like I'll have to re-hack the system modules. Good to hear the advanced search is getting fixed



28
zer0fill
Re: poll force view
  • 2004/6/12 9:43

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Doh! I wish I searched the forums before making my own poll hack (zip|tar). My hack doesn't use PHP in the block since I modified the assignResults() function to return the array than assign if the user is $in_block (viewing block). Like what KubaZ said, i too shrunk the width to fit in the column.

If you're still having trouble, remember to update the module AND make a backup copy of the original before implementing ours.

I would have placed it on the same line but it didn't look right when the numbers went to the next line.
Resized Image



29
zer0fill
Re: Most extensive module you can think of (I'm going to attempt at a tutorial)
  • 2004/6/12 8:09

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


ah, thanks. didn't know there was already a documentation team.

for coding style, i'm too used to the vertical curley-braces. After having been taught that way, it's really hard to adjust to the other method.

//vertical
function curley()
{

}

// not-vertical
function curley(){

}



30
zer0fill
Most extensive module you can think of (I'm going to attempt at a tutorial)
  • 2004/6/12 7:57

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


Hi all,

I'm going to attempt to write up a Jokes Module (tentatively labeled xJokes) but at the same time write up a tutorial step-by-step(ish) on how to properly implement the XOOPS API when building a module from scratch. Hopefully this can serve as a starting point for new developers for XOOPS, such as myself, than going from place to place on the WiKi (it's still awesome for modular additions, don't get me wrong). The current crash course is fine, which is where I learned a lot of the basics, but, as we all know, the complete documentation is still much to be desired.

In this tutorial, I want to try to go though as many XOOPS API classes as possible so the would-be dev can see how it is implemented in a familar module, assuming they read from the start.

Anyways, here is what I have so far
Quote:
Here are some requirements limecity and I thought this jokes module should have:
• User submission
• Ratings
• Categories (and sub-sub...sub cats)
• Jokes
• Searchable
• Add comments
• Sort by: rank, views, comments
• Move jokes to different categories (owner/admin can do it)
• Approval system (can set groups to auto-approved)
• Notifications (by category and/or global)
• Blocks (latest joke, most popular, what else?)
What other XOOPS API classes do you think I can add in terms of the tutorial, not so much the module itself?

[edit]
Another thing that will be used is the XOOPS form generator in the admin area
[/edit]

One thing when it is done (i hope it gets done): I'm no graphics artist by any means, so it'll look quite...ugly unless the community can help with the templates.




TopTop
« 1 2 (3) 4 5 6 ... 12 »



Login

Who's Online

148 user(s) are online (91 user(s) are browsing Support Forums)


Members: 0


Guests: 148


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