Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#26 08-16-2009 07:27:45

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Featured or Random Item Menu Block Script

thezazzi wrote:

Where abouts was Username & Password originally entered?

For CCP right on that page.  The user and password were created by you through your hosts control panel or by the person who did your install.

thezazzi wrote:

Looking though my hosts cPanel it shows the database and database users, there's no option to change passwords only to add a user to that database so I'm not to sure where about i need to look.

I've never understood why cPanel doesn't provide a way to change MySQL user passwords but it doesn't.  In your situation I'd probably create another user with ALL privileges to the CCP database and use it for what you're trying to do.  Or go back to the person who installed CCP for you and ask for the password for the existing user.

You may also find the password by looking at the contents of config.php in the private CCP folder. 

thezazzi wrote:

I'm not to fussed about having to add a new user so i can access the db  but its the fact that it should be me who knows all the passwords and no one else.

I'd normally agree with you but you'd be surprised at the number of people who do not want to know that amount of detail.  I do installs all of the time where I get nothing more than control panel credentials and do all of the set up of MySQL.  The client never asks for or receives the "gory details" unless they specifically ask for it.

Personally, if I gave out that much detail I'd be changing every password as soon as the installation was completed smile  But that's just me.

Offline

 

#27 08-16-2009 07:52:46

thezazzi
Member
Registered: 12-02-2008
Posts: 120

Re: Featured or Random Item Menu Block Script

Thanks for all the help and time on this Dave, its appreciated.

With the new user I've created and given all privileges to, can i then safely delete the original user then run the installer to step 11 and add the new username and password, continue to step 12 then stop.

Or should i add the new username and password at step 11 first then delete the original user from the db just to be safe.


Rob.

Offline

 

#28 08-16-2009 08:04:50

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Featured or Random Item Menu Block Script

I'd make the change via the installer and make sure everything works correctly, including ordering and making updates through admin, before I removed the previous user.

Offline

 

#29 08-16-2009 08:46:20

thezazzi
Member
Registered: 12-02-2008
Posts: 120

Re: Featured or Random Item Menu Block Script

Every thing seems to be working fine. Orders are being processed and email sent.

I will wait a while before i delete the original user just as a precaution.

Thank you again for the help on this Dave. i'l have a better understanding how the installer process works now when i upgrade to V7.


Rob.

Offline

 

#30 08-16-2009 12:17:15

thezazzi
Member
Registered: 12-02-2008
Posts: 120

Re: Featured or Random Item Menu Block Script

Is there a way to change the image size to about 50px  in the code rather than having to uploading smaller images?


Rob.

Offline

 

#31 08-16-2009 14:26:08

cyberws
Member
From: Atlanta, GA
Registered: 02-05-2004
Posts: 756

Re: Featured or Random Item Menu Block Script

I thought I would post in this thread if you are looking for a different way of enabling this function that offers more options and cleaner CCP integration you might want to view the following thread: https://forum.kryptronic.com/viewtopic.php?id=25157


Jeremy O

Production CCP .:. Version 6 w/QuickBuy and many in house hacks
Skills: PHP & Perl programming, Solaris & Linux server administration, Oracle OCP training and MySQL experience

Offline

 

#32 08-17-2009 10:47:24

thezazzi
Member
Registered: 12-02-2008
Posts: 120

Re: Featured or Random Item Menu Block Script

I have been searching through admin: xhtml includes to try and find away to change the width of the image in the php itself but I'm struggling to find an answer.

Ive looked at this thread  which i think may have the answer but don't know how to incorporate this in to the php of the 'Random Product' hack.

Has anyone managed to accomplish this at all?


Rob.

Offline

 

#33 08-18-2009 12:25:48

thezazzi
Member
Registered: 12-02-2008
Posts: 120

Re: Featured or Random Item Menu Block Script

could i use this img tag directly in the php of something like this to manipulate the image size? 

<img class="randimg" width="45" height="50" 

I have tried this but cant get it to work.


Rob.

Offline

 

#34 10-28-2009 07:59:52

sleeper
Member
Registered: 10-29-2004
Posts: 332

Re: Featured or Random Item Menu Block Script

Is it possible with Mysql to run a multi query?

For example what im tyring to do is edit the query for this mod to say something like:

WHERE `splashdisp` LIKE '1'  `pricedisp` LIKE `sale` order by rand() LIMIT 5" ) or die...

Basically it has to match both queires.


- Steve


Specialists in ClickCartPro Design

Offline

 

#35 10-28-2009 08:02:13

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Featured or Random Item Menu Block Script

Sure.  Exactly like you have it but pricedisp won't contain the word sale.  It's a single upper case character.

Offline

 

#36 10-28-2009 08:16:20

sleeper
Member
Registered: 10-29-2004
Posts: 332

Re: Featured or Random Item Menu Block Script

Haha..thanks Dave, i found that what i wrote was exactly what i needed just after i posted, you beat me to a reply before i can post back that it was resolved - thanks as always though smile


- Steve


Specialists in ClickCartPro Design

Offline

 

#37 10-28-2009 08:27:45

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Featured or Random Item Menu Block Script

Queries may be as complex as required and use a combination if ANDs and/or ORs. If you look at some of the queries built by CCP when looking for products in a category for example you'll see a combination of both of those and then some.

Offline

 

#38 10-28-2009 08:45:05

west4
Member
From: UK
Registered: 04-16-2008
Posts: 645
Website

Re: Featured or Random Item Menu Block Script

Hi All,

This would be a nice mod for ccp7 to fit into a Joomla Module....anyone?

Cheers,
Bruce.


I'd rather have a full bottle in front of me, than a full frontal labotomy.

Offline

 

#39 01-30-2010 17:13:57

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Featured or Random Item Menu Block Script

Using a div within a table column should not cause any validation errors.

Offline

 

#40 02-16-2010 10:56:22

sleeper
Member
Registered: 10-29-2004
Posts: 332

Re: Featured or Random Item Menu Block Script

Running into a slight problem with this that i can't seem to figure out...

Looking up items in a particular category works perfectly, but only if the product is in just one category, when an item is related to more than one category it does not work, is there a way of getting this to work with items that are related to more than one category?

This is current code;

Code:

FROM ecom_prod WHERE `xcat` LIKE 'MONITOR'

This will only disply items in the MONITOR category as long as that is the only category related to the item.


- Steve


Specialists in ClickCartPro Design

Offline

 

#41 02-17-2010 06:36:31

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Featured or Random Item Menu Block Script

Add % around the word monitor (%monitor%) to broaden the search. That's the quick and dirty solution and you may get more than you want using it.

Offline

 

#42 02-17-2010 10:07:19

sleeper
Member
Registered: 10-29-2004
Posts: 332

Re: Featured or Random Item Menu Block Script

Thanks Dave, this seems to work ok smile


- Steve


Specialists in ClickCartPro Design

Offline

 

#43 07-25-2010 04:44:07

Design_Wholesale
Member
From: England!
Registered: 11-21-2008
Posts: 1104
Website

Re: Featured or Random Item Menu Block Script

Another example of this code in use for a horizontal display (thanks also to Perkster):

Code:

<?php
$host   = 'localhost';
$dbUser = 'dbuser';
$dbPass = 'dbpassword';
$db = 'dbname';

print "<table border=\"0\" cellpadding=\"10px\" cellspacing=\"0px\"><tr>";

mysql_connect("$s", "$u", "$p") or die(mysql_error());
mysql_select_db("$d") or die(mysql_error());

$result = mysql_query("SELECT id,catimg,name FROM gbu0_cat order by rand() LIMIT 5" ) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
print "<td style=\"vertical-align: top;\"><br /><a href=\"/gbu0-catshow/" . $row['id'] . ".html\"><img alt=\"\" src=\"media/gbu0/cat/" . $row['catimg'] . "\" /><br />" . $row['name'] . "</a></td>";
}

print "</tr></table>";
?>

or (for vertical use):

Code:

<?php
$host   = 'localhost';
$dbUser = 'dbuser';
$dbPass = 'dbpassword';
$db = 'dbname';

print '<table border="0" cellpadding="10px" cellspacing="0" style="width: 100px; position: relative; top: -15px;"><tr>';

mysql_connect("$s", "$u", "$p") or die(mysql_error());
mysql_select_db("$d") or die(mysql_error());

$result = mysql_query("SELECT id,imgsm,name FROM gbu0_prod order by rand() LIMIT 3" ) or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
print '<td style="vertical-align: center; text-align: center;"><a href="/gbu0-prodshow/' . $row['id'] . '.html"><img alt="" src="/media/gbu0/prodsm/' . $row['imgsm'] . '" /><br />' . $row['name'] . '</a></td></tr>';
}

print '</tr></table>';

?>

Offline

 

Board footer