1
wizanda
Quran and Dmoz_inc not working?
  • 2005/7/12 19:36

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


I just moved server and these two modules have stopped working? Quran and Dmoz

At first I thought it was because, I didn't set the charcter set right, in phpadmin.

Then after spending about 4 hours clicking to adjust the charcter sets to latin1!!

I then realised that the Quran worked on the same database backup, without the charcter set changed already on my own PC.

Oops

So I checked what else it could be, register globals is turned off on the server I have just moved to.

Would this cause these 2 modules to stop working?

Do they need it on, for these to work?

I tried having a htaccess file to change it to test, yet i get 500 error when trying to view my site?

So is it likely to be register globals? or something else does anyone know what cause these not to work?

I need these as my keywords that people come to my site for are online Quran search and spiritual Dmoz!!

Please help how can I fix this?

If it is globals on, I may possibley be able to ask the server for it, as they are friends.

Is it possible to only turn it on, for indervidual modules?

Or will I need it at a server level for it to work?

2
wizanda
Re: Quran and Dmoz_inc not working?
  • 2005/7/13 8:57

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


Well I fixed the Dmoz, I got the new xoopsodp module

Yet the quran still doesnt work?

What cause it to need register globals on and is there an easy way to change this?

3
wizanda
Re: Quran and Dmoz_inc not working?
  • 2005/7/13 13:18

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21




Anybody???


4
wizanda
Quran not working?
  • 2005/7/17 20:01

  • wizanda

  • Home away from home

  • Posts: 1585

  • Since: 2004/3/21


Ok I have still have this problem, it is the register globals is off, tested it and that is the cause.

So within this script what causes them to be on and what must I change to turn them off? please!




include "header.php";

// This code will encode the page into Arabic windows. At this moment, it is not working. I don't know why. :(
// echo "";

// Developer information
function developer() {
        echo (
"
"
);    
echo (
"
javascript:void window.open('".XOOPS_URL."/modules/Quran/help.html''win2''status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no');" title=""._MD_INFO."">Quran 1.0
"
);
    }

// If you are a good citizen, please do not remove this copyright information.

// Main Index


function index() {
    global 
$xoopsConfig$xoopsDB$xoopsUser$xoopsTheme$xoopsLogger$xoopsModule$xoopsTpl$surano;
    include 
XOOPS_ROOT_PATH.'/header.php';
    
$myts =& MyTextSanitizer::getInstance();
    
searchform();
    echo 
"
"
;

     
$result mysql_query ("select sura, surano, ayatno, ayat from quran where ayatno=1 order by surano");
    echo 
"#D2F3CF">";
     
echo "center" width="25">"._MD_NO."left" width="175">"._MD_CHAPTERNAME."center" width="100">"._MD_VERSES."center" width="175">"._MD_LISTENDOWNLOAD."";
     while (list (
$sura,$surano,$ayat,$ayatno) = mysql_fetch_row ($result)) {
   
     
$result2 mysql_query ("select count(ayatno) from quran where surano=$surano");
     list (
$ayatcount) = mysql_fetch_row ($result2);
     
mysql_free_result ($result2);
     echo 
"#ffffff">";
     
echo "center" width="25">$surano.left" width="175">index.php?op=viewayat&surano=$surano">$suracenter" width="100">$ayatcountcenter" width="175">http://quran.al-islam.com/Recite/CRecite_g2.asp?s=$surano&f=$ayat&Reciter=1">$surano";
     
echo "";
 }
     echo 
"top">100%" colspan="4" align="center">";
    
    
developer(); 
 
    echo 
"";
    include 
'../../footer.php';
}

// Main Index Finished Here

// Search function


function search($query$min$show) {
    global 
$xoopsConfig$xoopsDB$xoopsUser$xoopsTheme$xoopsLogger$xoopsModule$xoopsTpl;

    if (!isset(
$min)) $min=0;
    if (!isset(
$max)) $max=$min+$perpage;

    
$perpage=10;

    
$searchresults=10;

    if (
$show!="") {
    
$searchresults=$show;
    } else {
    
$show=$searchresults;
    }
    
$query addslashes($query);
    
$result mysql_query("select ayat, sura, surano from quran where ayat LIKE '%$query%' OR sura LIKE '%$query%' limit  $min,$perpage");
    
$fullcountresult mysql_query("select id, sura, surano from quran where ayat LIKE '%$query%' ");

    
$totalselecteddownloads mysql_num_rows($fullcountresult);
    
$nrows  mysql_num_rows($fullcountresult);
    
$x=0;
    
$the_query stripslashes($query);
    
$the_query str_replace("'""'"$the_query);
    include 
XOOPS_ROOT_PATH.'/header.php';
    
$myts =& MyTextSanitizer::getInstance();
    echo 
"
"
;

    if (
$query != "") {

        if (
$nrows>0) {
    
    
searchform();
    echo 
"top">100%" colspan="4" align="center">option">"._MD_SEARCHRESULTS." : $the_query  "._MD_FOUND." : $nrows "._MD_VERSES.

"
;
    
    while(list(
$ayat,$ayatno,$sura,$surano) = mysql_fetch_row($result))
                  {
    
$ayat stripslashes($ayat);
    
$sura stripslashes($sura);
        
$ayat eregi_replace($query"background-color#FFFF00">$query", $ayat);

        
echo "left">$sura.$ayat";

        echo 
"
"
;
        
$sura ereg_replace($query"background-color#FFFF00">$query", $sura);
        
echo "
"
;
         
$x++;
                }
       echo 
"";

        }

       else {
        
searchform();
        echo 
"100%" colspan="4" align="center">

option">"._MD_NOMATCHESFOUND."

"
._MD_SEARCHAGAIN."
"
;
              
        }

      
/* Calculates how many pages exist.  Which page one should be on, etc... */
        
$quranpagesint = ($totalselecteddownloads $searchresults);
        
$downloadpageremainder = ($totalselecteddownloads $searchresults);
        if (
$downloadpageremainder != 0) {
            
$downloadpages ceil($quranpagesint);
            if (
$totalselecteddownloads $searchresults) {
                
$downloadpageremainder 0;
        }
        } else {
            
$downloadpages $quranpagesint;
        }
        
/* Page Numbering */
        
if ($downloadpages!=&& $downloadpages!=0) {
        echo 
"

"
            
.""._MD_SELECTPAGES.": ";
        
$prev=$min-$searchresults;
        if (
$prev>=0) {
                echo 
"  index.php?op=search&query=$the_query&min=$prev&show=$show">"
                
." << "._MD_PREVIOUS."
 ] "
;
              }
        
$counter 1;
            
$currentpage = ($max $searchresults);
            while (
$counter<=$downloadpages ) {
                
$cpage $counter;
                
$mintemp = ($perpage $counter) - $searchresults;
                if (
$counter == $currentpage) {
            echo 
"$counter "
;
            } else {
            echo 
"index.php?op=search&query=$the_query&min=$mintemp&show=$show">$counter ";
            }
                
$counter++;
            }
            
$next=$min+$searchresults;
            if (
$x>=$perpage) {
                echo 
"  index.php?op=search&query=$the_query&min=$next&show=$show">"
                
." "._MD_NEXT." >> ]
"
;
            }
    }
  }

else {
    
searchform();
    echo 
"4" width="100%" align="center">option">"._MD_FORGOTKEYWORDS."

"
;
       
        }
    echo 
"top">100%" colspan="4" align="center">";
    
developer();
    echo 
"";
    include 
'../../footer.php';
    
}

/********/

function choose() {

echo 
"top">100%" colspan="4" align="center">"._MD_BROWSECHAPTER.  surano" onChange="top.location.href=this.options[this.selectedIndex].value"> ";

echo 
""._MD_SELECTCHAPTER."";

    
$dropdown mysql_query("select sura, surano from quran where ayatno=1 ORDER BY surano");
    while (list(
$sura,$surano) = mysql_fetch_row($dropdown))
        {
        echo 
"$surano>$surano.$sura";
        }

echo 
"";

}

/********/

function searchform() {

echo 
"100%" cellspacing="0" cellpadding="10" border="0">";
echo 
"top">100%" colspan="4" align="center">n"
    
."

images/quran.gif" border="0" alt=""._MD_NOBLEQURAN."">

palatinogeorgiaverdanaarial">"._MD_NOBLEQURAN."

"
;


echo 
"top">100%" colspan="4" align="center">n"
    
."

index.php?op=search" method="post">n"
    
.""._MD_SEARCHQURAN.query" type=text>n"
    
."n"
    
."

"
;

echo 
"top">100%" colspan="4" align="center">n"
    
."

index.php?op=display" method="post">n"
    
.""._MD_CHAPTERNO.surano" type="text" maxLength="3" size="3">n"
    
." "._MD_VERSENO.ayatno" type="text" maxLength="4" size="3">n"
    
."n"
    
."

"
;

echo 
"top">100%" colspan="4" align="center">/">"._MD_HOME." | index.php">"._MD_QURANINDEX."
"
;

choose();

echo
"
"
;
}

// Search function finished

// Displaying ayat and surah

function display($surano,$ayatno) {

global 
$xoopsConfig$xoopsDB$xoopsUser$xoopsTheme$xoopsLogger$xoopsModule$xoopsTpl$surano$ayatno;
include 
XOOPS_ROOT_PATH.'/header.php';
$myts =& MyTextSanitizer::getInstance();
$result mysql_query("select sura, surano, ayat from quran where surano=$surano AND ayatno=$ayatno");
$resultar mysql_query("select ayat_ar from quran_ar where surano_ar=$surano AND ayatno_ar=$ayatno");

if(
$result!="") {

while(list(
$sura,$surano,$ayat) = mysql_fetch_row($result)) {

list(
$ayat_ar,$ayatno_ar,$id) = mysql_fetch_row($resultar) ;

searchform();

echo 
"top">100%" align="center">"._MD_DISPLAYING.": $sura ($surano)  "._MD_VERSENO.": $ayatno

"
;

echo 
"right">font-family:Simplified Arabic;font-size:20px" color=black>$ayat_ar  http://quran.al-islam.com/Recite/CRecite_g2.asp?s=$surano&f=$ayatno&Reciter=1">

 $surano.$ayat

";
     
}

}

else {
    echo 
"top">100%" align="center">option">"._MD_MENTIONNOCHAPTERORVERSE.

"
;

        echo 
"javascript:history.go(-1)">"._MD_TRYAGAIN."";

        }
    echo 
"top">100%" align="center">";
    
developer();
    echo 
"";
    include 
'../../footer.php';
 }

/********/

function viewayat($surano,$min,$show) {

   
$perpage=10;

    global 
$xoopsConfig$xoopsDB$xoopsUser$xoopsTheme$xoopsLogger$xoopsModule$xoopsTpl;
    include 
XOOPS_ROOT_PATH.'/header.php';
    
$myts =& MyTextSanitizer::getInstance();
    if (!isset(
$min)) $min=0;
    if (!isset(
$max)) $max=$min+$perpage;

    if (
$show!="") {
    
$perpage $show;
    } else {
    
$show=$perpage;
    }

    
searchform();

    
$resultx mysql_query("select id, sura, surano, ayatno, ayat from quran where surano=$surano limit $min,$perpage");
    
$fullcountresult mysql_query("select surano from quran where surano=$surano ORDER BY surano");
    
$totalayat mysql_num_rows($fullcountresult);
    echo 
"100%" cellspacing="0" cellpadding="10" border="0">content">";
    
$x=0;

    list(
$id,$sura,$surano,$ayatno,$ayat) = mysql_fetch_row($resultx);

    
$result2 mysql_query ("select count(ayatno) from quran where surano=$surano ");
    list (
$ayatcount) = mysql_fetch_row ($result2);
    if (
$ayatcount<10) {

    
$showstart=1;

    
$showend=$ayatcount;

    }
    else {

    
$showstart=$min+1;
    
$showend=$show+$min;

    }
  
$x++;

echo 
"

"._MD_CHAPTERNAME.": $sura "._MD_TOTALVERSES."$totalayat n"
    
.""._MD_DISPLAYING.": $showstart-$showend 
"
;

   if (
$ayatno<2) {

   echo
"
"
._MD_BISMILLAH."

"
;

   }

// Displaying Navbar at the top start

/* Calculates how many pages exist. Which page one should be on, etc... */
    
$audiopagesint = ($totalayat $perpage);
    
#global $surano; // I dont know why it does not work without this.

    
$audiopageremainder = ($totalayat $perpage);
    if (
$audiopageremainder != 0) {
        
$audiopages ceil($audiopagesint);
        if (
$totalayat $perpage) {
            
$audiopageremainder 0;
        }
    } else {
        
$audiopages $audiopagesint;
    }
    
/* Page Numbering */
    
if ($audiopages!=&& $audiopages!=0) {
        echo 
"
";
          echo 
"Select pages: ";
         
$prev=$min-$perpage;
         if (
$prev>=0) {
           
#echo "  ";
           #echo " < ]
 ";
      
}
        
$counter 1;
     
$currentpage = ($max $perpage);
           while (
$counter<=$audiopages ) {
              
$cpage $counter;
              
$mintemp = ($perpage $counter) - $perpage;
              if (
$counter == $currentpage) {

        echo 
"$counter ";

        } else {

        echo 
"index.php?op=viewayat&surano=$surano&min=$mintemp&show=$show">$counter ";

        }
               
$counter++;

           }
         
$next=$min+$perpage;

         if (
$x>=$perpage) {
            echo 
"  index.php?op=viewayat&surano=$surano&min=$next&show=$show">";
            
#echo ""._MD_Next." >> ]
 ";
         
}
    }
    echo 
"";


// Displaying Navbar at the top finished

   
$result mysql_query("select id, sura, surano, ayatno, ayat from quran where surano=$surano ORDER BY ayatno ASC limit  $min,$perpage");

   
$resultar mysql_query("select ayat_ar, surano_ar, ayatno_ar from quran_ar Where surano_ar=$surano ORDER BY ayatno_ar ASC limit $min,$perpage");

   while(list(
$id,$sura,$surano,$ayatno,$ayat)= mysql_fetch_row($result)) {

   list(
$ayat_ar,$ayatno_ar,$id) = mysql_fetch_row($resultar) ;

    
$sura=stripslashes($sura);
    
$ayat=stripslashes($ayat);
    
$ayat_ar=stripslashes($ayat_ar);
    
//  $ayatno_ar=$ayatno;
    //  echo"sura: $sura  Ayats: $ayatno
";
    
echo "right">font-family:Simplified Arabic;font-size:20px" color=black>$ayat_ar  http://quran.al-islam.com/Recite/CRecite_g2.asp?s=$surano&f=$id&Reciter=1">

$surano.$ayat

";

    
}

// added
   
    
developer();
    include 
'../../footer.php';
    
}

$op = isset($HTTP_GET_VARS['op']) ? trim($HTTP_GET_VARS['op']) : '';

// Displaying ayat and surah finished here

switch($op) {

    case 
"viewayat":
    
viewayat($surano,$min,$show);
    break;

    case 
"search";
    
search($query,$min,$show);
    break;

    case 
"display";
    
display($surano,$ayatno);
    break;

    case 
"choose":
    
choose();
    break;

    default:
    
index();
    break;

}



This is the only section of code as the rest of the files are just name, ect

Can some one please help me and show me how to turn off register globals in this module??

Login

Who's Online

354 user(s) are online (61 user(s) are browsing Support Forums)


Members: 0


Guests: 354


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits