SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: A little help

  1. #1
    SitePoint Zealot
    Join Date
    Jul 2002
    Location
    New Zealand
    Posts
    168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    A little help

    Hey guys, its been a long time since i last posted due to my heavily sceduled school work and then the outside the computer commitment.

    Anyways, I m creating an Online Quran, If you do not know what that is, dont worry, i m not here to preech, instead i m here for some help/assistance or what ever you want to call it.

    My situation is, that someone once created me the quran script, but i formated my computer and lost it. . so i m at it trying to make it myself. And so far i've setup the Table and its rows and what not.

    Row :
    1. Surah_ID
    2. Surah_Text
    3. Surah_Arabic_Text

    and well, i dont know how to create something that will show up a picture for every return found in Surah_Text.

    heres an example of what i mean. http://www.unn.ac.uk/societies/islam...e/nobae001.htm

    if you go there, you can see that there is a picture before the english text(translation). i want to create something like that.

    So any ideas?

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Are you referring to the arabic numerals shown before each arabic text of the surah? Well ...

    ¤ You will need to create an image for each arabic numeral.
    ¤ You will need to add a column to your table called, say, Surah_ID_GIF and in there you put the name of the image file for that numeral (e.g. arabic1.gif). You could also put the path if you wished to.

    When you query the table and return the results then you simply take the data in the Surah_ID_GIF field and use that as the src= attribute of an HTML <img> tag - simple as that.
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Zealot
    Join Date
    Jul 2002
    Location
    New Zealand
    Posts
    168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, something like that would be fine.. i know what you mean mr.Guru, but what i m asking is how do i make a picture load up for ever "Return" found in the record?

    say in the content for:
    1. Surah_ID = 1
    2. Surah_Text =
    adasdasd
    adada
    d
    ad
    ad
    a
    dasdad
    3. Surah_Arabic_Text
    1.gif
    2.gif
    3.gif
    4.gif
    5.gif
    6.gif
    7.gif

    all these images will load for every "ENTER, Return" found in the 'Surah_Text'...

    do you get what i mean.. i want that feature.. and i dont know how to get it..

  4. #4
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    So, you mean that after displaying "adasdasd" you want to display the image 1.gif, and after "adada" you want to display 2.gif, etc.?

    Here's a pseudo-example of what you could do ...
    PHP Code:
    $sql "SELECT * FROM Surah_Table ORDER BY Surah_ID"
    $rs mysql_query ($sql);
    // Loop through the recordset
    while ($row mysql_fetch_array ($rs)) {
      
    // Get the field data
      
    $text $row["Surah_Text"];
      
    $imgs $row["Surah_Arabic_Text"];

    // Explode on newline to create arrays
      
    $arrtext explode ("\n"$text);
      
    $arrimgs explode ("\n"$imgs);

    // Same number of elements in each array?
      
    if (count ($arrtext) == count ($arrimgs)) {
        echo 
    "<p>";

    // Loop through the arrays and display them
        
    for ($i=0$i<=count($arrtext)-1$i++) {
          echo 
    $arrtext[$i] . " <img src=\"".$arrimgs[$i]."\"><br />";
        }
        echo 
    "</p>";
      }

    Ian Anderson
    www.siteguru.co.uk

  5. #5
    SitePoint Zealot
    Join Date
    Jul 2002
    Location
    New Zealand
    Posts
    168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    umm
    that works sorta the way


Bookmarks

Posting Permissions

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