Member Awards (2.0 Compatible!)

Started by Spuds, September 18, 2006, 03:14:03 PM

Previous topic - Next topic

Sci-Fi_Fan

Quote from: Sisko Punk on August 07, 2011, 07:39:07 AM
go to the mod download page and select the version and click parse .
it will tell you what to do, you will need to manually make the edits if they're not there already.

Thanks for your help! I'll do that.
ShadowFleet.org - more than just a Star Trek RPG!

treehugger

Got a couple of things not showing properly in my admin panel so I'm parsing my various mod changes to a clean copy of admin.php to see if that helps.

Here's what I have for Member Awards:


/Sources/Admin.php
Find: [Select]

),
),
'layout' => array(
Add Before: [Select]

'awards' => array(
'label' => $txt['awards'],
'file' => 'ManageAwards.php',
'function' => 'Awards',
'icon' => 'awards.gif',
'permission' => array('manage_awards'),
'subsections' => array(
'main' => array($txt['awards_main']),
'modify' => array($txt['awards_modify']),
'assign' => array($txt['awards_assign']),
'categories' => array($txt['awards_categories']),
'settings' => array($txt['awards_settings']),
),
),

Find: [Select]

// You have to be able to do at least one of the below to see this page.
isAllowedTo(array('admin_forum', 'manage_permissions', 'moderate_forum',

Add After: [Select]
'manage_awards',


'manage_awards' shows as an Add After - which I've finally learnt means put it in BEFORE the stuff you had to find. However common sense says it goes in after 'moderate_forum' - so now I'm trying to decide whether I've done the right thing by putting the main chunk of code in the first change in AFTER 'layout' => array(

Anyone know for sure please?

hcfwesker

#2402
Quote'manage_awards' shows as an Add After - which I've finally learnt means put it in BEFORE the stuff you had to find.

Actually it's the opposite.  The code listed under "FIND", just find it, and the code you edit in, whether labeled Add AFTER (means below the original lines of code you FOUND), or Add BEFORE (means above the original lines of code you FOUND)


Add After, for this particular edit, means it should be edited to look like this.

// You have to be able to do at least one of the below to see this page.
isAllowedTo(array('admin_forum', 'manage_permissions', 'moderate_forum','manage_awards',


BUT, if you got an install error, it probably means another MOD got added in it's place which means you just add it after the last thing added.   

For example, if you had the advance prefic MOD installed.

// You have to be able to do at least one of the below to see this page.
isAllowedTo(array('admin_forum', 'manage_permissions', 'moderate_forum','manage_prefixes',


^ the 'manage_prefixes' was added, and the MOD installation will bring back an error, since it's originally looking for CLEAN/Fresh php files.  So, do manually edit it corfrectly, you would do this

// You have to be able to do at least one of the below to see this page.
isAllowedTo(array('admin_forum', 'manage_permissions', 'moderate_forum','manage_prefixes','manage_awards',



About the Awards menu appearing, it's just for the order of how you want it to appear in the admin page.   This will install it UNDERNEATH the 'themes' menu in your admin panel.

FIND
'theme' => array(
'label' => $txt['theme_admin'],
'file' => 'Themes.php',
'function' => 'ThemesMain',
'custom_url' => $scripturl . '?action=admin;area=theme;sa=admin',
'icon' => 'themes.gif',
'subsections' => array(
'admin' => array($txt['themeadmin_admin_title']),
'list' => array($txt['themeadmin_list_title']),
'reset' => array($txt['themeadmin_reset_title']),
'edit' => array($txt['themeadmin_edit_title']),
),
),


ADD (the following code) AFTER ( the code above)

'awards' => array(
'label' => $txt['awards'],
'file' => 'ManageAwards.php',
'function' => 'Awards',
'icon' => 'awards.gif',
'permission' => array('manage_awards'),
'subsections' => array(
'main' => array($txt['awards_main']),
'modify' => array($txt['awards_modify']),
'assign' => array($txt['awards_assign']),
'categories' => array($txt['awards_categories']),
'settings' => array($txt['awards_settings']),
),
),


I think that was what you were asking explanation on?


Sci-Fi_Fan

Quote from: hcfwesker on August 08, 2011, 03:56:55 PM
Add After, for this particular edit, means it should be edited to look like this.

// You have to be able to do at least one of the below to see this page.
isAllowedTo(array('admin_forum', 'manage_permissions', 'moderate_forum','manage_awards',


BUT, if you got an install error, it probably means another MOD got added in it's place which means you just add it after the last thing added.   

For example, if you had the advance prefic MOD installed.

// You have to be able to do at least one of the below to see this page.
isAllowedTo(array('admin_forum', 'manage_permissions', 'moderate_forum','manage_prefixes',


^ the 'manage_prefixes' was added, and the MOD installation will bring back an error, since it's originally looking for CLEAN/Fresh php files.  So, do manually edit it corfrectly, you would do this

// You have to be able to do at least one of the below to see this page.
isAllowedTo(array('admin_forum', 'manage_permissions', 'moderate_forum','manage_prefixes','manage_awards',


That is really helpful! Thanks. I thought I had the correct page to edit, but it seems I don't. Just to clarify, it's the sources.admin.php file I need, right? Where do I find this file?
ShadowFleet.org - more than just a Star Trek RPG!

hcfwesker


I edited my reply above with other info that may help.

Quote from: Sci-Fi_Fan on August 08, 2011, 04:01:42 PM
That is really helpful! Thanks. I thought I had the correct page to edit, but it seems I don't. Just to clarify, it's the sources.admin.php file I need, right? Where do I find this file?

One thing that I found out the hard way, is when you have to manually install an ERROR.  When you open the file to edit, don't search the entire line of code, just try searching the first line, or a portion ...

// You have to be able to do at least one of the below to see this page.

^^ Then, once you find it, just examine the lines with it, to see if it reflects a majority of what you were suppose to find.

The file you're looking for, will be under your Cpanel, under File Manager, or Legacy File Manager.  Or if you have FTP access (which i never use, myself,)

You'll want to look under public_html  >  Sources  >  Admin.php   <--- click the file to open and edit it.  Always note changes, or download the file before editing, just so you have a backup ready and if you make a mistake, you can simply upload the file to overwrite it.


Sci-Fi_Fan

Quote from: hcfwesker on August 08, 2011, 04:06:15 PM

I edited my reply above with other info that may help.

Quote from: Sci-Fi_Fan on August 08, 2011, 04:01:42 PM
That is really helpful! Thanks. I thought I had the correct page to edit, but it seems I don't. Just to clarify, it's the sources.admin.php file I need, right? Where do I find this file?

One thing that I found out the hard way, is when you have to manually install an ERROR.  When you open the file to edit, don't search the entire line of code, just try searching the first line, or a portion ...

// You have to be able to do at least one of the below to see this page.

^^ Then, once you find it, just examine the lines with it, to see if it reflects a majority of what you were suppose to find.

The file you're looking for, will be under your Cpanel, under File Manager, or Legacy File Manager.  Or if you have FTP access (which i never use, myself,)

You'll want to look under public_html  >  Sources  >  Admin.php   <--- click the file to open and edit it.  Always note changes, or download the file before editing, just so you have a backup ready and if you make a mistake, you can simply upload the file to overwrite it.

Thanks for the advice. I'll try that now.
ShadowFleet.org - more than just a Star Trek RPG!

Sci-Fi_Fan

#2406
Quote from: Sci-Fi_Fan on August 08, 2011, 04:08:29 PM
Quote from: hcfwesker on August 08, 2011, 04:06:15 PM

I edited my reply above with other info that may help.

Quote from: Sci-Fi_Fan on August 08, 2011, 04:01:42 PM
That is really helpful! Thanks. I thought I had the correct page to edit, but it seems I don't. Just to clarify, it's the sources.admin.php file I need, right? Where do I find this file?

One thing that I found out the hard way, is when you have to manually install an ERROR.  When you open the file to edit, don't search the entire line of code, just try searching the first line, or a portion ...

// You have to be able to do at least one of the below to see this page.

^^ Then, once you find it, just examine the lines with it, to see if it reflects a majority of what you were suppose to find.

The file you're looking for, will be under your Cpanel, under File Manager, or Legacy File Manager.  Or if you have FTP access (which i never use, myself,)

You'll want to look under public_html  >  Sources  >  Admin.php   <--- click the file to open and edit it.  Always note changes, or download the file before editing, just so you have a backup ready and if you make a mistake, you can simply upload the file to overwrite it.

Thanks for the advice. I'll try that now.

Ah, it seems that was OK in my admin.php file. In fact, it was the first part that errored on install.

It says I need to find this:


),
),
'layout' => array(


and add this before:


'awards' => array(
'label' => $txt['awards'],
'file' => 'ManageAwards.php',
'function' => 'Awards',
'icon' => 'awards.gif',
'permission' => array('manage_awards'),
'subsections' => array(
'main' => array($txt['awards_main']),
'modify' => array($txt['awards_modify']),
'assign' => array($txt['awards_assign']),
'categories' => array($txt['awards_categories']),
'settings' => array($txt['awards_settings']),
),
),


However, I can't find the first bit of code in the file.
ShadowFleet.org - more than just a Star Trek RPG!

Sci-Fi_Fan

Quote from: Sci-Fi_Fan on August 08, 2011, 04:17:23 PM
Quote from: Sci-Fi_Fan on August 08, 2011, 04:08:29 PM
Quote from: hcfwesker on August 08, 2011, 04:06:15 PM

I edited my reply above with other info that may help.

Quote from: Sci-Fi_Fan on August 08, 2011, 04:01:42 PM
That is really helpful! Thanks. I thought I had the correct page to edit, but it seems I don't. Just to clarify, it's the sources.admin.php file I need, right? Where do I find this file?

One thing that I found out the hard way, is when you have to manually install an ERROR.  When you open the file to edit, don't search the entire line of code, just try searching the first line, or a portion ...

// You have to be able to do at least one of the below to see this page.

^^ Then, once you find it, just examine the lines with it, to see if it reflects a majority of what you were suppose to find.

The file you're looking for, will be under your Cpanel, under File Manager, or Legacy File Manager.  Or if you have FTP access (which i never use, myself,)

You'll want to look under public_html  >  Sources  >  Admin.php   <--- click the file to open and edit it.  Always note changes, or download the file before editing, just so you have a backup ready and if you make a mistake, you can simply upload the file to overwrite it.

Thanks for the advice. I'll try that now.

Ah, it seems that was OK in my admin.php file. In fact, it was the first part that errored on install.

It says I need to find this:


),
),
'layout' => array(


and add this before:


'awards' => array(
'label' => $txt['awards'],
'file' => 'ManageAwards.php',
'function' => 'Awards',
'icon' => 'awards.gif',
'permission' => array('manage_awards'),
'subsections' => array(
'main' => array($txt['awards_main']),
'modify' => array($txt['awards_modify']),
'assign' => array($txt['awards_assign']),
'categories' => array($txt['awards_categories']),
'settings' => array($txt['awards_settings']),
),
),


However, I can't find the first bit of code in the file.

Ah! After some experiementing and rejigging of the code (with a backup ready, of course!), I finally managed to get it to work properly. Thanks for all of your help and support!
ShadowFleet.org - more than just a Star Trek RPG!

treehugger

Thank you Hcfwesker - I was told the same when I asked a similar question yesterday on the Edit Emails thread.

I've spent ages trying to train myself that Before = After, only to discover yesterday that the rule only applies to making manual edits from the .xml file in a package.

I finally understand why my carefully modified files create the chaos that they do! :-[ :D

Sci-Fi_Fan

Hi, it's me again! Sorry to keep bothering you with my problems, but I can't get the mod to display awards in topic view. I have it installed and working fine, apart from that. I can add/edit awards, assign them and view them in a member's profile, just not in topic view. I'm running SMF 2.0 if that helps.

Thanks in advance!
ShadowFleet.org - more than just a Star Trek RPG!

hcfwesker

You're Welcome, treehugger.  :)

Quote from: Sci-Fi_Fan on August 09, 2011, 06:55:07 AM
Hi, it's me again! Sorry to keep bothering you with my problems, but I can't get the mod to display awards in topic view. I have it installed and working fine, apart from that. I can add/edit awards, assign them and view them in a member's profile, just not in topic view. I'm running SMF 2.0 if that helps.

Thanks in advance!

Try checking this post, and the 4 posts that follow, to see if that helps.   http://www.simplemachines.org/community/index.php?topic=114701.msg3117407#msg3117407

thecoo1est

Parse the MOD and make sure all language file edits were made.  Particularly  languages/Admin.english.php  , or whichever is your default language.
[/quote]

okay, tried this, I still get same result, text doesnt show up under features and options only a blank space. When i click the blank see the url http://www.psvita-mod.com/forums/index.php?action=admin;area=featuresettings;sa=awards;b571fe07be=155c5f15bba0ac1d6438d7f842fa0b59

but it redirects to the configuration page in admin panel, any ideas or do i need to wait on a update, or will there be one?

hcfwesker

Quote from: thecoo1est on August 09, 2011, 04:20:26 PM

okay, tried this, I still get same result, text doesnt show up under features and options only a blank space. When i click the blank see the url http://www.psvita-mod.com/forums/index.php?action=admin;area=featuresettings;sa=awards;b571fe07be=155c5f15bba0ac1d6438d7f842fa0b59

but it redirects to the configuration page in admin panel, any ideas or do i need to wait on a update, or will there be one?

Sorry, it's under this file, actually.  Themes/default/languages/Modifications.english.php    <---- the language edits of that file.  Also, check on 'server settings' to see what your forum's default language is.

thecoo1est

yea, I manually did the subs.php and admin.php, all others including "default/languages/Modifications.english.php" were edited correctly from what I seen, I parsed the file and checked all my files against the parsed files, but it just wouldnt work, I guess I will wait on a update or something unless someone can figure this out before then, thanks for your advice.

*Would my portal or anything have something to do with it?

David111567

Quote from: thecoo1est on August 10, 2011, 09:17:57 PM
yea, I manually did the subs.php and admin.php, all others including "default/languages/Modifications.english.php" were edited correctly from what I seen, I parsed the file and checked all my files against the parsed files, but it just wouldnt work, I guess I will wait on a update or something unless someone can figure this out before then, thanks for your advice.

*Would my portal or anything have something to do with it?


I'm having the same exact problem. It just won't show up in the posts. Profiles...no issues. Admin section, no issues.  What good is it if you can't display them in the posts below the avatar??

Sci-Fi_Fan

Quote from: David111567 on August 13, 2011, 02:58:20 AM
Quote from: thecoo1est on August 10, 2011, 09:17:57 PM
yea, I manually did the subs.php and admin.php, all others including "default/languages/Modifications.english.php" were edited correctly from what I seen, I parsed the file and checked all my files against the parsed files, but it just wouldnt work, I guess I will wait on a update or something unless someone can figure this out before then, thanks for your advice.

*Would my portal or anything have something to do with it?


I'm having the same exact problem. It just won't show up in the posts. Profiles...no issues. Admin section, no issues.  What good is it if you can't display them in the posts below the avatar??

Yeah I'm afraid I have to second this. I attempted to do the edits manually, but I gave up after a short while. There's too much to edit to make this happen. Will it be possible to fix this in a future update?
ShadowFleet.org - more than just a Star Trek RPG!

Spuds

QuoteI'm having the same exact problem. It just won't show up in the posts. Profiles...no issues. Admin section, no issues.  What good is it if you can't display them in the posts below the avatar??
Make sure that under award settings, the show awards in post value is > 0 or nothing will show up.

QuoteYeah I'm afraid I have to second this. I attempted to do the edits manually, but I gave up after a short while. There's too much to edit to make this happen. Will it be possible to fix this in a future update?
Unlikely .... the edits to the template files are required and there is no integration hook way around that.  If another mod or a custom theme has made the search points unavailable its manual edit time.  Its why those specific edits were placed in a separate .xml file.

thecoo1est

Quote from: Spuds on August 13, 2011, 11:50:35 AM
QuoteI'm having the same exact problem. It just won't show up in the posts. Profiles...no issues. Admin section, no issues.  What good is it if you can't display them in the posts below the avatar??
Make sure that under award settings, the show awards in post value is > 0 or nothing will show up.

QuoteYeah I'm afraid I have to second this. I attempted to do the edits manually, but I gave up after a short while. There's too much to edit to make this happen. Will it be possible to fix this in a future update?
Unlikely .... the edits to the template files are required and there is no integration hook way around that.  If another mod or a custom theme has made the search points unavailable its manual edit time.  Its why those specific edits were placed in a separate .xml file.

okay, Im on smf 2.0 gold, I installed this emulated on rc4, the only file that faile were admin.php and subs.php, I manually edited those and I have a blank space in the tab where the awards text is supposed to be, when i hover over it I can see the link "myurl/sa=awards" I click the blank space and it redirects to admin panel features and settings, in essence refreshing the page im on really, I checked all the edits in every other file to make sure install edited them right and they all were correct but I still have this problem, I even tried uninstalling and reinstalling as 2.0. Im not that new to this but Ive done all I can except rewrite php code which I would have no idea where to start with that, is there a known bug with another mod I might have? I just dont understand it honestly because everyting is there.

Spuds

If the only problem you are having is the missing text string, that would indicate that either (or both) of the following things happened.  Also you should not have to emulate rc4 but it does not hurt either.

1) The edits to Modifications.english.php did not happen
2) The file ManageAwards.english.php file did not get copied to the language file directory (if you are using a custom there place a copy in there as well, should not have to do this but ...)

there are utf8 versions of the above if you are using that on your forum. 

Those languages files will be under Themes\default\languages

CedarMill

Hello, Spuds! :)
Please write in this modification the ability to add in the future such functions:
to reward one person of the same award more than once?

Screenshot:


P.S. Sorry for my english.
SMF 2.0.7

Advertisement: