New #tab after poll.

Discuss the development of future releases of phpBB (phpBB 3.x minor releases) and MODing/Coding related questions.
Post Reply
andreask
New member
New member
Posts: 13
Joined: 05 May 2011, 19:00

New #tab after poll.

Post by andreask »

Im trying to add a new tab in the new post page.

Here is what i have done so far...

Code: Select all

[open]
styles/prosilver/template/posting_layout.html

[find]
<!-- IF S_SHOW_POLL_BOX or S_POLL_DELETE --><!-- INCLUDE posting_poll_body.html --><!-- ENDIF >

[Add after]

<!-- IF S_SHOW_PRODUCT_REVIEW --><!-- INCLUDE posting_prod_review.html --><!-- ENDIF -->


[open]
styles/prosilver/template/posting_editor.html

[find]
<!-- IF S_SHOW_POLL_BOX || S_POLL_DELETE --><li id="poll-panel-tab"><a href="#tabs" onclick="subPanels('poll-panel'); return false;"><span>{L_ADD_POLL}</span></a></li><!-- ENDIF -->

[add after]
<!-- IF S_SHOW_PRODUCT_REVIEW --><li id="product-review-tab"><a href="#tabs" onclick="subPanels('product-review-panel'); return false;"><span>Product Review</span></a></li><!-- ENDIF -->

[open]
styles/prosilver/template/posting_buttons.html

[find]
var panels = new Array('options-panel', 'attach-panel', 'poll-panel');

[replace with]
var panels = new Array('options-panel', 'attach-panel', 'poll-panel', 'product-review-panel');

[create new file]
posting_prod_review.html
in styles/prosilver/template/


That contains...

<div class="panel bg3" id="product-review-panel">
   <div class="inner"><span class="corners-top"><span></span></span>

   <p>HEADER</p>

   <fieldset class="fields2">
      - CONTENT -
   </fieldset>

   <span class="corners-bottom"><span></span></span></div>
</div>


Still i cant see the new tab! :(

What do i do wrong?
Do i have to declare "S_SHOW_PRODUCT_REVIEW" somewere????
Or do i have to do something else???

Thank you!
User avatar
tumba25
Supporter
Supporter
Posts: 1058
Joined: 24 Oct 2007, 13:10
Real name: Jari Kanerva
Location: Kokkola, Finland.
Contact:

Re: New #tab after poll.

Post by tumba25 »

andreask wrote:Do i have to declare "S_SHOW_PRODUCT_REVIEW" somewere????
Yes, of course. You need to tell the template engine that it exists and the state of it. They are called template vars, BTW. Take a look at here, [url]http://wiki.phpbb.com/Tutorial.Template_syntax[/url].

S_* are typically switches, true or false. U_* is a url, L_ language. LA_* and UA_* are when they are in JavaScript.

Search for $template->assign_vars(array( in the file generating that page. That is viewtopic.php if you are editing viewtopic_body.html. If that tab is to be seen in every topic there is no need to have that switch.
andreask
New member
New member
Posts: 13
Joined: 05 May 2011, 19:00

Re: New #tab after poll.

Post by andreask »

@tumba25 Ok i did it thanks!

Now im trying to make the permisions for my mod...

So i added f_prod_rev in phpbb_acl_options with 1,0,0
command line


i have read here http://wiki.phpbb.com/Tutorial.Permissions lots of times.
But i must be an idiot cause i cant make it work! :(

Could someone explain to me how to create permisions?
I want it to be like 'polls'.

I'm sorry for the trouble!
andreask
New member
New member
Posts: 13
Joined: 05 May 2011, 19:00

Re: New #tab after poll.

Post by andreask »

ok here is what i have done so far!

Code: Select all

INSERT INTO phpbb_acl_options (auth_option, is_global, is_local, founder_only) VALUES ('f_prodrev', 1, 0, 0);


and then i created a file named permissions_prodrev.php

in lang/en/mods/

Code: Select all

if (!defined('IN_PHPBB'))
{
    exit;
}

if (empty($lang) || !is_array($lang))
{
    $lang = array();
}


$lang['Prod_reviews']['f_prodrev'] = 'Product Reviews';

$lang = array_merge($lang, array(
    'acl_f_prodrev'             => array('lang' => 'Can view product Review Permision', 'cat' => 'Product Reviews')));


Could someone explain to me what im doing wrong!


Thank you!
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: New #tab after poll.

Post by RMcGirr83 »

Are you making a forum permission (f) a user permission (u) or a moderator permission (m)?
andreask
New member
New member
Posts: 13
Joined: 05 May 2011, 19:00

Re: New #tab after poll.

Post by andreask »

forum permission.
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: New #tab after poll.

Post by RMcGirr83 »

forum permissions are usually for things like can read a forum ('f_read') you seem to be wanting to make a user/group permission to be able to display your product panel to a user as it does not matter what forum the user is in?
andreask
New member
New member
Posts: 13
Joined: 05 May 2011, 19:00

Re: New #tab after poll.

Post by andreask »

Hmmm, you'r probably right!

What i want to do is, to be able to allow or disallow users/groups to post product reviews.

I only set it to f_ because i took as example 'polls'.
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: New #tab after poll.

Post by RMcGirr83 »

f_ allows polls to display within certain forums, u_ allows users/groups to respond to those polls that are allowed within forums. I think you want a u instead of a f or a combination of the two similar to how it is for attachments and polls. ;)
andreask
New member
New member
Posts: 13
Joined: 05 May 2011, 19:00

Re: New #tab after poll.

Post by andreask »

So what do i have to do to appear a tab with this permissions:?:

Lets say, first on forum permisions.
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: New #tab after poll.

Post by RMcGirr83 »

Well there is no cat called

Code: Select all

'cat' => 'Product Reviews')


so first thing I would do is change that to

Code: Select all

'cat' => 'misc')


and forum permissions are local not global so your sql insert should be this

Code: Select all

INSERT INTO phpbb_acl_options (auth_option, is_global, is_local, founder_only) VALUES ('f_prodrev', 0, 1, 0);


Which then gives you this

Noname.png
andreask
New member
New member
Posts: 13
Joined: 05 May 2011, 19:00

Re: New #tab after poll.

Post by andreask »

Code: Select all

$lang['Prod_reviews']['f_prodrev'] = 'Product Reviews';


Isn't that line supose to create a new category/tab in permissions?
Or i misunderstood?

I mean like post | content |action | misc | polls | prodrev

From http://wiki.phpbb.com/Tutorial.Permissions wrote:// Adding new category
$lang['permission_cat']['foo'] = 'Foo management';


['permission_cat'] = the array of the new category?
['foo'] = f_prodrev ?
'Foo management' = Title??? like ['Product Review']

I obviusly do something wrong :oops: im a complete noob! :( you can ban me if you want to! :cry:
User avatar
RMcGirr83
Supporter
Supporter
Posts: 6243
Joined: 30 Nov 2006, 14:23
Real name: Rich McGirr

Re: New #tab after poll.

Post by RMcGirr83 »

You need a module php file and html file to be able to add your own tabs/categories.
Post Reply