Results 1 to 10 of 10

Thread: Getting data from an other directory

  1. #1
    Join Date
    Feb 2004
    Posts
    455

    Default Getting data from an other directory

    Hello,

    The first site is: Health and healers directory, I am trying to display data from Sure Tips Article Directory in a block. I did create a script like such:

    Code:
    <?
    
    $dbServer = "mysql";
    $dbHostname = "localhost";
    $dbUsername = "****";
    $dbPassword = "****";
    $dbName = "****";
    
    mysql_connect($dbserver, $dbUsername, $dbPassword)
    or die ("UNABLE TO CONNECT TO DATABASE");
    mysql_select_db($dbName)
    or die ("UNABLE TO SELECT DATABASE");
    
    $sql = "SELECT * FROM idx_link WHERE  suspended=0 and category_id=59 OR category_id=149 ORDER BY RAND() limit 1";
    $result = mysql_query($sql);
    
    ?>
    
                <div class="block_small_title">Related Articles</div>
                <div class="block_small_content">
                  <div class="block_small_content_text">
    
    <?
    
    if ($myrow = mysql_fetch_array($result)) {
    do
    {
    
    $link_id=$myrow["link_id"];
    $title=$myrow["title"];
    $description=$myrow["summary"];
    $url=$myrow["url"];
    $title_mod=$myrow["url_name"];
    
    $newtitle = wordwrap($title, 25, "<br />\n");
    
    $descrip150=substr($description,0,100);
    
    $newdesc150 = wordwrap($descrip150, 25, "\n", 1);
    
    echo "<BR><font face=\"Verdana\"><span style=\"font-size:8pt;\"><a href=\"http://www.sure-tips.com/detail.php?id=$link_id\"><b>$newtitle</b></a>";
    echo "<BR>$newdesc150 ...<a href=\"http://www.sure-tips.com/detail.php?id=$link_id\">more</a><br></span></font>"; 
    
    }
    while ($myrow = mysql_fetch_array($result));
    }
    ?>
    
    <div>
    
    <a href="http://www.sure-tips.com/disease-illness/">More related articles</a>
    
    </div>
                  </div>
                </div>
    For and other of my Indexu (v 3.2) but that same script that I did call block.article.html for Indexu v 5.4 does not work. Why?
    Note that both database (SURE-TIPS and HEALTHANDHEALERS) reside in the same server but are two separate database. Any help?

  2. #2
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Why not just do a block with an RSS feed from the one site. I don't remember if v3.2 supports rss but even if it doesn't you can run an external script and place it in the index.

    Also remember that blocks require more than just the .html file, they also have a php file.

  3. #3
    Join Date
    Feb 2004
    Posts
    455

    Default

    Thank you for your help. It is my first try to hack Indexu 5.4, and I am not very familiar with the process. Using that method I do not understand how I can force a block to look in a third party database. Any idea?

  4. #4
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    But why do you need to load a database when you can just use the category RSS? That would solve most of your issues and would be very simple to do.

    Using the RSS would give you the last 3/5/10 (however many you specify) article in the category you specified and would update automatically every time you added a new article.

  5. #5
    Join Date
    Nov 2004
    Posts
    1,822

    Default

    depends on the data your collecting, i have done what aladdin is doing because im collecting different data from the RSS feed provides.

    If rss feeds arent the way to go (and they probably are) what error message do you get?
    Main IndexU sites : | Campsite Directory | Tourist Guide | Places2B | AfterDirectory <-- Half price submission using coupon DP50 (from just $11 premium, and $10 basic permanent )

  6. #6
    Join Date
    Feb 2004
    Posts
    455

    Default

    Quote Originally Posted by Bruceper View Post
    But why do you need to load a database when you can just use the category RSS? That would solve most of your issues and would be very simple to do.
    I have 2 database because I got 2 distinctive domain and 2 distinctive Indexu directory with different but related content. I want to cross promote both directories.

    Using the RSS would give you the last 3/5/10 (however many you specify) article in the category you specified and would update automatically every time you added a new article.
    I do not know how to use category RSS, but I can learn if you give me some pointers

  7. #7
    Join Date
    Feb 2004
    Posts
    455

    Default

    Quote Originally Posted by inspireme View Post
    depends on the data your collecting, i have done what aladdin is doing because im collecting different data from the RSS feed provides.

    If rss feeds arent the way to go (and they probably are) what error message do you get?
    [22-Jun-2007 02:34:40] PHP Fatal error: Smarty error: [in footer.html line 8]: syntax error: unrecognized tag: block.article (Smarty_Compiler.class.php, line 436) in /home/eguncom/public_html/healtha/lib/smarty/Smarty.class.php on line 1088

    I also try
    Code:
      <php> include('modules/article.php'); </php>
    In footer (as I do with Indexu 3.2) but it does not work either

  8. #8
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    <%block_rss_feed url="http://www.yoururl.com/feed.rss" title="Your titleh ere" template="block.rss_feed.html" max_item="3" cache_time="86400"%>

    That's all there is to add a feed to v5.4

    To get a feed on v 3.2 you would need an external feed reader, and then include that where ever you wanted it.

  9. #9
    Join Date
    Feb 2004
    Posts
    455

    Default

    Thank you, I shall try to make it work. Of course it is not currently working properly maybe because the URL field is empty (http://sure-tips is an article directory) but I shall look into it.

  10. #10
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    I forgot about that, sorry. You might have to edit the file rss.php to work for you in this situation. I knew your site was an article directory, but my brain wasn't realizing that there were no url's even though I knew that already.

    Adding the code for your block would probably be easier than editing rss.php, my apologies on my confusion.

Similar Threads

  1. Importing Data
    By CEC in forum v5.x
    Replies: 18
    Last Post: 06-23-2006, 06:01 PM
  2. Where was the data inserted to?
    By mycolumbus in forum Extreme Dmoz Extractor - dmoz.org xml parser
    Replies: 2
    Last Post: 09-11-2005, 11:01 AM
  3. Directory data for sale
    By aladdin1 in forum v5.x
    Replies: 0
    Last Post: 01-01-2005, 02:29 PM
  4. Added Data
    By ezykiwi in forum v3.2
    Replies: 1
    Last Post: 06-11-2004, 06:25 PM
  5. Can't import data
    By Phil Latio in forum v5.x
    Replies: 4
    Last Post: 10-15-2002, 12:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •