The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question... PHP functions that'll work? - Solved
#1
Lightbulb 
Okay, to combat the numerous relative link issues and at the same time allow immense customization, I put my CSS in php files and included them in my template... but this increases (obviously) the loading time per pay by 140KBs (size of both CSS files collectively).
So.. what would be the best way to have my plugin instead output CSS files from these php files on command? This way styles are used as they are supposed to (in external files that apply to every page) but the customization from the admin cp is possible as well as fixing any relative link issue with the use of
PHP Code:
<?php get_theme_url(); ?>
to make absolute urls.
.... re-reading that... it sounds confusing... what I'm trying to say is I want to built static CSS files from PHP data after variables are set via my plugin options... whats the best way to do this?



And question 2....
I'm trying to figure out how to allow a user to paste their social site links in a text box and parse each line and validate the url. Then parse each line (I'll add html to give it an image whos filename matches the domain) in my template header....
Make sense? This way the user can just paste away and go instead of tediously trying to find the each field which matches their social site (and theme options would get really messy with 100s of fields).


So... any ideas?
Help is much appreciated!
This is all towards working on a major update to my FoundationNation theme for GetSimple.




Edit:
Doing things this way hasn't worked yet:
Code:
<link rel='stylesheet' type='text/css' href='css/style.php' />
And I don't want to change .htaccess to use css files as php.
I just want the php page to output the css file when accessed.
trying some function ideas out to see if I can make this method to work:
http://aquagraphite.com/2011/11/dynamically-generate-static-css-files-using-php/
I was thinking something like this:
PHP Code:
/* This generates our PHP powered CSS files on demand */
function generate_styles_css() {
    global 
$SITEURL;
    global 
$TEMPLATE;
    
$themeurl trim($SITEURL "theme/" $TEMPLATE);
    
$stylefile_style $themeurl '/style.php';
    
$stylefile_app $themeurl '/appstyle.php';
    if(
file_exists($stylefile_style && $stylefile_app)){
        
ob_start(); // Capture all output
        
require($stylefile_style); // Generate CSS for style.php
        
require($stylefile_app); // Generate CSS for appstyle.php
        
$stylescss ob_get_clean(); // Get generated CSS (output buffering)
        
file_put_contents($themeurl 'style.css'$stylescssLOCK_EX); // Save it
    
}

is there a better way?
Reply


Messages In This Thread
Question... PHP functions that'll work? - Solved - by WebDevandPhoto - 2013-02-24, 17:11:31



Users browsing this thread: 4 Guest(s)