1
m0nty
need a hack for XFSection
  • 2004/4/15 4:53

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


i use this module for displaying DJ Profiles and interviews, both seperate categories..

but also use it instead of the news module as i think it's more versatile etc..

the problem is...

there are basically 3 categories

News
DJ Profiles
Interviews

what i really need to do is on the user submit page and edit article etc.

i want to hide the parts that let the user choose the category and the groups allowed to view article..

basically i want it so that on the user submit, they can only submit articles for the news category (currently category id=2) as i don't want users to be able to submit profiles and interviews.

2ndly i want to get rid of the group selection box and make it so that any article submitted will always be viewable to every1.

Admin shud still be able to submit to any category tho using XOOPS admin..

any help wud be much appreciated..

thanks

2
m0nty
Re: need a hack for XFSection
  • 2004/4/17 21:04

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


sorry to bump this..

i keep looking thru the code myself, and i'm sure it's pretty easy to some1 who knows.. but i must be missing something.. i'm not a coder and my knowledge is limited.. but i would really like this hack to be done :(

i really don't want to email catzwolf about it, as i appreciate he has many projects on the go and is really working hard on his new wfsections module.. so if any1 can help? :)

3
JackJ
Re: need a hack for XFSection
  • 2004/4/17 21:24

  • JackJ

  • Community Support Member

  • Posts: 747

  • Since: 2003/8/31


Xfsection is a renamed clone of wfsections as you may know, I could help if it was wfsections, as I have my own files to relate to.

Perhaps if you try the xfsections website? Catswolf does not support xfsections, the coding has changed so he can't really.

4
simonvl
Re: need a hack for XFSection
  • 2004/4/18 1:59

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


Having a quick look at submit.php, I'll hazard a guess. I'm not a php programmer so it is only a guess...

Remove
$xt->makeSelBox(0);
$sform->addElement(new XoopsFormLabel(_WFS_CATEGORYob_get_contents()));
ob_end_clean();
$sform->addElement($topic_select);
$sform->addElement(new XoopsFormSelectGroup(_WFS_GROUPPROMPT'groupid'truetrue5true), false);


And replace it with something like
$sform->addElement(new XoopsFormHidden('topic_select',2));
$sform->addElement(new XoopsFormHidden('groupid',array(1,2,3)));


The idea being that these are posted as hidden fields- topic as "2" and group ids as an array of all those you want to have access to the article.
But I am pretty sure there is something wrong with what I put above. Hopefully it gives you a starting point though.

Simon

5
m0nty
Re: need a hack for XFSection
  • 2004/4/18 4:23

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


thanks simon..

u were right there was something wrong with what u wrote.. no matter how i tried ur method it messed up..

BUT it did put me on the right track after some messing etc..

it meant me editing 1 line in submit.php

and then editing 3 lines in xfsection/include/storyform.inc.php

and voila :) all is well now my users can only submit to the news category (2) and all groups are selected but both fields are hidden..

without your little help there i'd have been at it for a lot longer..

now the next thing i might try to add is an option in admin to let admin choose what category a user can submit to.. wish me luck.. lol

6
simonvl
Re: need a hack for XFSection
  • 2004/4/18 4:33

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


I see you've been up all night too!

Well, good luck with the admin option hack...
You will need to mess around with tables and change several files. I did it for a very simple tickbox field for iMenu (see post).

I found that it was very simple once I found a similar field (in my case another tick box in the admin)- I just changed the name and made sure the new one was in all the places the original one was. I'd recommend backing up and trying something similar if you've never messed with a module before.

Have fun!
Simon

7
m0nty
Re: need a hack for XFSection
  • 2004/4/18 5:07

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


yeah being up all night is something i'm pretty much used to these days..

i get by with abt 3 - 4 hrs sleep lol sometimes up for 2 days in a row with work etc..

i've had some experience with messing with a few modules.. but i got a feeling tryin to do this hack is gonna be a challenge for me and probly will end up being beyond my ability.. but worth a try.. plenty of time tho as it's not necessary really at the mo being as there's only 3 categories.. and it'll probly not be needed once catzwolf has finished his new WFSections module which i'm eagerly awaiting :)

thanks again for the help and advice..

Login

Who's Online

178 user(s) are online (96 user(s) are browsing Support Forums)


Members: 0


Guests: 178


more...

Donat-O-Meter

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

Latest GitHub Commits