Title: view images
Last modified: March 27, 2017

---

# view images

 *  [ichavarria](https://wordpress.org/support/users/ichavarria/)
 * (@ichavarria)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/view-images/)
 * Hi, I have created a shortcode to display on a page the results of a particular
   form, it shows everything well except the images that are only seen when I am
   logged in as administrator. What I lack? I attach the code that I have written
   in case you can help me.
    regards
 * function decalogoE_shortcode( $atts, $content = null ) {
 *  $formName = ‘miformulario’;
    $fieldNameWithFile = ‘logo’; $TipoEntidad = ‘tipo’;
   $linea = “”; // conectamos con el plugin CFDB para sacar los datos require_once(
   ABSPATH . ‘wp-content/plugins/contact-form-7-to-database-extension/CF7DBPlugin.
   php’); $plugin = new CF7DBPlugin(); require_once(ABSPATH . ‘wp-content/plugins/
   contact-form-7-to-database-extension/CFDBFormIterator.php’); $exp = new CFDBFormIterator();
   $exp->export($formName, array(‘show’ => ‘entidad,logo’, ‘search’ => $TipoEntidad));
 *  while ($row = $exp->nextRow()) {
    // ponemos la url de la imagen de CFDB $fileUrl
   = $plugin->getFileUrl($row[‘submit_time’], $formName, $fieldNameWithFile); $linea.
   = “ ” . $row[‘entidad’] . “<br />”; } return $linea; } add_shortcode( ‘decalogoE’,‘
   decalogoE_shortcode’ );

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [ichavarria](https://wordpress.org/support/users/ichavarria/)
 * (@ichavarria)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/view-images/#post-8967526)
 * The url that returns is
 * [http://aebam.org/wp-admin/admin-ajax.php?action=cfdb-file&s=1490299641.3958&form=Decalogo+ciudadano&field=logo](http://aebam.org/wp-admin/admin-ajax.php?action=cfdb-file&s=1490299641.3958&form=Decalogo+ciudadano&field=logo)
 * But the image is only visible if I am logged in
    can you help me please?
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/view-images/#post-8971157)
 * I don’t see why you need to write your own shortcode. I think you could get equivalent
   output using [cfdb-html](https://cfdbplugin.com/?page_id=284)
 *     ```
       [cfdb-html form="miformulario" show="entidad,logo" search="tipo" filelinks="img"]
       $logo $entidad <br/>
       [/cfdb-html]
       ```
   
 * Check your [security options](https://cfdbplugin.com/?page_id=625) and set “Can
   See Submission data when using shortcodes” to “Anyone”
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/view-images/#post-8971641)
 * Was an error above. Instead do:
 *     ```
       [cfdb-html form="miformulario" show="entidad,logo" search="tipo" filelinks="img"]
       ${logo} ${entidad} <br/>
       [/cfdb-html]
       ```
   
 *  Thread Starter [ichavarria](https://wordpress.org/support/users/ichavarria/)
 * (@ichavarria)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/view-images/#post-8973028)
 * Thanks Michael, everything was sorted out with security options. Even my code
   works now correctly, I will investigate more with the shortcodes generator. Congratulations
   on your plugin, it’s one of the best I know.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘view images’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/contact-form-7-to-database-extension_ffffff.
   svg)
 * [Contact Form DB](https://wordpress.org/plugins/contact-form-7-to-database-extension/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-to-database-extension/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [ichavarria](https://wordpress.org/support/users/ichavarria/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/view-images/#post-8973028)
 * Status: not resolved