-
Invoicing software
I use Kashflow and find it really easy to use and it emails payment reminders to clients and I definitely get paid faster now after using it.
-
Navigation sub-menus not working as they should on Responsive Mobile version
I have a navigation bar with has the following code in it for the main menu. As you can see the Services section contains some sub-links but the services link itself also goes to a page of its own. On a desktop this is fine as you hover over the word Services and it brings down the drop-down but if you then click the word Services it correctly goes to the Services page. Unfortunately on a mobile if you click Services it just goes straight to the services page as the drop-down isn't activated. If you go back quickly you can see it there opened on screen. How can I get it so that the drop-down is activated on a mobile by clicking Services and then if you click Services again, rather than closing the drop-down you can go to the services page? Alternatively do you think when going to the mobile menu on a mobile device the drop-down could already be visible if you press the 'hamburger' menu icon? Any help most welcome. I have looked for a few hours now at various solutions but many seem a few years out of date now. Using latest version of Bootstrap. <nav class="col-md-9 col-sm-9 col-xs-9"> <a class="cmn-toggle-switch cmn-toggle-switch__htx open_close" href="javascript:void(0);"><span>Menu mobile</span></a> <div class="main-menu"> <div id="header_menu"> <img src="images/logo.png" width="150" alt=“Logo” data-retina="true"> </div> <a href="#" class="open_close" id="close_in"><i class="icon_close"></i></a> <ul> <li><a href="index.html">Home</a></li> <li class="submenu"> <a href="services/" class="show-submenu">Services <i class="icon-down-open-mini"></i></a> <ul> <li><a href="services/link2/“>Link 2</a></li> <li><a href="services/link3/“>Link 3</a></li> <li><a href="services/link4/“>Link 4</a></li> <li><a href="services/link5/“>Link 5</a></li> </ul> </li> <li><a href="about-us/">About Us</a></li> <li><a href="contact/">Contact Us</a></li> </ul> </div> </nav>
-
Moving a Joomla site from Windows server to Linux - 404 errors
Hi all, first foray into the Joomla world and I am taking over a site for a client that was previously on a Windows server (files were in a httpdocs folder). I have imported the database and uploaded all of the files. Amended the configuration.php file with the server settings and can see the home page fine. When I click any of the links they fail and go to a server 404 page. Worked out that it is something to do with the re-write rules as the links are going to .html pages after the re-write, i.e.: www.website.com/about-us.html www.website.com/our-services.html If I tweak the configuration file from: Code: public $sef = '1'; public $sef_rewrite = '1'; to Code: public $sef = '1'; public $sef_rewrite = '0'; I can get all of the pages and links to work fine but they have index.php in the links, i.e: www.website.com/index.php/about-us.html www.website.com/index.php/our-services.html How can I get it so the links work correctly as required? It is still on the test server so I can mirror the live site before switching the DNS. Presume I need to amend something in the .htaccess file but have tried everything and lots of conflicting advice. Any help most welcome.
-
ASP: Using checkboxes to refine search results - query string?
Thanks again. I have added that in and tweaked it and the form seems to be actioning but I get an error when it refreshes back. The page I have the form on is the same page I want the results to come back on, I am not linking to a different page. Error is Microsoft OLE DB Provider for SQL Server error '80040e14' Incorrect syntax near the keyword 'AND'. /office15.asp, line 79 Where line 79 is PropSQL.Open SQL, Conn,1,3 In the main prop table which has everything in the main ID field is called propid. Not sure if it clashes with the PropID you referenced? Also not 100% what to put where you referenced somefield=something. I am definitely selecting a checkbox before I click submit. Wondering if my original rs recordset is clashing with the new one? Here is everything I have at the top of the page now: <%@LANGUAGE="VBSCRIPT"%> <!--#include file="Connections/CONNECIONNAME.asp" --> <% Dim rs__varsection rs__varsection = "1" if (request("section") <> "") then rs__varsection = request("section") %> <% Dim rs__varstatus rs__varstatus = "%" if (request("status") <> "") then rs__varstatus = request("status") %> <% Dim rs__varproploc rs__varproploc = "%" if (request("proploc") <> "") then rs__varproploc = request("proploc") %> <% set rs = Server.CreateObject("ADODB.Recordset") rs.ActiveConnection = Conn rs.Source = _ "SELECT * FROM prop, section, status, proploc" _ & " WHERE status = statusid AND section = sectionid AND proploc = proplocid" _ & " AND section in (1,5,6,7) " _ & " AND status like '" & Replace(rs__varstatus, "'", "''") & "' " _ & " AND proploc like '" & Replace(rs__varproploc, "'", "''") & "' " _ & " ORDER BY price DESC" rs.CursorType = 0 rs.CursorLocation = 2 rs.LockType = 3 rs.Open() rs_numRows = 0 %> <% Set chkBox = Server.CreateObject("ADODB.Recordset") chkBox.Open "SELECT * FROM proploc", Conn,1,3 %> <% Dim rs2__MMColParam rs2__MMColParam = "1" if (Request.QueryString("statusid") <> "") then rs2__MMColParam = Request.QueryString("statusid") %> <% set rs2 = Server.CreateObject("ADODB.Recordset") rs2.ActiveConnection = Conn rs2.Source = "SELECT * FROM status WHERE statusid = " + Replace(rs2__MMColParam, "'", "''") + "" rs2.CursorType = 0 rs2.CursorLocation = 2 rs2.LockType = 3 rs2.Open() rs2_numRows = 0 %> <% Dim rs4__MMColParam rs4__MMColParam = "1" if (Request.QueryString("proplocid") <> "") then rs4__MMColParam = Request.QueryString("proplocid") %> <% set rs4 = Server.CreateObject("ADODB.Recordset") rs4.ActiveConnection = Conn rs4.Source = "SELECT * FROM proploc WHERE proplocid = " + Replace(rs4__MMColParam, "'", "''") + "" rs4.CursorType = 0 rs4.CursorLocation = 2 rs4.LockType = 3 rs4.Open() rs4_numRows = 0 %> <% 'get our checkbox object PropID = Request.Form("proplocid") Set PropSQL = Server.CreateObject("ADODB.Recordset") SQL = "SELECT * FROM prop" IF PropID <> "" Then 'if one or more is selected SQL=SQL& " AND proploc IN ("&PropID&") " END IF SQL=SQL& " ORDER BY propid DESC " PropSQL.Open SQL, Conn,1,3 %> <% Dim Repeat1__numRows Repeat1__numRows = 10 Dim Repeat1__index Repeat1__index = 0 rs_numRows = rs_numRows + Repeat1__numRows %>
-
ASP: Using checkboxes to refine search results - query string?
Lyndsey - that's great, i'm almost there now. I have the checkboxes (proplocid) and their names (proplocname) coming into the page now along with the submit button on the form but submitting the form doesn't change anything. I have added your "SELECT * FROM prop WHERE proploc IN ("&request("proplocid")&")" to the header but giving me an error Microsoft VBScript compilation error '800a0400' Expected statement /office15.asp, line 48 "SELECT * FROM prop WHERE proploc IN ("&request("proplocid")&")" ^ Presume I need to put this into it's own recordset? Tried it as <% set rs5 = Server.CreateObject("ADODB.Recordset") rs5.ActiveConnection = Conn rs5.Source = "SELECT * FROM prop WHERE proploc IN ("&request("proplocid")&")" rs5.CursorType = 0 rs5.CursorLocation = 2 rs5.LockType = 3 rs5.Open() rs5_numRows = 0 %> but then got further error Microsoft OLE DB Provider for SQL Server error '80040e21' The requested properties cannot be supported. /office15.asp, line 91 On the form the action I am using is the same page name, presume this is correct? <form action="office.asp" method="post"> Not far away though
-
ASP: Using checkboxes to refine search results - query string?
Lyndsey - thanks for taking the time out to help. I have a table called proploc which has two fields proplocid and proplocname then then have the following rows proplocid 1 2 3 propname Manchester Liverpool London Then in the main prop table which has all the information about the properties there is a field called proploc which references this table. In MS SQL this is an int field. Each property record has a a number listed for it's proploc. With the code above should this be within the < form > tags? Also I presume this will create the checkboxes and pull in a list of what it finds in the proploc table (proplocid for the checkboxes and proplocname for the name of the locations to sit next to them) but how will i get the page to update with just the checked locations? Thanks again
-
ASP: Using checkboxes to refine search results - query string?
Hi there, I have a search facility on a clients property website. It is using MS SQL and classic ASP for the coding. I have it set up so that clicking on 'Office' pulls in all of the office properties they have listed. They now want to be able to narrow this down to locations. I added a new field called 'proploc' and amended all of the current properties to give them a 'proplocid' (1 = Manchester, 2 = Liverpool, 3 = London etc., there are 8 in total) I added links on the Offices page so that they can go to each location, eg: offices.asp?proplocid=1 brings in all properties in Manchester only offices.asp?proplocid=2 brings in all properties in Liverpool only offices.asp?proplocid=3 brings in all properties in London only What they want though is to have checkboxes and a 'Go' button so that the user could select more than one location and then click Go to bring in both Liverpool and London properties (proplocid's 1 and 3) How do I go about this in terms of it generating the correct link? I know I am using old code in classis ASP but it does work for me generally. Here is the source code I am using before the opening html tag: <%@LANGUAGE="VBSCRIPT"%> <!--#include file="Connections/CONNECTIONNAME.asp" --> <% Dim rs__varsection rs__varsection = "1" if (request("section") <> "") then rs__varsection = request("section") %> <% Dim rs__varstatus rs__varstatus = "%" if (request("status") <> "") then rs__varstatus = request("status") %> <% Dim rs__varproploc rs__varproploc = "%" if (request("proploc") <> "") then rs__varproploc = request("proploc") %> <% Dim rs__varpl rs__varpl = "0" if (Request.QueryString("minprice") <> "") then rs__varpl = Request.QueryString("minprice") %> <% Dim rs__varpu rs__varpu = "99999999999999" if (Request.QueryString("maxprice") <> "") then rs__varpu = Request.QueryString("maxprice") %> <% set rs = Server.CreateObject("ADODB.Recordset") rs.ActiveConnection = Conn rs.Source = _ "SELECT * FROM prop, section, status, proploc" _ & " WHERE status = statusid AND section = sectionid AND proploc = proplocid" _ & " AND section in (1,5,6,7) " _ & " AND status like '" & Replace(rs__varstatus, "'", "''") & "' " _ & " AND proploc like '" & Replace(rs__varproploc, "'", "''") & "' " _ & " AND price between " & CDBL(rs__varpl) & " AND " & CDBL(rs__varpu) _ & " ORDER BY price DESC" rs.CursorType = 0 rs.CursorLocation = 2 rs.LockType = 3 rs.Open() rs_numRows = 0 %> <% Dim rs2__MMColParam rs2__MMColParam = "1" if (Request.QueryString("statusid") <> "") then rs2__MMColParam = Request.QueryString("statusid") %> <% set rs2 = Server.CreateObject("ADODB.Recordset") rs2.ActiveConnection = Conn rs2.Source = "SELECT * FROM status WHERE statusid = " + Replace(rs2__MMColParam, "'", "''") + "" rs2.CursorType = 0 rs2.CursorLocation = 2 rs2.LockType = 3 rs2.Open() rs2_numRows = 0 %> <% Dim rs4__MMColParam rs4__MMColParam = "1" if (Request.QueryString("proplocid") <> "") then rs4__MMColParam = Request.QueryString("proplocid") %> <% set rs4 = Server.CreateObject("ADODB.Recordset") rs4.ActiveConnection = Conn rs4.Source = "SELECT * FROM proploc WHERE proplocid = " + Replace(rs4__MMColParam, "'", "''") + "" rs4.CursorType = 0 rs4.CursorLocation = 2 rs4.LockType = 3 rs4.Open() rs4_numRows = 0 %> <% Dim Repeat1__numRows Repeat1__numRows = 10 Dim Repeat1__index Repeat1__index = 0 rs_numRows = rs_numRows + Repeat1__numRows %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables ' set the record count rs_total = rs.RecordCount ' set the number of rows displayed on this page If (rs_numRows < 0) Then rs_numRows = rs_total Elseif (rs_numRows = 0) Then rs_numRows = 1 End If ' set the first and last displayed record rs_first = 1 rs_last = rs_first + rs_numRows - 1 ' if we have the correct record count, check the other stats If (rs_total <> -1) Then If (rs_first > rs_total) Then rs_first = rs_total If (rs_last > rs_total) Then rs_last = rs_total If (rs_numRows > rs_total) Then rs_numRows = rs_total End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (rs_total = -1) Then ' count the total records by iterating through the recordset rs_total=0 While (Not rs.EOF) rs_total = rs_total + 1 rs.MoveNext Wend ' reset the cursor to the beginning If (rs.CursorType > 0) Then rs.MoveFirst Else rs.Requery End If ' set the number of rows displayed on this page If (rs_numRows < 0 Or rs_numRows > rs_total) Then rs_numRows = rs_total End If ' set the first and last displayed record rs_first = 1 rs_last = rs_first + rs_numRows - 1 If (rs_first > rs_total) Then rs_first = rs_total If (rs_last > rs_total) Then rs_last = rs_total End If %> <% ' *** Move To Record and Go To Record: declare variables Set MM_rs = rs MM_rsCount = rs_total MM_size = rs_numRows MM_uniqueCol = "" MM_paramName = "" MM_offset = 0 MM_atTotal = false MM_paramIsDefined = false If (MM_paramName <> "") Then MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "") End If %> <% ' *** Move To Record: handle 'index' or 'offset' parameter if (Not MM_paramIsDefined And MM_rsCount <> 0) then ' use index parameter if defined, otherwise use offset parameter r = Request.QueryString("index") If r = "" Then r = Request.QueryString("offset") If r <> "" Then MM_offset = Int(r) ' if we have a record count, check if we are past the end of the recordset If (MM_rsCount <> -1) Then If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' move the cursor to the selected record i = 0 While ((Not MM_rs.EOF) And (i < MM_offset Or MM_offset = -1)) MM_rs.MoveNext i = i + 1 Wend If (MM_rs.EOF) Then MM_offset = i ' set MM_offset to the last possible record End If %> <% ' *** Move To Record: if we dont know the record count, check the display range If (MM_rsCount = -1) Then ' walk to the end of the display range for this page i = MM_offset While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size)) MM_rs.MoveNext i = i + 1 Wend ' if we walked off the end of the recordset, set MM_rsCount and MM_size If (MM_rs.EOF) Then MM_rsCount = i If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount End If ' if we walked off the end, set the offset based on page size If (MM_rs.EOF And Not MM_paramIsDefined) Then If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then If ((MM_rsCount Mod MM_size) > 0) Then MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' reset the cursor to the beginning If (MM_rs.CursorType > 0) Then MM_rs.MoveFirst Else MM_rs.Requery End If ' move the cursor to the selected record i = 0 While (Not MM_rs.EOF And i < MM_offset) MM_rs.MoveNext i = i + 1 Wend End If %> <% ' *** Move To Record: update recordset stats ' set the first and last displayed record rs_first = MM_offset + 1 rs_last = MM_offset + MM_size If (MM_rsCount <> -1) Then If (rs_first > MM_rsCount) Then rs_first = MM_rsCount If (rs_last > MM_rsCount) Then rs_last = MM_rsCount End If ' set the boolean used by hide region to check if we are on the last record MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount) %> <% ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters ' create the list of parameters which should not be maintained MM_removeList = "&index=" If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "=" MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone="" ' add the URL parameters to the MM_keepURL string For Each Item In Request.QueryString NextItem = "&" & Item & "=" If (InStr(1,MM_removeList,NextItem,1) = 0) Then MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item)) End If Next ' add the Form variables to the MM_keepForm string For Each Item In Request.Form NextItem = "&" & Item & "=" If (InStr(1,MM_removeList,NextItem,1) = 0) Then MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item)) End If Next ' create the Form + URL string and remove the intial '&' from each of the strings MM_keepBoth = MM_keepURL & MM_keepForm if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1) if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1) if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1) ' a utility function used for adding additional parameters to these strings Function MM_joinChar(firstItem) If (firstItem <> "") Then MM_joinChar = "&" Else MM_joinChar = "" End If End Function %> <% ' *** Move To Record: set the strings for the first, last, next, and previous links MM_keepMove = MM_keepBoth MM_moveParam = "index" ' if the page has a repeated region, remove 'offset' from the maintained parameters If (MM_size > 0) Then MM_moveParam = "offset" If (MM_keepMove <> "") Then params = Split(MM_keepMove, "&") MM_keepMove = "" For i = 0 To UBound(params) nextItem = Left(params(i), InStr(params(i),"=") - 1) If (StrComp(nextItem,MM_moveParam,1) <> 0) Then MM_keepMove = MM_keepMove & "&" & params(i) End If Next If (MM_keepMove <> "") Then MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1) End If End If End If ' set the strings for the move to links If (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&" urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "=" MM_moveFirst = urlStr & "0" MM_moveLast = urlStr & "-1" MM_moveNext = urlStr & Cstr(MM_offset + MM_size) prev = MM_offset - MM_size If (prev < 0) Then prev = 0 MM_movePrev = urlStr & Cstr(prev) %> Any help would be welcome on creating the checkbox section to generate the results I am after.
-
ASP - Search Form, pulling in more than one ID?
Hi there, I have a search form for an estate agent whereby the user selects price then the type of property they are interested in. There are 5 options for them to select in the drop down, each with their own ID eg 1=Option1 2=Option2 3=Option3 4=Option4 5=Option5 All works fine if the user puts the correct price range and then option 3 for example. All properties in option 3 at that price range come in. URL looks something like this: http://example.com/search-results.asp?minprice=200000&maxprice=600000§ion2=5&Submit.x=96&Submit.y=16&Submit=Search&MM_insert=true What do I need to put in the form code if the user want to see All properties within that price range? Current form is this <form action="search-results.asp" method="get" name="form1" id="form1" onsubmit="MM_validateForm('maxprice','','NisNum','minprice','','NisNum','section2');return document.MM_returnValue"> <select name="minprice" id="minprice"> <option value="0" selected="selected">£0</option> <option value="100000">£100,000</option> <option value="125000">£125,000</option> <option value="150000">£150,000</option> <option value="175000">£175,000</option> <option value="200000">£200,000</option> <option value="225000">£225,000</option> <option value="250000">£250,000</option> <option value="275000">£275,000</option> <option value="300000">£300,000</option> <option value="325000">£325,000</option> <option value="350000">£350,000</option> <option value="375000">£375,000</option> <option value="400000">£400,000</option> <option value="425000">£425,000</option> <option value="450000">£450,000</option> <option value="475000">£475,000</option> <option value="500000">£500,000</option> <option value="550000">£550,000</option> <option value="600000">£600,000</option> <option value="650000">£650,000</option> <option value="700000">£700,000</option> <option value="800000">£800,000</option> <option value="900000">£900,000</option> <option value="1000000">£1,000,000</option> <option value="1250000">£1,250,000</option> <option value="1500000">£1,500,000</option> <option value="2000000">£2,000,000</option> <option value="2000000">£3,000,000</option> </select> Max Price <select name="maxprice" id="maxprice"> <option value="100000">£100,000</option> <option value="125000">£125,000</option> <option value="150000">£150,000</option> <option value="175000">£175,000</option> <option value="200000">£200,000</option> <option value="225000">£225,000</option> <option value="250000">£250,000</option> <option value="275000">£275,000</option> <option value="300000">£300,000</option> <option value="325000">£325,000</option> <option value="350000">£350,000</option> <option value="375000">£375,000</option> <option value="400000">£400,000</option> <option value="425000">£425,000</option> <option value="450000">£450,000</option> <option value="475000">£475,000</option> <option value="500000">£500,000</option> <option value="550000">£550,000</option> <option value="600000">£600,000</option> <option value="650000">£650,000</option> <option value="700000">£700,000</option> <option value="800000">£800,000</option> <option value="900000">£900,000</option> <option value="1000000" selected="selected">£1,000,000</option> <option value="1250000">£1,250,000</option> <option value="1500000">£1,500,000</option> </select> Property Type <select name="section2" id="section2"> <option value="1" selected="selected">Option1</option> <option value="2">Option2</option> <option value="3">Option3</option> <option value="4">Option4</option> <option value="5">Option5</option> </select> <input name="Submit" type="image" class="imageborder2" value="Search" src="images/search.png" alt="Search" title="Search" /> <input type="hidden" name="MM_insert" value="true" /> </form>
-
Estate Agent site pulling in feed from Vebra?
Hi there, have previously used the iframe feed from Vebra but looking at a different method so I can pull data in to agent's own custom built website. Basically Vebra provide a Zip file containing 4 CSV files and is updated daily from the agents office based software. I presume I then need to take that Zip file and import the data contained in the CSV files into a database and then pull in the information from the database into the website pages. Has anyone else had experience with this and Vebra at all? Never written a Cron Job before so unsure. Site will be on a Windows server. Any help most welcome and if I am struggling may be a job I farm out to be done for me. Just wondering if I have the gist of it correct?
-
Google Map API on Estate Agent website
Thanks for the replies, yes I would use it a fair few times. So in your database you have a column for co-ordinates and you created a table with all of these co-ordinates in to start with? Client then selects a location from that table (via a dropdown?) for each property? Would ideally need to be street level so must be thousands of co-ordinates to ad in to start with though. One agent I do has 7 offices in the county. It's the joining that up with the API that I think I am getting lost on.
-
Google Map API on Estate Agent website
Hi there, have an estate agent site, results are stored in a MS SQL database and they input the postcode for each property with no spaces. Users can search for their properties via price range (min and max) and it pulls the results in a repeating list. Would like to offer the option here of showing results on a Google Map and have been reading up on the google map API but having never used it before it is losing me a little. Is this achievable just from the postcode alone and can it have pop ups showing other data pulled in from the DB (photo, price, address etc.) Like this here, presume they are using the Google API? mappr.co.uk Anyone done something similar? Thanks for any advice.
-
Best CMS for product listings with no e-commerce needed
Thanks for the advice everyone, am trying with Wordpress and Dukapress. Have got a fair way there, categories all sorted and few test products added. What I need to do now is show the product description to the right of the main image but can't see where to do this in the CSS. At the moment the large image that uses the lightbox effect is on the left of the page with the main description below it. Just want to move this description to the right of the image. Any ideas?
-
Best CMS for product listings with no e-commerce needed
Thanks for that, i've used Wordpress more than any other CMS and the admin area is fairly user friendly. I presume that you use the Catalogue mode in DukaPress? They may want a buy now button adding which they can point to a supplier of choice per product though.
-
Best CMS for product listings with no e-commerce needed
Client wants to list their products online and be able to add / edit and delete them as and when they wish. They want to use an open source CMS but which one would be best? Ease of use in the back end has been requested. Wordpress seems fairly easy to use but am wondering if there is a plugin for adding in products etc. It doesn't require a purchasing facility so an e-commerce plugin isn't needed. They want people to come in store so it's just a case of listing their catalogue online. There are 200+ products to be listed initially. Would there be a fast way of importing this data (from CSV or XLS) Site would be 5 static pages then the product pages. They would want an option where if it is a Gent Gold Bracelet for example it could be found in the Gents section and the Bracelets section. Anyone created something similar at all? Sorry for so many questions, any help most welcome.
-
Alternative to Imagick? Image uploads
Hi there, I have recently taken over a website for a client and their site uses Image Magick and the Imagick module to re-size and upload images. I can add a new product to the database, the record goes in fine, as does the image file name into the MySQL database but the actual physical image does not get uploaded. After looking at the logs it appears that although Image Magick is installed, the Imagick module is not. I have asked my hosts to add it but they say as it is on a shared hosting package they will not add it for security reasons. Now I am new to PHP so am struggling to find al alternative on how to get these images up. Here is the code I am currently using: I have this at the top <?php $uploadedfile = $_FILES['userfile']['tmp_name']; //$uploadedfile_dimensions = getimagesize($uploadedfile); then the rest of the page and then } if(is_uploaded_file($_FILES['image']['tmp_name'])) { $image = new Imagick($_FILES['image']['tmp_name']); $maxWidth = 250; $maxHeight = 250; if(($maxWidth/$image->getImageWidth()) < ($maxHeight/$image->getImageHeight())) $maxHeight = 0; else $maxWidth = 0; $image->thumbnailImage($maxWidth, $maxHeight); $image->writeImage($_SERVER['DOCUMENT_ROOT'].'/product_images/'.$product_id.'-'.$product_version.'_large.jpg'); $maxWidth = 180; $maxHeight = 180; if(($maxWidth/$image->getImageWidth()) < ($maxHeight/$image->getImageHeight())) $maxHeight = 0; else $maxWidth = 0; $image->thumbnailImage($maxWidth, $maxHeight); $image->writeImage($_SERVER['DOCUMENT_ROOT'].'/product_images/'.$product_id.'-'.$product_version.'_small.jpg'); } else if(isset($_REQUEST['product_id']) && (int)$_REQUEST['product_id'] > 0) { $old_product_version = $product_version - 1; copy($_SERVER['DOCUMENT_ROOT'].'/product_images/'.$product_id.'-'.$old_product_version.'_large.jpg', $_SERVER['DOCUMENT_ROOT'].'/product_images/'.$product_id.'-'.$product_version.'_large.jpg'); copy($_SERVER['DOCUMENT_ROOT'].'/product_images/'.$product_id.'-'.$old_product_version.'_small.jpg', $_SERVER['DOCUMENT_ROOT'].'/product_images/'.$product_id.'-'.$product_version.'_small.jpg'); } echo 'SUCCESS'; ?> Have read that GD may be an alternative but wouldn't know where to start to be honest. Used to ASP and Windows servers. Any help would be most welcome.