Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
rickleigh
Worker
Worker


Joined: Jan 06, 2009
Posts: 183

PostPosted: Fri Feb 13, 2009 5:19 pm Reply with quote

I'm trying to figure out how to update the yellowpages module to work with Raven. It states that it works on PHP-NUKE 6.5 and 7.x.

Here is the link to the download. Its free but requires you to be a member.
Only registered users can see links on this board! Get registered or login!

Here is the index.php Code just to give you an idea how its coded:
Code:
<?php


/********************************************************/
/* Yellow Pages Version 2                               */
/* Original Script - Yellow Pages - Version1 (2001) for phpNuke 5-  by Nylis G. Renschler II (webmaster@nukescripts.net)  */
/* http://phpyp.allthingsnuked.com - http://eShoppingGui.de  */
 /* Re-Mod Script - Yellow Pages - Version 2 (25 August 2004) By: Albini.net (webmaster@albini.net.net)  */
/* http://www.albini.net                                                                                        */
/* ==================================================== */
/* Yellow Pages Version 2  Module applicable for:                                          */
/* PHP-NUKE 6.5 and 7.x: Web Portal System                          */
/* CopyRight 2000-2004 - G. Renschler II  & A. Albini                    */
/* The Yellow Pages module can be modified for your personal use ONLY          */
/********************************************************/



if (!eregi("modules.php", $PHP_SELF)) {
    die ("You can't access this file directly...");
}


require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include ("modules/$module_name/admin.php");
include ("modules/$module_name/config.php");
include ("modules/$module_name/functions.php");
$pagetitle = "- Yellow Pages";


if (isset($ypadminoverride)) {
  $ypadmintest=1;
  $yp5commandline="op=modload&name=$name&file=index&ypadminoverride=1";
} else {
  $yp5commandline="op=modload&name=$name&file=index";
}

function main() {
  global $PHP_SELF,$yp5commandline,$sitename,$nukeversion,$PHPversion,$ypadmintest;
 
  include("header.php");
 
  OpenTable();
    displaytitle();
    echo "<br>";
    ypsearchbox();
    displaynumbus();
    displaytopcat();
    displaytopreg();
    displaybrowsecat();
    footmenu();
   
  CloseTable();
  echo "<br>";
 
  include("footer.php");
}



function makePass() {
        $makepass="";
        $syllables  = "er,in,tia,wol,fe,pre,vet,jo,nes,al,len,son,cha,ir,ler,bo,ok,tio,nar,sim";
        $syllables .= ",ple,bla,ten,toe,cho,co,lat,spe,ak,er,po,co,lor,pen,cil,li,ght,wh,at,the";
        $syllables .= ",he,ck,is,mam,bo,no,fi,ve,any,way,pol,iti,cs,ra,dio,sou,rce,sea,rch,pa,per";
        $syllables .= ",com,bo,sp,eak,st,fi,rst,gr,oup,boy,ea,gle,tr,ail,bi,ble,brb,pri,dee,kay,en,be,se";
        $syllable_array=explode(",", $syllables);
        srand((double)microtime()*1000000);
        for ($count=1;$count<=4;$count++) {
                if (rand()%10 == 1) {
                        $makepass .= sprintf("%0.0f",(rand()%50)+1);
                } else {
                        $makepass .= sprintf("%s",$syllable_array[rand()%62]);
                }
        }
        return($makepass);
}


function chkuser() {
  global $user;
    if(isset($user)) {
        $user2 = base64_decode($user);
        $ucookie = explode(":", $user2);
    }
    if(isset($ucookie[1]) && $ucookie[1] != '')  {
      $uid =$ucookie[0];
       return($uid);
    } else {
    return(0);
    }
}


function parsevars() {
  global $HTTP_POST_VARS,$subcatidarray;
  if (is_array($HTTP_POST_VARS)) {
    $idarray=array_keys($HTTP_POST_VARS);
    $numids = count($idarray);
    $cnt = 0;
    for ($i=0;$i < $numids; $i++) {
      if ($idarray[$i] <> "Submit" && substr($idarray[$i],0,8)=="subcatid") {
        $subcatidarray[$cnt++] = substr($idarray[$i],8);
      }

    }
  }
}

function displayinfo() {
  global $PHP_SELF, $yp5commandline,$bid, $sitename;
  if ($bid == 0 or $bid == null) {main();}
  include("header.php");
  $index =0;
  OpenTable();
    displaytitle();
    $sql="select b.*,i.pagetext";
    $sql .= " from yp_business b,yp_infopage i";
    $sql .= " where b.infopageid = i.infopageid";
    $sql .= " and b.busid = $bid";
    $sql .= " and b.active = 1 and deleted=0";
    $result = mysql_query($sql);
    while($busarray = mysql_fetch_array($result)) {
   
    echo"<table border=\"0\" cellpadding=\"7\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"100%\" bgcolor=\"#FFFFFF\">"
  . "<tr><td width=\"100%\"><center>$busarray[name]<br><br><img src=\"modules/Yellowpages/images/description.png\" border=0></center><br>$busarray[pagetext]</td>"
  . "</tr></table>";
echo "<hr>";   
       
       
       
       //echo "<center>$busarray[name]<br><img src=\"modules/Yellowpages/images/description.png\" border=0></center><br><br>$busarray[pagetext]";
       //echo "<hr>";
       
       
       if ($busarray[url] == "" or $busarray[url] == null) {
         echo "<b>$busarray[name]</b><br>";
         } else {
           //echo "<a href=\"$busarray[url]\">$busarray[name]</a><br>";
           echo "<b>$busarray[name]</b><br><a href=\"$busarray[url]\"> <img src=\"modules/Yellowpages/images/website2.png\" border=0></a><br>";
         }
         if ($busarray[address1] <> "" or $busarray[address1] <> null) {
           echo "$busarray[address1]<br>";
         }
         if ($busarray[address2] <> "" or $busarray[address2] <> null) {
           echo "$busarray[address2]<br>";
         }
         
         echo "$busarray[city] - $busarray[zip] - $busarray[state]<br>";
         if ($busarray[country] <> "" or $busarray[country] <> null) {
          echo "$busarray[country]<br>";
           }
           if ($busarray[phone] <> "" or $busarray[phone] <> null) {
           echo "$busarray[phone]<br>";
           }
       
         if ($busarray[phone2] <> "" or $busarray[phone2] <> null) {
           echo "$busarray[phone2]<br>";
         }
         if ($busarray[fax] <> "" or $busarray[fax] <> null) {
           echo "$busarray[fax]<br>";
         }
         if ($busarray[email] <> "" or $busarray[email] <> null) {
           //echo "<a href=\"mailto:$busarray[email]\">$busarray[email]</a><br>";
           echo "<a href=\"mailto:$busarray[email]\"><img src=\"modules/Yellowpages/images/contactsubmitter2.png\" border=0></a><br>";
           }
    }
    echo "<br>";
   
  CloseTable();
  echo "<br>";
  footmenu();
  include("footer.php");
}



function sendbus() {
  global $PHP_SELF,$subcatidarray,$yp5commandline,$admin, $sitename, $user, $cookie,$country,$uid,$catid,$busname,$address1,$address2,$city,$state;
  global $zip,$region,$phone,$phone2,$fax,$url,$email,$logourl,$infoline,$pagetext,$paidad,$bgcolor1,$bgcolor2,$bgcolor3,$debugstat;

  include("header.php");
 
  OpenTable();
    displaytitle();

  if ($debugstat) {
    echo "uid: [$uid]<br>catid: [$catid]<br>name: [$busname]<br>";
    echo "address1: [$address1]<br>address2: [$address2]<br>city: [$city]<br>state: [$state]<br>";
    echo "zip: [$zip]<br>region: [$region]<br>phone: [$phone]<br>phone2: [$phone2]<br>";
    echo "fax: [$fax]<br>url: [$url]<br>email: [$email]<br>logourl: [$logourl]<br>";
    echo "infoline: [$infoline]<br>infopageid: [$infopageid]<br>paidad: [$paidad]<br>";
    echo "password: [$password]<br>confirmpassword: [$confirmpassword]<br>";
    echo "<br>";
  }

  $password=makePass();

  if ($region == 1) {$region == 0;}

  $sql = " INSERT INTO yp_business_add VALUES (null,'".date("Y-m-d",time())."',$uid,";
  $sql .= "'$busname','$address1','$address2','$city','$state','$zip','$country',$region,'$phone','$phone2','$fax','$url',";
  $sql .= "'$email','$logourl','$infoline','$pagetext',$paidad,0,'0000-00-00','$password')";

  $result=mysql_query($sql);
  $insertid = mysql_insert_id();

  $errno=mysql_errno();
  $errmsg=mysql_error();
  if ($debugstat or $errno <> 0) {
    echo "sql=$sql<br>result=";
    echo "$result<br>";
    echo "password=$password<br>";
    echo "Error:$errno : $errmsg<BR>";
  }

  if (!$errno) {
    for ($i = 0; $i < count($subcatidarray);$i++) {
      $sql = " INSERT INTO yp_subcat_add VALUES (null,$insertid,$subcatidarray[$i])";
      $result=mysql_query($sql);
      $errno2=mysql_errno();
      $errmsg2=mysql_error();
      if ($errno2) echo "Error:$errno2 : $errmsg<BR>";

    }
  }


  if ($errno || $errno2) {
    echo "Please contact the administrator and report the error.";
  } else {
    echo ""._YPTHKYOUSUB."<br><br>";
    echo ""._YPTHKYOUSUB2."<br>";
    echo ""._YPTHKYOUSUB3."<br><br>";
    echo ""._YPTHKYOUSUB4."<br>";
    echo "<font color=\"#FF0000\"><b>"._YPTHKYOUSUB5."</b><font color=\"#000000\"><br>";
  }
  echo "<br>";
 
  CloseTable();
  echo "<br>";
  footmenu();
  include("footer.php");
}

function sendeditbus() {
  global $PHP_SELF,$subcatidarray,$yp5commandline,$admin, $sitename, $user,$busid,$uid,$country,$catid,$busname,$address1,$address2,$city,$state;
  global $zip,$region,$phone,$phone2,$fax,$url,$email,$logourl,$infoline,$pagetext,$infopageid,$paidad,$debugstat,$buspass;
  include("header.php");
  $index =0;
  OpenTable();
    displaytitle();

  if ($debugstat) {
    echo "uid: [$uid]<br>catid: [$catid]<br>name: [$busname]<br>";
    echo "address1: [$address1]<br>address2: [$address2]<br>city: [$city]<br>state: [$state]<br>";
    echo "zip: [$zip]<br>region: [$region]<br>phone: [$phone]<br>phone2: [$phone2]<br>";
    echo "fax: [$fax]<br>url: [$url]<br>email: [$email]<br>logourl: [$logourl]<br>";
    echo "infoline: [$infoline]<br>infopageid: [$infopageid]<br>paidad: [$paidad]<br>";
    echo "password: [$password]<br>confirmpassword: [$confirmpassword]<br>";
    echo "<br>";
  }

  if ($region == -1) {$region = 0;}

  $sql = " UPDATE yp_business set ";
  $sql .= "name='$busname',address1='$address1',address2='$address2',city='$city',state='$state',zip='$zip',";
  $sql .= "country='$country',region=$region,phone='$phone',phone2='$phone2',fax='$fax',url='$url',";
  $sql .= "email='$email',logourl='$logourl',infoline='$infoline',paidad=$paidad,pass='$buspass' ";
  $sql .= "where busid=$busid";
  $result=mysql_query($sql);
  $errno=mysql_errno();
  $errmsg=mysql_error();
  if ($debugstat or $errno <> 0) {
    echo "sql=$sql<br>result=";
    echo "$result<br>";
    echo "password=$password<br>";
    echo "Error:$errno : $errmsg<BR>";
  }

  if (!$errno) {
      $sql = "DELETE FROM yp_categorylist where busid = $busid";
      $result=mysql_query($sql);
    for ($i = 0; $i < count($subcatidarray);$i++) {
      $sql = " INSERT INTO yp_categorylist VALUES (null,$subcatidarray[$i],$busid)";
      $result=mysql_query($sql);
      $errno2=mysql_errno();
      $errmsg2=mysql_error();
      if ($errno2) echo "Error:$errno2 : $errmsg<BR>";

    }
}

 if (!$errno2) {
      if ($infopageid) {
      $sql = "UPDATE yp_infopage set pagetext='$pagetext' where infopageid = $infopageid";
      $result=mysql_query($sql);
      $errno3=mysql_errno();
      $errmsg3=mysql_error();
      if ($errno3) echo "Error:$errno3 : $errmsg3<BR>";
      }

}


 if ($errno || $errno2 || $errno3) {
  echo "Please contact the administrator and report the error.";
   
} else {
    echo "<br>"._YPBUSID3.": $busid "._YPUPDATED3.".<br>";
}
  echo "<hr>";
 
  CloseTable();
  echo "<br>";
  footmenu();
  include("footer.php");
}


function adminmenu() {
  global $PHP_SELF,$subcatidarray,$yp5commandline,$admin,$ypstartlist,$ypbustolist,$sitename, $user, $cookie,$uid,$bgcolor1,$bgcolor2,$bgcolor3,$debugstat;
  include("header.php");
  OpenTable();
    displaytitle();
  CloseTable();
  echo "<br>";
  OpenTable();
    echo "<center>PHPyp "._YPADMINMENU."</center><br>";
    headermenu();
  CloseTable();
  echo "<br>";
  OpenTable();
    displaysubmissions();
  CloseTable();
  echo "<br>";
 
  include("footer.php");
}

parsevars();

$uid=chkuser();
if ($uid && !$admin) {loadconfig($uid);} else {loadconfig();}

if ((!$ypadmintest || $uid<>0) && !$ypadminoverride) {
  switch($func) {

        case "search":
       
                searchdb();
                break;
        case "submitbus":
                submitbus();
                break;
        case "catselect":
                catselect();
                break;
        case "previewcat":
                previewcat();
                break;
        case "previewbus":
                previewbus();
                break;
        case "sendbus":
                sendbus();
                break;
        case "displaycat":
                displaycat();
                break;
        case "displayinfo":
                displayinfo();
                break;
        case "loginedit":
                loginedit();
                break;
        case "loginbus":
                loginbus();
                break;
        case "previeweditbus":
                previeweditbus();
                break;
        case "sendeditbus":
                sendeditbus();
                break;
        case "adminconfig":
                adminconfig();
                break;

        default:
                main();
                break;
  }
} else {
 
  switch($func) {
        case "adminbus":
                adminbus();
                break;
        case "adminconfig":
                adminconfig();
                break;
        case "adminsidebanners":
                adminsidebanners();
                break;
        case "adminreg":
                adminreg();
                break;
        case "adminsubcat":
                adminsubcat();
                break;
        case "admincat":
                admincat();
                break;
        case "adminsendbus":
                adminsendbus();
                break;

        case "loginedit":
                loginedit();
                break;
        case "loginbus":
                loginbus();
                break;
        case "previeweditbus":
                previeweditbus();
                break;
        case "sendeditbus":
                sendeditbus();
                break;

        default:
                adminmenu();
                break;

  }
}
?>


Thanks for any help provided
 
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9449
Location: Arizona

PostPosted: Fri Feb 13, 2009 5:59 pm Reply with quote

rickleigh, I am sorry to say, but I would run as far away as you can from this script. This thing is old, old, old code and is just full of security holes.

This thing needs a serious overhaul / re-write IMO.

"global $HTTP_POST_VARS" ???? oh my....

Does anyone out there know of something newer/better?

Oh my...

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
rickleigh
PostPosted: Fri Feb 13, 2009 7:03 pm Reply with quote

Thanks montego for the bad news Smile

Well if there is anyone that knows of a module that will do the same concept. Please post a link. I have done a Google search and have had no luck in finding anything other then this.

Thanks for looking in advance
 
pureliving
Worker
Worker


Joined: Dec 01, 2008
Posts: 180

PostPosted: Sat Feb 14, 2009 6:42 pm Reply with quote

I have seen articles stating 'address book' being a module similar to yellow pages, but still i am yet to see a working module that works like yellow pages, that actually works with RN, as from my testing, neither seem to work.

Hope someone knows of any just as good or even better.

xx Bless xx
 
View user's profile Send private message
draxx
Involved
Involved


Joined: Nov 19, 2003
Posts: 282

PostPosted: Tue Apr 28, 2009 10:27 am Reply with quote

Awwww I had just installed it too.... off it goes.

This was a good one - hard to re-write?
 
View user's profile Send private message
pureliving
PostPosted: Tue Apr 28, 2009 11:28 am Reply with quote

So draxx did you actually manage to rewrite the yellow pages module, so it works correctly?
 
draxx
PostPosted: Tue Apr 28, 2009 12:36 pm Reply with quote

Ohhh no Im not that good Razz
 
pureliving
PostPosted: Tue Apr 28, 2009 12:57 pm Reply with quote

I have attempted several times, with failure each time.
I'm aware also that several members of raven, etc, have also tried without ability.

Hands up to the one who has or does, would love to see a working updated version of this. Would be great.
 
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6792
Location: Ha Noi, Viet Nam

PostPosted: Thu Apr 30, 2009 1:54 am Reply with quote

This was originally a commercial script but it never worked properly even in it's V2.0 release.
If there is sufficient interest, I would be willing to take it on as a project but the release date would be "sometime 2009" due to other projects I'm working on now like an independent PM system (no dependency on the forums).
 
View user's profile Send private message Send e-mail
draxx
PostPosted: Tue Jul 15, 2014 7:02 pm Reply with quote

@Guardian (or any other capable person) - I want this and well if it didn't get written by someone here I don't run it.

What would be the fee to make it work with RN. ?

Once working I would want one update to it and that would be that it makes a call to google maps and produces a map (on my page) and marks it on the page with the business address.

As I see that as 2 different projects what would be the fee for that part?
 
misterstereus
Hangin' Around


Joined: Aug 03, 2012
Posts: 47
Location: Rome Italy

PostPosted: Mon Jul 28, 2014 12:14 am Reply with quote

Hello draxx I can help you if have Skype add me "MisterStereus" or contact me to email Only registered users can see links on this board! Get registered or login!

_________________
MisterStereus from Rome Italy!! 
View user's profile Send private message Send e-mail Visit poster's website
Guardian2003
PostPosted: Mon Aug 04, 2014 9:59 pm Reply with quote

[b[draxx[/b] - I could take a look but it is going to be a while before I get my computer back together.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©