Hello all experts,

I am new to the Drupal party. I had evaluated Joomla, Mojoportal and couple others and found that this is the one. Long story short, I am trying to port my existing website (www.retiresoon.me) to Drupal but I don't have much idea what the best approach should be. My site does blog and charts for most stocks (user enter a ticker or stock symbol) and my site will present a pre-generated chart using Google Chart API (throught URL). User enter a ticker in the search box and on the center pane presents the chart.

I am thinking I can modify the Search module to accomplish the similar result. Also, I would like to have a virtual page url for each stocks (around 7000+) for SEO reason. The search page may have a query string like "?ticker=AAPL" at the end of the search url but would also be available as "/AAPL.html". Is this the right approach? Is it better to index each stock as a single page?

There will be a weekly chart option which only registered user can check the box and view it, so I think I need to add some tweak on the search module as well.

If someone can point me to the right direction or even offer help, I will be very appreciated. I think Drupal is almost the best abstract website framework
on the earth and there could be many approaches to achieve a similar result. But I have a feeling that if I don't get the design right, it not only limit the potential but harder to maintain and extend in the future.

Thanks in advance,
Ray

Vision, Insight and Creative are the ways to go.

Edited by WorldFallz - moved to appropriate forum.

Comments

ludo1960’s picture

..the info for the 7000 stocks come from? If you can get the info in CVS format then you can import the data and using CCK and views, get pretty much any result you wish!

rtsang’s picture

The 7000+ stocks are just tickers (e.g. AAPL for Apple Computer Inc). I have a list of those tickers stored in a table along with an URL generated as another column. What I need to do is to query the database and get the URL and include it in an img HTML element. The URL will be updated every 5 mins in the day time, therefore the the URL is dynamic, can I still use the CCK approach? Also need to consider the weekly option for charts. The default is daily real time chart.

Just a thought, by looking at the source code of the standard search module, it can hook to other module and delegate the search work to other modules as long as the module implements the search hook. This is almost perfect and very nice if I don't need to support the weekly chart option. The standard search block doesn't come with that option box, there I might need to make a copy of the search module and modify it.

ludo1960’s picture

For the first point, the "ticker" table could be CCK, no problem querying it for the real time chart, not sure about the weekly thing (how is that data currently stored?)

Second point, search can be customised, pretty any way you want (within reason that is :-))

rtsang’s picture

Thanks for the valuable suggestions. As for the weekly chart, it would be just another column in the same table. But for the extensibility later, the site might need to support history view. For now, the chart only shows up to 30 days. Therefore the table need to be redesigned to have a master-detail relationships for support histories but first thing first, at least I need to make it runs the same as the existing website.

ludo1960’s picture

For the Historical view,

CCK comes with a node reference field, that might just take care of the master detail requirement.

check out these for true "Module Madness" :

http://drupal.org/project/autocreate

http://drupal.org/project/blockreference

http://drupal.org/project/fusioncharts

PM me if you need any further details.

rtsang’s picture

Thanks ludo1960 for the links. As for the urls for each stocks, should I use:

c.html

or c.htm

or c_citi_group.html (parse the url and grep the first token and use as ticker)

for SEO reason?

or any better suggestions?

ludo1960’s picture

dear.... so technical!

PM me if you want more info..

Good Luck!

PS I think yout current site is cool and Drupal is a good platforrm for stage 2!

Edit............. pathauto module should help!

rtsang’s picture

Here I have spent couple days to flush out more details of my site migration and come up some ideas how to present or melt it with Drupal's own philosophy. IMHO, Drupal shouldn't exist on this planet and none of the commercial software can compare to such a flexible system, at least I am in the software industry for over 15 years and working as a software architect. I could say this is the ideal platform to build most sophisticated websites WITHOUT hacking. But long story short after praising the wonderful creator and the dev team.

My old site is quite simple, I used BlogEngine.Net to write up some blogs and tweak their search function to let user to enter a ticker and show a chart which generated by another page by passing in a token and return a PNG image stream. The stream is generated by opening http connection to chart.google.com and just simply redirect the output to the response. I chose this way because I can hide the data from the user if they ever view the page source and that's a secret I would like to keep.

After going through some Drupal tutoriasl and reading some source code of Drupal modules, I think my design would be:

1. Create a new content type called "stocktrendchart"
2. Add fields to this content type such as ticker, image url...etc.
3. Write a php to use Drupal API to create 7000+ content based on this content type and populate the ticker field and url correspondingly. Here I think the system will create same number of nodes in the database for each stocks.
4. How to present it...here I stuck, I am not sure how to modify the page to put in <a href="/mychartmodule/chartgen?token=[tokenfield]" alt="[ticker] - [company name]" />. I am not sure if I need to create a form or not or use view and I think view is for presenting multiple results which is not the case here.
5. How to make the search box to limit to this content type and present ONLY one result based on the ticker. The user input have to match with the ticker field reside in this custom content type. I know there is a search module which you can constraint to one content type, but how to present a single result? I would like the page to be presented on the center block to display the corresponding chart using the image url.
6. If the user entered a ticker which is not found, I would like to present a view and shows some possible matches.

Enhancement:
1. Use taxonomy to make all the stock tickers created as a term in the system able to refer to the corresponding chart page. Therefore user click on the term (refer the term in blog, forum...etc) will direct the user to the chart.
2. For SEO reason, is it better to use taxonomy and term as well?
3. On the chart page, I also want to add <prev> and <next> to show different periods of the chart, not sure how to achieve this.
4. Enhance SEO so that the search engine will find my chart page by searching "stock trend ", "stock trend chart ". How to achieve this? I think I might need the pathauto module or some url rewriting module to map my URL from "www.mydomain.com/node/1" to "www.mydomain.com/trends/.html". Is this the way to go for SEO reason?

Hopefully any of you can direct me or evaluate what I am doing is on the right track.

Many Thanks and Merry Christmas!

Ray