Swiftsmoke / openwowcms

Open Source Web frontend for the private WoW servers.
http://swiftsmoke.github.com/openwowcms
GNU General Public License v3.0
5 stars 0 forks source link

VoteShop Delivery failes. Produces a solid white page #25

Open bj21 opened 11 years ago

bj21 commented 11 years ago

My noob non-existant sql skills is unable to diagnose this issue. It's frustrating to be so close yet so far away.

I'll need help getting vote shop delivery to work.

Help!

sharkbit commented 11 years ago

Hello bj21,

What core are you using? Dose the page die when you go to it, or after you submit an item? And a link to the site is always helpful.

bj21 commented 11 years ago

Trinitycore-commit:bd135718b6e33da228b052f68544f918d09aff9d (as of 15 dec 2012)

The vote shop will list the items, pull the characters from the realms and list them properly BUT when a player tries to select an item to 'purchase' the item, the browser page goes white and nothing is delivered.

I have found other issues[*] but none other that are show stoppers like the vote delivery one.

I will send you details to the git email address on file.

bj21 commented 11 years ago

attempting to "UPDATE" the CMS via the administration update link caused the CMS to re-install itself. Upon reinstallation the voteshop breaks again due to Issue#23 and Issue#24. Are you able to implement the fixes suggested for issue#23 and issue#24 ?

Also, I'm unable to continue to update the CMS. I get an Access Error message.

I will wait a bit before attempting a reinstall/re-update.

Swiftsmoke commented 11 years ago

The above issues should now be fixed, sorry for the inconvenience and thanks for the fixes :)

bj21 commented 11 years ago

On 12/27/2012 12:25 PM, Swiftsmoke wrote:

The above issues should now be fixed, sorry for the inconvenience and thanks for the fixes :)

Are you kidding? Thank YOU! I'm just glad to have the ability to restrict votes to once per 12hrs by IP AND account. And to have the vote shop working!

I did a fresh 'git clone' and got the latest changes. I verified them in 'git log' and by looking at the files on disk (trinity.php). Yet when I logged back into the CMS administrator link, it showed the CMS was out of date. I'm not sure what that is about and I haven't used the web based 'update' button yet. I can't do much programming but I can test and debug!

The next thing I'm going to try with the CMS is to disable the teleport and shoutbox modules. I'm even going to try to make voteshop a side link to make things very simple.

Let me know if there is anything I can do for you.

BJ

Swiftsmoke commented 11 years ago

Ah its due to the SHA_VERSION not being updated by myself in the last commit, just open up

engine/version.php

change

define('SHA_VERSION', '2b3fa5526e819d70d7798f6d32ed66e9d33f3c1a');

to

define('SHA_VERSION', '725391e9a876fe882f9d2f7add7f06ad34c56203');

If theres any other issues you find let me know about them and i'll get them fixed as soon as possible ^_^

Glad to see someone is using this branch, although it is mostly for experimental use lol that said good luck with your website and server bj21 :+1:

bj21 commented 11 years ago

On 12/28/2012 11:07 AM, Swiftsmoke wrote:

Glad to see someone is using this branch, although it is mostly for experimental use lol that said good luck with your website and server bj21 :+1:

Is there something better to use?? From ALL of the various CMS's that I've seen, this one has had exactly the features that I wanted. Nothing else had a vote shop delivery option. Many of the others had player realm list listings but I don't know that I want players hunting other players or locating invisible GMs. :)

Thanks for the well-wishes. Now that we have working vote shop deliveries, I will be sending out the first, and ONLY email to the old WoWGasm player base -- which I inherited. After "The Last Shindig - A WoWGasm Reunion™" is over, I will be purging the accounts and character tables of inactives.

Oh, and I added the voteshop, profile editor and expansion selection to the leftbottom menu and made the USERPANEL link invisible. So things are finally setup and final. Gonna make a scheduled sql procedure to cleanup shoutcast posts. :) yay!

Have a super great merry happy wonderful New Year and success to all of your endeavors.

BJ

Swiftsmoke commented 11 years ago

I believe Azer-CMS V3 is probably one of the best wow websites around at the moment, openwowcms doesn't really have much of a community anymore (when it was webwow it was huge)...

That said your more than welcome to use this one and i'll happily fix any issues you find/implement features that you require..

Happy xmas and new year to you aswell :)

~ Rob

bj21 commented 11 years ago

The goblins have struck again! They are stealing all of the vote shop deliveries! Vote point purchases look like they go through but nothing arrives in the mailbox.

Turns out the character 'name' is not pulling results in the query. I'm off to go see if I can find where the action happens and fix the goblin sabotage.

Here is the Remote Administration log entries and the related web screen output

2012-12-31_15:44:32 Incoming connection from 127.0.0.1 2012-12-31_15:44:38 Login attempt for user: VOTEBOT 2012-12-31_15:44:38 User login: VOTEBOT 2012-12-31_15:44:38 Got command: .send items "VoteShopREF236137" "This mail was sent trough website. Timestamp: 1356968672" 33455 2012-12-31_15:44:38 Closing connection

Mail with item sent! No money was sent. -- For admins only -- Char name: Char guid: 1 Subject: Vote Shop REF 956921 Item: 33455 Realm: 0 Stack: 1 SQL1: SELECT name, guid, race, class, gender, level, money FROM characters WHERE guid = '1' AND account = '0' LIMIT 1 SQL2: SELECT itemid,charges,cost,allowedrealms,sep FROM openwowcms.wwc2_shop WHERE id='10' AND donateorvote='0' LIMIT 1
bj21 commented 11 years ago

I think this is the answer to fixing PART of the vote delivery issue. There was an

AND account = '{$param[1]}'

on the case1 line that seemed to cause the query to fail. Since guid seems to be sufficiently unique for the query, I hacked out the 'and account' part and vote deliveries are now successful.

I know not all the ramification of this action, but will be on the lookout as we test this.

Oh..and I put more backticks around some field names and table names on the case0 line.

The quantity of items isn't being sent. I can't seem to send multiples of the same item. I'm working on that issue still.

diff --git a/engine/core/trinity.php b/engine/core/trinity.php
index fed280a..83011aa 100644
--- a/engine/core/trinity.php
+++ b/engine/core/trinity.php
@@ -41,9 +41,9 @@ class User extends SessionUser implements BaseUser {
         switch ($id)
         {
             case 0: // Get id and username
-                return "SELECT id, username FROM " . TBL_ACCOUNT . " WHERE username = \"{$db->escape($param[0])}\" LIMIT 1";
+                return "SELECT `id`, `username` FROM ".TBL_ACCOUNT." WHERE username = \"{$db->escape($param[0])}\" LIMIT 1";
             case 1: // Get character info
-                return "SELECT name, guid, race, class, gender, level, money FROM " . TBL_CHARACTERS . " WHERE guid = '{$param[0]}' AND account = '{$param[1]}' LIMIT 1";
+                return "SELECT `name`, `guid`, `race`, `class`, `gender`, `level`, `money` FROM " . TBL_CHARACTERS . " WHERE guid = '{$param[0]}'  LIMIT 1";
             case 2: // Teleport character
                 return "UPDATE ".TBL_CHARACTERS." SET position_x=\"{$param[2]}\", position_y=\"{$param[3]}\", position_z=\"{$param[4]}\", map=\"{$param[0]}\", money=\"{$param[6]}\" WHERE guid='{$param[7]}'";
             case 3: // Unstuck character
@@ -427,4 +427,4 @@ class User extends SessionUser implements BaseUser {
                else
                        return  "<span class=\"colorbad\">Trinity server is offline, you must do this when server is online.</span>";
        }
-}
\ No newline at end of file
+}
bj21 commented 11 years ago

ITEM STACK DELIVERY FIX:

diff --git a/engine/core/trinity.php b/engine/core/trinity.php
index fed280a..d6a4793 100644
--- a/engine/core/trinity.php
+++ b/engine/core/trinity.php
@@ -338,7 +338,7 @@ class User extends SessionUser implements BaseUser {

                $text = str_replace(array("\n", "\""), "", $externaltext);
                if (!$text)
-                       $text = "This mail was sent trough website. Timestamp: ".date("U");
+                       $text = "VoteShop mail delivery!  Timestamp: ".date("U");
                $money= preg_replace( "/[^0-9]/", "", $money);
                /**
                * REALM DETECTION:
@@ -390,7 +390,7 @@ class User extends SessionUser implements BaseUser {
                        if ($item<>'' && $item<>'0')//send item
                        {