Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-03-2008, 02:19 AM
OsideRida06 OsideRida06 is offline
 
Join Date: Apr 2008
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Trade Manager Mod Help?

I have recently had a friend install a new trade manager on my forum. Almost everything is working great. He took it from his forum and pretty much re-created it on mine. For a small fee of course.

Well here is my situation. There are two things that are not working right. When you "create" a trade you have to put it what the creator of the trade is giving, and what you are receiving as well. And other small notes as well of course.

On the "info" page for each trade, the "what creator is sending" and "what you are receiving" does not show up. So I am guessing there is some kind of wrong template edit or something that is causing this.

It would be great if I could send the code to some to just look at for a minute. It's really not that big at all. Or if that does not work I could give them temporary access to the forum.

I would greatly appreciate it. The person who was installing it is going through some family problems and I really would like to get this TM launched. This is the last thing that needs fixed before we can launch it.

Thanks for reading! Any help would be great.
Reply With Quote
  #2  
Old 12-04-2008, 05:11 AM
OsideRida06 OsideRida06 is offline
 
Join Date: Apr 2008
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone?
Reply With Quote
  #3  
Old 12-04-2008, 02:18 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It is very hard to just jump into someone else's code and 'see' what is going on and then fix the issues. That is probably why you aren't getting people to help. You may want to actually post the relevant parts of the code and maybe we can see the error - the php part that grabs the variable and the template that spits it out and the part around the other template for where the custom template gets inserted.
Reply With Quote
  #4  
Old 01-18-2009, 04:08 AM
OsideRida06 OsideRida06 is offline
 
Join Date: Apr 2008
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry this has taken so long. I did not know that some one had finally replied. Hopefully you can help.

Here is the template that takes it.

Picture



Code:
<center><span style="text-decoration:underline;color:white;"><a href='index.php?pageid=trademanager'><img border="0" src="http://calistyle101.com/forums/trademanager/images/home.png">Trade Manager</a></span> | <span style="text-decoration:underline;color:white;"><a href='index.php?pageid=tradecreator'><img border="0" src="http://calistyle101.com/forums/trademanager/images/create.png">Create Trade</a></span> | <span style="text-decoration:underline;color:white;"><a href='/index.php?pageid=confirmtrade'><img border="0" src="http://calistyle101.com/forums/trademanager/images/confirm.png">Confirm Trade</a></span> | <span style="text-decoration:underline;color:white;"><a href='index.php?pageid=completetrade'><img border="0" src="http://calistyle101.com/forums/trademanager/images/complete.png">Complete Trade</a></span></center> 
<br />
<?
if($_POST[submit])
{
	$tradewith = $_POST['tradewith'];
	$trades = $db->query("SELECT userid from user where username='$tradewith'");
	$count=0;
	while ($trades1 = $vbulletin->db->fetch_array($trades))
	{
		$tradewith = $trades1['userid'];
		$count++;
	}
	$userid =$vbulletin->userinfo['userid'];
	$date = date('Y-m-d');
	if($count=='1')
	{
		$_POST[send] = addslashes($_POST[send]);
		$_POST[receive] = addslashes($_POST[receive]);
		$_POST[notes] = addslashes($_POST[notes]);
		$db->query("INSERT into trademanager SET lastaction='trade created', status='unconfirmed', trader=$tradewith, creator=$userid, creator_send='$_POST[send]', trader_send='$_POST[receive]', notes='$_POST[notes]', date='$date'");
		echo "Your trade has been added.  If you would like to view your trade please go to <a href='index.php?pageid=trademanager'>Trade Manager</a>"; 
		unset($_POST);
	}
	else
	{
		echo "You have made a mistake.  Please check to make sure that the username is properly entered.";
	}
}

if(is_numeric($_GET['user']) && $_GET['user'] != 0)
{
	$trades = $db->query("SELECT username from user where userid = '$_GET[user]'");
        while ($trades1 = $vbulletin->db->fetch_array($trades))
        {
		$_POST[tradewith] = $trades1['username'];
	}
}
?>
<style>
div.trademanager td, div.trademanager table {border:1px solid #000066; border-collapse:collapse;}
div.trademanager tr.header {border:1px solid #000066; border-collapse:collapse; background-color: #c0c0c0;}
div.trademanager tr.white {border:1px solid #000066; border-collapse:collapse; background-color: #f0f0f0;}
</style>
<form name="createtrade" action="/index.php?pageid=tradecreator"
method="POST">
<div class="trademanager">
<table width="100%" border="1">
<tr>
<td>Trade With:</td>
<td><input size="40" type="text" name="tradewith" value='<?=$_POST[tradewith]?>'></td>
</tr>
<tr>
<td>They are getting:</td>
<td><textarea name="send" rows="5" cols="40"><?=$_POST['send']?></textarea></td>
</tr>
<tr>
<td>I am getting:</td>
<td><textarea name="receive" rows="5" cols="40"><?=$_POST['receive']?></textarea></td>
</tr>
<tr>
<td>Additional Terms:</td>
<td><textarea name="notes" rows="5" cols="40"><?=$_POST['notes']?></textarea></td>
</tr>
<tr>
<td>
</td>
<td>
<input name="submit" type="submit" value="Submit Trade" />
</td>
</table>
</div>
</form>



And here is the one that is suppose to spit it out.

Picture


Where it says creator sends, and trade partner sends are the parts that are not coming up. Any ideas?

Code:
<center><span style="text-decoration:underline;color:white;"><a href='index.php?pageid=trademanager'><img border="0" src="http://calistyle101.com/forums/trademanager/images/home.png">Trade Manager</a></span> | <span style="text-decoration:underline;color:white;"><a href='index.php?pageid=tradecreator'><img border="0" src="http://calistyle101.com/forums/trademanager/images/create.png">Create Trade</a></span> | <span style="text-decoration:underline;color:white;"><a href='/index.php?pageid=confirmtrade'><img border="0" src="http://calistyle101.com/forums/trademanager/images/confirm.png">Confirm Trade</a></span> | <span style="text-decoration:underline;color:white;"><a href='index.php?pageid=completetrade'><img border="0" src="http://calistyle101.com/forums/trademanager/images/complete.png">Complete Trade</a></span></center> 
<br />



<?
if($_POST['submit'])
{
   
   $comments=addslashes($_POST['comments']);
   $vbulletin->db->query("UPDATE trademanager SET comments = '$comments' WHERE (id=$_REQUEST[tradeid])"); 

}


$userid =$vbulletin->userinfo['userid'];
        $trades = $vbulletin->db->query("SELECT trademanager.*, userfield1.field12 as address1, userfield2.field12 as address2, user1.username as username1, user2.username as username2 from trademanager, user as user1, user as user2, userfield as userfield1, userfield as userfield2 WHERE (id=$_REQUEST[tradeid]) and user1.userid = trademanager.creator and user2.userid = trademanager.trader and userfield1.userid=trademanager.creator and userfield2.userid=trademanager.trader");
while ($trades1 = $vbulletin->db->fetch_array($trades))
{
    if($trades1[creator] == $userid)
    {
        $tradepartner = $trades1[trader];
    }
    else
    {
        $tradepartner = $trades1[creator];
    }
?>
<style>
div.trademanager td, div.trademanager table {border:1px solid #000066; border-collapse:collapse;}
div.trademanager tr.header {border:1px solid #000066; border-collapse:collapse; background-color: #256193;}
div.trademanager tr.white {border:1px solid #000066; border-collapse:collapse; background-color: #184162;}
</style>

<center>
<div class="trademanager">
<table>
<tr class="header">
<td colspan="2">
Trade Info
</td>
</tr>
<tr>
<td>Trade ID</td>
<td><?=$trades1['id']?></td>
</tr>
<tr>
<td>Trade Date</td>
<td><?=date('n-d-Y', strtotime($trades1['date']))?></td>
</tr>
<tr>
<td>Trade Creator</td>
<td><?=$trades1['username1']?></td>
</tr>
<tr>
<td>Trade Partner</td>
<td><?=$trades1['username2']?></td>
</tr>
<tr>
<td>Creator Sends</td>
<td><?=$trades1['creatorsends']?></td>
</tr>
<tr>
<td>Trade Partner Sends</td>
<td><?=$trades1['tradersends']?></td>
</tr>
<tr>
<td>Creator Confirmation</td>
<td>
<?
if($trades1['creatorconfirm'])
{
echo "Yes";
}
else
{
echo "No";
}
?>
</td>
</tr>
<tr>
<td>Trader Confirmation</td>
<td>
<?
if($trades1['traderconfirm'])
{
echo "Yes";
}
else
{
echo "No";
}
?>
</td>
</tr>
<tr>
<td>Creator Receive Date</td>
<td>
<?
if($trades1[traderreceivedate] !='0000-00-00 00:00:00')
{
echo date('n-d-Y', strtotime($trades1[creatorreceivedate]));
}
else
{
echo "Not Received";
}
?>
</td>
</tr>
<tr>
<td>Trader Receive Date</td>
<td>
<?
if($trades1[traderreceivedate] !='0000-00-00 00:00:00')
{
echo date('n-d-Y', strtotime($trades1[traderreceivedate]));
}
else
{
echo "Not Received";
}
?>
</td>
</tr>
<tr>
<td>Trade Status</td>
<td><?=$trades1['tradestatus']?></td>
</tr>
<tr>
<td>Notes</td>
<td><?=$trades1['notes']?></td>
</tr>
<tr>
<td>Last Action</td>
<td><?=$trades1['lastaction']?></td>
</tr>
<tr>
<td>Leave Feedback</td>
<td>
    <?
       echo "<a href='http://www.calistyle101.com/forums/itrader_feedback.php?u=" . $tradepartner . "&dealurl=". urlencode('http://www.calistyle101.com/forums/index.php?pageid=tradeinfo&tradeid='). $trades1['id'] ."'>Leave Feedback</a>";
    ?>
</td>
</tr>
<tr>
<td>
Comments
</td>
<td>
<?
if(($vbulletin->userinfo['usergroupid']=='6') || ($vbulletin->userinfo['usergroupid']=='7') || ($vbulletin->userinfo['usergroupid']=='5') || ($vbulletin->userinfo['usergroupid']=='18'))
{
?>
<form name="comment" method="post" action = "index.php?pageid=tradeinfo&tradeid=<?=$trades1[id]?>">
<textarea name="comments"cols="30" rows="5"><?=stripslashes($trades1['comments'])?></textarea>
<input type="submit" name="submit" value="Submit" />
</form>
<?
}
else
{
   stripslashes($trades1['comments']);
}
?>

</td>
</tr>
</table>
</div>
</center>
<?
}
?>
If someone could help, I would GREATLY appreciate it. I don't have much but I could paypal a few dollars your way.
Reply With Quote
  #5  
Old 01-18-2009, 03:41 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wrong column names....
Code:
<td>Creator Sends</td>
<td><?=$trades1['creatorsends']?></td>
</tr>
<tr>
<td>Trade Partner Sends</td>
<td><?=$trades1['tradersends']?></td>
Try:
Code:
<td>Creator Sends</td>
<td><?=$trades1['creator_send']?></td>
</tr>
<tr>
<td>Trade Partner Sends</td>
<td><?=$trades1['trader_send']?></td>
Reply With Quote
  #6  
Old 01-18-2009, 10:52 PM
OsideRida06 OsideRida06 is offline
 
Join Date: Apr 2008
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It looks as if I still get the same result. I changed that in the tradeinfo file and still get the same thing, nothing at all. I tried changing everything I could find that has to do with receive or send to those, but it still did not work.

Any other ideas?
Reply With Quote
  #7  
Old 01-19-2009, 01:50 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'd suggest you look in the table and verify the names of the columns. Also, look to see it is even getting input. You need to find out if it isn't being spit out because it isn't there (thus something is wrong with your first block of code) or because soemthing is wrong with the second block of code.
Reply With Quote
  #8  
Old 01-19-2009, 03:16 AM
OsideRida06 OsideRida06 is offline
 
Join Date: Apr 2008
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, I have went through all of that many times. I do not know much php though. I just know what I do know from editing mods and so forth. Would there be any way possible I could get some hands on help? Maybe we can work through IM and I could give you access to this? Like I said I dont have much, but I could give you some money if we could possibly get this fixed.
Reply With Quote
  #9  
Old 01-19-2009, 03:28 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm able to spot the little things that are incorrect (like inconsistencies in column names), but I am not so good at just jumping into someone else's code and being able to see what is going on. When I code and have problems, I fill it with debug info to see what is going on. I can't do that with something I don't have installed myself so I really wouldn't be any help at all with your problem. It may be your best bet is to post a request in the Requests For Paid Services forum.
Reply With Quote
  #10  
Old 01-19-2009, 03:32 AM
OsideRida06 OsideRida06 is offline
 
Join Date: Apr 2008
Posts: 168
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah I thought about doing that. But from the looks of it most things over there do not get picked up or even commented on.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:47 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04744 seconds
  • Memory Usage 2,275KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete