Forum Replies Created

Viewing 6 replies - 31 through 36 (of 36 total)
  • Thread Starter asle

    (@asle)

    Is this cell always the second one? If so make sure the counter is = 1 and then check if the cell contains the data to replace or trigger. You must first replace the symbol “N” in your code to excel. Then you can look for the symbol. E.g. your cell contains “##” where the “N” symbol is now.

    <table class="wp_excel_cms_table wp_excel_cms_table_<?php echo $name; ?>">
    <?php $i = 0; $end=0; // to count and get the first cell
    
    foreach($data as $entry): ?>
     if($i==0){$count = count($entry);} ?>
        <tr>
         <?php if($i==0):  ?>
             foreach ($entry as $cell): ?>
                <th><?php echo $cell; ?></th>
            <?php endforeach;
         	else:
             foreach ($entry as $cell): ?>
                <td><?php
                if($end==1) && strstr($cell,'##')) {
    // then this is the second cell
    // AND it contains string "##"
                echo '<img src="https://domain.com/m_image.gif" alt="" />'; $end=2; }
                else {
                echo $cell;} ?></td>
            <?php endforeach;
         	endif; ?>
        </tr>
        <?php $end = 0; // reset $end
        $i++; // increase counter
    	endforeach; ?>
    
    </table>
    Thread Starter asle

    (@asle)

    Maybe I was not clear with my question. This is not a CSS issue. I want the first cell in each row to be a URL. And skip the header. I changed the code in /wp-content/plugins/wp-excel-cms/public/templates/ to the following that works.

    The excel sheet is displayed as a table. The first cell is a link to a product like https://domain.com/id_number (this id_number is the cells value)

    <table class="wp_excel_cms_table wp_excel_cms_table_<?php echo $name; ?>">
    <?php $i = 0; $end=0; // to count and get the first cell
    ?>
    <?php foreach($data as $entry): ?>
        <?php if($i==0){$count = count($entry);} ?>
        <tr>
         <?php if($i==0):  ?>
             <?php foreach ($entry as $cell): ?>
                <th><?php echo $cell; ?></th>
            <?php endforeach; ?>
         <?php else:
             foreach ($entry as $cell): ?>
                <td><?php
                if($end==0) { // then this is the first cell
                echo '<a href="https://domain.com/'.$cell.'" target="_blank">' .$cell. "</a>" ; $end=1; }
                else {
                echo $cell;} ?></td>
            <?php endforeach; ?>
         <?php endif; ?>
        </tr>
        <?php $end = 0; // reset $end
    ?>
        <?php $i++; ?>
    <?php endforeach; ?>
    </table>

    You have to set up a page with the language related translation. Then you add the page in the Appearance->Menu section. The menu item will look e.g. this for Norwegian and English:
    <!–:NO–>Kontakt oss<!–:–><!–:en–>Contact us<!–:–>

    To translate the “Home” menu choose a “custom” menu. And add this:
    URL: https://your_site.com
    Navigation label: <!–:NO–>Hjem<!–:–><!–:en–>Home<!–:–>

    Sorry for doubleposting but a similar problem I had was to get to the actual code for the search widget. I guess you could edit the same file. See my post below. To get a title to edit on the widget page I guess you would have to do something also with /wp-includes/widgets.php.

    This must be a well hidden secret. Nobody wants to answer, do this and that with CSS, bla,bla. Of course, don′t touch it you just want to style it. Use CSS! But, just show me the code! I want to use a jQuery input box hint: https://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/
    So to really edit the search form structure you find it here:
    /wp-includes/general-template.php
    In WP 2.7 it is in function get_search_form() and edit line 113.
    Hope that saves some time ??

    /asle

    This must be a well hidden secret. Nobody wants to answer, do this and that with CSS, bla,bla. Of course, don′t touch it you just want to style it. Use CSS! But, just show me the code! I want to use a jQuery input box hint: https://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/
    So to really edit the search form structure you find it here:
    /wp-includes/general-template.php

    In WP 2.7 it is in function get_search_form() and edit line 113.
    Hope that saves some time ??

    /asle

    Hi,
    It has been a hard time figuring out this. If you run your own server like I do it was simple. I run Apache in chrooted environment (yes, I was hacked once, never since) so my security was set up very tight. I could not get mod_security to accept the wp header sent from admin-ajax.php so I set up this in mod_security.conf:


    SecRule REQUEST_METHOD “!^(GET|HEAD)$” chain
    SecRule HTTP_Content-Type “!(^application/x-www-form-urlencoded$|^multipart/form-data|^application/x-www-form-urlencoded*;)”

    Now I don’t see how this is a security hole to accept anything after “application/x-www-form-urlencoded” but would be glad for any commennts. At least once again WP 2.3.3 works fine for deleting posts, pages, categories.
    /asle

Viewing 6 replies - 31 through 36 (of 36 total)