Jump to content

Colleen78

Members
  • Posts

    66
  • Joined

  • Last visited

    Never

About Colleen78

  • Birthday 05/14/1978

Contact Methods

  • Website URL
    http://www.kalinawebdesigns.com/

Profile Information

  • Gender
    Female
  • Location
    Canada

Colleen78's Achievements

Member

Member (2/5)

0

Reputation

  1. Wow, thank you, that's perfect, and I learned what I am doing wrong.
  2. Thank you, CV. I don't need to include the table start and end, because I have it as you'll see below, and also, this is how I included your code, I tried other ways, but keep getting an error. The error is: Parse error: syntax error, unexpected $end in /home/domain/public_html/template/hctheme/index.php on line 76 My code: <table class="newitems" cellspacing="1" cellpadding="0" border="0" bgcolor="#ffffff" align="center" width="100%" style="border: 1px solid rgb(45, 135, 7);"> <tr><td colspan="3" align="center"><strong>New Products</strong></td></tr> <?php //Specify the query $query = 'SELECT * FROM `tbl_item` where category_id not in (104,105,106,107,108,109,110,111,112,113,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,132,133,138,139,140) GROUP BY `item_id` ORDER BY `item_id` DESC LIMIT 3'; //Execut the query $result = mysql_query($query) or die ("Error. Unable to perform query."); //Loop through all the results, displaying each one while ($row = mysql_fetch_array($result)) $cols = 0; while ($cols < 20) { echo ($cols % 3 == 0)? "</tr><tr>" : ""; { extract($row); $item_name = str_replace(" ", "_",$item_name); echo "<td width=\"33%\" bgcolor=\"#c2edaa\" style=\"border: 1px solid rgb(45, 135, 7);\">\n"; echo "<a href=\"$URL/item/$item_name/$item_id\"><img src=\"$SSL_URL/item_images/$thumbnail_image\" width=\"110\" height=\"100\" alt=\"$short_description\" border=\"0\" /></a><br />\n"; echo "<b>$row[item_name]</b><br />\n"; echo "$row[short_description]"; echo "</td>\n"; $cols++; } ?></table> I'm not quite sure how to adapt your code into mine. ???
  3. I have this PHP code, it creates 1 row of the 3 latest new items in our shopping cart: <tr align="center" valign="top"> <?php //Specify the query $query = 'SELECT * FROM `tbl_item` where category_id not in (104,105,106,107,108,109,110,111,112,113,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,132,133,138,139,140) GROUP BY `item_id` ORDER BY `item_id` DESC LIMIT 3'; //Execut the query $result = mysql_query($query) or die ("Error. Unable to perform query."); //Loop through all the results, displaying each one while ($row = mysql_fetch_array($result)) { extract($row); $item_name = str_replace(" ", "_",$item_name); echo "<td width=\"33%\" bgcolor=\"#c2edaa\" style=\"border: 1px solid rgb(45, 135, 7);\">\n"; echo "<a href=\"$URL/item/$item_name/$item_id\"><img src=\"$SSL_URL/item_images/$thumbnail_image\" width=\"110\" height=\"100\" alt=\"$short_description\" border=\"0\" /></a><br />\n"; echo "<b>$row[item_name]</b><br />\n"; echo "$row[short_description]"; echo "</td>\n"; } ?></tr> But now I'd like to display 9 items, so 3 rows of 3 items per row... I don't know how to include the <tr> tag into the php to make it loop per each 3 items, does anyone have an idea how to do this? Thanks
  4. Wow, that did the trick, the errors are gone and everything's still working. Thanks so much!
  5. I am not sure what you mean, but I did notice this is happening when someone views a page which contains a link that is not an amazon link, if they view a page with an amazon link in the post, no errors, and it works fines, but if I view a post with a link to anything else I get these errors. I think it needs to be coded in what to do if it's a normal link and not an amazon link.
  6. Hello, The creator of a modification I am using for my SMF 1.1.5 board seems to have stopped offering support so I'd like to fix this issue myself. The modification takes Amazon links in my forum and adds my associate ID. Here's a link to the modification if it helps, http://custom.simplemachines.org/mods/index.php?mod=893 The error I am getting in the error log is this: This is that line: if (preg_match('/(.*)amazon\.(com|co.uk|de|fr|co.jp|ca)+/i', $parsed['host'])) { Here is the rest of the code from around and including that line: // CYCLE THROUGH EACH LINK foreach($links as $link) { $parsed = parse_url($link); // MATCH ANY AMAZON LINKS AND CREATE REPLACEMENTS if (preg_match('/(.*)amazon\.(com|co.uk|de|fr|co.jp|ca)+/i', $parsed['host'])) { $parsed['host'] = str_replace('www.','',$parsed['host']); $parsed['host'] = str_replace('amazon.','',$parsed['host']); // IF THE DOMAIN EXTENSION IS VALID if(isset($temp[$parsed['host']])) { $search[] = '<a href="'. $link. '"' ; $replace[] = '<a href="'. str_replace($parsed['host'], $modSettings['amazonlinksassociatestore'], $link) . ((strpos($link,'?') === FALSE) ? '?' : '&') . 'tag='. $modSettings['amazonlinksassociateid'].'"' ; } } // TIDY UP unset($parsed); } No other parts of the modification mention "$parsed" so I believe the error is limited to these few lines and am guessing it's not coded properly. If anyone has any ideas how to fix this, please let me know. Thanks!
  7. Well there's this bit, which looks like it was meant to handle the situation if there was no change: if ($shareinfo['change'] == 0) $change = "$changenum ($shareinfo[perchange])"; else if ($shareinfo['perchange'] > 0) $change = "<font color=green>$changenum ($shareinfo[perchange])</font>"; else if ($shareinfo['perchange'] < 0) $change = "<font color=red>$changenum ($shareinfo[perchange])</font>"; And there's this for the gainper part. $gaintxt = number_format($gain,3); $gainpertxt = number_format($gainper,3); if ($gain > 0) { $gaintxt = "<font color=green>$gaintxt</font>"; $gainpertxt = "<font color=green>$gainpertxt%</font>"; } elseif ($gain < 0) { $gaintxt = "<font color=red>$gaintxt</font>"; $gainpertxt = "<font color=red>$gainpertxt%</font>"; } else { $gainpertxt .= '%'; }
  8. Thank you, you guys are like miracle workers here. I had to make a minor adjustment to get it to work. if($mktval <= "0") { $change = "None"; } else { $gainper = number_format((($gain/$mktval)*100),3); } I had to change the first instance of "$gainper" to the value called in the td row, "$change" and now "None" is displaying there correctly.
  9. Thanks again, one last thing, the error is gone, but "none" is being printed at the top of the page, instead of in the table td row it's meant to be in, which is here "<td align=right>$change</td>" I need to somehow get it to echo "None" there instead of outside the whole page, should I post more code or anything?
  10. Thanks for the response. I'm not a programmer at all, so did I do this wrong? if($mktval <= "0") echo "None"; { $gainper = number_format((($gain/$mktval)*100),3); } Cause it's still displaying the error, but also now with "none" in front of the error.
  11. I have a plugin for my vbulletin forum but the author appears to have abandoned supporting the plugin. I don't know when this issue started, but it was reported by my members today. It's a stock trader plugin, when you go to view a members stocks, any stocks they have with no change, ie; 0, are causing this error at the top of the page: And that error is repeated for each stock with 0 change. You can view what I mean, here: http://www.webtalkforums.com/vbtrade.php?do=viewportfolio&userid=2898 (I don't think you need to be logged in to view it, if you do, let me know) This is line 112 in vbtrade.php $gainper = number_format((($gain/$mktval)*100),3); I'd like to try and fix this, any help/guidance is appreciated, thank you.
  12. I came up with a solution but have one last issue, it's not parsing correctly when using quick reply, it loads in using the image code instead, but on refresh it's fine. I don't have to use plugins or anything, I just did this to my postbit_onlinestatus template: <if condition="$vbulletin->userinfo['field8'] != 'Horizontal Postbit' AND in_array(THIS_SCRIPT, array('showthread','private'))"><if condition="$onlinestatus==0">0</if><if condition="$onlinestatus==1">1</if><if condition="$onlinestatus==2">2</if><else /><if condition="$onlinestatus==0"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/user_offline.gif" alt="<phrase 1="$user[username]">$vbphrase[x_is_offline]</phrase>" border="0" /></if> <if condition="$onlinestatus==1"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/user_online.gif" alt="<phrase 1="$user[username]">$vbphrase[x_is_online_now]</phrase>" border="0" /></if> <if condition="$onlinestatus==2"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/user_invisible.gif" alt="<phrase 1="$user[username]">$vbphrase[x_is_invisible]</phrase>" border="0" /></if></if> My members can choose their postbit, hence the first part of the code. Any ideas how to make this parse right away with quick reply?
  13. By default, vbulletin returns an image to indicate if a user is online, offline, or invisible, I am trying to return text, I could just do that in the default template, but can't because I am using the default template as it is in other areas, such as the members profile page. This is hard code in one of the files to return a users online status. $onlinestatus = 0; // now decide if we can see the user or not if ($user['lastactivity'] > $datecut AND $user['lastvisit'] != $user['lastactivity']) { if ($user['invisible']) { if (($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseehidden']) OR $user['userid'] == $vbulletin->userinfo['userid']) { // user is online and invisible BUT bbuser can see them $user['invisiblemark'] = '*'; $onlinestatus = 2; } } else { // user is online and visible $onlinestatus = 1; } } if ($setstatusimage) { eval('$user[\'onlinestatus\'] = "' . fetch_template('postbit_onlinestatus') . '";'); } return $onlinestatus; } I hope that helps, I've been trying to figure this out for 2 days.
  14. I am trying to make it so a background image in my postbit changes color depending on if a user is online, offline or invisible. I am doing this by assigning a class which I need to change using conditionals, and I found this bit of code for a plugin: http://www.vbulletin.org/forum/showpost.php?p=1323306&postcount=8 However, it's not working, it's showing everyone as offline. What's the best way to go about doing this? I had my class change depending on the users status, ie "class="online1"... The "1" would be the part that changes to either 0, 1 or 2... any ideas how to get this working? Here's what I have so far. I made a custom template. Title: postbit_onlinestatus_two Inside that template: <if condition="$onlinestatus==0">0</if><if condition="$onlinestatus==1">1</if><if condition="$onlinestatus==2">2</if> I've made a plugin to cache the template. Hook Location: cache_templates Title: cache custom templates Code: $globaltemplates = array_merge($globaltemplates, array('beer','drink','postbit_onlinestatus_two')); (it's caching other templates as well) I've created a plugin to execute the template. Hook Location: postbit_display_complete Title: Postbit Online Status Code: eval('$postbitonlinestatus = "' . fetch_template('postbit_onlinestatus_two') . '";'); And the code in my postbit template: <div class="online$postbitonlinestatus"> It's currently returning a "0" regardless if I am online or not. Can someone please give me a little guidance to get this working? Thank you.
  15. redarrow, your latest code above causes the date to change to "Last Activity: Dec 31st, 1969 7:33 pm" Your earlier code was working fine.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.