Jump to content

dunc1234

New Members
  • Posts

    3
  • Joined

  • Last visited

dunc1234's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hi i am trying to write a website in wordpress to do a livedrive automated subscription, Livedrive provide api php samples that can be downloaded from here http://www.livedrive.com/Content/api/api-php.zip i have verified that the coding works with the api key running them by linking directly to the file inside plugin folder but when i try and copy the code as shown by the file and save it in a plugin and call as a short code or even just running the code, it fails. I'm trying to figure it out, but need help to get started as failing i'm miserably i'm trying to achieve; i have a test wordpress site that i'm working with on local machine i want to get one of the php files to display the form on a new page in the site by using a short_code . A working example and an explanation on how this is done is required and i would hope from there i can get the rest sorted. I can pay for suitable help via paypal and i can offer more detail if required (but i would think the samples would be enough info), example site, screenshots if necessary but the basics is that there are about 6 php files, i only need one or two of them to work in a web page. please contact me via duncanmgreen@hotmail.com many thanks in advance duncan m green
  2. hi, many thanks for replying, i tried to show the code in the screen shots to give an idea but i am happy to attach files,also all files are available to download from here http://www.livedrive.com/api at base of page is the link to download them. there is one plugin done for this for wordpress by cubettech but i have tried to contact them by there website and facebook with no response and it does not look like they have updated it for two years so relectuctant to try and buy it. i would be more than happy to pay someone on here to assist but couldn't find anywhere on the site to request this below is the code of one of the files if thats of help again guidance appreciated <html> <?php include('includes/Header.inc'); ?> <body> <div id="page"> <div id="content"> <?php include('includes/SideBar.inc'); ?> <div id="main_content"> <?php if(isset($_POST['apiKey'])) { $totalUserArray = array(); $currentPage = 1; do { $client = new SoapClient("https://www.livedrive.com/ResellersService/ResellerAPI.asmx?wsdl", array("trace"=> 1, "exceptions" => 0)); $result = $client->GetUsers(array('apiKey' => $_POST['apiKey'], 'page' => $currentPage)); $currentPage = $result->GetUsersResult->Page; $totalPages = $result->GetUsersResult->TotalPages; print "Page: " . $result->GetUsersResult->Page . "/". $result->GetUsersResult->TotalPages . "<br/>"; $array = $result->GetUsersResult->Collection->LiveDriveUserManagement; if(count($array) == 1 ) {$array = array($array);} $totalUserArray = array_merge($totalUserArray, $array); $currentPage++; } while($currentPage <= $totalPages); print "<pre class='brush: php;' style='size: 7px'>"; print "Request:\n".htmlspecialchars($client->__getLastRequest()) ."\n\n"; print "Response:\n".htmlspecialchars($client->__getLastResponse())."\n"; print "</pre>"; print "<table border='2' style='font-size: 9px; width: 1020px'>"; print "<tr> <th>Row</th> <th>ID</th> <th>Email</th> <th>SubDomain</th> <th>Display Type</th> <th>Display Status</th> <th>Backup Space Used</th> <th>Backup Capacity</th> <th>Briefcase Space Used</th> <th>Briefcase Capacity</th> </tr>"; foreach($totalUserArray as $k=>$v) { print " <tr> <td align='right'>" . ($k+1) . "</td> <td>" . $v->ID . "</td> <td>" . $v->Email . "</td> <td>" . $v->SubDomain . "</td> <td>" . $v->DisplayType . "</td> <td>" . $v->DisplayStatus . "</td> <td>" . $v->BackupSpaceUsed . "</td> <td>" . $v->BackupCapacity . "</td> <td>" . $v->BriefcaseSpaceUsed . "</td> <td>" . $v->BriefcaseCapacity . "</td> </tr>"; } print "</table>"; } else { ?> <h1>GetAllUsers Live Example:</h1> <form id="getallusers" action="getallusers.php" method="post"> What is your API KEY? <br/> <input id="apiKey" name="apiKey" size="50" type="text" value="" /> <br/> <input id="submit" name="submit" type="submit" value="submit" /> </form> <?php } ?> <br /> <h1>GetAllUsers() Code:</h1> <pre class="brush: php;html-script: true" style="size: 8px"> <?php if(isset($_POST['apiKey'])) { $totalUserArray = array(); $currentPage = 1; do { $client = new SoapClient("https://www.livedrive.com/ResellersService/ResellerAPI.asmx?wsdl", array("trace"=> 1, "exceptions" => 0)); $result = $client->GetUsers(array('apiKey' => $_POST['apiKey'], 'page' => $currentPage)); $currentPage = $result->GetUsersResult->Page; $totalPages = $result->GetUsersResult->TotalPages; print "Page: " . $result->GetUsersResult->Page . "/". $result->GetUsersResult->TotalPages . "<br/>"; $array = $result->GetUsersResult->Collection->LiveDriveUserManagement; if(count($array) == 1 ) {$array = array($array);} $totalUserArray = array_merge($totalUserArray, $array); $currentPage++; } while($currentPage <= $totalPages); print "<pre>"; print "Request :\n".htmlspecialchars($client->__getLastRequest()) ."\n"; print "Response:\n".htmlspecialchars($client->__getLastResponse())."\n"; print "</pre>"; print "<table border='2'>"; print "<tr>" . "<th>Row</th>" . "<th>ID</th>" . "<th>Email</th>" . "<th>SubDomain</th>" . "<th>DisplayType</th>" . "<th>DisplayStatus</th>" . "<th>BackupSpaceUsed</th>" . "<th>BackupCapacity</th>" . "<th>BriefcaseSpaceUsed</th>" . "<th>BriefcaseCapacity</th>" . "</tr>"; foreach($totalUserArray as $k=>$v) { print "<tr>" . "<td align='right'>" . ($k+1) . "</td>" . "<td>" . $v->ID . "</td>" . "<td>" . $v->Email . "</td>" . "<td>" . $v->SubDomain . "</td>" . "<td>" . $v->DisplayType . "</td>" . "<td>" . $v->DisplayStatus . "</td>" . "<td>" . $v->BackupSpaceUsed . "</td>" . "<td>" . $v->BackupCapacity . "</td>" . "<td>" . $v->BriefcaseSpaceUsed . "</td>" . "<td>" . $v->BriefcaseCapacity . "</td>" . "</tr>"; } print "</table>"; } else { ?> <br/> <h1>GetAllUsers Live Example:</h1> <form id="getallusers" action="getallusers.php" method="post"> What is your API KEY? <br/> <input id="apiKey" name="apiKey" size="50" type="text" value="" /> <br/> <input id="submit" name="submit" type="submit" value="submit" /> </form> <?php } ?> </pre> </div> </div> <!-- #content --> </div> <!-- #page --> </body> </html>
  3. before i get burnt for asking, i have tried for days, watched videos, read stuff but its hard for an old fart to learn new tricks. a brief outline of what i've done so far (without previous knowledge of wordpress or php) 1. created wordpress website - its going to be a subscription site for livedrive reseller 2. i have used plugins downloaded throught Wordpress and short codes in pages in order to make the site automatic i need working php api's , Livedrive provide example api's but no support. i have downloaded and installed wamp for testing. i have made a folder in the plugin folder called api examples the files won't run if i try making a plugin file and activating but i have got them to work by copying the path into internet explorer like so; http://localhost/wordpress/wp-content/plugins/apiexamples/closeuser.php which looks like screenshot 1 ld this is one of several php files, which works in this page if i put in the api key and click submit. I try copying the code and save it as a new php file and place it in a new folder called test-livedrive inside the plugin folder. my problems are; i can't work out how to get a short code to work where i place the shortcode in a new page if i paste the code as it shows into a page it shows all sorts of crap before the form at the bottom see screenshots 234 and if i put the my api key in the field box it fails. so i'm failing miserably, i have even tried to find a freelancer on freelancer.co.uk but prices are about £500 i simply can't afford and seems an awful lot when a lot of coding is there, it just needs sorts. appreciate and help/guidance/examples thanks, dunc
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.