Startseite
  • » Home
  • » Handbuch & FAQ
  • » Forum
  • » Übersetzungsserver
  • » Suche
Startseite › Forum › Drupalcenter.de › Module › Modul-Entwicklung ›

Wordpress Plugin zu Drupal Modul

Eingetragen von KiLLAH89 (181)
am 10.04.2010 - 11:19 Uhr in
  • Modul-Entwicklung
  • Drupal 6.x

Einen schönen guten Tag,

ich möchte gerne ein Wordpress Plugin in ein Drupal Module umschreiben und wollte fragen, ob mir jmd. dabei helfen kann!? Das Wordpress Plugin ist ziemlich klein (4kb). Hier mal die Codes der beiden Dateien:

affiliate_overview_affilinet.php

<?php
function printAffilinetOverview()
{ 
 
define ("WSDL_LOGON", "https://api.affili.net/V2.0/Logon.svc?wsdl");
 
define ("WSDL",  "https://api.affili.net/V2.0/AccountService.svc?wsdl");
 
 
$SOAP_LOGON = new SoapClient(WSDL_LOGON);


 
$Token      = $SOAP_LOGON->Logon(array(
              
'Username'  => get_option("affilinetPubID"),
              
'Password'  => get_option("affilinetPubWsPw"),
              
'WebServiceType' => 'Publisher'
              
));
 
 
$SOAP_REQUEST = new SoapClient(WSDL);
 
$req = $SOAP_REQUEST->GetPublisherSummary($Token);

 
$thisMonthConfirmed = $req->CurrentMonth->Confirmed;
 
$thisMonthOpen = $req->CurrentMonth->Open; 
 
$thisMonthCancelled = $req->CurrentMonth->Cancelled; 
 
$otherMonthConfirmed = $req->PreviousMonths->Confirmed;
 
$otherMonthOpen = $req->PreviousMonths->Open; 
 
$otherMonthCancelled = $req->PreviousMonths->Cancelled; 
 
$lastPaymentDate = $req->Payments->LastPayment;
 
$totalPayment = $req->Payments->TotalPayment;
 
$partnerShipsActive = $req->Partnerships->PartnershipsActive;
 
$partnerShipsWaiting = $req->Partnerships->PartnershipsWaiting;
 
?>

<table style="width:100%;border:dotted gray 1px;" cellspacing="1">
   <tr class="header">
     <th colspan="2">Kontostand</th>
     <th colspan="2">Umsatz der Vormonate</th>
     <th>Auszahlungen</th>
     <th colspan="2">Partnerschaften</th>
   </tr>
   <tr class="gerade">
     <td class="rightgray">Best&auml;tigt</td>
     <td class="rightgray bold confirmed"><?=money($thisMonthConfirmed);?></td>
     <td class="rightgray">Best&auml;tigt</td>
     <td class="rightgray bold confirmed"><?=money($otherMonthConfirmed);?></td>
     <td class="rightgray bold other"><?=gerDate($lastPaymentDate);?></td>
     <td class="rightgray">Aktive:</td>
     <td class="bold other center"><?=$partnerShipsActive?></td>
   </tr>
   <tr class="ungerade">
     <td class="rightgray">Offen</td>
     <td class="rightgray bold open"><?=money($thisMonthOpen);?></td>
     <td class="rightgray">Offen</td>
     <td class="rightgray bold open"><?=money($otherMonthOpen);?></td>
     <td class="rightgray bold other"><?=money($totalPayment);?></td>
     <td class="rightgray">Wartend:</td>
     <td class="bold other center"><?=$partnerShipsWaiting?></td>
   </tr>
   <tr class="gerade">
     <td class="rightgray">Storniert</td>
     <td class="rightgray bold canceled"><?=money($thisMonthCancelled);?></td>
     <td class="rightgray">Storniert</td>
     <td class="rightgray bold canceled"><?=money($otherMonthCancelled);?></td>
     <td>&nbsp;</td>
     <td colspan="2">&nbsp;</td>
   </tr>
   <tr class="ungerade rightgray">
     <td colspan="7"><a href="http://publisher.affili.net" target="_blank" title="publisher.affili.net"><b>&raquo; zum affilinet Publisher-Login</b></td>
   </tr>
</table>
<?php

}
?>

affiliate_overview.php

<?php
/*
Plugin Name: Affiliate Overview
Plugin URI: http://rosch24.de/affiliate-overview
Description: Konto&uuml;bersicht f&uuml;r affilinet-Publisher.
Version: 1.0
Author: Sebastian Roschitzki
Author URL: http://rosch24.de
*/
include('affiliate_overview_affilinet.php');
add_action('activity_box_end', 'wpaffilinet');
wp_enqueue_style( 'overview_css', plugins_url( $path = '/affiliate-overview/style.css'), array() );

//ERRORS
$phpVersionError = 'Tut mir leid, Du brauchst mindestens <b>PHP5</b> um dieses Plugin verweden zu k&ouml;nnen. Deine Version ist: <b>'.phpversion().'</b>';
$noWsPwError = 'Du musst erst deine PublisherID und dein Webservicepasswort eintragen um dieses Plugin verwenden zu k&ouml;nnen.';
$wrongWsPwError = 'Deine Kontoinformationen konnten nicht geladen werden. Bist Du sicher, dass die eingegebenen Daten stimmen?';

//FUNCTIONS
function gerDate($value)
{
 
$year = substr($value, 0, 4);
 
$month = substr($value, 5, 2);
 
$day = substr($value, 8, 2);
  if(
$year > 2000)
  {
 
$value = $day.'.'.$month.'.'.$year;
  }
  else
  {
 
$value = "noch keine&nbsp;";
  }
  return
$value;
}

function
money($value)
{
  if(
$value < 1)
  {
   
$value = " - ";
  }
 
$value = str_replace('.',',',$value);
 
$value = $value.' &euro;';
  return
$value;
}

function
error($value)
{
 
$value= '<div style="display:block;background-color:#ffdbdb;border:dotted 1px red;text-align:center;padding-top:10px;padding-bottom:10px">'.$value.'</div>';
  return
$value;
}
 
function
wpaffilinet()
{
  global
$phpVersionError;
  global
$noWsPwError;
  global
$wrongWsPwError;
  echo
'<hr style="display:none;" />';
  echo
'<h2>Affiliate-Overview</h2>';

  if (
phpversion() < 5)
  {   
     echo
error($phpVersionError);
  }
  else
  {
    if(
current_user_can('level_10'))
    {
      if(
get_option("affilinetPubID")!="" && get_option("affilinetPubWsPw")!="")
      {
      try
         {     
           
printAffilinetOverview();
         }
      catch(
Exception $e)
         {
            echo
error($wrongWsPwError);
         }
      }
      else
      {
         echo
error($noWsPwError);
      }     
    }
  }
}


//ADMIN-PAGE
 
$affilinetPubID = get_option('affilinetPubID');
 
$affilinetPubID = get_option('affilinetPubWsPw');

  if (
'insert' == $HTTP_POST_VARS['action'])
  {
      
update_option("affilinetPubID",$HTTP_POST_VARS['affilinetPubID']);
   
update_option("affilinetPubWsPw",$HTTP_POST_VARS['affilinetPubWsPw']);
  }
 
function
affiliate_overview_option_page()
{
?>
  
  <div class="wrap">
    <h2>Affiliate-Overview Einstellungen</h2>
      Um auf dein affilinet Konto zugreifen zu k&ouml;nnen musst Du deine PublisherID und dein Webservicepasswort eingeben.<br/>
        Das Webservicepasswort kannst Du im Loginbereich (<a href="http://publisher.affili.net" target="_blank" title="publisher.affili.net"><b>publisher.affili.net</b></a>) unter <b>Konto->Technische Einstellungen->Webservices->Publisher Webservices</b> generieren.<br/><br/>
        <form name="form1" method="post" action="<?=$location ?>">
          <table>
            <tr><td>PublisherID:</td><td><input name="affilinetPubID" value="<?=get_option("affilinetPubID");?>" type="text" /></td></tr>
            <tr><td>Webservice-Passwort:</td><td><input name="affilinetPubWsPw" value="<?=get_option("affilinetPubWsPw");?>" type="text" /></td></tr>
            <tr><td colspan="2"><input type="submit" value="Speichern" /></td></tr>
          </table>
          <input name="action" value="insert" type="hidden" />
      </form>
<?php if(isset($_POST['action'])) echo '<h4>&Auml;nderungen gespeichert</h4>';?>
    </div>
<?php
}
  
function
affiliate_overview_menu()
{
 
add_option("affilinetPubWsPw","");
 
add_option("affilinetPubID","");
   
add_options_page('Affiliate-Overview', 'Affiliate-Overview', 9, __FILE__, 'affiliate_overview_option_page');
}
 
 
add_action('admin_menu', 'affiliate_overview_menu');

?>

Ist nicht sonderlich viel Code, dennoch bekomme ich es nicht hin das Plugin umzuschreiben. Ich habe nämlich weder Ahnung von PHP (bzw. Anfänger) und erst recht keine Ahnung, wie ich das dann noch in Drupal schreiben soll.

Meine Drupal Version: 6x
Modul nur für Adminbereich. Es soll ein Übersichtsmodul sein, womit ich auf http://www.affili.net zugreifen kann wie mein Guthaben derzeit ist.

Ich hoffe ihr könnt mir dabei helfen.

‹ Daten aus Table mit FOrm Verknüpfen Regular Expression Problem ›
  • Anmelden oder Registrieren um Kommentare zu schreiben

Benutzeranmeldung

  • Registrieren
  • Neues Passwort anfordern

Aktive Forenthemen

  • Canvas Palette: Eine fertige Komponentenbibliothek für Drupal Canvas
  • Hilfe zu Updates oder Composer
  • Vergleich Drupal und Contao
  • [geloest] Blocks in Bootstrap nebeneinander darstellen und nicht untereinander
  • DrupalCamp Frankfurt 27-28 November 2026
  • Bitte mein Bentzerkonto löschen
  • Beim Aufruf einiger Inhalte erhalte ich folgende Fehlermeldung
  • Neuinstallation: vermutlich ein rewrite-Problem
  • Drupal CMS installieren
  • [erledigt]MP3 in Drupal 10 einbinden
  • (gelöst)Drupal 11 installieren
  • Titel ausblenden
Weiter

Neue Kommentare

  • Danke ich werde mir die
    vor 5 Wochen 2 Tagen
  • Vielen Dank für Ihren
    vor 5 Wochen 5 Tagen
  • Composer ist sehr ratsam
    vor 6 Wochen 10 Stunden
  • Vielen Dank für den
    vor 6 Wochen 2 Tagen
  • Die alten CMS Vergleiche von contentmanager.de
    vor 6 Wochen 3 Tagen
  • Gut gemacht
    vor 6 Wochen 3 Tagen
  • Layout Builder etc. z.B. für Landing Pages
    vor 6 Wochen 3 Tagen
  • Links
    vor 6 Wochen 5 Tagen
  • Moin,wow, sehr gutes
    vor 7 Wochen 15 Minuten
  • Dass ist eine spannende
    vor 7 Wochen 7 Stunden

Statistik

Beiträge im Forum: 250316
Registrierte User: 20567

Neue User:

  • Philiphelve
  • Robertspaft
  • drupalthemes

» Alle User anzeigen

User nach Punkten sortiert:
wla9466
stBorchert6003
quiptime4972
Tobias Bähr4019
bv3924
ronald3857
md3717
Thoor3678
Alexander Langer3416
Exterior2903
» User nach Punkten
Zur Zeit sind 0 User und 8 Gäste online.

Hauptmenü

  • » Home
  • » Handbuch & FAQ
  • » Forum
  • » Übersetzungsserver
  • » Suche

Quicklinks I

  • Infos
  • Drupal Showcase
  • Installation
  • Update
  • Forum
  • Team
  • Verhaltensregeln

Quicklinks II

  • Drupal Jobs
  • FAQ
  • Drupal-Kochbuch
  • Best Practice - Drupal Sites - Guidelines
  • Drupal How To's

Quicklinks III

  • Tipps & Tricks
  • Drupal Theme System
  • Theme Handbuch
  • Leitfaden zur Entwicklung von Modulen

RSS & Twitter

  • Drupal Planet deutsch
  • RSS Feed News
  • RSS Feed Planet
  • Twitter Drupalcenter
Drupalcenter Team | Impressum & Datenschutz | Kontakt
Angetrieben von Drupal | Drupal is a registered trademark of Dries Buytaert.
Drupal Initiative - Drupal Association