Skip to content

Insert ramdom image at random location of article from local machine/HDD

currently we have 2 options to insert a random image into article:

1. by violating international copyright law and using image search or image sites
to insert a random image at a random location inside an article

2. by hard-coding into article at fixed location a random image from own machine

desirable would be to ADD a feature to insert from OWN machine (=local path) a random image at RANDOM location of article instead of hard coding random image path into fixed location of article
Tagged:

Comments

  • SvenSven www.GSA-Online.de
    edited September 2013
    On next version you can use something like:
    [local_images_to_data_url]
    type=image
    result=<img src="%spinfolder_data_url-c:\some\folder\with\images\%" style="max-width:500px;">

    ...in content_search.dat (remove all other engines than).
  • @sven
    that is a great new feature, one small problem left:

    I have fix image sub-folders named by keywords with pictures for different projects / niches
    and the file "content_search" is a global configuration valid for ALL SER projects ...

    How do I define in that "content_search" which sub-folder of images to choose for random images for a particular project or tiers ??
  • SvenSven www.GSA-Online.de
    @hans51 on next version you can sue %search% in the result string which should hold your anchor text or keyword. result="<img src="%spingfolder-c:\images\%search%\%">"
  • edited September 2013
    @sven
    fail to understand your point

    does it mean I have to use desktop search and search for the sub-folder on my HDD containing the pics for a particular photo-category = where the folder-name=keyword for search ??

    or is there a possibility to create/define a variable and create multiple entries

    [local_images_to_data_url]
    type=image
    result=<img src="%spinfolder_data_url-c:\some\folder\with\images\%" style="max-width:500px;">

    = where [local_images_to_data_url] can be assigned a variable to select a particular sub-folder of images matching a particular project / article-topic ??
    like
    [local_images_to_data_url variable1]
    ..
    [local_images_to_data_url variable2]
    ..
    [local_images_to_data_url variable3]
    ..

    and each such definition points to a different relevant image-folder ..
  • SvenSven www.GSA-Online.de
    just use my result string from above. It will look into the sub folder that should look the same as your keyword.
  • edited September 2013
    @sven
    OK
    does folder-name AND image names to  be or to contain keyword in filename or file-name string ??
    or
    only folder-name = keyword ??
    and image name ANY name?
  • SvenSven www.GSA-Online.de
    Just the folder as the spinfolder macro is taking a random file from there.
  • @sven
    does SER take the keyword for image search from keywords defined in project / tiers
    or
    from actual keywords found in article ?
  • SvenSven www.GSA-Online.de
    It takes the %tag% here. That can be the keyword or the anchor text used in the article depending on your project options.
  • tks for clarification
    all OK now
  • edited September 2013
    my content_search.dat contains:
    ;edit this to your needs

    ;this could be used to take a random image from a folder
    [local_images_to_data_url]
    type=image
    result=<img src="%spinfolder_data_url-d:\Dropbox\images\%" width="3{0|1|2|3|4|5|6|7|8|9}{0|1|2|3|4|5|6|7|8|9}" height="2{0|1|2|3|4|5|6|7|8|9}{0|1|2|3|4|5|6|7|8|9}" align="{left|right}">

    I selected to insert up to : 1-2 images in project settings, but max 1 image is inserted. There are also a lot of posts without images even if I selected to insert min1, max2 images. Can you please check?

    In some posts the image is not inserted properly, the html code appear instead of the image:
    http://www.hindufederation.ca/affiliates/try-these-tips-successful-affiliate-marketing
    http://www.tabuladecimal.info/assignatures/sga1/m21/drupal7/en/node/4422

    or the image don't appear at all, instead a white box appear:
    http://www.vype.nl/index.php?do=/blog/23569/simple-tips-and-tricks-for-successful-affiliate-marketing/
  • @Sven Let me know when to start testing again :) I can't use this yet
  • the base64 code as well as html code for links is also appearing in many of my posts on drupal blogs,
    seems to be normal on drupal - NOT all but many.
    in my most recent drupal blog posts there normally is nothing = no pics and no empty space at all

    for myself, I haven't seen a single random image AT ALL on any type or article site since changing new code
    but
    there are very few site-types anyway that allow pics even before when i had pics hardcoded
  • SvenSven www.GSA-Online.de
    Well all the samples above either do not allow the usage of the things or modify it. I have changed things for next update to not use data urls in drupal engine as @hans51 suggested. I think it's more save to not use it when the majority of sites do not allow it.
  • YES that seems the case
    either no images at all on drupal
    or data

    if base64 code published on drupal, then also html code for links

    if NO base64  code published on drupal,  then correct links with anchor
  • That's fine with me!
  • @sven
    here is an example of how drupal garbles a submission with html code and LINKS cut = wrong links or 404

    http://web.asis.mcu.edu.tw/zh-hant/node/22037

    in THIS case no base64 code for images but all HTML img code

    that behavior of cutting LINKS I have seen only on drupal so far, but relatively often (may be half of all articles
  • SvenSven www.GSA-Online.de
    OK this is fixed in upcoming version (without tests though).
  • @Sven I have to manually edit content_search.dat every time you update the software. Is there a way to lock for updates this file?

    I forgot to edit it after your last update and I ended with children pictures in my adult posts!
  • SvenSven www.GSA-Online.de
    Next version will ask you to overwrite it or not.
  • @sven
    testing since available and many drupal included
    so far ALL looks perfect
    clean URL-links many times better than broken links before


  • @Sven You can remove it from the engines below too
    wordpress article
    elgg
  • SvenSven www.GSA-Online.de
    @Ovidius sorry but remove what in those engines?
Sign In or Register to comment.