Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Still no Google Drive urls support in AIB... is a 30 lines code!



<?php

echo "<h1>GOOGLE DRIVE SHARE URLS</h1>";

$a_urls = array(
"docx" => "https://docs.google.com/document/d/XXXXXXXX/edit?usp=sharing|PROJECT NAME",
"xlsx" => "https://docs.google.com/spreadsheets/d/XXXXXXXX/edit?usp=sharing|PROJECT TODOLIST",
"pptx" => "https://docs.google.com/presentation/d/XXXXXXXX/edit?usp=sharing|SALES PRESENTATION",
"form" => "https://docs.google.com/forms/d/XXXXXXXX/edit?usp=sharing|FILL THIS FORM",
"generic" => "https://drive.google.com/open?id=XXXXXXXX|VIEW THIS MEMO TODAY");

foreach ($a_urls as $k => $v) {
if (substr($v, 0, 33) == "https://docs.google.com/document/") {
$pos = strpos($v, '|');
echo substr($v, $pos + 1) . " (DOCX)<hr>";
} elseif (substr($v, 0, 37) == "https://docs.google.com/spreadsheets/") {
$pos = strpos($v, '|');
echo substr($v, $pos + 1) . " (XLSX)<hr>";
} elseif (substr($v, 0, 37) == "https://docs.google.com/presentation/") {
$pos = strpos($v, '|');
echo substr($v, $pos + 1) . " (PPTX)<hr>";
} elseif (substr($v, 0, 30) == "https://docs.google.com/forms/") {
$pos = strpos($v, '|');
echo substr($v, $pos + 1) . " (FORM)<hr>";
} elseif (substr($v, 0, 29) == "https://drive.google.com/open") {
$pos = strpos($v, '|');
echo substr($v, $pos + 1) . " (DOCUMENT)<hr>";
} else {
echo $v . "<hr>";
}
}

1 person likes
this idea
+1
Reply
  • Remi (Senior Developer - ActiveInbox) August 29, 2017 11:19
    Hi davidjimenez75.

    I take it from the code snippet you would like us to replace all google drive urls with a fixed text link?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated happy, confident, thankful, excited

  • I’m thankful
    With just translate Google Drive Edit urls to links who open a new tab with the url ( target="_blank") AIB TasksList could improve a lot for me.

    I think "|" is a good char to separate GoogleDriveLink|FilenameUserSeeOnAIB.doc

    Advanced users will use this feature without problem.

    1. Get Edit url from Google Drive
    2. Paste in a new task en AIB
    3. Add a |NameOfTheFile.doc or just add a |Filename without extension

    And now a simple Google Drive link is a shorcut to your files (great feature for AIB)

    ---------------------------------------------------

    Example 1: Document with filename

    https://docs.google.com/document/d/XX... NAME

    link= PROJECT NAME (open in new tab)

    ---------------------------------------------------

    Example 2: Document without filename

    https://docs.google.com/document/d/XX...

    link=Document (open in new tab)

    ---------------------------------------------------

    Example 3: Spreadsheet without filename

    https://docs.google.com/spreadsheets/...

    link=Spreadsheet (open in new tab)

    ---------------------------------------------------

    Sorry for my english O;)

    Adding Font Aweome (XLS, DOC, PPT) icons is a problem?

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated happy, confident, thankful, excited

  • 1
    "https://docs.google.com/document/d/XX... NAME",
    "xlsx" => "https://docs.google.com/spreadsheets/... TODOLIST",
    "pptx" => "https://docs.google.com/presentation/... PRESENTATION",
    "form" => "https://docs.google.com/forms/d/XXXXX... THIS FORM",
    "generic" => "https://drive.google.com/open?id=XXXX... THIS MEMO TODAY");
    foreach ($a_urls as $k => $v) {
    if (substr($v, 0, 33) == "https://docs.google.com/document/") {
    $pos = strpos($v, '|');
    echo substr($v, $pos + 1) . " (DOCX)";
    } elseif (substr($v, 0, 37) == "https://docs.google.com/spreadsheets/") {
    $pos = strpos($v, '|');
    echo substr($v, $pos + 1) . " (XLSX)";
    } elseif (substr($v, 0, 37) == "https://docs.google.com/presentation/") {
    $pos = strpos($v, '|');
    echo substr($v, $pos + 1) . " (PPTX)";
    } elseif (substr($v, 0, 30) == "https://docs.google.com/forms/") {
    $pos = strpos($v, '|');
    echo substr($v, $pos + 1) . " (FORM)";
    } elseif (substr($v, 0, 29) == "https://drive.google.com/open") {
    $pos = strpos($v, '|');
    echo substr($v, $pos + 1) . " (DOCUMENT)";
    } else {
    echo $v . "";
    }
    }
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned kidding, amused, unsure, silly sad, anxious, confused, frustrated happy, confident, thankful, excited