•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Existing Scripts section within the Web Development category of DaniWeb, a massive community of 425,932 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,672 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Existing Scripts advertiser: Web Code Converter
Views: 1660 | Replies: 0
![]() |
| |
•
•
Join Date: Nov 2006
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Here a great script to automate link in a page with CSC
<?
function getArray_fromCSV()
{
$row = 1;
$handle = fopen ("/table.csv","r");
$i=0;
while ( $data = fgets ($handle, 1000))
{
$datensatz = explode('^',$data);
$datensatz[1] = trim ( $datensatz[1]);
$alle_daten[$i++] = $datensatz;
}
fclose ($handle);
//echo "<pre>";var_dump($alle_daten);echo "</pre>";
return $alle_daten;
}
function dreieckstausch($all)
{
for ($i=0;$i < sizeof($all);$i++)
{
for ($z=$i+1;$z < sizeof($all); $z++)
{
if ($all[$i][1] > $all[$z][1] )
{
$arr_tmp = $all[$i];
$all[$i] = $all[$z];
$all[$z] = $arr_tmp;
}
}
}
return $all;
}
function main2($beschreibung){
return $beschreibung;
}
function main($beschreibung)
{
define('LINKANZAHL',9);
$all_search = getArray_fromCSV();
//$all = dreieckstausch($all);
//$beschreibung = get_String();
$arr_beschreibung = explode(' ',$beschreibung);
$startwert = 5;
$bool_startwert_chk=false;
for ($i=0; $i < LINKANZAHL;$i++)
{
$bool_chk = false;
do
{
for ($z=0;$z < sizeof($all_search);$z++)
{
$suchbegriff = $all_search[$z][0];
$url = $all_search[$z][1];
$expr3 = '°\s?>*'.$suchbegriff.'<*\s?°imU';
$expr = '°^(.*>)?'.$suchbegriff.'(.*<)?$°imU';
if(preg_match($expr,$arr_beschreibung[$startwert],$foundarray) > 0)
{
$arr_beschreibung[$startwert]=str_replace($suchbegriff,"<a style=\"color:#464946;text-decoration:underline;\" href='$url'>$suchbegriff</a>",$arr_beschreibung[$startwert]);
//unset($all_search[$z]);
$all_search[$z][0] = 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk';
$bool_chk = true;
if ($startwert < sizeof($arr_beschreibung))
$startwert += 5;
else
$bool_startwert_chk = true;
break;
}
elseif(strpos($suchbegriff,' ') != false && preg_match($expr,$arr_beschreibung[$startwert].' '.$arr_beschreibung[$startwert+1],$foundarray) > 0)
{
$arr_suchbegriff = explode(' ',$suchbegriff);
$arr_beschreibung[$startwert]=str_replace($arr_suchbegriff[0],"<a style=\"color:#464946;text-decoration:underline;\" href='$url'>".$arr_suchbegriff[0]." ".$arr_beschreibung[$startwert+1]."</a>",$arr_beschreibung[$startwert]);
$arr_beschreibung[$startwert+1]='';
$all_search[$z][0] = 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk';
$bool_chk = true;
if ($startwert < sizeof($arr_beschreibung))
$startwert += 6;
else
$bool_startwert_chk = true;
break;
}
}
if ($bool_chk===false)
{
if ($startwert < sizeof($arr_beschreibung))
$startwert+=1;
else
$bool_startwert_chk = true;
}
if ($bool_startwert_chk)
break;
} while ($bool_chk === false);
}
//var_dump($all_search);
$beschreibung = implode($arr_beschreibung,' ');
return $beschreibung;
}
?>
http://www.digitalfreemarket.com/des...pc-ordinateur/
![]() |
•
•
•
•
•
•
•
•
DaniWeb Existing Scripts Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Clean Previous Next Script for MySQL results (PHP)
- The name for the Resize Button to ad to Script (HTML and CSS)
- Random Programming Script (Computer Science and Software Design)
- Importing SQL Script File - Urgent !! (Database Design)
- Script problems with IE (Web Browsers)
- Help with shell script to auto gzip a .sql dump after backup (Shell Scripting)
- Adding mutiple PC's to an OU via script? (Windows NT / 2000 / XP / 2003)
- Table of Contents Script (Java)
- ASP slow-down server script (ASP)
Other Threads in the Existing Scripts Forum
- Previous Thread: pseudocode help
- Next Thread: Easy (and free) site monitor


Hybrid Mode