DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • February 18, 2019, 03:31:31 PM
Home Forums News Downloads Login Register Advanced Search
* *
DragonPrime Menu
Login
 
 
Resource Pages
Search

  Show Posts
Pages: [1] 2 3 ... 124
1  Coding Support / Coding Support Desk / Re: How To Get One Word Within A String Variable? on: January 11, 2019, 02:27:28 AM
I tried an unserialize on this.  It still came back wrong, and this time it returned an array.
So I went back to in_array - still did not work.

So, I imploded the value of the fetched variable as a comma delineated string...and all I got was a bunch of 1's separated by commas.

I am truly flummoxed here.  Nothing is getting me to where I want to be.

I looked in the case: biostat of Petra.
But I don't understand quite what is happening there.  I want to compare each thing one at a time.
I need to compare ONE AT A TIME....each possible tattoo, do they have it or not?  And then do or do not do an action accordingly.

I am not sure how I get there.

Go to http://phptester.net/ and put this in:

Code:
<?php
$s 
'a:9:{s:7:"mermaid";i:1;s:7:"rainbow";i:1;s:10:"red_dragon";i:1;s:13:"yellow_dragon";i:1;s:11:"blue_dragon";i:1;s:12:"white_dragon";i:1;s:12:"black_dragon";i:1;s:11:"gold_dragon";i:1;s:12:"green_dragon";i:1;}';
$t unserialize($s);
print 
"<pre>";
print_r($t);
print 
"<pre>";

It works. In your code, you might need to use stripslashes() first, when you get the pref.
2  Coding Support / Coding Support Desk / Re: How To Get One Word Within A String Variable? on: January 11, 2019, 02:23:50 AM
Code:
if ($rdtat = "yes") {

Look at this line in your code. = is to set. == is to check. You're setting $rdtat to "yes" in your if statement.

Just for interest...I had it print out the value of $tat and this is what came back

a:9:{s:7:"mermaid";i:1;s:7:"rainbow";i:1;s:10:"red_dragon";i:1;s:13:"yellow_dragon";i:1;s:11:"blue_dragon";i:1;s:12:"white_dragon";i:1;s:12:"black_dragon";i:1;s:11:"gold_dragon";i:1;s:12:"green_dragon";i:1;}

Yes, that is a serialized array.

Still, though, should I actually do an unserialize on this?

How would I get where I am trying to go?

Use unserialize() on it, then you can use in_array() to see if a tattoo is in that array of tattoos.

But why would the strpos function find something that was not there?

Going back to the first part of my answer, that therefore means that strpos() is working fine. You're just re-setting the $rdtat variable after the use of strpos().
3  Coding Support / Coding Support Desk / Re: Tables Question on: January 11, 2019, 12:18:41 AM
And that is different based on the screen size of the end user, isn't it?

Sometimes. If you have a wide table and narrow view (e.g. mobile phone), then there's not overly much you can do.

But how to make the next table show up just to the right of the first one...instead of underneath?
Whatever table you're wanting align, just set the "style" attribute to "float:left" in the table'a HTML itself.

I had already said.

The other way, though not recommended, is to create a "wrapper" table and cells, and put the tables in those cells. So:

Table
Row 1
Cell 1 - Includes first table
Cell 2 - Includes second table
End row
End table
4  Coding Support / Coding Support Desk / Re: Tables Question on: January 09, 2019, 08:38:07 PM
OK, I noticed the function cssfloat.  Because "float" is reserved in Java.  You can use this directly within a module, then?  Was not sure LOTGD would recognize the function as it is not defined within LOTGD.

"cssFloat" is the Javascript property, but that's not necessary here at all. Whatever table you're wanting align, just set the "style" attribute to "float:left" in the table'a HTML itself.
5  Coding Support / Coding Support Desk / Re: Tables Question on: January 09, 2019, 03:22:55 PM
So it would need to be done in the style sheets of the templates themselves, and not the module?

Nope. Not everything CSS has to be done in the style sheets of templates. You can use CSS inline in HTML's "style" attribute.
6  Coding Support / Coding Support Desk / Re: Tables Question on: January 09, 2019, 02:27:00 AM
Look up CSS's "float" property.
7  Game Administration, Installation and Configuration / Installation and Configuration Assistance / Re: Accounts not saving to db on: December 29, 2018, 04:47:07 AM
In the code where the creation of a character is executed, debug the error output and post the results.
8  Game Administration, Installation and Configuration / Game Administration Chat / Re: LOGD Net on: December 23, 2018, 11:21:56 PM
It seems to me I am required to have an AUTHOR Paypal link on my site...he should likewise be required to list me.
Dragonprime has nothing to do with the listing.

Yes, we got it the first time.

How do I do that?
You'll need to get hold of Eric Stevens.

His email address is likely in the source code for the author PayPal button. Also, it's his site, he's not required to do anything.
9  Coding Support / Coding Support Desk / Re: PopUp Size on: December 18, 2018, 03:34:41 AM
Pass the custom size as the second argument. So, instead of popup("prefs.php"), use popup("prefs.php","1000x500"). "550x300" is the default value of the argument when it isn't provided through the function call.
10  Game Administration, Installation and Configuration / Game Administration Chat / Re: Administrators resigning and aftermath on: December 10, 2018, 02:39:37 AM
- is it possible for the resigned admin to retain some "benefits" of the position, such as seeing IP addresses of players?

The module allowing the seeing IP addresses of players is based upon a superuser flag, so if they removed that flag, they could no longer use that module. It's always best to keep a list of module preferences and/or settings that must be manually added to any Staff, so that you can remove them later if required (e.g. the Staff List, or Staff Crowns).

- if this happens, would there be anything differently about their account, indicating they are no longer an admin?

Do you have the online list module installed, that separates staff and players? If so, they'll be listed as a player. I can't think of any other modules that list a Staffer separately or differently.
11  Modules, Themes and other customizations for your game / Completed Modules for version 1.x.x / Re: Keep gold after dragonkill on: November 27, 2018, 05:34:54 AM
Good to hear. Make sure that you have a check to disable it in case you ever need to. Core edits should only be done in the most necessary of circumstances, and can go terribly wrong in the future when other things are changed. That's what modules were created for. Cheers.
12  Modules, Themes and other customizations for your game / Completed Modules for version 1.x.x / Re: Keep gold after dragonkill on: November 25, 2018, 04:32:04 AM
Core code, module, either works. The logic works at any rate, I tested it in about two minutes. Cheers.
13  Modules, Themes and other customizations for your game / Completed Modules for version 1.x.x / Re: Keep gold after dragonkill on: November 24, 2018, 10:19:41 PM
Right.  I sorta got that figured.  I was trying to find it within the core code and make a core edit.
The module presented seemed to require a fair bit of reworking to get where I wanted.  I am gonna check out the other module presented and see if it more meets my needs here.
Will update.

Not quite there, either.  I need to not have booleans...I need to be able to have values of goldinbank saved across a DK - and set those based on number of DK's

Damn...seems like this is an easier core rewrite, if only I can find exactly WHERE in the core the damn reset happens.


This module is basically created for what you want. It saves how much gold you have before a DK, then sets your gold to that after a DK (i.e. "values of goldinbank saved across a DK"). You just want different levels of gold saved. The logic I provided can be used directly (after turning it into code) in the post-DK hook, barely any reworking necessary.
14  Modules, Themes and other customizations for your game / Completed Modules for version 1.x.x / Re: Keep gold after dragonkill on: November 24, 2018, 03:29:18 PM
As for the actual checks, in the module, find where $session['user']['goldinbank'] is being set. (Hint, it's not being set to zero, it's being set to a module pref, calculated earlier.)

If they have 120k and the limit is 250k, then they get 120k. If they have 1m and the limit is 250k, then they get 250k. So, what you're wanting is the minimum between the limit and their current gold. So, use the following logic:

If dragonkills < 50 then goldinbank = 0
else if dragonkills >= 50 and dragonkills < 100 then goldinbank = (minimum of 50000 and current gold)
else if dragonkills >= 100 and dragonkills < 200 then goldinbank = (minimum of 100000 and current gold)
else if dragonkills >= 200 and dragonkills < 500 then goldinbank = (minimum of 250000 and current gold)
else if dragonkills >= 500 then goldinbank = (minimum of 500000 and current gold)
15  Game Administration, Installation and Configuration / Game Administration Chat / Re: LOGD Net on: November 23, 2018, 03:58:52 AM
The list is maintained by Eric Stevens (MightyE) and has nothing to do with Dragonprime.

An idea would be to contact them.
Pages: [1] 2 3 ... 124

*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
21 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search