DragonPrime - LoGD Resource Community

Modules, Themes and other customizations for your game => Themes => Topic started by: RaynDarren on September 28, 2016, 03:11:27 PM



Title: Removing Charstats
Post by: RaynDarren on September 28, 2016, 03:11:27 PM
So, I'm working on a template for my new site. What I need to do is block all char stats completely. I've managed to get the actual char stats blocked using the htm file, but, all the data is still there in several long lines. How do I get rid of them?

Additionally, I need to block navs where are you do not have the option to chat, but ONLY on this theme, Is that possible? if so, how?

Any help would be greatly appreciated.
Thanks,
~Rayn


Title: Re: Removing Charstats
Post by: MarcTheSlayer on October 13, 2016, 08:00:30 AM
Removing the char stats isn't easy as they're coded to always show, even when you're in the grotto. I wouldn't know where to begin after all these years.

To block navs based on a person's template is easy though as the template name is stored in a cookie. Get said cookie and if the name is what you're looking for then block the navs.

Code:
$_COOKIE['template']

:)


Title: Re: Removing Charstats
Post by: Maverick on October 13, 2016, 12:18:54 PM
I've managed to get the actual char stats blocked using the htm file, but, all the data is still there in several long lines. How do I get rid of them?

I'm confused with what you mean? Can you post a picture of the 'several long lines' so I can get a better idea of what you're trying to accomplish?


Title: Re: Removing Charstats
Post by: Aeolus on October 13, 2016, 02:43:58 PM
Have you looked at using the wipe_charstats() function? If you hook into the charstats hook with a high priority number (i.e. so it runs last), you'll remove all of your charstats.

It's what some sites use when they hide the charstats when a new MotD is posted, so players are forced to read it.


Title: Re: Removing Charstats
Post by: RaynDarren on October 14, 2016, 03:03:37 PM
Removing the char stats isn't easy as they're coded to always show, even when you're in the grotto. I wouldn't know where to begin after all these years.

To block navs based on a person's template is easy though as the template name is stored in a cookie. Get said cookie and if the name is what you're looking for then block the navs.

Code:
$_COOKIE['template']

:)

Thanks Afkamm!

I've managed to get the actual char stats blocked using the htm file, but, all the data is still there in several long lines. How do I get rid of them?

I'm confused with what you mean? Can you post a picture of the 'several long lines' so I can get a better idea of what you're trying to accomplish?

I'm afraid I can't, but, if you go to http://testbox.rpglink.in/home.php?, create a character and select the mythrp template you'll see right off what I'm talking about.


Have you looked at using the wipe_charstats() function? If you hook into the charstats hook with a high priority number (i.e. so it runs last), you'll remove all of your charstats.

It's what some sites use when they hide the charstats when a new MotD is posted, so players are forced to read it.

I haven't tried that no, haven't ever heard of it actually, I've never looked at the code in the force read MotD module. Thanks so much for the suggestion, it's been driving me crazy.


Title: Re: Removing Charstats
Post by: Sunday on October 17, 2016, 10:36:51 AM
Removing the char stats isn't easy as they're coded to always show, even when you're in the grotto. I wouldn't know where to begin after all these years.

To block navs based on a person's template is easy though as the template name is stored in a cookie. Get said cookie and if the name is what you're looking for then block the navs.

Code:
$_COOKIE['template']

:)

Thanks Afkamm!

I've managed to get the actual char stats blocked using the htm file, but, all the data is still there in several long lines. How do I get rid of them?

I'm confused with what you mean? Can you post a picture of the 'several long lines' so I can get a better idea of what you're trying to accomplish?

I'm afraid I can't, but, if you go to http://testbox.rpglink.in/home.php?, create a character and select the mythrp template you'll see right off what I'm talking about.


Have you looked at using the wipe_charstats() function? If you hook into the charstats hook with a high priority number (i.e. so it runs last), you'll remove all of your charstats.

It's what some sites use when they hide the charstats when a new MotD is posted, so players are forced to read it.

I haven't tried that no, haven't ever heard of it actually, I've never looked at the code in the force read MotD module. Thanks so much for the suggestion, it's been driving me crazy.

Sorry that it took you this long to receive answers. I am not sure if wipe_charstats() would work here - there are no hooks to intercept $charstat_info before getcharstats() is ran, I believe. Don't quote me there, because I haven't used it at all.

Is this usage in just one template, or the entire site? If it is just for one template, I advise to use CSS to hide the stats, and maybe JavaScript after to destroy it after the page has loaded entirely. That would just require your template to be edited. Otherwise the easiest way would be through the everyfooter hook, manipulating the $footer global before page_footer() does in lib/pageparts.php (forget the line #). All you have to do in that hook is a simple str_replace() of {stats} in $footer. Keep in mind that you need to not have any CSS rules for your stats section, and move the {paypal} template part for this to look right. If you are running this on any core template, it will look odd! (http://prntscr.com/cvhb79)

I will attach an example to get you started, good luck with your customization. :)


Title: Re: Removing Charstats
Post by: RaynDarren on October 17, 2016, 05:21:10 PM
I've loaded the module you posted Stephen, thank you. Now, to get it to work for only that one template. I've tried a prefs hook, which didn't work.

Code:
    'prefs'=>array(
'Template,title',
'mythrp' => 'Use MythRP template?,bool|1',
),

The getmoduleinfo function is set up in a way I'm unfamiliar with, so I'm not even sure if I set the pref correctly.

It did wipe the nearly three pages of "WARNING! XXXXX does not exist" that I was getting though, so that's good.

Should I use a pref?


Title: Re: Removing Charstats
Post by: RaynDarren on November 10, 2016, 04:56:31 PM
::Bump::


Title: Re: Removing Charstats
Post by: Sunday on November 12, 2016, 10:29:02 AM
I've loaded the module you posted Stephen, thank you. Now, to get it to work for only that one template. I've tried a prefs hook, which didn't work.

Code:
    'prefs'=>array(
'Template,title',
'mythrp' => 'Use MythRP template?,bool|1',
),

The getmoduleinfo function is set up in a way I'm unfamiliar with, so I'm not even sure if I set the pref correctly.

It did wipe the nearly three pages of "WARNING! XXXXX does not exist" that I was getting though, so that's good.

Should I use a pref?

Well, you could check if the $_COOKIE['template'] value is set to 'MythRP'.


Title: Re: Removing Charstats
Post by: RaynDarren on November 12, 2016, 11:17:28 AM
Thanks! Might there be somewhere in the code I could look at that would have this set already? Examples are good, :).


Title: Re: Removing Charstats
Post by: Maverick on November 13, 2016, 06:58:24 AM
Thanks! Might there be somewhere in the code I could look at that would have this set already? Examples are good, :).

Might be something in lib/pageparts.php.

However, if you use debug($_COOKIE['template']); in RawPHP it will return something like 'jade.htm'

So if you want to set something for a specific template, you could use:

if ($_COOKIE['template'] == 'MythRP.htm') { }


Title: Re: Removing Charstats
Post by: RaynDarren on November 14, 2016, 12:04:21 PM
Awesome! Thanks!


Title: Re: Removing Charstats
Post by: Mr-Coincidental on December 10, 2016, 08:05:45 AM
in the html file for template

find <td class="stats">

and replace with <td class="stats" style="display: none;">

that will hide all the stats


Title: Re: Removing Charstats
Post by: Sunday on December 10, 2016, 10:37:35 AM
in the html file for template

find <td class="stats">

and replace with <td class="stats" style="display: none;">

that will hide all the stats
Templates shouldn't be in tables, and it is better to modularize it rather than editing all templates.


Title: Re: Removing Charstats
Post by: Mr-Coincidental on December 10, 2016, 11:30:29 AM
i dunno, for mine i just edited the html for the template i wanted to do it on, the template already had tables in it, so i just added that to hide the whole thing..

The original post says that he just wants to do it for a new template he is making, so surely that's the easiest way?


Title: Re: Removing Charstats
Post by: RaynDarren on December 10, 2016, 06:18:10 PM
Thank you for the advice Mr. Coincidental,  :). Oh, and btw, I'm a she, not a he. :)


Title: Re: Removing Charstats
Post by: Mr-Coincidental on December 11, 2016, 12:55:37 PM
oops sorry! i read it as Ryan ha!

© 2018 DragonPrime - LoGD Resource Community
Email Talisman: talisman -at- gmail.com
&oeXs)2U7=V BmܲV.U e=;p\}eG )Jj} C5EH7ˤH=j } mo|*Ŋw{drV_@IV>/- TFQJ׀̀Ve}l1,V O iNYx͘$e$;
Forums: Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines