Archive

Posts Tagged ‘echo’

Quick Mod-rewrite & Php Fix

October 28th, 2011 Comments off

Please dont bid until we talk in PMB. Dont copy and paste your company sales letter to me.

The issue is that when I access my mod-rewritten URLs, they arent able to capture/echo the extra URL parameters that I use in the URL.

Here is the mod rewrite:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^page/([^_]*).html$ page/index.php?a=$1 [L]

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

The mod-rewrite works perfectly, but When I goto www.domain.com/page/something.html?word=duck&sound=quak

and use <?php echo($_GET["word"])?> & <?php echo($_GET["sound"])?> It doesnt echo it in the PHP page.

Categories: Modification, PHP Tags: , , , , , ,

Apply Filters To Php

September 24th, 2011 Comments off

Hello there,

this is what i have:

<?php $q = get_the_author_meta( ‘ID’) ?>
<?php $ret = get_user_meta( $q , “wpcfbio”, true); $string = $ret; echo make_clickable($string); ?>

this code is pulling out user meta for wpcfbio.

The problem with this, is that it echos the text, but it doesn’t insert any styling. i’d like to

apply something like this to it:

<?php
$content = apply_filters(‘the_content’, $post->post_content); //get the post content store in $content
$save = explode(“</p>”, $content); //Separate the content into <p> blocks
foreach($save as $item) {
echo $item; //print the <p> block
echo “</p>”;

?>

This is an example of add paragraph to the_content() tag. I want something similar for the user meta wpcbio

Let me know if you understand, if you have any questions please message me.

Thanks

Jan

Categories: PHP, Wordpress Tags: , , , , , ,

Search Engine Optimization For A WordPress Website

August 22nd, 2011 Comments off

Bellow, you will find the header code to edit for me.

Here is what I want:

Replace “1260 6th Avenue New York, United States of America 10020″ by the actual address of the event.

Replace “Event Categories: Arts/Theater, Broadway, Comedy, Dance, Techno and Electronic, and Music” by the actual category and subcategory of the event.

You will be welcome with any better suggestion except SEO plugin, I don’t like them.

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head profile=”http://gmpg.org/xfn/11″>

<?php
/*$category = get_the_category();
$parent = get_cat_name($category[0]->category_parent);
if (!empty($parent)) {
$p_cat_name = $parent. ” | ” ;
}*/
?>

<title>
<?php echo $p_cat_name; ?>
<?php if($_REQUEST['ptype']==’post_listing’){ echo HEADER_ADD_PLACE_SEO;?> | <?php bloginfo(‘name’); }else?>
<?php if($_REQUEST['ptype']==’post_event’){ echo HEADER_ADD_EVENT_SEO;?> | <?php bloginfo(‘name’); }else?>
<?php if($_REQUEST['ptype']==’preview’){ echo HEADER_ADD_PREVIEW_SEO;?> | <?php bloginfo(‘name’); }else?>
<?php if($_REQUEST['ptype'] == ‘register’ || $_REQUEST['ptype'] == ‘login’){ echo HEADER_LOGIN_REGISTRATION_SEO;?> | <?php bloginfo(‘name’); }else?>
<?php if($_GET['ptype'] == ‘return’ || $_GET['ptype'] == ‘payment_success’){ echo HEADER_SUCCESS_PAGE_SEO;?>|<?php bloginfo(‘name’); }else?>
<?php if ( is_home() ) { ?><?php bloginfo(‘description’); ?> | <?php bloginfo(‘name’); ?><?php } ?>
<?php if ( is_search() ) { ?>Search Results | <?php bloginfo(‘name’); ?><?php } ?>
<?php if ( is_author() ) { ?>Author Archives | <?php bloginfo(‘name’); ?><?php } ?>
<?php if ( is_single() ) { ?><?php wp_title(”); ?> | <?php bloginfo(‘name’);?><?php } ?>
<?php if ( is_page() ) { ?><?php wp_title(”); ?> | <?php bloginfo(‘name’);?><?php } ?>
<?php if ( is_archive() ) { ?>
<?php
if(is_category())
{
single_cat_title();
}else
{
global $wp_query, $post;
$current_term = $wp_query->get_queried_object();
echo $current_term->name;
}
?>
|<?php bloginfo(‘name’); ?><?php } ?>
<?php if ( is_month() ) { ?><?php the_time(‘F’); ?>|<?php bloginfo(‘name’); ?><?php } ?>
<?php if (function_exists(‘is_tag’)) { if ( is_tag() ) { ?><?php //single_tag_title(“”, true);
} } ?>
 1260 6th Avenue New York, United States of America 10020
</title>

<meta name=”DESCRIPTION” content=”<?php echo $p_cat_name; ?><?php wp_title(”); ?>
| 1260 6th Avenue New York, United States of America 10020 | Event Categories: Arts/Theater, Broadway, Comedy, Dance, Techno and Electronic, and Music”
/>

<meta name=”KEYWORDS” content=”<?php echo $p_cat_name; ?><?php wp_title(”); ?>
1260 6th Avenue New York, United States of America 10020, + event tags, Broadway, Comedy, Dance, Techno and Electronic, and Music”
/>

<meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” />
<?php if (is_home()) { ?>
<?php if ( get_option(‘ptthemes_meta_description’) <> “” ) { ?>
<meta name=”description” content=”<?php echo stripslashes(get_option(‘ptthemes_meta_description’)); ?>” />
<?php } ?>
<?php if ( get_option(‘ptthemes_meta_keywords’) <> “” ) { ?>
<meta name=”keywords” content=”<?php echo stripslashes(get_option(‘ptthemes_meta_keywords’)); ?>” />
<?php } ?>
<?php if ( get_option(‘ptthemes_meta_author’) <> “” ) { ?>
<meta name=”author” content=”<?php echo stripslashes(get_option(‘ptthemes_meta_author’)); ?>” />
<?php } ?>
<?php } ?>
<link rel=”stylesheet” type=”text/css” href=”<?php bloginfo(‘stylesheet_url’); ?>” media=”screen” />
<?php if ( get_option(‘ptthemes_favicon’) <> “” ) { ?>
<link rel=”shortcut icon” type=”image/png” href=”<?php echo get_option(‘ptthemes_favicon’); ?>” />
<?php } ?>
<link rel=”alternate” type=”application/rss+xml” title=”RSS 2.0″ href=”<?php if ( get_option(‘ptthemes_feedburner_url’) <> “” ) { echo get_option(‘ptthemes_feedburner_url’); } else { echo get_bloginfo_rss(‘rss2_url’); } ?>” />
<link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” />
<?php if ( get_option(‘ptthemes_scripts_header’) <> “” ) { echo stripslashes(get_option(‘ptthemes_scripts_header’)); } ?>
<link rel=”stylesheet” type=”text/css” href=”<?php bloginfo(‘template_directory’); ?>/library/css/print.css” media=”print” />
<link href=”<?php echo bloginfo(‘template_url’); ?>/library/js/swfupload/default.css” rel=”stylesheet” type=”text/css” />
<link href=”<?php bloginfo(‘template_directory’); ?>/library/css/slimbox.css” rel=”stylesheet” type=”text/css” />
<script src=”<?php bloginfo(‘template_directory’); ?>/library/js/jquery-1.3.2.min.js” type=”text/javascript”></script>
<script src=”<?php bloginfo(‘template_directory’); ?>/library/js/jquery.nivo.slider.pack.js” type=”text/javascript”></script>
<link href=”<?php bloginfo(‘template_directory’); ?>/library/css/dhtmlgoodies_calendar.css” rel=”stylesheet” type=”text/css” />

<?php if(is_single()){ ?>
<!–Add fancybox for single post video–>
<script type=”text/javascript” src=”<?php bloginfo(‘template_directory’); ?>/fancybox/jquery.min.js”></script>
<script type=”text/javascript” src=”<?php bloginfo(‘template_directory’); ?>/fancybox/jquery.mousewheel-3.0.4.pack.js”></script>
<script type=”text/javascript” src=”<?php bloginfo(‘template_directory’); ?>/fancybox/jquery.fancybox-1.3.4.pack.js”></script>
<link rel=”stylesheet” type=”text/css” href=”<?php bloginfo(‘template_directory’); ?>/fancybox/jquery.fancybox-1.3.4.css” media=”screen” />
<script type=”text/javascript”>
var J = jQuery.noConflict();

J(document).ready(function() {

J(“.various3″).fancybox({
‘width’ : ’75%’,
‘height’ : ’75%’,
‘autoScale’ : false,
‘transitionIn’ : ‘none’,
‘transitionOut’ : ‘none’,
‘type’ : ‘iframe’
});

});
</script>
<!–Add fancybox for single post video–>
<?php } ?>

<?php
if ( is_singular()

Jcart Update

August 5th, 2011 Comments off

Hi we are looking for a jcart expert.

**Please do not apply if you have not got experience with jcart**

We need the <?php $jcart->display_cart();?> function modified to fit our design.

This is the current jcart code:

////////////////////////////////////////////////////////////////////////
// Output the cart

// Return specified number of tabs to improve readability of HTML output
function tab($n) {
$tabs = null;
while ($n > 0) {
$tabs .= “t”;
–$n;
}
return $tabs;
}

// If there’s an error message wrap it in some HTML
if ($errorMessage) {
$errorMessage = “<p id=’jcart-error’>$errorMessage</p>”;
}

// Display the cart header
echo tab(1) . “$errorMessagen”;
echo tab(1) . “<form method=’post’ action=’$checkout’>n”;
echo tab(2) . “<fieldset>n”;
echo tab(3) . “<input type=’hidden’ name=’jcartToken’ value=’{$_SESSION['jcartToken']}’ />n”;
echo tab(3) . “<table border=’1′>n”;
echo tab(4) . “<thead>n”;
echo tab(5) . “<tr>n”;
echo tab(6) . “<th colspan=’3′>n”;
echo tab(7) . “<strong id=’jcart-title’>{$config['text']['cartTitle']}</strong> ($this->itemCount $itemsText)n”;
echo tab(6) . “</th>n”;
echo tab(5) . “</tr>”. “n”;
echo tab(4) . “</thead>n”;

// Display the cart footer
echo tab(4) . “<tfoot>n”;
echo tab(5) . “<tr>n”;
echo tab(6) . “<th colspan=’3′>n”;

// If this is the checkout hide the cart checkout button
if ($isCheckout !== true) {
if ($config['button']['checkout']) {
$inputType = “image”;
$src = ” src=’{$config['button']['checkout']}’ alt=’{$config['text']['checkout']}’ title=” “;
}
echo tab(7) . “<input type=’$inputType’ $src id=’jcart-checkout’ name=’jcartCheckout’ class=’jcart-button’ value=’{$config['text']['checkout']}’ />n”;
}

echo tab(7) . “<span id=’jcart-subtotal’>{$config['text']['subtotal']}: <strong>$currencySymbol” . number_format($this->subtotal, $priceFormat['decimals'], $priceFormat['dec_point'], $priceFormat['thousands_sep']) . “</strong></span>n”;
echo tab(6) . “</th>n”;
echo tab(5) . “</tr>n”;
echo tab(4) . “</tfoot>n”;

echo tab(4) . “<tbody>n”;

// If any items in the cart
if($this->itemCount > 0) {

// Display line items
foreach($this->get_contents() as $item) {
echo tab(5) . “<tr>n”;
echo tab(6) . “<td class=’jcart-item-qty’>n”;
echo tab(7) . “<input name=’jcartItemId[]‘ type=’hidden’ value=’{$item['id']}’ />n”;
echo tab(7) . “<input id=’jcartItemQty-{$item['id']}’ name=’jcartItemQty[]‘ size=’2′ type=’text’ value=’{$item['qty']}’ />n”;
echo tab(6) . “</td>n”;
echo tab(6) . “<td class=’jcart-item-name’>n”;

if ($item['url']) {
echo tab(7) . “<a href=’{$item['url']}’>{$item['name']}</a>n”;
}
else {
echo tab(7) . $item['name'] . “n”;
}
echo tab(7) . “<input name=’jcartItemName[]‘ type=’hidden’ value=’{$item['name']}’ />n”;
echo tab(6) . “</td>n”;
echo tab(6) . “<td class=’jcart-item-price’>n”;
echo tab(7) . “<span>$currencySymbol” . number_format($item['subtotal'], $priceFormat['decimals'], $priceFormat['dec_point'], $priceFormat['thousands_sep']) . “</span><input name=’jcartItemPrice[]‘ type=’hidden’ value=’{$item['price']}’ />n”;
echo tab(7) . “<a class=’jcart-remove’ href=’?jcartRemove={$item['id']}’>{$config['text']['removeLink']}</a>n”;
echo tab(6) . “</td>n”;
echo tab(5) . “</tr>n”;
}
}

// The cart is empty
else {
echo tab(5) . “<tr><td id=’jcart-empty’ colspan=’3′>{$config['text']['emptyMessage']}</td></tr>n”;
}
echo tab(4) . “</tbody>n”;
echo tab(3) . “</table>nn”;

echo tab(3) . “<div id=’jcart-buttons’>n”;

if ($config['button']['update']) {
$inputType = “image”;
$src = ” src=’{$config['button']['update']}’ alt=’{$config['text']['update']}’ title=” “;
}

echo tab(4) . “<input type=’$inputType’ $src name=’jcartUpdateCart’ value=’{$config['text']['update']}’ class=’jcart-button’ />n”;

if ($config['button']['empty']) {
$inputType = “image”;
$src = ” src=’{$config['button']['empty']}’ alt=’{$config['text']['emptyButton']}’ title=” “;
}

echo tab(4) . “<input type=’$inputType’ $src name=’jcartEmpty’ value=’{$config['text']['emptyButton']}’ class=’jcart-button’ />n”;
echo tab(3) . “</div>n”;

// If this is the checkout display the PayPal checkout button
if ($isCheckout === true) {
// Hidden input allows us to determine if we’re on the checkout page
// We normally check against request uri but ajax update sets value to relay.php
echo tab(3) . “<input type=’hidden’ id=’jcart-is-checkout’ name=’jcartIsCheckout’ value=’true’ />n”;

// PayPal checkout button
if ($config['button']['checkout']) {
$inputType = “image”;
$src = ” src=’{$config['button']['checkout']}’ alt=’{$config['text']['checkoutPaypal']}’ title=” “;
}

if($this->itemCount <= 0) {
$disablePaypalCheckout = ” disabled=’disabled’”;
}

echo tab(3) . “<input type=’$inputType’ $src id=’jcart-paypal-checkout’ name=’jcartPaypalCheckout’ value=’{$config['text']['checkoutPaypal']}’ $disablePaypalCheckout />n”;
}

echo tab(2) . “</fieldset>n”;
echo tab(1) . “</form>nn”;

echo tab(1) . “<div id=’jcart-tooltip’></div>n”;
}
}

We need it formatted like this:

<div class=”heading”>
<h1>Your Shopping Cart</h1>
<a href=”#”><img src=”skin/images/shopping-cart.jpg” width=”21px” height=”22px” alt=”shopping-cart” /></a>
</div>
<br class=”clear” />
<div class=”trash”>
<a href=”#”><img src=”skin/images/trash-box.jpg” width=”33px” height=”34px” alt=”trash-box” /></a>
<a href=”#” class=”image-two”><img src=”skin/images/trash-box.jpg” width=”33px” height=”34px” alt=”trash-box” /></a>
</div>
<div class=”cart”>
<ul class=”list-one”>
<li class=”list-item-one”> </li>
<li class=”list-item-two”>Item Description</li>
<li class=”list-item-three”>Qty</li>
<li class=”list-item-four”>Artwork Uploaded</li>
<li class=”list-item-five”>VAT</li>
<li class=”list-item-six”>Price</li>
</ul>
<ul class=”list-two”>
<li class=”list-item-one”><img src=”skin/images/image01.jpg” width=”107px” height=”92px” alt=”image” /></li>
<li class=”list-item-two”>
<span>Matt Laminated Business Cards</span>
<p>
55mm x 85mm<br /> Double Sided
</p>
<em>Options</em>
<p>
3 Names <span>Edit</span>
</p>
</li>
<li class=”list-item-three”>1000</li>
<li class=”list-item-four”><p>No artwork uploaded – <a href=”#”>click<br /> here to upload now</a></p></li>
<li class=”list-item-five”>20%</li>
<li class=”list-item-six”>£89.99</li>
</ul>
<ul class=”list-three”>
<li class=”list-item-one”><img src=”skin/images/image02.jpg” width=”107px” height=”92px” alt=”image” /></li>
<li class=”list-item-two”>
<span>Business Stationery Bundle</span>
<em>Options</em>
<p>
Combo Package (Business Cards,<br /> Letterheads & Compliment slips) <span>Edit</span>
</p>
</li>
<li class=”list-item-three”>1000</li>
<li class=”list-item-four”><p>Stationery_final.pdf uploaded – <a href=”#”>click<br /> here to change</a></p></li>
<li class=”list-item-five”>20%</li>
<li class=”list-item-six”>£300.00</li>
</ul>
<p class=”paragraph-one”>Sub Total: <span>£389.99</span></p>
<br class=”clear” />
</div>
<div class=”bottom-content”>
<a class=”continue-shopping” href=”#”>Continue Shopping</a>
<div class=”totals”>
<p>VAT: <span>78.00</span></p>
<p class=”paragraph-one”>Grand Total: <span>£468.00</span></p>
<input type=”submit” name=”proceed_to_checkout” value=”Proceed to Checkout” />

***Please only apply if you have experience with jcart***

Need Php Coder For On-going Text Ad Exchange Work

July 6th, 2011 Comments off

I own a couple of different text ad exchange scripts and there are improvements that I would like to make on them. All of our usual coders are busy right now, so I’m trying to find someone that is familiar and comfortable working with these scripts. I have multiple projects that need to be completed. I’m really looking for someone who is stable and that I can depend on for future work.

TAEs are written in fairly simple php. Here’s an example:

<?php

include “header.php”;
include “config.php”;
include “style.php”;

$count= mysql_query(“select * from members WHERE verified=’1′”);

$count= mysql_query(“select * from members WHERE memtype=’PRO’ and verified=’1′”);

$count= mysql_query(“select * from members WHERE memtype=’JV Member’ and verified=’1′”);

$count= mysql_query(“select * from members WHERE memtype=’SUPER JV’ and verified=’1′”);

?><font size=”2″ face=”<? echo $fonttype; ?>” color=”<? echo $fontcolour; ?>”>
</font><font face=”<? echo $fonttype; ?>” color=”<? echo $fontcolour; ?>”>
<p align=”center”><font face=”Tahoma” size=”2″ color=”<? echo $fontcolour; ?>”><b>PRO Members: <? echo $prorowcount; ?>

Categories: MySQL, PHP, Programming Tags: , , , , , ,

Xmpp Echo Bot

June 26th, 2011 Comments off

I am looking for someone to setup an echo bot. We need to connect from the the game Star Trek Online to our IRC Chat (mibbit). It needs to use the XMPP Protocol…other than that I am lost.

I have researched it all over the nest and I just cant figure it out.

Please respond soon…thank you.

Categories: Bot, Game Tags: , , , , ,

Social Engine– Echo Profile Fields

June 15th, 2011 Comments off

I am adding a new PHP Block to my user Profiles.. (Send Message, Follow Button & text)
You can view the graphics here: http://mcma.com/profilemcma/index.html

The text in the html needs to pull from a few user (Profile Questions) Fields.

- Display Name (db field)
- Company Name – Profile Question
-Position – Profile Question
- City & State – Profile Questions

(eg. %Display Name% currently works for %Company Name% as %Postion% | %City%, %State%)

Please keep the html styled)

If you can do this ASAP I’ll pay $50 soon as you finish!

Real Quick Php Help

June 12th, 2011 Comments off

I am settng up some websites and and created a paypal for to take payment, I am using php variables in the form to substitue in some info. I have congif file that I am holding the variable in. My problem now is, How can I encrpyt the paypal form so people cannot just View Source and steal the Return URL and go get the download? I would like to encrypt the returnfile.html filename, or the whole PP form is possible. Can you help me?

here is a sampel of what my form looks like:

<form method=”post” target=”_self” action=”https://www.paypal.com/cgi-bin/webscr”>
<p align=”center”><input type=”hidden” name=”cmd” value=”_xclick”>
<input type=”hidden” name=”business” value=”<?php echo $paypal_email; ?>”>
<input type=”hidden” name=”item_name” value=”<?php echo $directoryName; ?>”>
<input type=”hidden” name=”item_number” value>
<input type=”hidden” name=”return” value=”http://www.<?php echo $domain_name; ?>/<?php echo $directory; ?>/<?php echo $directoryName; ?>/returnfile.html”>
<input type=”hidden” name=”amount” value=”<?php echo $price2; ?>”>
<input type=”hidden” name=”currency_code” value=”USD”>
<input type=”hidden” name=”quantity” value=”1″>
<input type=”hidden” name=”shipping” value=”0″>
<input type=”hidden” name=”shipping2″ value=”0″>
<input type=”image” name=”I1″ src=”<?php echo $buynow_button_url; ?>”> </p>
</form>

Categories: Perl/CGI, PHP, Quick Tags: , , , , , ,

Magento Quick Modification

February 25th, 2010 Comments off

Need a snippet of code with an “IF” statement that determines this:
If subcategories = id# 1,2,3, (etc.) then change quantity to decimals
If attribute = name, name2, etc. then use integers for the quantity

Here’s the code that is currently NOT working properly:

<?php $_product = $this->getProduct(); ?>
<?php $currentCategory = Mage::registry(‘current_category’); ?>
<?php if($_product->isSaleable()): ?>
<fieldset class=”add-to-cart-box”>
<legend><?php echo $this->__(‘Add Items to Cart’) ?></legend>
<?php if(!$_product->isGrouped()): ?>
<span class=”qty-box”><label for=”qty”><?php echo $this->__(‘Qty’) ?>:</label>
<!–<input name=”qty” type=”text” class=”input-text qty” id=”qty” maxlength=”12″ value=”<?php //echo $this->getMinimalQty($_product) ?>” />–>

<?php $color=$_product->getResource()->getAttribute(‘Color’); ?>
<?php $designer=$_product->getResource()->getAttribute(‘Designer’); ?>

<?php if(((isset ($currentCategory))

Database Display Page

January 30th, 2010 Comments off

I need a display page written in php that has a table with 4 columns wide and as many rows as needed.

I already have the database created and the config and connect files

Categories: PHP Tags: , , , , , ,

Echo Payment Gateway & Joomla

December 28th, 2009 Comments off

Need someone to bug-fix an Echo Payment Gateway I have on a Joomla site running Virtuemart. Needs to be completed by Friday.

Soap Ovh In Excel Vba

December 4th, 2009 Comments off

Hi,

I would like to convert a script php5 in VBA excel.

My situation:
I have a formular in html and it is using to send an email.
When I click on the bouton “send”, the script send.php5 run.

send.php5:

<?php
$nic=”xx123456-ovh”;
$pass=”ovh123456″;
$sms_compte=”sms-xx123456-1″;
$from=”+336666666″;
$to=$HTTP_POST_VARS['destinataire'];
$message=$HTTP_POST_VARS['texte'];

try
{
$soap = new SoapClient(“https://www.ovh.com/soapi/soapi-re-1.8.wsdl”);
$session = $soap->login(“$nic”, “$pass”,”fr”, false);
echo “login successfulln”;
$result = $soap->telephonySmsSend($session, “$sms_compte”, “$from”, “$to”, “$message”, “”, “1″, “”, “”);
echo “telephonySmsSend successfulln”;
print_r($result);
$soap->logout($session);
echo “logout successfulln”;
}
catch(SoapFault $fault)
{
echo “Problem” ; //$fault;
}
?>

The job:
I would like in one sheet in Excel a formular:
Exemple: range(“A1″).value = “+33612345678″ (phone number)
range(“A2″).value = “the text to send”
I need a button to run a VBA program in Excel:
The VBA will be the translation of send.php5.
The result of the send will be in other sheet.

Regards

Categories: Programming, Visual Basic Tags: , , , , , ,

Soap Problems With Magento

November 19th, 2009 Comments off

We have had soap working with magento but has suddenly stopped working and causing errors in our script.

making this call twice seemed to fix the problem to the proxy and sessionID

<?
//$proxy = new SoapClient(‘http://www.xxx.co.uk/api/soap/?wsdl’, array(‘trace’=>1));
$proxy = new SoapClient(‘http://www.xxx.co.uk/api/soap/?wsdl’);
$sessionId = $proxy->login(‘xxx’, ‘xxx’);

$row_rsGetOrderInfo=$proxy->call($sessionId, ‘sales_order.info’, 100000324);
$trackitem_shipmethod=$row_rsGetOrderInfo[shipping_description];
echo “SHIP METHOD: $trackitem_shipmethod<BR><BR>”;

//try { $row_rsGetOrderInfo=$proxy->call($sessionId, ‘sales_order.info’, 100000319); } catch(SoapFault $soapFault){

//echo “<br><br>Fault: ” . var_dump($soapFault);
//echo “<br><br>Request :<br>”, htmlentities($proxy->__getLastRequest()), “<br>”;
//echo “<br><br>Response :<br>”, htmlentities($proxy->__getLastResponse()), “<br>”;

//}

//$proxy = new SoapClient(‘http://www.xxx.co.uk/api/soap/?wsdl’);
//$sessionId = $proxy->login(‘xxx’, ‘xxx’);

$row_rsGetOrderInfo=$proxy->call($sessionId, ‘sales_order.info’, 100000324);
$trackitem_shipmethod=$row_rsGetOrderInfo[shipping_description];
echo “SHIP METHOD: $trackitem_shipmethod<BR><BR>”;

?>

We then discovered last night that reinstantiate the SoapClient Object worked but today we have new / more problems with getting soap to work which previously worked:

Just worked out that I only need to reinstantiante the SoapClient object for it to work. I dont even need to log back in to the session.
i.e. I can do this first:
$proxy = new SoapClient(‘http://www.xxx.co.uk/api/soap/?wsdl’);
$sessionId = $proxy->login(‘xxx’, ‘xxx’);
Then execute a query:
try { $countries = $proxy->call($sessionId, ‘country.list’); } catch(Exception $e){ echo “<BR>ERROR Code : ” . $e->getCode() . “: ” . $e->getMessage(); }
Next time I just:
$proxy = new SoapClient(‘http://www.xxx.co.uk/api/soap/?wsdl’);
then execute another query.
And this works.
Are you there?
I’ve just recoded all that – run 5 test orders through successfully.
Noticed a small error with the order comments which I fixed.
Went to retest a single order and now getting a different error:
ERROR Code : 0: SOAP-ERROR: Parsing WSDL: Couldn’t load from ‘http://www.xxx.co.uk/api/soap/?wsdl’

Keyword – Replace With Script

October 19th, 2009 Comments off

Hello,

I need some help. I am working on a site where I want to have a script where if a keyword appears on the page the script would look if custom content replaced variables are needed that were previously added into the DB.

For example if

Unix Based

October 17th, 2009 Comments off

Project 1:

Click on Terminal Program.

Content Delivery System

August 29th, 2009 Comments off

I’m looking for some software which can be installed on systems (Windows 2000 / 2003 / XP / Vista / 7) by subscribers and will automatically deliver requested content by launching their default web browser… in essence, a more intelligent, remotely configurable version of the DeskTopPop product.

Content delivery can occur:

1) after a pre-determined period of time (hours), or

2) at a pre-set UTC time

…provided that a period of recent and continued user activity has been detected.

For example, I might decide to have the user’s browser display a URL every 8 or 12 hours, provided that their computer is currently being used and has been continuously used for a short period of time i.e. 5 minutes.

I do not want to have browser windows open simply based on a timer so some monitoring of the keyboard and/or mouse will be required.

The actual current “waiting period” between browser launches and the required period of user activity (both in minutes) before triggering will be specified within the string returned by my server script which also specifies the target URL.

Please also note that the “waiting period” for “time delayed” URLs is the minimum time to wait since the previous URL was launched and is not cumulative i.e. if the waiting time is set to 8 hours but the user does not use their computer for 20 hours then only one URL should be launched (after the required “continuous use” period) and the next URL should not trigger for at least another 8 hours.

The utility should be unobtrusive to the user i.e. must install as an application but be invisible (nothing on the task bar, in the system tray or in the Alt-Tab window / Task Manager) during normal operation.

It is very important that the utility is able to work with all the major browsers and should not trigger false-positives for anti-virus / spyware / adware / malware systems – it should also be firewall-friendly.

A unique, system generated ID should be created during the 1st run process and passed to my server (when appropriate) during communications so that duplicate content can be avoided for each user.

The overall process should be something along the following lines:

a) at 1st run, generate and store a unique “user” ID in the registry, along with the current UTC time (indicating the “last launch” time)

b) immediately contact my server via an http post, passing the user ID

c) server will return the appropriate “waiting” and “continuous use” periods (both as minutes) followed by the “time delayed” URL in the following format: 10|3|yahoo.com

– the returned URL, waiting and continuous use periods should be stored in the registry

d) immediately contact my server via an http post, passing NO user ID

e) server will either return the UTC “activation time” and “continuous use” period (as minutes) followed by the “time specific” URL in the following format: 200911281457|2|google.com OR a “nothing scheduled” instruction in the following format: ||

– if a time-specific instruction was returned, the URL, UTC activation time and continuous use period should be stored (or replaced) in the registry (separately to the “time delayed” information)

f) monitor the time passed since 1st run / last URL launch and most recent period of continuous user activity until:
i) 60 minutes have passed, in which case go to step d)
ii) the pending “time delayed” URL should be launched, in which case go to step g)
iii) the pending “time specific” URL should be launched, in which case go to step h)

g) launch the “time delayed” URL in the default browser, update the “last launch” time in the registry, then go to step b)

h) launch the “time specific” URL in the default browser, update the “last launch” time in the registry, then go to step d)

Notes:

1) the initial “time delayed” URL should not be launched until “waiting” period minutes after the UTC time stored during the 1st run

2) “time specific” URLs should be ignored (i.e. not stored in the registry) unless the launch time is in the future

3) “time specific” URLs take precidence over “time delayed” URLs so if a “time specific” URL is scheduled to launch within the next 24 hours (note that it may have been scheduled for several days already) then any pending “time delayed” URL launch should be postponed until “waiting” period after the “time specific” launch takes place

4) the registry location should be configurable to allow multiple copies of the system to run concurrently and deliver different scheduled content

The following PHP script can be used for testing purposes:

<?PHP
if (isset($_REQUEST['id']))
{
echo “10|3|yahoo.com”;
}
else
{
if (rand(0, 1) == 0)
echo gmdate(“YmdHi”, time() + 480) . “|2|google.com”;
else
echo “||”;
}
exit;
?>

Delphi is the preferred development language but not a necessity.

All, fully commented, source code should be provided.

Any 3rd party code included in the project must be public domain / GNU or similar i.e. no cost for commercial use.

Size and speed / simplicity of installation is important so any potential 3rd party downloads / code extensions i.e. dotNET, are not acceptable.

Confirmation of successful testing on Windows 2000, 2003, XP, Vista & 7 is a requirement.

Landing Page Clone

August 27th, 2009 Comments off

I need this page cloned:

http://myrachelrayweightlossblog.com/

Links on page should be masked. I have specific redirect & tracking code to use. (see attachment)

Using these product affiliate links in redirect:

Product Name: Acai Fuel Extreme

Aff URL: http://affiliate.adtrtracker.com/rd/r.php?sid=134&pub=500033&c1=<?PHP echo $seed; ?>

Product Name: Colon Cleanse Max

Aff URL: http://affiliate.adtrtracker.com/rd/r.php?sid=46&pub=500033&c1=<?PHP echo $arid; ?>

There is a third link in the last comment that should have a masked link to this link.

Product Name: Acai Xtreme

Aff URL: http://affiliate.adtrtracker.com/rd/r.php?sid=30&pub=500033&c1=<?PHP echo $arid; ?>

Very simple and straight forward. Needs to be uploaded to website & done in the next couple of hours. Pay via PayPal upon completion.

Problem With Rss Feeds (php)

August 10th, 2009 Comments off

This job should be really easy for someone who knows what they are doing.

There is a file single php file on my article directory which controls all the RSS feeds. The problem is that the feed is incomplete and does not contain all the data I want it to. Also, certain charators like ‘ and – display as ’s and –

I need someone to fix this problem get add the required additional feed items to display and deliver a W3C Vaild RSS feed. (validator.w3.org/feed/)

The feeds render a default meta and feed title and decsription in every instance, I want them to display title that is relevant to the feed being displayed. IE, the Heath and Fitness feed displays Health and fitness feed.

The additional fields that need to display are

<author> </author>
<category> </category>

I have added these 2 and they do display when one views the source code of the feed, but not on the feed itself, not are they passed to any feed reader.

Here is an extract from the code if it helps.

$strxml = $strxml.”<title>”.getsettings(2,”",2).” Articles</title>”;

$strxml = $strxml.”<link>”.getsettings(3,”",2).”/articlerss.php?type=”.$_GET["type"].”&category=”.$_GET["category"].”</link>”;

$strxml = $strxml.”<description>Latest Articles </description>”;

$strxml = $strxml.”<language>en-us</language>”;

$strxml = $strxml.”<copyright>Copyright (c) “.getsettings(2,”",2).” All rights reserved.</copyright>”;

echo $strxml; flush();
$j=0;
while($rs=mysql_fetch_array($cmd))
{
// $url=getsettings(3,”",2).”/article” . $rs["article_id"] . “-” . urlencode($rs["article_title"]) . “.html”;
$url=getsettings(3,”",2).”/article” . $rs["article_id"] . “-” . urlencode(preg_replace(‘/[^a-zA-Z0-9s!?"']+/’,'_’,$rs['article_title'])) . “.html”;
$out=”<item>n”;
$out .= “<title>”.removechar(htmlentities(strip_tags($rs["article_title"]))).”</title>n”;

//$out .= “<link>”.preg_replace(‘/[^a-zA-Z0-9s!?"']+/’,'_’).str_replace(“ ”, “”, strip_tags($url)).”</link>n”;
//$out .= “<link>”.preg_replace( ,’3F’,preg_replace(‘/[^a-zA-Z0-9s.-:/+!?"']+/’,'_’, $url)).”</link>n”;
$out .= “<link>”.$url.”</link>n”;
$out .= “<author>”.removechar(htmlentities(strip_tags($rs["article_author"]))) . “</author>n”;
$out .= “<category>”.removechar(htmlentities(strip_tags($rs["category_name"]))) . “</category>n”;
$out .= “<description>”.removechar(htmlentities(strip_tags($rs["article_snippet"]))) . “</description>n”;
$out .= “<pubDate>” . date(‘r’,strtotime($rs["article_date"])) . “</pubDate>”;
$out .= “</item>n”;
echo $out; flush();

$j=$j+1;
if($j >= 50) break;//limit !
}

$strxml = “</channel>n”;

$strxml = $strxml.”</rss>n”;

echo $strxml; flush();

Oscomm 2 Mods

July 15th, 2009 Comments off

hi,

1. i installed a oscomm contrib called giftwrap. the admin is working great, but the giftwrap/nogiftwrap option does not show up on the checkout_shiping.php page as it is supposed to. the prob is that i have instlled the fec contrib and i could not do the final step in the instructions. the problem is that the docs say to find

<?php
if (tep_count_shipping_modules() > 0) {
?>

in checkout_shiping and then add this above it:

<!–BOF osc_Giftwrap –>
<?php
if (tep_count_giftwrap_modules() > 0) {
?>
<tr>
<td><table border=”0″ width=”100%” cellspacing=”0″ cellpadding=”2″>
<tr>
<td class=”main”><b><?php echo TABLE_HEADING_GIFTWRAP_METHOD; ?></b></td>
</tr>
</table></td>
</tr>
<tr>
<td><table border=”0″ width=”100%” cellspacing=”1″ cellpadding=”2″ class=”infoBox”>
<tr class=”infoBoxContents”>
<td><table border=”0″ width=”100%” cellspacing=”0″ cellpadding=”2″>
<?php
$quotes1_size = sizeof($quotes1);

if ($quotes1_size > 1) {
?>
<tr>
<td><?php echo tep_draw_separator(‘pixel_trans.gif’, ’10′, ’1′); ?></td>
<td class=”main” width=”50%” valign=”top”><?php echo TEXT_CHOOSE_GIFTWRAP_METHOD; ?></td>
<td class=”main” width=”50%” valign=”top” align=”right”><?php echo ‘<b>’ . TITLE_PLEASE_SELECT . ‘</b><br>’ . tep_image(DIR_WS_IMAGES . ‘arrow_east_south.gif’); ?></td>
<td><?php echo tep_draw_separator(‘pixel_trans.gif’, ’10′, ’1′); ?></td>
</tr>
<?php
} else {
?>
<tr>
<td><?php echo tep_draw_separator(‘pixel_trans.gif’, ’10′, ’1′); ?></td>
<td class=”main” width=”100%” colspan=”2″><?php echo TEXT_ENTER_GIFTWRAP_INFORMATION; ?></td>
<td><?php echo tep_draw_separator(‘pixel_trans.gif’, ’10′, ’1′); ?></td>
</tr>
<?php
}

$radio_buttons = 0;
for ($i=0; $i<$quotes1_size; $i++) {
?>
<tr>
<td><?php echo tep_draw_separator(‘pixel_trans.gif’, ’10′, ’1′); ?></td>
<td colspan=”2″><table border=”0″ width=”100%” cellspacing=”0″ cellpadding=”2″>
<?php
if (isset($quotes1[$i]['error'])) {
?>
<tr>
<td width=”10″><?php echo tep_draw_separator(‘pixel_trans.gif’, ’10′, ’1′); ?></td>
<td class=”main” colspan=”3″><?php echo $quotes1[$i]['error']; ?></td>
<td width=”10″><?php echo tep_draw_separator(‘pixel_trans.gif’, ’10′, ’1′); ?></td>
</tr>
<?php
} else {
$size = sizeof($quotes1[$i]['methods']);
for ($j=0, $n2=$size; $j<$n2; $j++) {
// set the radio button to be checked if it is the method chosen
$checked = (($quotes1[$i]['id'] . ‘_’ . $quotes1[$i]['methods'][$j]['id'] == $giftwrap_info['id']) ? true : false);

if ( ($quotes1[$i]['id'] . ‘_’ . $quotes1[$i]['methods'][$j]['id'] == $giftwrap_info['id']) || (tep_count_giftwrap_modules() == (int)1) ) {
echo ‘ <tr id=”defaultSelectedGift” class=”moduleRowSelected” onmouseover=”rowOverEffectGift(this)” onmouseout=”rowOutEffect(this)” onclick=”selectRowEffectGift(this, ‘ . $radio_buttons . ‘)”>’ . “n”;
} else {
echo ‘ <tr class=”moduleRow” onmouseover=”rowOverEffectGift(this)” onmouseout=”rowOutEffectGift(this)” onclick=”selectRowEffectGift(this, ‘ . $radio_buttons . ‘)”>’ . “n”;
}

?>
<td width=”10″><?php echo tep_draw_separator(‘pixel_trans.gif’, ’10′, ’1′); ?></td>
<td class=”main” width=”75%”><?php echo $quotes1[$i]['methods'][$j]['title']; ?></td>
<?php
if ( ($quotes1_size > 1) || ($n2 > 1) ) {

if (DISPLAY_PRICE_WITH_TAX == ‘true’) {
$gift_tax_rate_tmp = tep_get_tax_rate(MODULE_ORDER_TOTAL_GIFTWRAP_TAX_CLASS);
$gift_tax_amt_tmp = $quotes1[$i]['methods'][$j]['cost'];
$gift_tax_amt_tmp += tep_calculate_tax($quotes1[$i]['methods'][$j]['cost'], $gift_tax_rate_tmp);
?>
<td class=”main”><?php echo $currencies->format($gift_tax_amt_tmp); ?></td>
<?php
} else {
?>
<td class=”main”><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost']); ?></td>
<?php
}
?>
<td class=”main” align=”right”><?php echo tep_draw_radio_field(‘giftwrap’, $quotes1[$i]['id'] . ‘_’ . $quotes1[$i]['methods'][$j]['id'], $checked); ?></td>
<?php
} else {
?>
<td class=”main” align=”right” colspan=”2″><?php echo $currencies->format($quotes1[$i]['methods'][$j]['cost']) . tep_draw_hidden_field(‘giftwrap’, $quotes1[$i]['id'] . ‘_’ . $quotes1[$i]['methods'][$j]['id']); ?></td>
<?php
}
?>
<td width=”10″><?php echo tep_draw_separator(‘pixel_trans.gif’, ’10′, ’1′); ?></td>
</tr>
<?php
$radio_buttons++;
}
}
?>
</table></td>
<td><?php echo tep_draw_separator(‘pixel_trans.gif’, ’10′, ’1′); ?></td>
</tr>
<?php
}
?>
</table></td>
</tr>
</table></td>
</tr>
<?php
}
?>
<!–EOF osc_Giftwrap–>

my file has been modified with th fec install and i think i am placing this in the wrong place. i have placed it in includes/fec/shipping_box.php

2. i have created a ctergory which will be used for selling gift certificates http://www.babybow.co.za/index.php?cPath=45. now when a person purchases a certificate they then must enter a email address for the recipient i.e the person who will receive the gift cetificate. this email field must go on the product details page so when they add it to the cart, the email address is recorded. e.g http://www.babybow.co.za/product_info.php?cPath=45&products_id=150

Fix Download Script

June 5th, 2009 Comments off

I moved my website to a new server now the script I use to download datafeeds do not work. It fails and give the error message “There was an error downloading the file” Here is the script:

&lt;link rel=”stylesheet” type=”text/css” href=”styles.css” /&gt;
&lt;b&gt; MegaShoppingOnline Project &lt;/b&gt;
&lt;hr&gt;
Downloads starting in few seconds…

&lt;?php

set_time_limit(3600);
str_repeat(‘ ‘,250);

chdir(‘/var/www/vhosts/megashoppingonline.com/httpdocs/feeds’);
$afile = array( array(‘/1110′ ,’1110_1646303_mp.xml.gz’ ),
array(‘/1145′ ,’1145_1646303_mp.xml.gz’ ),
array(‘/1805′ ,’1805_1646303_mp.xml.gz’ ),
array(‘/2208′ ,’2208_1646303_mp.xml.gz’ ),
array(‘/2119′ ,’2119_1646303_mp.xml.gz’ ),
array(‘/2305′ ,’2305_1646303_mp.xml.gz’ ),
array(‘/3342′ ,’3342_1646303_mp.xml.gz’ ),
array(‘/3446′ ,’3446_1646303_mp.xml.gz’ ),
array(‘/3447′ ,’3447_1646303_mp.xml.gz’ ),
array(‘/768′ ,’768_1646303_mp.xml.gz’ ),
array(‘/13790′ ,’13790_1646303_mp.xml.gz’ ),
array(‘/775′ ,’775_1646303_mp.xml.gz’ ),
array(‘/926′ ,’926_1646303_mp.xml.gz’ ),
array(‘/1110′ ,’1110_1646303_mp.xml.gz’ ),
array(‘/13504′ ,’13504_1646303_mp.xml.gz’ ),
array(‘/13589′ ,’13589_1646303_mp.xml.gz’ ),
array(‘/13630′ ,’13630_1646303_mp.xml.gz’ ),
array(‘/13790′ ,’13790_1646303_mp.xml.gz’ ),
array(‘/13968′ ,’13968_1646303_mp.xml.gz’ ),
array(‘/13974′ ,’13974_1646303_mp.xml.gz’ ),
array(‘/14028′ ,’14028_1646303_mp.xml.gz’ ),
array(‘/14083′ ,’14083_1646303_mp.xml.gz’ ),
array(‘/14118′ ,’14118_1646303_mp.xml.gz’ ),
array(‘/14119′ ,’14119_1646303_mp.xml.gz’ ),
array(‘/14126′ ,’14126_1646303_mp.xml.gz’ ),
array(‘/14130′ ,’14130_1646303_mp.xml.gz’ ),
array(‘/147′ ,’147_1646303_mp.xml.gz’ ),
array(‘/1623′ ,’1623_1646303_mp.xml.gz’ ),
array(‘/24183′ ,’24183_1646303_mp.xml.gz’ ),
array(‘/24242′ ,’24242_1646303_mp.xml.gz’ ),
array(‘/24243′ ,’24243_1646303_mp.xml.gz’ ),
array(‘/24285′ ,’24285_1646303_mp.xml.gz’ ),
array(‘/24315′ ,’24315_1646303_mp.xml.gz’ ),
array(‘/2504′ ,’2504_1646303_mp.xml.gz’ ),
array(‘/2613′ ,’2613_1646303_mp.xml.gz’ ),
array(‘/3184′ ,’3184_1646303_mp.xml.gz’ ),
array(‘/24407′ ,’24407_1646303_mp.xml.gz’ ),
array(‘/3176′ ,’3176_1646303_mp.xml.gz’ ),
array(‘/2855′ ,’2855_1646303_mp.xml.gz’ ),
array(‘/982′ ,’982_1646303_mp.xml.gz’ ),
array(‘/3306′ ,’3306_1646303_mp.xml.gz’ ),
array(‘/14080′ ,’14080_1646303_mp.xml.gz’ ),
array(‘/24278′ ,’24278_1646303_mp.xml.gz’ ),
array(‘/24550′ ,’24550_1646303_mp.xml.gz’ ),
array(‘/1189′ ,’1189_1646303_mp.xml.gz’ ),
array(‘/2692′ ,’2692_1646303_mp.xml.gz’ ),
array(‘/13892′ ,’13892_1646303_mp.xml.gz’ ));

echo ‘&lt;br&gt;&lt;br&gt; Start ‘.date(“H:i:s”).’&lt;br&gt;’;
echo ‘&lt;br&gt;&lt;br&gt;&lt;B&gt;LinkShare&lt;/B&gt;… 1.5 hours’; flush();

foreach ($afile as $lfile) {
chdir(‘/var/www/vhosts/megashoppingonline.com/httpdocs/feeds’);
ftp_ls($lfile[0],$lfile[1]);
//echo exec(“gunzip -f “.$lfile[1]);
}

echo ‘&lt;br&gt;&lt;br&gt; End ‘.date(“H:i:s”).’&lt;br&gt;’;

function ftp_ls($dir,$file)
{
$ftp_server= ‘aftp.linksynergy.com’;
$ftp_user_name = ‘ADMega’;
$ftp_user_pass = ‘icgVbkwN’;

// set up basic connection
$conn_id = ftp_connect($ftp_server) or die(“Couldn’t connect to $ftp_server”);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// check connection
if ((!$conn_id) || (!$login_result)) {
die(“FTP connection has failed !”);
}

// try to change the directory to somedir
if (ftp_chdir($conn_id, $dir)) {
// echo “&lt;br&gt;Current directory is now: ” . ftp_pwd($conn_id) . “n &lt;br&gt;”;
} else {
echo “Couldn’t change directoryn”;
}

// Initate the download
echo ‘&lt;br&gt;’.$file;

$ret = ftp_nb_get($conn_id, $file, $file, FTP_BINARY);
while ($ret == FTP_MOREDATA) {

// Do whatever you want
echo “.”; flush();

// Continue downloading…
$ret = ftp_nb_continue($conn_id);
}
if ($ret != FTP_FINISHED) {
echo “There was an error downloading the file…”;
exit(1);
}

echo ‘ok.’;
// close the connection
ftp_close($conn_id);
}
?&gt;

Fix Download Script

June 5th, 2009 Comments off

I moved my website to a new server now the script I use to download datafeeds do not work. It fails and give the error message “There was an error downloading the file” Here is the script:

&lt;link rel=”stylesheet” type=”text/css” href=”styles.css” /&gt;
&lt;b&gt; MegaShoppingOnline Project &lt;/b&gt;
&lt;hr&gt;
Downloads starting in few seconds…

&lt;?php

set_time_limit(3600);
str_repeat(‘ ‘,250);

chdir(‘/var/www/vhosts/megashoppingonline.com/httpdocs/feeds’);
$afile = array( array(‘/1110′ ,’1110_1646303_mp.xml.gz’ ),
array(‘/1145′ ,’1145_1646303_mp.xml.gz’ ),
array(‘/1805′ ,’1805_1646303_mp.xml.gz’ ),
array(‘/2208′ ,’2208_1646303_mp.xml.gz’ ),
array(‘/2119′ ,’2119_1646303_mp.xml.gz’ ),
array(‘/2305′ ,’2305_1646303_mp.xml.gz’ ),
array(‘/3342′ ,’3342_1646303_mp.xml.gz’ ),
array(‘/3446′ ,’3446_1646303_mp.xml.gz’ ),
array(‘/3447′ ,’3447_1646303_mp.xml.gz’ ),
array(‘/768′ ,’768_1646303_mp.xml.gz’ ),
array(‘/13790′ ,’13790_1646303_mp.xml.gz’ ),
array(‘/775′ ,’775_1646303_mp.xml.gz’ ),
array(‘/926′ ,’926_1646303_mp.xml.gz’ ),
array(‘/1110′ ,’1110_1646303_mp.xml.gz’ ),
array(‘/13504′ ,’13504_1646303_mp.xml.gz’ ),
array(‘/13589′ ,’13589_1646303_mp.xml.gz’ ),
array(‘/13630′ ,’13630_1646303_mp.xml.gz’ ),
array(‘/13790′ ,’13790_1646303_mp.xml.gz’ ),
array(‘/13968′ ,’13968_1646303_mp.xml.gz’ ),
array(‘/13974′ ,’13974_1646303_mp.xml.gz’ ),
array(‘/14028′ ,’14028_1646303_mp.xml.gz’ ),
array(‘/14083′ ,’14083_1646303_mp.xml.gz’ ),
array(‘/14118′ ,’14118_1646303_mp.xml.gz’ ),
array(‘/14119′ ,’14119_1646303_mp.xml.gz’ ),
array(‘/14126′ ,’14126_1646303_mp.xml.gz’ ),
array(‘/14130′ ,’14130_1646303_mp.xml.gz’ ),
array(‘/147′ ,’147_1646303_mp.xml.gz’ ),
array(‘/1623′ ,’1623_1646303_mp.xml.gz’ ),
array(‘/24183′ ,’24183_1646303_mp.xml.gz’ ),
array(‘/24242′ ,’24242_1646303_mp.xml.gz’ ),
array(‘/24243′ ,’24243_1646303_mp.xml.gz’ ),
array(‘/24285′ ,’24285_1646303_mp.xml.gz’ ),
array(‘/24315′ ,’24315_1646303_mp.xml.gz’ ),
array(‘/2504′ ,’2504_1646303_mp.xml.gz’ ),
array(‘/2613′ ,’2613_1646303_mp.xml.gz’ ),
array(‘/3184′ ,’3184_1646303_mp.xml.gz’ ),
array(‘/24407′ ,’24407_1646303_mp.xml.gz’ ),
array(‘/3176′ ,’3176_1646303_mp.xml.gz’ ),
array(‘/2855′ ,’2855_1646303_mp.xml.gz’ ),
array(‘/982′ ,’982_1646303_mp.xml.gz’ ),
array(‘/3306′ ,’3306_1646303_mp.xml.gz’ ),
array(‘/14080′ ,’14080_1646303_mp.xml.gz’ ),
array(‘/24278′ ,’24278_1646303_mp.xml.gz’ ),
array(‘/24550′ ,’24550_1646303_mp.xml.gz’ ),
array(‘/1189′ ,’1189_1646303_mp.xml.gz’ ),
array(‘/2692′ ,’2692_1646303_mp.xml.gz’ ),
array(‘/13892′ ,’13892_1646303_mp.xml.gz’ ));

echo ‘&lt;br&gt;&lt;br&gt; Start ‘.date(“H:i:s”).’&lt;br&gt;’;
echo ‘&lt;br&gt;&lt;br&gt;&lt;B&gt;LinkShare&lt;/B&gt;… 1.5 hours’; flush();

foreach ($afile as $lfile) {
chdir(‘/var/www/vhosts/megashoppingonline.com/httpdocs/feeds’);
ftp_ls($lfile[0],$lfile[1]);
//echo exec(“gunzip -f “.$lfile[1]);
}

echo ‘&lt;br&gt;&lt;br&gt; End ‘.date(“H:i:s”).’&lt;br&gt;’;

function ftp_ls($dir,$file)
{
$ftp_server= ‘aftp.linksynergy.com’;
$ftp_user_name = ‘ADMega’;
$ftp_user_pass = ‘icgVbkwN’;

// set up basic connection
$conn_id = ftp_connect($ftp_server) or die(“Couldn’t connect to $ftp_server”);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// check connection
if ((!$conn_id) || (!$login_result)) {
die(“FTP connection has failed !”);
}

// try to change the directory to somedir
if (ftp_chdir($conn_id, $dir)) {
// echo “&lt;br&gt;Current directory is now: ” . ftp_pwd($conn_id) . “n &lt;br&gt;”;
} else {
echo “Couldn’t change directoryn”;
}

// Initate the download
echo ‘&lt;br&gt;’.$file;

$ret = ftp_nb_get($conn_id, $file, $file, FTP_BINARY);
while ($ret == FTP_MOREDATA) {

// Do whatever you want
echo “.”; flush();

// Continue downloading…
$ret = ftp_nb_continue($conn_id);
}
if ($ret != FTP_FINISHED) {
echo “There was an error downloading the file…”;
exit(1);
}

echo ‘ok.’;
// close the connection
ftp_close($conn_id);
}
?&gt;

Fix Download Script

June 5th, 2009 Comments off

I moved my website to a new server now the script I use to download datafeeds do not work. It fails and give the error message “There was an error downloading the file” Here is the script:

&lt;link rel=”stylesheet” type=”text/css” href=”styles.css” /&gt;
&lt;b&gt; MegaShoppingOnline Project &lt;/b&gt;
&lt;hr&gt;
Downloads starting in few seconds…

&lt;?php

set_time_limit(3600);
str_repeat(‘ ‘,250);

chdir(‘/var/www/vhosts/megashoppingonline.com/httpdocs/feeds’);
$afile = array( array(‘/1110′ ,’1110_1646303_mp.xml.gz’ ),
array(‘/1145′ ,’1145_1646303_mp.xml.gz’ ),
array(‘/1805′ ,’1805_1646303_mp.xml.gz’ ),
array(‘/2208′ ,’2208_1646303_mp.xml.gz’ ),
array(‘/2119′ ,’2119_1646303_mp.xml.gz’ ),
array(‘/2305′ ,’2305_1646303_mp.xml.gz’ ),
array(‘/3342′ ,’3342_1646303_mp.xml.gz’ ),
array(‘/3446′ ,’3446_1646303_mp.xml.gz’ ),
array(‘/3447′ ,’3447_1646303_mp.xml.gz’ ),
array(‘/768′ ,’768_1646303_mp.xml.gz’ ),
array(‘/13790′ ,’13790_1646303_mp.xml.gz’ ),
array(‘/775′ ,’775_1646303_mp.xml.gz’ ),
array(‘/926′ ,’926_1646303_mp.xml.gz’ ),
array(‘/1110′ ,’1110_1646303_mp.xml.gz’ ),
array(‘/13504′ ,’13504_1646303_mp.xml.gz’ ),
array(‘/13589′ ,’13589_1646303_mp.xml.gz’ ),
array(‘/13630′ ,’13630_1646303_mp.xml.gz’ ),
array(‘/13790′ ,’13790_1646303_mp.xml.gz’ ),
array(‘/13968′ ,’13968_1646303_mp.xml.gz’ ),
array(‘/13974′ ,’13974_1646303_mp.xml.gz’ ),
array(‘/14028′ ,’14028_1646303_mp.xml.gz’ ),
array(‘/14083′ ,’14083_1646303_mp.xml.gz’ ),
array(‘/14118′ ,’14118_1646303_mp.xml.gz’ ),
array(‘/14119′ ,’14119_1646303_mp.xml.gz’ ),
array(‘/14126′ ,’14126_1646303_mp.xml.gz’ ),
array(‘/14130′ ,’14130_1646303_mp.xml.gz’ ),
array(‘/147′ ,’147_1646303_mp.xml.gz’ ),
array(‘/1623′ ,’1623_1646303_mp.xml.gz’ ),
array(‘/24183′ ,’24183_1646303_mp.xml.gz’ ),
array(‘/24242′ ,’24242_1646303_mp.xml.gz’ ),
array(‘/24243′ ,’24243_1646303_mp.xml.gz’ ),
array(‘/24285′ ,’24285_1646303_mp.xml.gz’ ),
array(‘/24315′ ,’24315_1646303_mp.xml.gz’ ),
array(‘/2504′ ,’2504_1646303_mp.xml.gz’ ),
array(‘/2613′ ,’2613_1646303_mp.xml.gz’ ),
array(‘/3184′ ,’3184_1646303_mp.xml.gz’ ),
array(‘/24407′ ,’24407_1646303_mp.xml.gz’ ),
array(‘/3176′ ,’3176_1646303_mp.xml.gz’ ),
array(‘/2855′ ,’2855_1646303_mp.xml.gz’ ),
array(‘/982′ ,’982_1646303_mp.xml.gz’ ),
array(‘/3306′ ,’3306_1646303_mp.xml.gz’ ),
array(‘/14080′ ,’14080_1646303_mp.xml.gz’ ),
array(‘/24278′ ,’24278_1646303_mp.xml.gz’ ),
array(‘/24550′ ,’24550_1646303_mp.xml.gz’ ),
array(‘/1189′ ,’1189_1646303_mp.xml.gz’ ),
array(‘/2692′ ,’2692_1646303_mp.xml.gz’ ),
array(‘/13892′ ,’13892_1646303_mp.xml.gz’ ));

echo ‘&lt;br&gt;&lt;br&gt; Start ‘.date(“H:i:s”).’&lt;br&gt;’;
echo ‘&lt;br&gt;&lt;br&gt;&lt;B&gt;LinkShare&lt;/B&gt;… 1.5 hours’; flush();

foreach ($afile as $lfile) {
chdir(‘/var/www/vhosts/megashoppingonline.com/httpdocs/feeds’);
ftp_ls($lfile[0],$lfile[1]);
//echo exec(“gunzip -f “.$lfile[1]);
}

echo ‘&lt;br&gt;&lt;br&gt; End ‘.date(“H:i:s”).’&lt;br&gt;’;

function ftp_ls($dir,$file)
{
$ftp_server= ‘aftp.linksynergy.com’;
$ftp_user_name = ‘ADMega’;
$ftp_user_pass = ‘icgVbkwN’;

// set up basic connection
$conn_id = ftp_connect($ftp_server) or die(“Couldn’t connect to $ftp_server”);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// check connection
if ((!$conn_id) || (!$login_result)) {
die(“FTP connection has failed !”);
}

// try to change the directory to somedir
if (ftp_chdir($conn_id, $dir)) {
// echo “&lt;br&gt;Current directory is now: ” . ftp_pwd($conn_id) . “n &lt;br&gt;”;
} else {
echo “Couldn’t change directoryn”;
}

// Initate the download
echo ‘&lt;br&gt;’.$file;

$ret = ftp_nb_get($conn_id, $file, $file, FTP_BINARY);
while ($ret == FTP_MOREDATA) {

// Do whatever you want
echo “.”; flush();

// Continue downloading…
$ret = ftp_nb_continue($conn_id);
}
if ($ret != FTP_FINISHED) {
echo “There was an error downloading the file…”;
exit(1);
}

echo ‘ok.’;
// close the connection
ftp_close($conn_id);
}
?&gt;

Fix Download Script

June 5th, 2009 Comments off

I moved my website to a new server now the script I use to download datafeeds do not work. It fails and give the error message “There was an error downloading the file” Here is the script:

&lt;link rel=”stylesheet” type=”text/css” href=”styles.css” /&gt;
&lt;b&gt; MegaShoppingOnline Project &lt;/b&gt;
&lt;hr&gt;
Downloads starting in few seconds…

&lt;?php

set_time_limit(3600);
str_repeat(‘ ‘,250);

chdir(‘/var/www/vhosts/megashoppingonline.com/httpdocs/feeds’);
$afile = array( array(‘/1110′ ,’1110_1646303_mp.xml.gz’ ),
array(‘/1145′ ,’1145_1646303_mp.xml.gz’ ),
array(‘/1805′ ,’1805_1646303_mp.xml.gz’ ),
array(‘/2208′ ,’2208_1646303_mp.xml.gz’ ),
array(‘/2119′ ,’2119_1646303_mp.xml.gz’ ),
array(‘/2305′ ,’2305_1646303_mp.xml.gz’ ),
array(‘/3342′ ,’3342_1646303_mp.xml.gz’ ),
array(‘/3446′ ,’3446_1646303_mp.xml.gz’ ),
array(‘/3447′ ,’3447_1646303_mp.xml.gz’ ),
array(‘/768′ ,’768_1646303_mp.xml.gz’ ),
array(‘/13790′ ,’13790_1646303_mp.xml.gz’ ),
array(‘/775′ ,’775_1646303_mp.xml.gz’ ),
array(‘/926′ ,’926_1646303_mp.xml.gz’ ),
array(‘/1110′ ,’1110_1646303_mp.xml.gz’ ),
array(‘/13504′ ,’13504_1646303_mp.xml.gz’ ),
array(‘/13589′ ,’13589_1646303_mp.xml.gz’ ),
array(‘/13630′ ,’13630_1646303_mp.xml.gz’ ),
array(‘/13790′ ,’13790_1646303_mp.xml.gz’ ),
array(‘/13968′ ,’13968_1646303_mp.xml.gz’ ),
array(‘/13974′ ,’13974_1646303_mp.xml.gz’ ),
array(‘/14028′ ,’14028_1646303_mp.xml.gz’ ),
array(‘/14083′ ,’14083_1646303_mp.xml.gz’ ),
array(‘/14118′ ,’14118_1646303_mp.xml.gz’ ),
array(‘/14119′ ,’14119_1646303_mp.xml.gz’ ),
array(‘/14126′ ,’14126_1646303_mp.xml.gz’ ),
array(‘/14130′ ,’14130_1646303_mp.xml.gz’ ),
array(‘/147′ ,’147_1646303_mp.xml.gz’ ),
array(‘/1623′ ,’1623_1646303_mp.xml.gz’ ),
array(‘/24183′ ,’24183_1646303_mp.xml.gz’ ),
array(‘/24242′ ,’24242_1646303_mp.xml.gz’ ),
array(‘/24243′ ,’24243_1646303_mp.xml.gz’ ),
array(‘/24285′ ,’24285_1646303_mp.xml.gz’ ),
array(‘/24315′ ,’24315_1646303_mp.xml.gz’ ),
array(‘/2504′ ,’2504_1646303_mp.xml.gz’ ),
array(‘/2613′ ,’2613_1646303_mp.xml.gz’ ),
array(‘/3184′ ,’3184_1646303_mp.xml.gz’ ),
array(‘/24407′ ,’24407_1646303_mp.xml.gz’ ),
array(‘/3176′ ,’3176_1646303_mp.xml.gz’ ),
array(‘/2855′ ,’2855_1646303_mp.xml.gz’ ),
array(‘/982′ ,’982_1646303_mp.xml.gz’ ),
array(‘/3306′ ,’3306_1646303_mp.xml.gz’ ),
array(‘/14080′ ,’14080_1646303_mp.xml.gz’ ),
array(‘/24278′ ,’24278_1646303_mp.xml.gz’ ),
array(‘/24550′ ,’24550_1646303_mp.xml.gz’ ),
array(‘/1189′ ,’1189_1646303_mp.xml.gz’ ),
array(‘/2692′ ,’2692_1646303_mp.xml.gz’ ),
array(‘/13892′ ,’13892_1646303_mp.xml.gz’ ));

echo ‘&lt;br&gt;&lt;br&gt; Start ‘.date(“H:i:s”).’&lt;br&gt;’;
echo ‘&lt;br&gt;&lt;br&gt;&lt;B&gt;LinkShare&lt;/B&gt;… 1.5 hours’; flush();

foreach ($afile as $lfile) {
chdir(‘/var/www/vhosts/megashoppingonline.com/httpdocs/feeds’);
ftp_ls($lfile[0],$lfile[1]);
//echo exec(“gunzip -f “.$lfile[1]);
}

echo ‘&lt;br&gt;&lt;br&gt; End ‘.date(“H:i:s”).’&lt;br&gt;’;

function ftp_ls($dir,$file)
{
$ftp_server= ‘aftp.linksynergy.com’;
$ftp_user_name = ‘ADMega’;
$ftp_user_pass = ‘icgVbkwN’;

// set up basic connection
$conn_id = ftp_connect($ftp_server) or die(“Couldn’t connect to $ftp_server”);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// check connection
if ((!$conn_id) || (!$login_result)) {
die(“FTP connection has failed !”);
}

// try to change the directory to somedir
if (ftp_chdir($conn_id, $dir)) {
// echo “&lt;br&gt;Current directory is now: ” . ftp_pwd($conn_id) . “n &lt;br&gt;”;
} else {
echo “Couldn’t change directoryn”;
}

// Initate the download
echo ‘&lt;br&gt;’.$file;

$ret = ftp_nb_get($conn_id, $file, $file, FTP_BINARY);
while ($ret == FTP_MOREDATA) {

// Do whatever you want
echo “.”; flush();

// Continue downloading…
$ret = ftp_nb_continue($conn_id);
}
if ($ret != FTP_FINISHED) {
echo “There was an error downloading the file…”;
exit(1);
}

echo ‘ok.’;
// close the connection
ftp_close($conn_id);
}
?&gt;

Form Not Working Corrrectly.

May 22nd, 2009 Comments off

hi,

i installed a coupon code contribution to a oscomm store, works 100%. clients enter code for discount and then discount aplied upon checkout. per contribution instructions i must place the coupon form in checkout_payment.php . i moved the form to checkout_shipping.php as a while back i combined checkout_payment and checkout_shipping into one step and now only checkout_shipping.php is used in the order process. the form will not work in checkout_shipping.php, it does nothing, as there is a call to a function that is present in checkout_payment but not in checkout_shipping. this is the code for the html form that i moved to checkout_ shipping.php

&amp;lt;?php
/* kgt – discount coupons */
if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == ‘true’ ) {
?&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;table border=”0″ width=”100%” cellspacing=”0″ cellpadding=”2″&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td class=”main”&amp;gt;&amp;lt;b&amp;gt;&amp;lt;?php echo TABLE_HEADING_COUPON; ?&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;table border=”0″ width=”100%” cellspacing=”1″ cellpadding=”2″ class=”infoBox”&amp;gt;
&amp;lt;tr class=”infoBoxContents”&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;table border=”0″ width=”100%” cellspacing=”0″ cellpadding=”2″&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td class=”main”&amp;gt;&amp;lt;?php echo ENTRY_DISCOUNT_COUPON.’ ‘.tep_draw_input_field(‘coupon’, ”, ‘size=”32″‘); ?&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;?php echo tep_draw_separator(‘pixel_trans.gif’, ’100%’, ’10′); ?&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;?php
}
/* end kgt – discount coupons */
?&amp;gt;

i have attached checkout_shipping.php and checkout_payment.php.

russ

Move Form.

May 19th, 2009 Comments off

hi,

i just installed a coupon code contribution to a oscomm store, works 100%. clients enter code for discount. per contribution instructions i must place the coupon form in checkout_payment.php . i want to move it to checkout_shipping.php. this is the code that needs to be moved:

&lt;?php
/* kgt – discount coupons */
if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == ‘true’ ) {
?&gt;
&lt;tr&gt;
&lt;td&gt;&lt;table border=”0″ width=”100%” cellspacing=”0″ cellpadding=”2″&gt;
&lt;tr&gt;
&lt;td class=”main”&gt;&lt;b&gt;&lt;?php echo TABLE_HEADING_COUPON; ?&gt;&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;table border=”0″ width=”100%” cellspacing=”1″ cellpadding=”2″ class=”infoBox”&gt;
&lt;tr class=”infoBoxContents”&gt;
&lt;td&gt;&lt;table border=”0″ width=”100%” cellspacing=”0″ cellpadding=”2″&gt;
&lt;tr&gt;
&lt;td class=”main”&gt;&lt;?php echo ENTRY_DISCOUNT_COUPON.’ ‘.tep_draw_input_field(‘coupon’, ”, ‘size=”32″‘); ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;?php echo tep_draw_separator(‘pixel_trans.gif’, ’100%’, ’10′); ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;?php
}
/* end kgt – discount coupons */
?&gt;

i have attached checkout_shipping.php.

russ

Fix Mysql Php Script Command

May 16th, 2009 Comments off

Hello,

This is how it should work.

I have 5 ads saved. I check the checkbox next to the 5 ads
and then click on Post. All 5 ads should then be inserted into the database.

This is how it’s working.

It enters 5 ads but they all have the same adbody and url.

here is the echo statement:

insert into post (adbody,userid,posted,url,saved_id) values(‘Entire Package Of 50 Awesome Newly Released Products’,'showme48′,’1242502038′,’http://resellermania.net/’,’2′)
Your message has been added successfully. You have 24 post left today. Click Here to post again.

insert into post (adbody,userid,posted,url,saved_id) values(‘Entire Package Of 50 Awesome Newly Released Products’,'showme48′,’1242502038′,’http://resellermania.net/’,’3′)
Your message has been added successfully. You have 24 post left today. Click Here to post again.

insert into post (adbody,userid,posted,url,saved_id) values(‘Entire Package Of 50 Awesome Newly Released Products’,'showme48′,’1242502038′,’http://resellermania.net/’,’138′)
Your message has been added successfully. You have 24 post left today. Click Here to post again.

insert into post (adbody,userid,posted,url,saved_id) values(‘Entire Package Of 50 Awesome Newly Released Products’,'showme48′,’1242502038′,’http://resellermania.net/’,’211′)
Your message has been added successfully. You have 24 post left today. Click Here to post again.

insert into post (adbody,userid,posted,url,saved_id) values(‘Entire Package Of 50 Awesome Newly Released Products’,'showme48′,’1242502038′,’http://resellermania.net/’,’213′)
Your message has been added successfully. You have 24 post left today. Click Here to post again.

As you can see the adbody and url are the same for every post but they are of 1 ad.

Here is the code I’m using:

foreach($saved_id as $each) {

$qpost=”insert into post (adbody,userid,posted,url,saved_id) values(‘”.$_POST['message'].”‘,’$userid’,'”.time().”‘,’”.$_POST['url'].”‘,’$each’)”;

echo $qpost;

$rpost=mysql_query($qpost);
echo “&lt;center&gt;&lt;p&gt;&lt;b&gt;Your message has been added successfully. You have “.($numpost – $todaycount – 1).” post left today. &lt;a href=posttextads.php&gt;Click Here&lt;/a&gt; to post again.&lt;/b&gt;&lt;/p&gt;&lt;/center&gt;”;

}

Obvioulsy I need this to work correctly.

Virtuemart Tmplate For Edit

May 9th, 2009 Comments off

Hello.
This is a posting for modifying a Joomla Virtumart Category template (browse_lite_pdf.php). My client would like for this template to be very similar to sprint.com’s category list ex:http://nextelonline.nextel.com/NASApp/onlinestore/en/Action/DisplayPhones?filterString=PDA_Smartphone_Phone_Char&amp;id12=CHP_PhonesTab_Link_PDAandSmartphones

Current category template is located at: http://www.sprintmichigan.com/index.php?option=com_virtuemart&amp;Itemid=87

As a semi programmer i feel my client is needing an additional product description field that can be modified using a wysiwyg editor in the backend of the Virtuemart product editor. This will result in having 2 columns in the category template that will include 2 columns that can be modified using html. Currently I am using the short description field (&lt;?php echo $product_s_desc ?&gt;)in the category view which is can not be editied using a wysiwyg editor, just text.

Conclusion: I am needing 4 columns in the category view displaying the following:
Column 1: image thumbnail: &lt;a href=”&lt;?php echo $product_flypage ?&gt;”&gt;&lt;?php echo ps_product::image_tag( $product_thumb_image, ‘class=”browseProductImage” border=”0″ title=”‘.$product_name.’” alt=”‘.$product_name .’”‘ ) ?&gt;&lt;/a&gt;

and

Additional images: echo $this-&gt;vmlistAdditionalImages( $product_id, $images )

Column 2: Product Name: echo $product_name
Short Description: echo $product_s_desc
Ask Seller Question: echo $ask_seller

Column 3: Addition Product Description with wysiwyg editor in the backend of the Virtuemart product editor

Column 4: Upgrade Now: &lt;a href=”&lt;?php echo $product_flypage ?&gt;”&gt;
&lt;h4&gt;UPGRADE NOW&lt;/h4&gt;&lt;/a&gt; (This simply links to product detail page)

Magento – Site Crashes In Ie

May 1st, 2009 Comments off

Hi,

We are installing a mod for Magento and after installing the site where the mod is active, the site loads in all browsers with no problems except for internet explorer.

I found the code where the problem is being is being caused from but can fix it.

When I remove this code the problem goes away but of course I need it:
&lt;?php echo $this-&gt;getChildChildHtml(‘container2′, ”, true, true) ?&gt;
&lt;span class=”add-or”&gt;&lt;?php echo $this-&gt;__(‘OR’) ?&gt;&lt;/span&gt;
&lt;?php echo $this-&gt;getChildHtml(‘addto’) ?&gt;
&lt;/div&gt;
&lt;?php endif;?&gt;
&lt;?php //echo $this-&gt;getChildHtml(‘addto’) ?&gt;

I have attached the file if you’d like to look first. Also please pm me for the URL if you’d like to see the problem.

Thanks
Mike

Processing Array

April 15th, 2009 Comments off

I need this done ASAP.

I have a multidimensional associative array that I need to process. As I loop thru the array (in PHP) I need to be able to evaluate the value from the sub-array. Depending on the results I will either print out the entire sub-array or throw it out and continue to the next sub-array key.

The first processing that I need to do is on the value for a sub-array key ‘url’. If the value contains ‘/path1/*.pdf’ then it will not print out the entire sub-array it will move on the the next key. If the value contains anything else it will print. (ex: ‘/path1/path2/*.pdf’.

The code needs to be well documented (inline is fine) with verbosely named variables so that I can easily modify it to evaluate other sub-array values, string values, etc. A dump of the array is attached to this project.

The code that I have been using is:

while(list($key, $value) = each($qry_results)) {

while(list($key1, $value1) = each($value)) {

if($key1 == “url”) {

reset($value);

while(list($key1, $value1) = each($value)) {

echo “&lt;b&gt;$key1&lt;/b&gt; “;

echo “$value1&lt;br&gt;”;

}

}

}

echo “&lt;br&gt;&lt;br&gt;”;

}

Vb Gui To Replace Dos Menu

April 7th, 2009 Comments off

This small project is to create a VB front end that should replace a simple DOS menu.
Currently the DOS menu promtps the user for 5 arguments (name_string, scenario, user, pass, site) and then allows the user to select one of the 30 menu items.
Depending on the menu item choose, the Batch file just call a VBscript.
I don’t need integration with that script. Just the VB front end that will pass the command depending on what the user has clicked.
I also don’t need a fully populated VB GUI, as long as I can then edit the source, I will add more options myself.
Easy but no time.

**********
User Input
**********
set /P target_san=Enter Target Name]. (%target_name%):
If ‘%target_san%’==” goto SYNTAX
set /P scenario=Enter Scenario [A, B, C] (%scenario%):
If ‘%scenario%’==” goto SYNTAX
set /P username=Enter Username (%username%):
If ‘%username%’==” goto SYNTAX
set /P password=Enter Password (%password%):
If ‘%password%’==” goto SYNTAX
set /P trigram=Enter Site Trigram(%trigram%):
If ‘%trigram%’==” goto SYNTAX
……
Target name should be radio buttons with 3 names hardcoded
scenario is a drop down.
rest is InpuBox.

echo. General settings
echo. ———————
echo. 1. Action 1
echo. 2. Action 2
etc….

:ENTER
set /p choice=
if ‘%choice%’==’1′ set label=action_01
if ‘%choice%’==’2′ set label=action_02
etc…

Each choice is unique (there are 40 of them) so a radio box is enough.
No multiple tick box are required and drop down list too prone to errors.

Then a big Green button that says go :-)

REM ************************************
REM Command sent to the VBscript
REM ************************************

cscript “:PathVBscript.vbs” %target_name% %LABEL% %scenario% %username% %password% %trigram%

So the VB GUI is just used to create the command line above and display what’s going on in a DOS prompt embedded in the interface. The VBscript issues some Command Prompt so we need to see them.

Mysql Php Pagination Fix

March 29th, 2009 Comments off

Hello,

I have a script, it displays all active banners using pagination. Once the banner is clicked it doesn’t show up again. This works fine.

The issue:

For example I’m displaying 25 banners per page, I have over 1000 active banners so there are 102 pages.

If I click on the all 25 of the banners on page one and then leave the site, the next time I come back to the site they do not show. This works correctly. But here is the problem, when I come back to the site page one is blank, I have to move on to page 2 in order to see the next round of banners. So in other words it’s not moving the banners up to page one.

I need this fixed.

Here is the code if you think you want to tackle it.

[code]
&lt;?php

session_start();

include "../header.php";

include "../config.php";

include "../style.php";
$uname=$_SESSION[uname];
if( session_is_registered("ulogin") ) {

$tbl_name="banners"; //your table name

// How many adjacent pages should be shown on each side?

$adjacents = 3;

/*

First get total number of rows in data table.

If you have a WHERE clause in your query, make sure you mirror it here.

*/

if( session_is_registered("ulogin") )

{

$query = "SELECT COUNT(*) as num FROM banners, banner_clicks WHERE banners.status=1 and banners.max&gt;banners.shown AND banner_clicks.userid&lt;&gt;'".userid."' group by banners.id";

}

else

$query = "SELECT COUNT(*) as num FROM $tbl_name WHERE status=1 and max&gt;shown";

$ttlpag=mysql_query($query) or die (mysql_error());

$total_pages = mysql_fetch_array($ttlpag);

$total_pages = $total_pages[num];
$qn="select * from sat_banclicks where userid='$uname' group by bannerid";
$ns=mysql_query($qn);
$nk=mysql_num_rows($ns);
$total_pages=$total_pages-(2*$nk);
//echo $nk;

/* Setup vars for query. */

$targetpage = "bannerlinkview.php"; //your file name (the name of this file)

$limit = 25; //how many items to show per page

$page = $_GET['page'];

if($page)

$start = ($page - 1) * $limit; //first item to display on this page

else

$start = 1; //if no page var is given, set start to 0

/* Get data. */

if( session_is_registered("ulogin") )

{

$sql = "SELECT banners.id as id, banners.name as name, banners.bannerurl as bannerurl, banners.targeturl as targeturl, banners.userid as userid, banners.shown as shown, banners.clicks as clicks, banners.max as max, banners.added as added FROM banners, banner_clicks WHERE banners.status=1 and banners.max&gt;banners.shown AND banner_clicks.userid&lt;&gt;'".userid."' group by banners.id LIMIT $start, $limit";

}

else

{

$sql = "SELECT * FROM banners WHERE status=1 and max&gt;shown LIMIT $start, $limit";

}

$result = mysql_query($sql) or die (mysql_error());

if(!mysql_num_rows($result))

{

$result = mysql_query ("SELECT * FROM banners WHERE status=1 and max&gt;shown LIMIT $start, $limit");

}

/* Setup page vars for display. */

if ($page == 0) $page = 1; //if no page var is given, default to 1.

$prev = $page - 1; //previous page is page - 1

$next = $page + 1; //next page is page + 1

$lastpage = ceil($total_pages/$limit); //lastpage is = total pages / items per page, rounded up.

$lpm1 = $lastpage - 1; //last page minus 1

/*

Now we apply our rules and draw the pagination object.

We're actually saving the code to a variable in case we want to draw it more than once.

*/

$pagination = "";

if($lastpage &gt; 1)

{

$pagination .= "&lt;div class="pagination"&gt;";

//previous button

if ($page &gt; 1)

$pagination.= "&lt;a href="$targetpage?page=$prev"&gt;

Categories: MySQL, PHP Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Bear