Warning: The author of this contribution does not provide support for it anymore.

Moderator Needed

Moderator needed popup - Moderator Needed

Moderator needed popup

by javiexin » Thu Nov 10, 2011 12:06 pm

Hello,

Good mod, installed and working without problems.

One addition, if possible: how would you make a popup to be triggered when Moderation is needed, same way as a popup is displayed when a MP is received? Preferibly from "all pages" (ie, in overall_header.html). Would be a really good addition.

Best,
-javiexin
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: Moderator needed popup

by puabase-2 » Thu Dec 01, 2011 9:12 am

Would be great!
puabase-2
Registered User
Posts: 34
Joined: Sat Oct 29, 2011 8:54 am
Contact:

Re: Moderator needed popup

by demon327 » Thu Jan 19, 2012 1:33 pm

i'm doing it like this:

Code: Select all

<!-- IF TOTAL_MODERATOR_REPORTS -->
<script type="text/javascript" src="{T_TEMPLATE_PATH}/js/gritter.js"></script>
<script type="text/javascript">
$(document).ready(function(){ $.gritter.add({title: 'Moderator statistieken', text: '<p>De volgende (privé)berichten en of onderwerpen werden gemeld en vereissen een actie :</p>&nbsp;<ul style="list-style:none;"><!-- IF TOTAL_MODERATOR_REPORTS --><li><a href="{U_MODERATOR_REPORTS}">{TOTAL_MODERATOR_REPORTS}</a></li><!-- ENDIF --><!-- IF TOTAL_MODERATOR_POSTS --><li><a href="{U_MODERATOR_APPROVE_POSTS}">{TOTAL_MODERATOR_POSTS}</a></li><!-- ENDIF --><!-- IF TOTAL_MODERATOR_TOPICS --><li><a href="{U_MODERATOR_APPROVE_TOPICS}">{TOTAL_MODERATOR_TOPICS}</a></li><!-- ENDIF --><!-- IF TOTAL_MODERATOR_PMS --><li><a href="{U_MODERATOR_PMS}">{TOTAL_MODERATOR_PMS}</a></li><!-- ENDIF --></ul>'}); });
</script>
<!-- ENDIF -->


Please dont mind the hardcoded lang.

It popups when on of those conditions has been activated:)
demon327
Registered User
Posts: 847
Joined: Thu Nov 16, 2006 2:16 pm
Contact:

Re: Moderator needed popup

by javiexin » Thu Jan 19, 2012 1:41 pm

And what is this gritter.js that is included there?
Thanks,
-javiexin
User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: Moderator needed popup

by RMcGirr83 » Thu Jan 19, 2012 2:00 pm

It is a "modal" way of displaying a popup using jQuery.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Moderator needed popup

by Walther » Sun Nov 18, 2012 1:27 pm

Is it enough to just download and place gritter.js in the directory {t_TEMPLATE_PATH}/js/ and ad the code in the (for example) index_body.html ?
Or is there more involved to get this working properly.

Found gritter.js here : http://code.google.com/p/youcontrol/sou ... er.js?r=82
There are however more files when the whole package is downloaded, therefore my question.
phpBB 3.3.10 -- PHP 7.4.33 -- CentOs7 vps
User avatar
Walther
Registered User
Posts: 298
Joined: Fri Jul 09, 2004 5:21 pm
Location: The Netherlands
Contact:

Re: Moderator needed popup

by Oyabun1 » Sun Nov 18, 2012 9:03 pm

What happened when you tried it?
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill
Contact:

Re: Moderator needed popup

by Walther » Mon Nov 19, 2012 9:23 am

Nothing, did not work.

Also added <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> in the overall_header.html right after <body .... >

- edit: meanwhile, found out there where multiple instances of jquery calls, changed location to the <head> and deleted older jquery calls.
- eidt: in overall_header there are other (working) calls to .js files, with the variable {T_SUPER_TEMPLATE_PATH} instead of {T_TEMPLATE_PATH}, so trying that too
phpBB 3.3.10 -- PHP 7.4.33 -- CentOs7 vps
User avatar
Walther
Registered User
Posts: 298
Joined: Fri Jul 09, 2004 5:21 pm
Location: The Netherlands
Contact:

Re: Moderator needed popup

by RMcGirr83 » Mon Nov 19, 2012 11:01 am

The jQuery code goes before <body not after
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
User avatar
RMcGirr83
Former Team Member
Posts: 22016
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Moderator needed popup

by Walther » Mon Nov 19, 2012 4:55 pm

Thanks, already placed in the header, and made sure there is not more than one instance of it.
Still, no 'popup' when new moderator tasks.

Wondering whether {T_SUPER_TEMPLATE_PATH} or {T_TEMPLATE_PATH} must be used, tried both, and neither of them worked, just wondering though.

Any other way i can make a popup, so without gritter.js but with jqeury ?


update nov.26.2012 :
The variable {T_SUPER_TEMPLATE_PATH} or {T_TEMPLATE_PATH} did not work.
As gritter.js is located in the directory template/prosilver/js/ I replaced the brackets with a '.' , so it ended up being:

Code: Select all

<script type="text/javascript" src="./js/gritter.js"></script>
instead of

Code: Select all

<script type="text/javascript" src="{T_TEMPLATE_PATH}/js/gritter.js"></script>

A test script did work, now waiting for the 'real deal' to work.
phpBB 3.3.10 -- PHP 7.4.33 -- CentOs7 vps
User avatar
Walther
Registered User
Posts: 298
Joined: Fri Jul 09, 2004 5:21 pm
Location: The Netherlands
Contact:

Re: Moderator needed popup

by Walther » Mon Nov 26, 2012 4:12 pm

All my efforts stranded, so kind'a rebuilded it.

in the overall_header.html I have :

Code: Select all

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>


in the index_body.html I have now (and it works perfect):

Code: Select all

<!-- IF U_MCP -->
<link rel="stylesheet" type="text/css" href="./js/gritter.css" />
<script type="text/javascript" src="./js/gritter.js"></script>
<!-- ENDIF -->

<!-- IF U_MCP --><!-- IF TOTAL_MODERATOR_REPORTS -->
<script type="text/javascript">
$(document).ready(function(){ $.gritter.add({title: 'Moderator statistieken', text: '<p>De volgende (prive)berichten en of onderwerpen werden gemeld en vereissen een actie :</p>&nbsp;<ul style="list-style:none;"><li><a href="{U_MODERATOR_REPORTS}">{TOTAL_MODERATOR_REPORTS}</a></li>'}); });
</script>
<!-- ENDIF --><!-- ENDIF -->

<!-- IF U_MCP --><!-- IF TOTAL_MODERATOR_POSTS -->
<script type="text/javascript">
$(document).ready(function(){ $.gritter.add({title: 'Moderator statistieken', text: '<p>De volgende postings vereissen een actie :</p>&nbsp;<ul style="list-style:none;"><li><a href="{U_MODERATOR_APPROVE_POSTS}">{TOTAL_MODERATOR_POSTS}</a></li>'}); });
</script>
<!-- ENDIF --><!-- ENDIF -->

<!-- IF U_MCP --><!-- IF TOTAL_MODERATOR_TOPICS -->
<script type="text/javascript">
$(document).ready(function(){ $.gritter.add({title: 'Moderator statistieken', text: '<p>De volgende topics vereissen een actie :</p>&nbsp;<ul style="list-style:none;"><li><a href="{U_MODERATOR_APPROVE_TOPICS}">{TOTAL_MODERATOR_TOPICS}</a></li>'}); });
</script>
<!-- ENDIF --><!-- ENDIF -->

<!-- IF U_MCP --><!-- IF TOTAL_MODERATOR_PMS -->
<script type="text/javascript">
$(document).ready(function(){ $.gritter.add({title: 'Moderator statistieken', text: '<p>De volgende (prive)berichten vereissen een actie :</p>&nbsp;<ul style="list-style:none;"><li><a href="{U_MODERATOR_PMS}">{TOTAL_MODERATOR_PMS}</a></li></ul>'}); });
</script>
<!-- ENDIF --><!-- ENDIF -->


The files gritter.js and gritter.css and the image files, which can be downloaded here ( https://github.com/jboesch/Gritter/downloads ), are placed in the directory http://www.yourdomain.extension/forum/js/

The files gritter.css has been altered; all the references to '../images/' have been changed in './' to make it point to the new location, which is in the /js/ directory.

The original name of 'gritter.js' is 'jquery.gritter.min.js'
I changed it to 'gritter.js' , although if adapt the code there is no real need to it. :roll:

The language is still hard-coded, but there are basic 4 alerts which triggers a 'pop-up', and each of them is a seperate one enclosed in the original IF and ENDIF conditions, they should be easy to translate to the exact current reason in your preferred language.


As i come to think of it, Demon327 solution can only work when a posting is reported, not when a new posting or topic is made or a PM is reported.
No wonder it took me for ages to get it to work, did not check the code, just assumed it worked :oops:
stupid stupid stupid from me, never assume anything
phpBB 3.3.10 -- PHP 7.4.33 -- CentOs7 vps
User avatar
Walther
Registered User
Posts: 298
Joined: Fri Jul 09, 2004 5:21 pm
Location: The Netherlands
Contact: