Jump to content

[CRITICAL UPDATE]Web Vending Database (Standalone and FluxCP Addon)


Sanasol

Recommended Posts


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

Updated. still error but less error now!

 

[26-Aug-2013 03:59:32 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 11
[26-Aug-2013 04:01:58 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 11
[26-Aug-2013 04:02:00 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 11
[26-Aug-2013 04:10:36 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 11
[26-Aug-2013 04:10:39 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 11
[26-Aug-2013 04:13:07 America/Los_Angeles] PHP Warning:  require(/home/server/public_html/merch/class.db.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/server/public_html/merchant_db/config.php on line 8
[26-Aug-2013 04:13:07 America/Los_Angeles] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required '/home/server/public_html/merch/class.db.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/server/public_html/merchant_db/config.php on line 8
[26-Aug-2013 04:20:15 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 11
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

script still can't find class.db.php

 

config file check line 8

now must be

 

 require("class.db.php");
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

Thanks sanasol, it only gives me 1 error now on this line:

    $db->setErrorCallbackFunction("print_r", "text");

 

[26-Aug-2013 04:46:52 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 11
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

$db = new db("mysql:host={$host};dbname={$dbname}", $user, $pass);  
var_dump($db);
$db->setErrorCallbackFunction("print_r", "text");

do this in config

 

and post what it will show...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

The page (www.----.com/merchant_db) now says "NULL".

 

 

 

[26-Aug-2013 05:51:00 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 10
[26-Aug-2013 05:51:01 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 10
[26-Aug-2013 05:51:02 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 10
[26-Aug-2013 05:51:03 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 10
[26-Aug-2013 05:51:04 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 10
[26-Aug-2013 05:51:04 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 10
[26-Aug-2013 05:52:39 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 10
[26-Aug-2013 05:55:06 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 10
[26-Aug-2013 07:56:06 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 10
[26-Aug-2013 11:49:40 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 12
[26-Aug-2013 11:49:45 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 12
[26-Aug-2013 11:50:32 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 12
[26-Aug-2013 11:50:32 America/Los_Angeles] PHP Fatal error:  Call to a member function setErrorCallbackFunction() on a non-object in /home/server/public_html/merchant_db/config.php on line 12
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

script can't define db class.

 

I don't know why... 

class.db.php in a folder?

 

maybe try to change require path

 

require($_SERVER['DOCUMENT_ROOT']."/merchant_db/class.db.php");
require($_SERVER['DOCUMENT_ROOT']."/merchant_db/Paginator.class.php");
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

changed but still not work :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

open class.db.php

			try {
				parent::__construct($dsn, $user, $passwd, $options);
				} catch (PDOException $e) {
				$this->error = $e->getMessage();
			}

 

add debug var_dump($e->getMessage());

 

			try {
				parent::__construct($dsn, $user, $passwd, $options);
				} catch (PDOException $e) {
				var_dump($e->getMessage());
				$this->error = $e->getMessage();
			}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

did that, now it says this

 

string(105) "SQLSTATE[28000] [1045] Access denied for user 'root'@'us10.la.thewebhostserver.com' (using password: YES)" NULL
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

can't connect to mysql...

password wrong or something else.

 

Change this to ur DB Host, DB user and DB name

$host = "localhost";
$dbname = "san";
$user = "root";
$pass = "root";


Flux fix named item

1176fdc614a56dd53a176c839e1a.png


Flux fix refine array
 
https://github.com/S-anasol/sanasol/commit/ed5d5ef1ce0f6481be1da7dda082ece16a44766d

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.02
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

that is weird. i put the correct info. x.x

 

do i need to request my host to open certain ports?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

no, maybe ur mysql user can login only from localhost(if site stands separately from server), then you need add user perms for site ip i.e. root@us10.la.thewebhostserver.com

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

Added Demo

 

and FluxCP demo

 

re-uploaded attach with latest fixes

Edited by Sanasol
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

Some fixes for both versions.

 

FluxCP my and Yommy src

Standalone my and Yommy src

 

0edeed15b07e9b0239db0673b97f.png

 

Thank RagnaOk for providing the veeery big data to detect bugs: http://ragnaok.net/vending_database/

Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

When I mouse over the map, nothing appears.

Is that strictly part of this addon, or am I missing something from my FluxCP?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

Check browser console(F12 in Chrome)

 

any errors?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  161
  • Reputation:   5
  • Joined:  02/07/13
  • Last Seen:  

I didn't see anything that seemed to be related to the vending addon.

Only error I saw seemed to have something to do with the rotational screenshot module on the bottom of the page.

 

http://nymphro.com/?module=vending

I made a 'test' account:

Account: Test

Password: Aa123456

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

I think your php has short codes disabled

 

change this line

https://github.com/S-anasol/sanasol/blob/master/merchant_db_flux/vending/themes/default/vending/index.php#L103

 

to

 

 

<span class='mapinfo' data-map='<?php echo $char->last_map?>' data-x='<?php echo $char->last_x?>' data-y='<?php echo $char->last_y?>'><?php echo htmlspecialchars($char->last_map)." ".htmlspecialchars($char->last_x).",".htmlspecialchars($char->last_y) ?></span>
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  153
  • Reputation:   14
  • Joined:  07/07/12
  • Last Seen:  

You do not want to modify the code so that a click on item page would lead to the corresponding page poring.ru base in a new window?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

Серьезно? Совсем рук нету?

 

<td>{$nick}{$vvs}<a href=\"http://www.poring.ru/items/{$row->nameid}.html\" target=\"_blank\">{$item}</a></td> 

 

 

 

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.03
  • Content Count:  647
  • Reputation:   16
  • Joined:  11/21/11
  • Last Seen:  

Where

 

Source inserting shop info into database.
 
Few source lines and a little bit of magic php + js
Decorated with new Twitter Bootstrap

 

Remake of this http://www.eathena.ws/board/index.php?showtopic=255406  /oops 
 
Installation
 
/src/map/vending.c
 
Function: vending_closevending
 
After 

clif_closevendingboard(&sd->bl, 0);

Add

//vending to db [Sanasol]
if( SQL_ERROR == Sql_Query(mmysql_handle,"delete from `vending` where `char_id`='%d'", sd->status.char_id) )
Sql_ShowDebug(mmysql_handle);
//vending to db [Sanasol]

 

Function: vending_purchasereq

 

After

// vending item
pc_additem(sd, &vsd->status.cart[idx], amount, LOG_TYPE_VENDING);
vsd->vending[vend_list[i]].amount -= amount;
pc_cart_delitem(vsd, idx, amount, 0, LOG_TYPE_VENDING);
clif_vendingreport(vsd, idx, amount);

Add

 

//vending to db [Sanasol]
		if(vsd->vending[vend_list[i]].amount >= 1)
		{
			if( SQL_ERROR == Sql_Query(mmysql_handle,"update `vending` set `amount`='%d' where `char_id`='%d' and `index`='%d'", vsd->vending[vend_list[i]].amount, vsd->status.char_id, vend_list[i]) )
				Sql_ShowDebug(mmysql_handle);
		}
		else
		{
			if( SQL_ERROR == Sql_Query(mmysql_handle,"delete from `vending` where `char_id`='%d' and `index`='%d'", vsd->status.char_id, vend_list[i]) )
				Sql_ShowDebug(mmysql_handle);
		}
//vending to db [Sanasol]

 

Function: vending_openvending
 
After

clif_openvending(sd,sd->bl.id,sd->vending);

Add

 //vending to db [Sanasol]
    for( j = 0; j < count; j++ )
    {
        int index = sd->vending[j].index;
        struct item_data* data = itemdb_search(sd->status.cart[index].nameid);
        int nameid = ( data->view_id > 0 ) ? data->view_id : sd->status.cart[index].nameid;
        int amount = sd->vending[j].amount;
        int price = cap_value(sd->vending[j].value, 0, (unsigned int)battle_config.vending_max_value);
        
        if( SQL_ERROR == Sql_Query(mmysql_handle,"INSERT INTO `vending` (`char_id`,`name`,`index`,`nameid`,`amount`,`price`,`refine`,`card0`,`card1`,`card2`,`card3`) VALUES (%d, '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')", sd->status.char_id, message, j, nameid, amount, price, sd->status.cart[index].refine, sd->status.cart[index].card[0], sd->status.cart[index].card[1], sd->status.cart[index].card[2], sd->status.cart[index].card[3]) )
        Sql_ShowDebug(mmysql_handle);
    }
    //vending to db [Sanasol]
 

 

/src/map/unit.c

 

After

		case BL_PC: {
			struct map_session_data *sd = (struct map_session_data*)bl;

			if(sd->shadowform_id){ //if shadow target has leave the map
			    struct block_list *d_bl = map_id2bl(sd->shadowform_id);
			    if( d_bl )
				    status_change_end(d_bl,SC__SHADOWFORM,INVALID_TIMER);
			}
			//Leave/reject all invitations.
			if(sd->chatID)
				chat_leavechat(sd,0);
			if(sd->trade_partner)
				trade_tradecancel(sd);

Add

            //vending to db [Sanasol]
            vending_closevending(sd);
            //vending to db [Sanasol]

 


Create table

CREATE TABLE IF NOT EXISTS `vending` (
  `char_id` int(11) unsigned NOT NULL DEFAULT '0',
  `name` varchar(50) DEFAULT NULL,
  `index` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `nameid` int(11) unsigned NOT NULL DEFAULT '0',
  `amount` int(11) unsigned NOT NULL DEFAULT '0',
  `price` bigint(20) unsigned NOT NULL DEFAULT '0',
  `refine` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `card0` smallint(11) NOT NULL DEFAULT '0',
  `card1` smallint(11) NOT NULL DEFAULT '0',
  `card2` smallint(11) NOT NULL DEFAULT '0',
  `card3` smallint(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`char_id`,`index`),
  KEY `char_id` (`char_id`),
  KEY `nameid` (`nameid`)
) ENGINE=MyISAM;

 
Screenshots

 

Main page

69e9a99f1f02c192e3e2cef9562b.png

 

 

Map position tooltip

84c4ecf6c00cc0f01c182bdff472.png

For map showing need *.gat files

Approximate position, accurate display at map could not to achieve :(

 

And Search

1fb870736fd032484e2452df9f50.png

 

Item images very old, you need to add the new items

 

 

FluxCP Screens

[spoiler=Main Vending DB]e56669e30bf1f420c9484f948e1d.png

[spoiler=Search]d21beacb490bc2f4415285fee024.png

 

[spoiler=Map]399cb907803a06ce3e009b5f97d5.png

Demo

FluxCP Demo

 

Sources

github.png

Sources

Sources FluxCP Addon

 

Sources is absolutely free, but if you want you can do donation

ba074bc683178eb863ef108f820a.png

 

In attach web scripts with items images

 

where to install the merchant_db.rar?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

upload it to your website

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.03
  • Content Count:  647
  • Reputation:   16
  • Joined:  11/21/11
  • Last Seen:  

In what folder in flux cp?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

For flux you should upload this folder https://github.com/S-anasol/sanasol/tree/master/merchant_db_flux

to fluxcp/addons/

Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  130
  • Topics Per Day:  0.03
  • Content Count:  528
  • Reputation:   18
  • Joined:  09/11/12
  • Last Seen:  

error 1:

post-7694-0-25895100-1382490800_thumb.png

 

 

 

error2:

post-7694-0-89291100-1382362047_thumb.png

 

The Shopname and Charname are switched. An one are empty.

Whats the prob?

Edited by Vincent
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...