Page Index Toggle Pages: 1 2 [3] 4  Send TopicPrint
Very Hot Topic (More than 25 Replies) Compliance Rules for Y2 mods (Read 14225 times)
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #30 - Jul 30th, 2005 at 8:11am
Print Post  
Hello

@Access to show entry!?

My replay is talk about Mod Attachment Download Counter

How kann i check User access? (Topic/Thread view)

In the "attachments.txt" i have this values ..

Quote:
$amthreadid, $amreplies, $amthreadsub, $amposter, $amcurrentboard, $amkb, $amdate, $amfn, $viewattach, $attachclick


lg XTC
  

Back to top
WWW  
IP Logged
 
Administrator
Forum Administrator
*****
Offline


Yummm

Posts: 7
Location: Modders Rile
Joined: Oct 7th, 2014
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #31 - Jul 30th, 2005 at 11:03am
Print Post  
Since you have the boardname the attachment belongs to ($amcurrentboard), you can use the AccessCheck sub, just like this:

Code
Select All
($dummy, $boardperms, $dummy) = split(/\|/, $board{"$amcurrentboard"});
my $access = &AccessCheck($board, '', $amcurrentboard);
if ($access eq "granted") { ... } 



Since you'd call this sub several times if there are multiple attachments in a topic, I'd suggest you to cache the result of the AccessCheck() call in an array. That will speed things up a bit.
  

The Administrator.
Back to top
WWW  
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #32 - Jul 30th, 2005 at 1:37pm
Print Post  
Hi

Thx @Michael .... i check that out  Smiley

lg XTC
  

Back to top
WWW  
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #33 - Jul 31st, 2005 at 12:19pm
Print Post  
Hi

Ok Michael .... i point it out .... this works ...

Code
Select All
## Access check begin ##
($dummy, $boardperms, $dummy) = split(/\|/, $board{"$amcurrentboard"});
my $access = &AccessCheck($amcurrentboard, '', $boardperms);
if ($access ne "granted") { $amthreadsubshow = "N/A"; } else { $amthreadsubshow = qq~<a href="$scripturl?num=$amthreadid/$amreplies#$amreplies" target="blank"> $amthreadsub</a>~; }
## Access check end ## 


..... now it hide Threadlinks (N/A) if Boardaccess not "granted" .... only problem, when the Administrator the "Boardperms" leave emty .... and only set "Categoryperms" .... the "Threadlink" would be show !?  Undecided

lg XTC
  

Back to top
WWW  
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #34 - Jul 31st, 2005 at 2:49pm
Print Post  
Hello

It works

Code
Select All
## Access check begin ##
		$curcat = ${$uid.$amcurrentboard}{'cat'};

## Figure out the category access ##
		unless ($mloaded == 1){require "$boardsdir/forum.master";}
		($cat, $catperms) = split(/\|/, $catinfo{"$curcat"});
		my $cataccess = &CatAccess($catperms);

## Figure out the board access ##
		($dummy, $boardperms, $dummy) = split(/\|/, $board{"$amcurrentboard"});
		my $access = &AccessCheck($amcurrentboard, '', $boardperms);
## Print threadlink ##
		if (($access ne "granted") || (!$cataccess)) { $amthreadsubshow = "N/A"; } else { $amthreadsubshow = qq~<a href="$scripturl?num=$amthreadid/$amreplies#$amreplies" target="blank"> $amthreadsub</a>~; }
## Access check end ## 


... that is it  Cheesy Wink

lg XTC
  

Back to top
WWW  
IP Logged
 
Spikecity
God Member
*****
Offline


Beer anyone ?

Posts: 2630
Location: New York
Joined: Apr 16th, 2002
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #35 - Oct 8th, 2005 at 9:28am
Print Post  
Just a heads up for all those jumping on Y2 to mod it, very impressive people.

One reminder after looking through the newly introduced mods for Y2.
Keep in mind that Y2 is written to work multi-lingual by default so if you write a mod that handles language dependent stuff like e.g. board rules, just make sure that you write it to work multi lingual too.
Location of you datafile and language definitions should be in Languages/<your language>.
Buttons should be in yabbfiles/buttons/<your language>

The reason I'm stressing this issue is that even your mod should be able to allow users in different languages to read the data your mod serves up in their own language on the user side and on the admin side allow the sysop to edit all the languages from his admin center.

Keep up the brilliant work guys and girls, I'm truly impressed.
  

Nothing to add here Smiley
Back to top
 
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #36 - Oct 8th, 2005 at 1:48pm
Print Post  
Hi

Quote:
Buttons should be in yabbfiles/buttons/<your language>

But ModImages should be in "ModImages/<ModName>" ... !?

Suggestion ....

ModImages/<ModName>/buttonname_German.png
ModImages/<ModName>/buttonname_English.png

and in "Menu2.def" you can use ... $language

Code
Select All
'modname' => "<img src=\"$modimgurl/<ModName>/buttonname_$language.$imgext\" alt=\"$img_txt{'modname'}\" border=\"0\" />", 




lg XTC
  

Back to top
WWW  
IP Logged
 
Spikecity
God Member
*****
Offline


Beer anyone ?

Posts: 2630
Location: New York
Joined: Apr 16th, 2002
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #37 - Oct 26th, 2005 at 10:09pm
Print Post  
Resuming on one of my other remarks today I'd like to stress the use of language modifications separately.

The development rules for Y2 were set to be:

Mods that use separate .pl files (as in extra features like poll, RSS and such)  must use a separate .lng file.
Mods that alter the base functions of standard Y2 functions can use two ways of implementing extra text strings or changed txt strings.
1. Use the same structure as the first kind of mods, being a separate lng file (which makes localisation a breeze).
2. use an addition to the existing .lng file with a new variable and added just above the 1; in the lng file.

Changing the base text strings must be restricted to zero or the absolute minimum to avoid multiple mod incompatibility problems while installing them.
  

Nothing to add here Smiley
Back to top
 
IP Logged
 
Flicker
Senior Member
****
Offline


Six-Strings

Posts: 291
Location: Stockport
Joined: Oct 20th, 2003
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #38 - Dec 1st, 2005 at 2:08pm
Print Post  
How on earth do we add settings pages for mods?

I can't find any where instructions on how to do this!
  

www.smile-jesuslovesyou.org/forum
Message boarding- where everybody is always right


"For I am not ashamed of the gospel of Christ..."
Romans 1:16
Back to top
WWW  
IP Logged
 
Curtiss Grymala
God Member
*****
Offline


YaBB?... Y Not?

Posts: 1314
Joined: Apr 12th, 2004
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #39 - Dec 3rd, 2005 at 1:07am
Print Post  
I figured it out by looking at some other mods that had done that.

You have to edit AdminIndex.pl and search for:
Code
Select All
### END BOARDMOD ANCHOR ### 



Then add before, something like this:
Code
Select All
$you_mod = "you_mod|/you Feature Settings|Edit Your /you Feature Settings|";
push (@boardmod_mods, "$you_mod"); 



You then have to edit AdminEdit.pl and add the appropriate stuff.  You will most likely need to create two separate subs.  You will need one sub that shows your settings page, and a second sub that evaluates/stores the information.

You then need to edit AdminSubList.pl and add the subs that you just created.

I think that's just about it.  Again, I recommend checking out an existing mod that has its own settings page to see how it's done.
  

Currently using Y2.3 With no mods (though that will hopefully change, soon).

Click Here To See A List Of All The Mods I've Written
Back to top
WWW  
IP Logged
 
BRO_co03
Full Member
***
Offline


Courage. Wisdom. Power.

Posts: 216
Location: Lone Star State
Joined: May 19th, 2004
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #40 - Mar 21st, 2006 at 5:04am
Print Post  
Quote:
3. new board variables are added to the .info file using the UpdateBoard subroutine. (no additional files per board/cat allowed).

I can't seem to find this UpdateBoard subroutine.
  
Back to top
WWW  
IP Logged
 
..:X.T.C:..
Forum Administrator
*****
Offline


I love YaBB Forum!

Posts: 656
Location: Spittal
Joined: Dec 22nd, 2002
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #41 - Mar 21st, 2006 at 6:58am
Print Post  
Hi

Hmm .. check out the sub BoardTotals @ Sources/Sytem.pl

lg XTC
  

Back to top
WWW  
IP Logged
 
BRO_co03
Full Member
***
Offline


Courage. Wisdom. Power.

Posts: 216
Location: Lone Star State
Joined: May 19th, 2004
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #42 - Mar 24th, 2006 at 3:57am
Print Post  
..:X.T.C:.. wrote on Mar 21st, 2006 at 6:58am:
Hi

Hmm .. check out the sub BoardTotals @ Sources/Sytem.pl

lg XTC

Thank you. I found it.
  
Back to top
WWW  
IP Logged
 
Martin_W
Senior Member
****
Offline


I love YaBB 1G - SP1.2!

Posts: 463
Location: Devon
Joined: Jun 22nd, 2005
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #43 - Apr 30th, 2006 at 4:39pm
Print Post  
Mod images should be put in mod folder, and $modimgurl used to access them.

Looking at how yabbs display.pl is written, this code is used (for example)

Code
Select All
$template_split = qq~$menusep<a er">$img{'admin_split'}</a>~; 



$img{'admin_split'} contains the img html I assume.  Should a similar thing be done with mod images?  Sorry - still getting to grips with the way yabb2 differs from yabb1 Tongue
  
Back to top
WWW  
IP Logged
 
Spikecity
God Member
*****
Offline


Beer anyone ?

Posts: 2630
Location: New York
Joined: Apr 16th, 2002
Gender: Male
Re: Compliance Rules for Y2 mods
Reply #44 - May 1st, 2006 at 8:46pm
Print Post  
Martin_W wrote on Apr 30th, 2006 at 4:39pm:
Mod images should be put in mod folder, and $modimgurl used to access them.

Looking at how yabbs display.pl is written, this code is used (for example)

Code
Select All
$template_split = qq~$menusep<a er">$img{'admin_split'}</a>~; 



$img{'admin_split'} contains the img html I assume.  Should a similar thing be done with mod images?  Sorry - still getting to grips with the way yabb2 differs from yabb1 Tongue

$img{'admin_split'} is a menu item which can vary depending on how you setup your board (text only/icons+text/buttons only).
These are defined in Menu0.def, Menu1.def and Menu2.def found in /Variables
  

Nothing to add here Smiley
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 2 [3] 4 
Send TopicPrint