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

  • wmtbpo361x
  • Rolle erstellen nicht zu finden
  • Medien und andere Daten mit Feeds von Drupal 7 auf Drupal 10 migrieren
  • für drupal11 ein Slider Modul
  • [gelöst] W3CSS Paragraphs Views
  • Drupal 11 neu aufsetzen und Bereiche aus 10 importieren
  • Wie erlaubt man neuen Benutzern auf die Resetseite zugreifen zu dürfen.
  • [gelöst] Anzeigeformat Text mit Bild in einem Artikel, Drupal 11
  • Social Media Buttons um Insteragram erweitern
  • Nach Installation der neuesten D10-Version kein Zugriff auf Website
  • Composer nach Umzug
  • [gelöst] Taxonomie Begriffe zeigt nicht alle Nodes an
Weiter

Neue Kommentare

  • Rollen
    vor 5 Tagen 7 Stunden
  • Inzwischen sind wir bei
    vor 2 Wochen 2 Tagen
  • Migrieren von D7 auf D8/ D10/ D11
    vor 2 Wochen 2 Tagen
  • melde mich mal wieder, da ich
    vor 9 Wochen 6 Tagen
  • Hey danke
    vor 10 Wochen 15 Stunden
  • Update: jetzt gibt's ein
    vor 10 Wochen 1 Tag
  • Hallo, im Prinzip habe ich
    vor 10 Wochen 5 Tagen
  • Da scheint die Terminologie
    vor 10 Wochen 5 Tagen
  • Kannst doch auch alles direkt
    vor 11 Wochen 3 Tagen
  • In der entsprechenden View
    vor 11 Wochen 3 Tagen

Statistik

Beiträge im Forum: 250238
Registrierte User: 20467

Neue User:

  • LorisBen
  • StevenEness
  • ocvk2810

» Alle User anzeigen

User nach Punkten sortiert:
wla9461
stBorchert6003
quiptime4972
Tobias Bähr4019
bv3924
ronald3857
md3717
Thoor3678
Alexander Langer3416
Exterior2903
» User nach Punkten
Zur Zeit sind 0 User und 37 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