One of the main feature is the ability of the site is to allow users to create an account and then add an entry in the DB of the product (mobile phones) they want to sell. It’s kind of like ebay, but there wont be any bidding. Sellers can enter general comments about their mobile (that will be the content of WP post), and upload 4 pictures. The rest of the information about all the possible phone models will be captured by the form using drop-down lists, check-boxes etc. I do this because if I allow user to enter all details there will be spelling mistakes… and search results will be affected.
Once sellers upload their product, the buyers will search for them giving what kind of phone they want, and then they will contact the seller via email or phone.
So basically we can say our site will have user generated-content.
To take care of that, I bought the Gravity forms (personal license) and used it to create a form for sellers. This form when submitted creates a WordPress post. “Additional Comments” data goes to the post content, and rest of the information about the phone is saved from the pre-made drop-downs check-boxes etc as tags for the post. Everything from color of phone, price, manufacturer (e.g Samsung), OS (Android, Symbian etc), model (Galaxy etc), version, screen size, form factor, processor, battery time etc are all stored as tags.
Now to make a search form for buyers to search for phones, I can use this approach these guys are talking about: https://www.gravityhelp.com/forums/topic/can-i-use-gravity-forms-as-a-search-plugin
Search form for buyers is made with pre-selected choices using drop-downs. Like there is drop-down to choose the manufacturer, then choose the OS, so on, and choose the price-from to price-upto etc.
But then what about the fields “Price Upto”, “Year From” etc on the search form? How will I make a search for that criteria? I mean I saved the “Price” as a post tag. How will retrieve all posts by apply a comparison on all the saved Prices and then list the posts from the range of Prices user specified?
That’s not all. I looked into the WP database. Gravity form plugin is saving the whole fields and the captured data in wp_options table in “serialized” form: https://wpgarage.com/tips/data-portability-and-data-serialization-in-wordpress/ and I can’t run SQL queries on it. I can use unserialize() or maybe_unserialize() function and then use PHP code to extract data from the array (that’s what I have read, I have not actually done it). And I read this is slower than DB queries. What will happen if suppose lots of user start making searches?
Another thing bothering me is that there are say, may be 40 manufacturers, when one manufacturer (say Samsung) is selected, then there are may be 50 phone models for Samsung, and when Galaxy is selected, then there are may be 10 variations for Galaxy. In gravity forms I have to create a drop-down list for each of these, and choose the (conditional) hide option that says that “hide this Samsung models drop-down list”, and show it only if user selects Samsung in preceding drop-down list. If user selects Nokia, then show Nokia models drop-down list. And then, something like show variations (drop-down) of “Galaxy” only if Galaxy was selected by user in upper drop-down list. Now if you do the math, there will be lots of drop-down lists, and all will be *loaded* when “Sell your phone” page form loads because Gravity form is made that way. It has conditional logic option to hide fields but their HTML code is loaded anyway and just not visible because of a CSS display:none option. And so my “sell your pphone” page will be very slow to load when phones by all manufacturers are added.
My question: Am I making this site with the wrong approach in WordPress, and can it be made easily in WordPress using a different approach?
Or will it be better if I try to make it in something like Django or Rails? Problem with that is that I don’t know Python or Ruby and I’ll have to learn one of them (depending on which framework I choose). If I have to choose on of them I will choose the one that is easier to learn/understand in a ~5 month time. I know 5 months is not nearly enough time. But if WordPress will make me cry lots of tears in the next three months making this site, and I will end up with a no-good-just-a-hack web app, then it’s better that I work day and night on Python/Django or Ruby/Rails and make something that’s nicely done….
Am I making any sense?
Please advise. I need it badly. Share your thoughts.
— arslan
]]>// Heroku Postgres settings
if (isset($_ENV["DATABASE_URL"])) {
$db = parse_url($_ENV["DATABASE_URL"]);
define("DB_NAME", trim($db["path"],"/"));
define("DB_USER", $db["user"]);
define("DB_PASSWORD", $db["pass"]);
define("DB_HOST", $db["host"]);
} else {
die("Cannot determine database settings from DATABASE_URL\n");
}
Then I create .htaccess (app/.htaccess) and config(i have no edit):
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
Then I upload it to blog folder on heroku. And try install but it always return eror 404 (I see logs heroku) my link to install:
https://mywebsite.heroku.com/blog/wp-admin/install.php
ActionController::RoutingError (No route matches “/blog/wp-admin/install.php
Please help me install this.
Thanks so much
We’ve tried a lot of different options, like this:
https://webonrails.com/2008/08/08/hosting-rails-app-and-wordpress-on-same-domainas-folder-instead-of-subdomain/
changed user access to .htaccess to 777 775 666, you name it, and yes, mod_rewrite is running on apache.
No matter what we try, we always get the “Page not found” error when we enable permalinks. Default works find. Pretty sure it has something to do with Passenger.
Anyone have any ideas???
Thanks
]]>I have a rails web application that has various stuff like news etc etc. I also have a wordpress account, what i would like is to be able to create my post in my rails app but automatically send it to my wordpress blog so it is shown on my blog too.
Ive read around and think you may be able to do it only if both are on the same local domain.
Can anyone tell me is this possible and how much work is it?
]]>What I want to do is on my work site have a link which pops up a Lightbox based form which posts to my original blog post and says ‘thank you’ or whatever and doesn’t goto that post page.
Currently, I have a form which posts to the blog post but it goes to that post page as well after pressing submit. How can I just show ‘Thank you’ after pressing submit?
Thank you.
Any idea how I could go about it? Thank you.
]]>