dzirkelb
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Redirect ErrorThat did the trick like a charm, thanks a TON!!
Forum: Fixing WordPress
In reply to: Redirect ErrorI’m assuming I need to change the code of !is_user_logged_in() to my custom code to check if they are logged in, correct? I store it in a cookie, so I’d check that.
Forum: Fixing WordPress
In reply to: Redirect ErrorFor 1, it is a bit tricky.
The commerce-tracking-seach page has the following code which I added in the html editor on the page itself:
<link href="/wp-content/themes/destination/commerce/Commerce.css" rel="stylesheet" type="text/css" /> <script src="/wp-content/themes/destination/commerce/TrackingSearch.asp?txtSearch=<?php echo $_GET["txtSearch"]; ?>&RadioSearch=<?php echo $_GET["RadioSearch"]; ?>" type="text/javascript"></script>
So, it basically does nothing but calls my previously coded .asp page, which is this:
<!-- #include file="dbQS.asp" --> <% strSearch = request.querystring("txtSearch") strRadioSearch = request.querystring("RadioSearch") strCustID = request.cookies("CustID") strPWD = request.cookies("PWD") strEmail = request.cookies("Email") strDisplay = "" if len(Request.QueryString("FP")) > 0 then strFP = Request.QueryString("FP") else strFP = "/index.php/dee-e-commerce-center/commerce-tracking-search/" end if strDisplay = strDisplay & "<html>" if strCustID = "" then strDisplay = strDisplay & "<body onload=Redirect()>" else strDisplay = strDisplay & "<body>" end if strDisplay = strDisplay & "<br>" strDisplay = strDisplay & "<br>" strDisplay = strDisplay & "Search By:" strDisplay = strDisplay & "<form action='' method=get id=frmGeneral name=frmGeneral>" strDisplay = strDisplay & " <input type=hidden id=hidFP name=hidFP value="&strFP&">" strDisplay = strDisplay & " <p>" strDisplay = strDisplay & " <input type=radio id=RadioSearch name=RadioSearch value=CustPO checked>PO # |" strDisplay = strDisplay & " <input type=radio id=RadioSearch name=RadioSearch value=DeeOrder" if strRadioSearch = "DeeOrder" then strDisplay = strDisplay & " checked" end if strDisplay = strDisplay & ">Dee Order # |" strDisplay = strDisplay & " <input type=radio id=RadioSearch name=RadioSearch value=CustItem" if strRadioSearch = "CustItem" then strDisplay = strDisplay & " checked" end if strDisplay = strDisplay & ">Item # |" strDisplay = strDisplay & " <input type=radio id=RadioSearch name=RadioSearch value=Part" if strRadioSearch = "Part" then strDisplay = strDisplay & " checked" end if strDisplay = strDisplay & ">Mfg Part # |" strDisplay = strDisplay & " </p>" strDisplay = strDisplay & " <input type=text id=txtSearch name=txtSearch value='"&strSearch&"' class=Notes>" strDisplay = strDisplay & " <input type=submit value=Search id=SubmitSearch name=SubmitSearch>" strDisplay = strDisplay & "</form>" if len(strSearch) > 0 then ssql = "SELECT [ORDER DETAILS].[ORDER #] as OrdNum, ORDERS.[CUST PO #] as CustPO, [ORDER DETAILS].[PART_#] as Part, [ORDER DETAILS].[CUST ITEM #] as CustItem, [ORDER DETAILS].[MFG_NAME] as MfgName, [ORDER DETAILS].[QTY] as Qty, [ORDER DETAILS].[REQ SHIP DATE] as RSD, [ORDER DETAILS].[LINE_SERIAL #] as LineSerial" ssql = ssql & " FROM ORDERS INNER JOIN [ORDER DETAILS] ON ORDERS.[ORDER #] = [ORDER DETAILS].[ORDER #]" select case strRadioSearch case "CustPO" ssql = ssql & " WHERE (ORDERS.[CUST PO #] = '"&strSearch&"') AND (ORDERS.[CUSTOMER #] = '"&strCustID&"') AND (ORDERS.[BuyerEmail] = '"&strEmail&"')" case "DeeOrder" ssql = ssql & " WHERE ([ORDER DETAILS].[ORDER #] = '"&strSearch&"') AND (ORDERS.[CUSTOMER #] = '"&strCustID&"') AND (ORDERS.[BuyerEmail] = '"&strEmail&"')" case "Part" ssql = ssql & " WHERE ([ORDER DETAILS].[PART_#] like '%"&strSearch&"%') AND (ORDERS.[CUSTOMER #] = '"&strCustID&"') AND (ORDERS.[BuyerEmail] = '"&strEmail&"')" case "CustItem" ssql = ssql & " WHERE ([ORDER DETAILS].[CUST ITEM #] like '%"&strSearch&"%') AND (ORDERS.[CUSTOMER #] = '"&strCustID&"') AND (ORDERS.[BuyerEmail] = '"&strEmail&"')" end select set rs = Server.CreateObject ("adodb.Recordset") rs.Open ssql, dbc, adOpenForwardOnly, adLockReadOnly if rs.eof then intNumRec = 0 else intNumRec = 1 strDisplay = strDisplay & "<table>" strDisplay = strDisplay & " <tr>" strDisplay = strDisplay & " <th>Cust PO#</th>" strDisplay = strDisplay & " <th>Order#</th>" strDisplay = strDisplay & " <th>Cust Item#</th>" strDisplay = strDisplay & " <th>Part#</th>" strDisplay = strDisplay & " <th>Mfg Name</th>" strDisplay = strDisplay & " <th>Qty</th>" strDisplay = strDisplay & " <th>Req Ship Date</th>" strDisplay = strDisplay & " <th>Invoice Date</th>" strDisplay = strDisplay & " <th>Status</th>" strDisplay = strDisplay & " </tr>" do while not rs.EOF strDisplay = strDisplay & " <tr>" strDisplay = strDisplay & " <td>"&rs("CustPO")&"</td>" strDisplay = strDisplay & " <td>"&rs("OrdNum")&"</td>" strDisplay = strDisplay & " <td>"&rs("CustItem")&"</td>" strDisplay = strDisplay & " <td>"&rs("Part")&"</td>" strDisplay = strDisplay & " <td>"&rs("MfgName")&"</td>" strDisplay = strDisplay & " <td>"&rs("Qty")&"</td>" strDisplay = strDisplay & " <td>"&rs("RSD")&"</td>" strDisplay = strDisplay & " <td></td>" strDisplay = strDisplay & " <td>Open</td>" strDisplay = strDisplay & " <td><a href=# onclick=Tracking("&rs("LineSerial")&")>Track</a></td>" 'strDisplay = strDisplay & " <td><a href=custorderedit1.asp?PONum="&rs("CustPO")&"&OrdNum="&rs("OrdNum")&"&LS="&rs("LineSerial")&" Title='Click To Edit This Line Item'>Edit</td>" strDisplay = strDisplay & " </tr>" rs.movenext loop strDisplay = strDisplay & "</table>" end if rs.Close set rs = nothing ssql = "SELECT [ORDER #] as OrdNum, [CUST PO #] as CustPO, [PART_#] as Part, [CUST ITEM #] as CustItem, [MFG_NAME] as MfgName, [QTY] as InvQty , [INVOICE DATE] as InvDate, [LINESERIAL#] as LineSerial" ssql = ssql & " FROM [INVOICE DETAILS]" select case strRadioSearch case "CustPO" ssql = ssql & "WHERE ([CUST PO #] = '"&strSearch&"') AND ([CUSTOMER #] = '"&strCustID&"') AND ([BuyerEmail] = '"&strEmail&"')" case "DeeOrder" ssql = ssql & "WHERE ([ORDER #] = '"&strSearch&"') AND ([CUSTOMER #] = '"&strCustID&"') AND ([BuyerEmail] = '"&strEmail&"')" case "Part" ssql = ssql & "WHERE ([PART_#] like '%"&strSearch&"%') AND ([CUSTOMER #] = '"&strCustID&"') AND ([BuyerEmail] = '"&strEmail&"')" case "CustItem" ssql = ssql & "WHERE ([CUST ITEM #] like '%"&strSearch&"%') AND ([CUSTOMER #] = '"&strCustID&"') AND ([BuyerEmail] = '"&strEmail&"')" end select set rs = Server.CreateObject ("adodb.Recordset") rs.Open ssql, dbc, adOpenForwardOnly, adLockReadOnly if rs.EOF then if intNumRec = 0 then strDisplay = strDisplay & "<br>" strDisplay = strDisplay & "Dee Does Not Show Any Open Orders For "&strSearch&" Customer# "&strCustID&" With Buyer Email Address "&strEmail&"" strDisplay = strDisplay & "<br>" strDisplay = strDisplay & "<br>" strDisplay = strDisplay & "<a href=/index.php/dee-e-commerce-center/login/>Click Here To Change Logon</a>" end if else if intNumRec = 0 then strDisplay = strDisplay & "<table>" strDisplay = strDisplay & " <tr>" strDisplay = strDisplay & " <th>Cust PO#</th>" strDisplay = strDisplay & " <th>Order#</th>" strDisplay = strDisplay & " <th>Cust Item#</th>" strDisplay = strDisplay & " <th>Part#</th>" strDisplay = strDisplay & " <th>Mfg Name</th>" strDisplay = strDisplay & " <th>Qty</th>" strDisplay = strDisplay & " <th>Req Ship Date</th>" strDisplay = strDisplay & " <th>Invoice Date</th>" strDisplay = strDisplay & " <th>Status</th>" strDisplay = strDisplay & " </tr>" do while not rs.EOF strDisplay = strDisplay & "<tr>" strDisplay = strDisplay & " <td>"&rs("CustPO")&"</td>" strDisplay = strDisplay & " <td>"&rs("OrdNum")&"</td>" strDisplay = strDisplay & " <td>"&rs("CustItem")&"</td>" strDisplay = strDisplay & " <td>"&rs("Part")&"</td>" strDisplay = strDisplay & " <td>"&rs("MfgName")&"</td>" strDisplay = strDisplay & " <td>"&rs("InvQty")&"</td>" strDisplay = strDisplay & " <td></td>" strDisplay = strDisplay & " <td>"&rs("InvDate")&"</td>" strDisplay = strDisplay & " <td>Invoiced</td>" strDisplay = strDisplay & " <td><a href=# onclick=Tracking("&rs("LineSerial")&")>Track</a></td>" strDisplay = strDisplay & "</tr>" rs.movenext loop end if end if rs.close set rs=nothing strDisplay = strDisplay & "</table> " end if strDisplay = strDisplay & "</body>" strDisplay = strDisplay & "</html>" %> function Redirect() { FP = document.frmGeneral.hidFP.value; window.location = "/index.php/dee-e-commerce-center/login/?FP="+FP; } function Tracking(LS) { window.open ("/wp-content/themes/Destination/commerce/Tracking.asp?LS="+LS+"", "", "track, width=800,height=300,scrollbars=yes,resizable=no,status=yes"); } document.write("<%=strDisplay%>")
A little history as why it is done that way is we had this site previously coded in html and .asp, back in, oh, 1998 or so, and finally upgraded the site. In the upgrade, we went to wordpress so certain people at our company can update the pages and add new content and what not. Everything our company does is coded using .asp and .net, so we have 0 experience using .php.
I learned some quick snippets to make our existing pages work with the .php site, but it is definately a workaround.
On top of that, we are hosting the site ourselves on an IIS 6.0 server (windows 2003).
For question number 2, page template is listed on the right hand side. That page did have a blank line at the end of the code, so I removed that, but still the same problem.
Forum: Fixing WordPress
In reply to: Redirect ErrorA problem I run into, is since this is wordpress, there isn’t actually a page.php file created. Maybe it’ll be easier for you to look at what I am talking about:
https://www.dee-inc.com/index.php/dee-e-commerce-center/
Browse to that link, and then click the link “Live, Real-Time Order Tracking”.
You will notice it takes you to the page where you would abe able to do searches; however, since you are not logged in, it will redirect you. I am in search to get rid of loading the page, then redirecting.
And, since this is wordpress, there isn’t an actual page created that I can go to and edit the code. I am having to add the code directly into the html of the page, which is why I am struggling so much.
This seems to be a common problem, with a lot of it being caused by empty lines in the .php page, but I don’t have a .php page to look at, or at least I do not know what one to look at.
And, I only want to check to see if they are logged in for about 5 pages, not the other 100 on the site.
Forum: Fixing WordPress
In reply to: Redirect ErrorThe redirect will be an if then statement. It looks to see if the user is logged in, if not, then it redirects them to the login page. The page is burried in the site also, and will have no need to be ranked on google.
Currently, I have the page redirecting using a javascript code, but that code is ran after the page is rendered. Which, in turn, causes the page to load, then redirect, opposed to redirect before loading.
Forum: Themes and Templates
In reply to: Sidebar is cutting off text – recent posts widgetPerfect, thanks!!
Forum: Plugins
In reply to: Looking for Plug In or AdviceI answered my own question…I can place that code into each page that is created through the wordpress admin page. So, if anyone wants to know in the future how to put .asp pages into a wordpress theme without having to convert their page to php, or create custom pages, then just create the .asp page and use it as an include file.
one thing though…I haven’t played much with it, but it seems to display correctly on the screen, the asp page needs to look something like this:
[code]
<%
Dim word
word = " These results are from an ASP Page"
%>
document.write("<%= word %>")
[/code]notice the document.write portion…if that is not there, then I get a javascript error. I’ll look for ways around this, but for now, I’m going to use this.
Forum: Plugins
In reply to: Looking for Plug In or AdviceI found a way to do this through javascript:
<script language=”javascript” type=”text/javascript” src=”test.asp”></script>
adding that line of code produces the results of test.asp.
Now, does anyone know how I can produce a general template file the rest of the wordpress pages use so I can add this part of the code into it?