Jump to content


New TrueSite Template Beta


  • Please log in to reply
8 replies to this topic
Balladeer Balladeer

Hand of Avadon

  • Member
    • Member ID: 3,131
  • 1,687 posts
  • LocationBeyond Belief

Posted 21 March 2014 - 08:49 PM #1 New TrueSite Template Beta

Trying to design a new template for my BoA Scenario Pages. This is what I have so far and I would like some feedback. I know the Next button links to a missing page. Haven't created a page for Beechford yet. I'm looking for broken links, odd displays, and suggestions for scenario stats, layout, or additions. Or just a thumbs up/thumbs down in general.

Thanks.

Kelandon Kelandon

!!!

  • Global Moderator
    • Member ID: 2,682
  • 9,786 posts

Posted 21 March 2014 - 09:07 PM #2 New TrueSite Template Beta

Looks fine to me (on cursory inspection).
VCH: I believe we settled this way back when: Kelandon was the most attractive.
SoT: You'd be happy, too, if you were such a clever spider.
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!

sylae sylae

Wisebottom

  • Global Moderator
    • Member ID: 5,482
  • 3,321 posts
  • LocationToledo, Ohio, United States

Posted 21 March 2014 - 10:29 PM #3 New TrueSite Template Beta

fyi: i'm working on a new system for the scenario reviews that will make that ratings tab on the right a lot easier on your end.

on a design side i feel like having a tiny fixed-width detracts from it somewhat. I feel kind of silly scrolling an overflow:auto div when i have so much screen space that is just "the color purple". personal prefs though.

BMA BMA

Sorcerer

  • Member
    • Member ID: 5,939
  • 663 posts

Posted 22 March 2014 - 07:06 AM #4 New TrueSite Template Beta

The site looks good, it has an old-school look about it which fits in nicely. But you could change the high contrast (sky_blue against purple) of un-clicked links maybe ?

Balladeer Balladeer

Hand of Avadon

  • Member
    • Member ID: 3,131
  • 1,687 posts
  • LocationBeyond Belief

Posted 22 March 2014 - 08:33 PM #5 New TrueSite Template Beta

@sy, yeah.. was being lazy because absolute positions are quicker to figure out than floats but I think I got it now. Shift-F5 if it still looks the same.

@BMA I'll look at other colors. Just want something obvious without making my eyes bleed. If you were to suggest a color what would you pick.

BMA BMA

Sorcerer

  • Member
    • Member ID: 5,939
  • 663 posts

Posted 22 March 2014 - 10:27 PM #6 New TrueSite Template Beta

I'd say any colour that doesn't glow like that, maybe the same shade of blue used for the hints' X markers.

Note : I felt this when I was browsing through the entire list, deciding what scenario to download. It probably isn't an issue when you come to the site to download just those scenarios you wanted.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 22 March 2014 - 10:57 PM #7 New TrueSite Template Beta

Setup looks quite nice actually.

Balladeer Balladeer

Hand of Avadon

  • Member
    • Member ID: 3,131
  • 1,687 posts
  • LocationBeyond Belief

Posted 27 March 2014 - 02:36 PM #8 New TrueSite Template Beta

View Postsylae, on 21 March 2014 - 10:29 PM, said:

fyi: i'm working on a new system for the scenario reviews that will make that ratings tab on the right a lot easier on your end.

Let me know when you have this ready. I don't want to start transferring pages until the template is ready.

sylae sylae

Wisebottom

  • Global Moderator
    • Member ID: 5,482
  • 3,321 posts
  • LocationToledo, Ohio, United States

Posted 28 March 2014 - 01:09 PM #9 New TrueSite Template Beta

The data will be exposed as such (I'm using Adrift as an example here):

In each CSR review, there will be a chunk of HTML embedded in it, as such:
<span data-csr-composite="eyJ0aXRsZSI6IkFkcmlmdCIsInRpZCI6MTIzMDcsInRhZ3MiOlsiYXZlcm51bSB1bml2ZXJzZSIsImJlZ2lubmVyIiwiY29tYmF0IGhlYXZ5Iiwic2hvcnQiXSwiYmdhc3AiOnsiNSI6MSwiNCI6MTMsIjMiOjIsIjIiOjAsIjEiOjB9fQ==" id="csr-composite">
Composite Score: ...
</span>
The data-csr-composite attribute contains encoded machine-readable data on the scenario. You can use a CSS selector to grab that information, and send it to a parser. Using QueryPath (which is basically jQuery for PHP), the following code will grab it:
<?php
$data = htmlqp($html, '#csr-composite')->attr("data-csr-composite");
This data is essentially a JSON object encoded using base64. You can decode it using the following PHP string:
<?php
$array = json_decode(base64_decode($data), true);
The JSON string will look something like the following (note that I am still developing the script to generate this, but it may change slightly as I (possibly) add more metadata about the scenario):
{
	"title": "Adrift",
	"tid": 12307,
	"tags": [
		"avernum universe",
		"beginner",
		"combat heavy",
		"short"
	],
	"bgasp": {
		"5": 1,
		"4": 13,
		"3": 2,
		"2": 0,
		"1": 0
	}
}
Note that 'bgasp' is the abbreviation for the actual scenario stats. They are described in detail in this source config file. Basically, 5=best, 4=good, and so on down the line.

So, your solution will be to put this little function somewhere:
<?php // let's call this decode.php

require 'qp.php'; // Assuming QueryPath is somewhere in INCLUDE_PATH. May need to adjust.

/**
 * NOTE: This function doesn't do much in the way of error handling. Will probably cause drama.
 **/
function getPost($tid) {
  $url = "http://spiderwebforums.ipbhost.com/index.php?/topic/$tid-/";
  $html = file_get_contents($url);
  $data = htmlqp($html, '#csr-composite')->attr("data-csr-composite");

  return json_decode(base64_decode($data), true);
} // getPost

Then, once you've done that, you just need to simply include the following in each review page:
<?php
require '/path/to/decode.php';

$i = getPost(12307);
?>
<!-- html stuff here, yada yada -->
Best: <?php echo $i['bgasp']['5']; ?>
<!-- yada yada -->

Of course, with this data you can do a lot of stuff, look at this code:83 for a quick generator to list the "Composite Score" section




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users