|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////' N E$ t% k5 C' S5 \
// Theme Option
7 f! W" Y/ G( h. {4 z6 t8 m9 c////////////////////////////////////////////////////////////////////////////////: J* D( l' O- z# V, l
3 p; v( E" L& @( n: |! N# `
$themename = "Zenx";3 [9 O/ V2 Q% ]+ B. F
$shortname = str_replace(' ', '_', strtolower($themename));/ i+ @; \8 h9 K" @
3 \' |8 i; X0 T9 \% h: P5 n4 q
function get_theme_option($option)
/ P( J* u; q+ S3 Z. ?. T5 I{
% |2 ?+ M4 ]1 o- t8 X' }# O global $shortname;
# ~0 R4 I& L1 `, K return stripslashes(get_option($shortname . '_' . $option));
) u9 ]& Q; F- M$ \/ t6 {}
1 V& n h+ s! k! u
1 J- t }& Y$ D6 [function get_theme_settings($option)
V* y% k% k3 T1 u& z( @{
9 v& y& A3 w% n# _) z return stripslashes(get_option($option));
8 a0 I/ C$ u& W1 ]" Y0 O0 v}1 I" g9 \ H! o+ m' v
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");
4 Y3 y, g9 X, g# u% D }& o0 V$wp_getcat = array();
6 W. Q' [7 N' M. B/ O4 |# Yforeach ($wp_dropdown_rd_admin as $category_list) {
4 j5 g3 ]9 d9 n" U+ T* _$wp_getcat[$category_list->term_id] = $category_list->name;
4 n/ b B3 C2 Q8 i6 `! ^}$ G- o3 R1 q: U- T+ o
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");, p& N: v, t& e; H1 u x6 E
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");: ^0 M2 R# U. Z# J0 k/ x
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");' I9 v; Y7 w; f3 p4 h" F/ J: ~* u$ V
0 [; |/ l( P- G$options = array (
7 x5 P% } R$ j7 Q
7 T* f0 @- t, O/ t e* ?! N: L4 ~6 l6 @& Q D
array( "name" => "Blog Header Settings",( S/ A$ B' K/ H+ P1 P
"type" => "heading",9 e o2 Z3 E/ e( F
),
5 X) h9 T% F7 W! a* A# {/ N5 o) g( d4 `7 j# y' Y
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",/ H( r5 J# s, @3 }
"id" => $shortname."_header_logo_activate",
6 u/ S7 \! D6 j8 O4 c "type" => "select",7 a" _7 t4 q2 u
"std" => "No",- k/ l5 `! d$ o
"options" => array("No", "Yes")),5 G, M6 x3 d5 W. J1 D/ c: B
/ N: u: h: R n6 J array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
! h7 C5 g) v4 k2 k5 \" O "id" => $shortname."_logo_url",
# e8 u: y! ?6 T3 O "type" => "text",9 H S$ c: m# N/ O& f
"box" => "social",
, F! H$ Q5 b9 h* B% W "std" => "",
+ M& H: _( Z- X% ^3 h/ H7 ] ),/ S5 F$ i( T6 V. I; Y/ R8 }
7 S2 [) B) i0 }. h4 w array( "name" => "Insert Header Banner HTML Code (Header)
- H! C0 J6 x& A& e <br /><em>*Recommended Size 468 x 60</em>
7 I; y5 I* D$ T5 b; P9 n* O4 [ <br /><em>*leave blank if not use</em>",+ X; U8 |. N8 k4 ~+ E- z( g: p+ l1 A
"id" => $shortname."_header_banner",( Y+ J% a& S+ f1 }
"type" => "textarea",
- K% b. R7 z# D3 C1 K "std" => "",
9 n" r& C, @9 l ),4 E i7 j4 W4 @" }
5 ~+ b6 Q7 E' t* Q+ d
array( "name" => "</div></div>",
0 j$ Q B, ?) X/ ^ "type" => "close",
: p) i& h. J5 D0 a4 d ),
. @# _2 K/ ~1 D) g$ G) l' y: \
: t A1 b3 j: T" l* T$ l! _
" {- F+ X( ~ b% `2 W6 {" ~ array( "name" => "Header Navigation Settings",$ J* N: Z$ ?# p$ V8 E/ ~
"type" => "heading",5 K9 E$ ]8 [& s0 v
),
2 U/ `" T5 C' P+ H; B N
) _3 [% F$ ]7 Y array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
: m- O" a( S" r3 p5 n6 t- B <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
$ L9 R6 C) @) M <em>*Enter the page post ID number only</em><br />
" G5 G' [( L6 Q' W7 M4 u! p' p <em>*separate by comma</em><br />$ n# |% x. y! ?. Y, D
<em>*Exclude pages which you don't want to show on the header navigation</em>",* |( H, l$ E7 T8 n1 a
"id" => $shortname."_header_page_navigation",8 Y2 F. E- M4 d( H
"type" => "text",
( s: _$ A8 c+ N1 F5 G "std" => "",. h% W x7 i$ C: |" v
),, P% Y) g7 W: _+ X% e
- [+ v6 k& \$ J& {, Z l0 _' ^
array( "name" => "</div></div>",
( g9 b; w) ~% G) W9 V "type" => "close",& l. m% g" n1 t8 T( n+ ^5 s2 i
),
3 s8 [" j2 t& t% S
* ~% h+ }6 r: _4 W) I, o7 A. }$ U# [; r7 u% U8 Q
array( "name" => "Post Auto Thumbnails Settings",
' V$ u0 N& }8 o, ?4 Y& b+ n "type" => "heading",
! k# k. U) R+ S5 _: O, E ),0 P4 x. S) V$ z3 F* A( I
6 n7 B; j5 y/ g% f/ n array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
/ \' {/ O {: Y$ h N. p9 x3 `$ u "id" => $shortname."_timthumb_activate",
4 Z. X& u) b2 y/ O$ C8 w! p0 |; } "type" => "select",4 D' {4 a3 e/ `5 c9 {0 ^$ O. G
"std" => "No",
- p' ^5 |6 [: O* V "options" => array("No", "Yes")),2 h5 X2 r" l9 G% R: X
5 U, J( }% |' L6 x9 D array( "name" => "If Timthumb is enabled, Please choose its cropping method",
7 U* p) r7 a: E6 g6 ` "id" => $shortname."_timthumb_cropping",
H4 D% K7 O1 r- m& N% i$ x( s2 x/ `; | "type" => "select",3 R( \9 k$ A/ y
"std" => "",4 z9 U; H4 C: U
"options" => $crop_position),& I1 z6 O- e) Z+ O i8 K- V
) |& H6 i( z" F) Z) h array( "name" => "Insert Width Of Thumbnail Image<br />6 F5 `' w8 _: W e( Y8 u
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
# K& E! \/ Y9 J H: o! g <em>*Leave Blank To Use Default: 250</em><br />",1 y& O' @) w: M/ C( K% n" [& A
"id" => $shortname."_thumb_width",: t5 Z8 @5 h- N7 V8 j
"type" => "text",
) E( {" I7 M6 U "std" => "",
4 ?3 W8 L; T) T! s& I3 ~+ l ),1 F( P# c$ n( V) U4 P# P# _) ^% K6 i
# E* Y* ~+ k, D# V% D1 p! ~5 I array( "name" => "Insert Height Of Thumbnail Image<br />
- u7 f, {( a. k <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
& ]/ e' s, @1 v; [ <em>*Leave Blank To Use Default: 200</em><br />",
% u* h* O L# \. L$ R5 V "id" => $shortname."_thumb_height",2 w) M% V5 B; W6 }. T
"type" => "text",: e( D2 x9 X [9 ?
"std" => "",
. G7 }5 ~- r- s7 B ),* }9 d B; h) Q; r3 I
) K) C5 h. t; w2 y% Q0 z+ [% K l
array( "name" => "</div></div>",, d1 a& R+ j3 z3 O' |# B6 O* W: U3 m
"type" => "close",
& ~: E/ _ M6 X0 P' f* @. X ),; W s, N% j1 a' h
8 A2 f, X$ U1 r6 f
array( "name" => "Featured Content Slider Settings",. z. B) Q* I9 p, N
"type" => "heading",+ ?9 I3 u* k; n
),$ g+ C0 ?% q# o% ^5 O5 U
% D6 ^) f+ R& @# s" R
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% v2 g8 [- Z( g, b0 w1 t" o; w "id" => $shortname."_featured_activate",1 d0 J3 L5 q, q! c4 |7 {6 ]
"type" => "select",
5 P& {% v9 A1 `) D2 ?; E8 o. u "std" => "No",8 i' E- X. E, S4 c( _" l
"options" => array("No", "Yes")),
! G4 H0 l1 m% Z& F* D
* X$ T* [6 H6 Y( n8 j, R2 ^# m1 D1 m& w( Q" m. F& k8 O/ r
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",& r9 Q& k8 g9 K. C4 J D, C- Q; L
"id" => $shortname."_featured_category",( L L( m% _- f& k
"type" => "select",
& o' l- v5 ]! ^5 z# A* t "std" => "Choose a category:",
" ]. y" v4 S5 N" l' l3 D9 U: F "options" => $wp_getcat),: b$ a) X& e n4 \5 [1 Y
9 A' X9 W' Z5 ~9 l `
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
$ G/ x8 V% `+ v "id" => $shortname."_featured_number",* j5 Z8 ]5 s p5 B
"type" => "select",; e1 g# r. C- ^) H# S8 K3 _' ~
"std" => "Number of post:",
: f; \* e- @# g, u- | "options" => $number_entries),
: e. [6 S% c' ^- J$ B) H; H6 ?$ J5 n
array( "name" => "</div></div>",
- K' |0 z0 T Y! w "type" => "close",
6 e! U: ^/ s$ x' Y$ c( W) }9 G ),) n+ _9 y& O1 Q" {% B
( I4 o/ y: D& `7 J; p) N' s4 S- P array( "name" => "Featured Category Settings",1 F" `* |0 |- O. Y
"type" => "heading",
% F: Q' C& E7 T& ` [! b- ~ ),/ J& q* y) c: f; {1 D
+ @# e3 E: p, N6 v y* W& J
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",: o" _" I" T7 \0 F: w* n
"id" => $shortname."_featured_category_activate",
- ~2 a$ |- T: W1 Y9 i "type" => "select",' u g" |$ q. [1 g
"std" => "No",
; m- c7 K# f! P& `* U" n "options" => array("No", "Yes")),
9 M0 M' j, b2 t6 {& B
! x2 b2 {# ?* {# ] array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",- C' @7 `* i3 }# I# g( x: [$ j
"id" => $shortname."_featured_category_id1",% `0 P8 k* M6 q
"type" => "select",
/ T* z5 e# `9 e7 Y0 d4 j7 f' Q "std" => "Choose a category:"," |. E, Y! X# R" b$ [7 B% H
"options" => $wp_getcat),
1 Z9 A1 c% Q8 v / Q1 W. f% y/ @+ R( n1 E- Q4 w
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
8 Q' F |( f& Z& e& t "id" => $shortname."_featured_number1",
6 k, |! B& K( T "type" => "select",; ^' A% N9 D, x1 l
"std" => "Number of post:",
: }2 i. n' C1 R6 V" e "options" => $number_entries),( {0 q6 V( S3 V/ a. J
% Q/ p: p5 ]5 H' I
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
, |' d/ ~. X2 ^$ f2 ~ "id" => $shortname."_featured_category_id2",
6 }, g! k* T# V& x: e* O2 L2 D "type" => "select",
Y8 ^1 {0 M# N! x "std" => "Choose a category:",
6 ^0 W# d' Y1 Q) ?" { "options" => $wp_getcat),
; c/ W, q9 ?2 ~ - ~* k/ b3 Y4 I
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
/ t" T0 O! E, b3 ^6 b" e "id" => $shortname."_featured_number2",
4 b8 w5 J8 V" k/ k l4 G! M "type" => "select",
% v/ p d. s- J5 T. ^ "std" => "Number of post:",* Q1 x) S- S5 ?6 s
"options" => $number_entries),
5 u4 [) r8 d, S6 k9 ]" D G+ {
3 |2 }. ?& C8 g" F7 b5 l) Q6 W2 y) T / E$ G, N* R( e; i+ U# V. D0 {, f
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",9 f1 m! u5 W# c# O
"id" => $shortname."_featured_category_id3",# d2 J, e8 E/ v1 F1 z/ d
"type" => "select",; u% v2 x9 D6 H5 `' F- F: W
"std" => "Choose a category:",
9 O* J/ ?! L" _! O "options" => $wp_getcat),$ y5 \ M/ ?( K& D
0 s! C$ g6 ^9 \3 O
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",* h; D4 Z/ A6 Z! S, Y, r
"id" => $shortname."_featured_number3",; M) `8 ^! j3 e& K7 U7 W; t* f
"type" => "select",
: v! _6 ]2 R5 n% I2 D) N: O "std" => "Number of post:",: H Z+ W4 [1 M: w
"options" => $number_entries),
" L! n8 C" q, r. i1 f9 h
3 r6 j, h& m0 e+ w, N
( J3 a {. K. U& u/ P array( "name" => "</div></div>",( |& |+ M# s, h
"type" => "close",
' @5 x$ P3 i: n ),
5 e! j3 l( c) `4 ~$ V/ k1 a6 o0 X0 q- Y9 b
; g8 p' I7 l0 a6 Z. b array( "name" => "Google Adsense & Analytics Settings",3 Y3 ^6 w% N9 i# ]6 c) Q1 h- d
"type" => "heading",2 M( y1 l7 d" L1 b) L) @% J
),( T" r# p6 [/ |/ ]; e7 u. d
! N& H) I2 v# D% K
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",: H# G: B% L: A+ ^, H( e: a+ F1 [
"id" => $shortname."_adsense_loop_activate",1 S3 Z! J5 Y) n4 @
"type" => "select",
: ^. Z+ R! V! @# E8 a "std" => "Disable",
3 L# p' u. p5 L% o0 y "options" => array("Disable", "Enable")),
+ S+ \6 Q: _' C9 j& r7 |0 n* W! p/ A$ `$ h5 c* z8 A- T
array( "name" => "Insert Google Adsense Code For Loops Here<br />
0 U" o* w$ r; t) } <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
^# P$ `) X3 Z+ v- r* a "id" => $shortname."_adsense_loop",+ X) `: O7 }$ k+ l* W- J
"type" => "textarea",
8 Z6 o8 s' S: z/ e8 \7 p* }& _/ f6 C "std" => "",
l5 f3 j# n) m3 U4 I) d ),8 i: ?! B7 Q2 p: q. Z
# t1 ~) q( `/ X1 {3 f array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
. N" L' V, `, M "id" => $shortname."_adsense_single_activate",( [8 O& x8 _% S, U# J, ?
"type" => "select",
! ^" N0 H: T& J5 @, E "std" => "Disable",) o) v: F! e1 S$ x; H+ F! @1 U
"options" => array("Disable", "Enable")),3 n5 H' V; ?/ v4 P$ r7 p
8 _0 H1 k {+ q0 ^
array( "name" => "Insert Google Adsense Code For Single Page Here<br />4 A) s" P+ a" p5 c8 S( v5 a( s
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
* {9 [8 ^9 z& L# Y2 M: Y5 E "id" => $shortname."_adsense_single",
9 l& u8 s) J. J* `; Z" ^ "type" => "textarea",
5 I* a) {4 O2 ]1 K "std" => "",
' S% F/ k# Z) I( I. _3 B" V ),
$ l, g, P1 ^; w3 v, L7 ~) }, I0 j. c7 g6 a3 G* f3 N8 ~2 ^: i3 E
( u; _ Y- m7 d+ K/ a/ H/ y+ X array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
( v/ c; V1 ^, x5 m$ x8 r "id" => $shortname."_google_analytics",% U& m, o7 j( H7 g5 c
"type" => "textarea",0 E# j, o: e2 P7 x
"std" => "",
8 R% f' i6 n# ?8 i6 O" f ),7 x4 C4 T7 H( i8 N' ]. A
- \+ O, e8 ]7 q array( "name" => "</div></div>"," F- g; _5 Y) R$ M
"type" => "close",
/ Y" a* P @! ^" V# P7 p ),# s) F, h2 G' d
9 {/ _. S; i3 m) x/ H7 u, K$ X
; G- d$ R( m0 [0 q, l& n
array( "name" => "AddThis Social Bookmarking Settings",. j0 r+ i& r; E1 J) M! h+ m/ ]' i
"type" => "heading",8 w% B" F8 Y( p+ Z9 ^) h
),
7 E0 ]$ W1 W* S/ M; G @/ p! q7 z( Y5 r1 M1 L* K8 I- U
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>1 [% }1 @* ?1 M4 ~% S3 |
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",: ~1 H6 R& N9 |2 Q
"id" => $shortname."_addthis",2 {1 l; @1 b. l, M; w
"type" => "text",
6 J. U0 ~( S$ Y) e "box" => "social",
' V( k; s6 @2 Z "std" => "",+ h& g- A+ U8 w, Q( B& N
),
0 o, u. v3 J5 c! {2 y
5 D/ ^1 \, ^! l- b" w( \. m array( "name" => "</div></div>",
+ J0 I, B) Z) e# `5 U3 K "type" => "close",. N. @. C5 S& J+ p- ?
),& o0 Y) p' j: l; I2 N
7 B% L: I# n% [# y9 a. o) e+ q
# D5 t4 _! z% V$ N+ s- L
9 t5 q! O0 F8 s3 w# }8 a
array( "name" => "YouTube Video Settings",# X. I# v2 J C M( r
"type" => "heading",
% }7 b( y$ s: C% P& U ),
3 \( I+ b" _; v8 U5 p
* G, g$ x6 C- b! {8 D array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
2 N I" D/ W& X+ d$ t3 m "id" => $shortname."_emvideo_activate",+ q' h8 q* l- T: {! T! x" ]
"type" => "select",
/ U& e$ K# {! n "std" => "No",, w/ ~6 ^4 K$ w1 H
"options" => array("No", "Yes")),) E9 M/ b( Q$ m5 \: V3 v
/ I# c% |' m# K
array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",
; U7 Z$ s( z# T; D; T "id" => $shortname."_emvideo",1 a3 l9 [3 Y* ]; M1 m
"std" => "",
: _7 C0 p3 L0 F1 }1 y5 ~! @ "type" => "text"),8 G9 g: X: A/ s% E8 |4 x9 d
! I! y4 v. l) M* }
array( "name" => "</div></div>",) V; n: O- C9 I7 W8 b( X. a
"type" => "close",: r. T t k4 B |: p6 J
),, Q, I4 L. T0 _ f) M+ P+ a
/ N2 e- w1 W5 L% ~+ I7 P
array( "name" => "Twitter Settings",
7 F. q) G v. D% V, a! \7 ] "type" => "heading",
7 v& @! q4 d7 m' s" n, @0 K5 v' S) ?0 | ),
" K- D2 ?0 V/ @+ k7 C# w) I4 O- n# \! D ]6 N, U% z
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",8 l r, V9 w4 H
"id" => $shortname."_twitter_activate",
6 S1 J1 Y7 I9 ^& l, b "type" => "select",# d) W* H: ^ l" P' q2 @8 M
"std" => "No",
- M M. E- W' k) K/ v9 X' g7 v5 B "options" => array("No", "Yes")),
" _, w z+ \5 g. K' \, h7 d/ U( v+ L2 A l- Z$ U
array( "name" => "Insert Your Twitter ID here$ d+ d6 u" i2 B* Y
<br /><em>*leave blank if not necessary</em>- ?4 p3 I- x. |! e3 u
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",2 c& q3 _; w5 r4 v' M
"id" => $shortname."_twitter",0 b# m9 p* C& I. h) C
"type" => "text",
' w8 _4 q% p, o! A: c5 B- Y "box" => "social",
9 P, P* P2 [4 J) o, i "std" => "",9 ^9 V4 d, j: c! x- s1 u8 f4 r
),+ C& J. E% d8 O) v/ l) p4 O
. n0 @, u& |" H* C4 L) h
array( "name" => "Enter Twitter Feed Count here/ \( N& N+ g M: u( N/ n: `+ ~
<br /><em>*leave blank if not necessary</em>: ~' p, f9 l7 {) b
<br /><em>*Enter How Many Twitter Feed To Display</em>",
& m- v2 K" P5 `# E( Y6 z2 N "id" => $shortname."_twitter_count",4 h K# P& N0 F6 ^% O
"type" => "text",
) u; S- r4 N u) U "box" => "social",
8 p5 u+ r1 i9 s" q4 c7 N0 U- F "std" => "",: I, S4 C2 U, ~& k) Z3 n# e/ r/ K: W
),
: h( M0 @: s- [
9 q3 H& ^. e" u+ w& T. s. M- n array( "name" => "</div></div>",
8 W( z2 {0 G# x1 ^5 N "type" => "close",
8 L' b8 `! W. P1 i, n ),
Z+ i% ?3 o4 g: w
# a) r: K e, Q% n* W, E! R, ~
: m2 ]& K5 H! c6 p, J3 J array( "name" => "125 x 125 Banners Advertisement Settings",) x; a; T- X/ `
"type" => "heading",
9 @5 e9 c" U1 \4 B( t2 h. P" w ),
' P J) T" l a8 g: t; p 3 j7 `5 X; ], J; ?' d
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% O/ K! A! Y& S8 B "id" => $shortname."_sponsor_activate",
( t- }" e9 o" `/ m5 p4 m5 ] "type" => "select",' l# k" p8 L- i1 [6 P8 k
"std" => "No",
# ]( N* [& H8 E& r# v& \ "options" => array("No", "Yes")),% K: e4 T: V+ C6 z
, @' n% m3 {4 o$ S2 C% i' E4 B0 h1 X* o) m( ?* d- J. N) w% w& K' K
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
3 X r: e; @$ M B8 k1 B "id" => $shortname."_sponsor_banner_one",
) s# M& r+ b5 x: o( p- m j9 e4 A "type" => "textarea",+ O `1 }/ e% |! ]
"std" => "",! r% J, l, u2 r/ F$ ^9 Q
),
" h7 K; Q2 N; {) F; U; u4 C& m1 V" r
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
9 h. e' n% a) ?, y; S8 V4 J/ v "id" => $shortname."_sponsor_banner_two",4 v# ~6 l! V7 a! D: ?
"type" => "textarea",
+ i) j' D. W" N1 _! E8 C8 X; }$ \' z "std" => "",
# p+ S$ f/ A% F) ^9 M ),
2 a& ^( w& [- o) Y1 @; Z( q
9 @4 Q6 j0 c G) a/ l: t* a; H array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",+ p* `* D, x R! z% v
"id" => $shortname."_sponsor_banner_three",
3 I5 b7 y# ~: Y$ P "type" => "textarea",' ?( {8 o$ k7 c& A7 q( O
"std" => "",4 G- R/ T5 i; j- V( m
),6 \/ [. p) v9 _: L& N
) f$ r, s" R; L+ w
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
, h2 ?, H# X1 e& m "id" => $shortname."_sponsor_banner_four",
8 ?. }" r! Y( ? "type" => "textarea",; _- h( v" W& T, f* S
"std" => "",
- a$ k- d& \9 |) r& J1 b" u5 v ),
7 C# }# i. r+ p! ]; q9 S2 @* X& ]( U: ~3 l2 \8 h, `& C0 X
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",& I4 G5 z5 S/ X4 U9 Y3 B0 ^& F5 ?
"id" => $shortname."_sponsor_banner_five"," ^" L' A: u/ [2 a6 ~7 }
"type" => "textarea",6 r" X2 E" ]' `. p4 Y( ~! ~( i
"std" => "",
5 O+ e$ q' q7 c: n) T* r+ D ),9 P* c4 y3 Z8 d! z' g$ [. C2 J
% X9 m7 Y* p, S, @( u8 a& ]+ W! L array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",- C# N- U( O2 y9 G1 E3 T n& R! R% h! j
"id" => $shortname."_sponsor_banner_six",
, s7 A. j( N$ H6 r/ N6 N6 [3 C "type" => "textarea"," e# D+ O2 |" O+ n" {
"std" => "",
+ Y$ ]) S- i& c) \# P: h ),
9 d8 z$ y/ v' @" Z. }' l/ y' ]0 ]
array( "name" => "</div></div>",
1 f1 r" Y7 `: V1 ], {5 c "type" => "close",5 d; T) h5 Z( N7 T3 m" L
),
6 s5 _; I( v5 @# a$ ]3 ?- \+ B: Y8 j9 m
8 Z+ {' ?& V( A6 g
( H! `% Y" C& E/ X);
$ r, z$ F' Z- {* Y* w7 u
6 ]) ^, v. E9 Cfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {- N( R4 m7 {5 d
) a" ]4 D, w4 X" a5 M9 X
echo "<div id=\"admin-options\"> ";$ E6 {" Y1 P" y. f. }+ S
; i. ]3 M2 O# o' @# X: o
global $themename, $shortname, $options;
5 V. h% W6 y" d; c% D) yif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';4 U8 \) ~- Y3 H. l
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
1 N3 ]6 U3 N3 v6 v. r0 b?>
( U5 w6 ~/ f7 W/ l) K) ?7 W4 Q, S% }0 r0 S& k: ^0 {' b- ^, k
<h4><?php echo "$themename"; ?> Theme Options</h4>
& |: I' T: H5 r0 y2 p/ ?2 P3 J' |) Z7 B7 G6 Q3 r( r
<div class="annouce">
0 Z* i' F" P L' n<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>8 ~9 H; d6 N* G' ^8 Z
<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>
7 l) s7 z$ J- v8 @; q+ K; p3 `</div>
* N$ i, H; \8 n- y/ I- u4 {/ b! p c7 a- P
<form action="" method="post">8 P9 O! N2 o1 p9 y2 Q
& C2 y% E- q+ ]! s$ J; V4 p5 ^
<?php foreach ($options as $value) { ?>
+ E$ j" i6 @3 `
& I( K% Y3 y: j2 h8 F<?php switch ( $value['type'] ) { case 'heading': ?>9 y7 Y+ [: ^* f! e9 y5 [, H1 w- S
/ K2 Q6 ^5 u5 k( z V. f
<div class="get-option">
( o' @5 ^* N8 ~' G7 D" C( U, O, ^' h( q% M0 \" ~+ c
<h2><?php echo $value['name']; ?></h2>
, k& c2 j% H4 y' z0 v" [7 s( |/ v r! g P4 j3 e5 t/ Z
<div class="option-save">" _$ d6 w1 s5 ]" Q. A
) F2 N2 C' @0 h7 ]6 t5 V<?php: b5 M& z2 f7 Y0 E
break;
" o: S7 C- W9 K* x3 Kcase 'text':+ p: p2 s% E, p0 Z# _3 `
?>
" q) |0 E {& o( O" C" _% A4 t3 Q: ?5 J& m& q8 g
<div class="description"><?php echo $value['name']; ?></div>* k8 U8 n6 [. X+ i: X
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (' c' m7 [" y1 G" |) n
+ M z" f5 v- {get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
. p( a/ J/ q1 a$ U, x% T4 @6 Q
( o/ o5 F/ _' ?, m* P- Q& o$ a<?php) I1 O" [& z* S, Q9 x
break;" U2 i1 t3 ^, M7 T) p
case 'select':
" C* b" D% B* E: m5 }?>4 L4 O1 P; i, t- |( I! x
( E; ]! x1 l. e5 E' z/ P. Q4 d: c<div class="description"><?php echo $value['name']; ?></div>
, s/ N9 c% Q) x k" p<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">2 K$ U" P- v6 w, r! L4 y v
<?php foreach ($value['options'] as $option) { ?>( E( i% D1 i4 y- `8 n x
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>' t- g- e, d; I. ~$ r5 s. A6 Q$ ~
<?php } ?>
$ n, e. K, z0 R; t+ X) |' J; D</select>, s) c. x7 ?; n" j, X5 J& M
</p>
2 Z6 c" T1 s; u' d. b4 R8 e1 m+ i5 Q) y9 x9 M& j9 g d
<?php& r8 S1 B6 a. c4 b' @
break;
( B! E" i1 W+ x3 |case 'textarea':
P8 K! D7 Y/ ^" [$valuex = $value['id'];
7 A0 J1 I8 N! b9 {# X1 R$valuey = stripslashes($valuex);
$ \' L8 ?" d- K0 @* f$video_code = get_settings($valuey);
: [# ?9 D( E# i5 Q3 D# {5 m?>
: j2 `3 c- P5 }* B% A) i9 ?% e
: T7 P7 t8 W/ h! J( N<div class="description"><?php echo $value['name']; ?></div>
( e1 w$ Z/ I; x8 |<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }5 m2 Q6 R( z6 q3 G
4 [& _% k1 j# ?- w8 h
else { echo $value['std']; } ?></textarea></p>
. J! V# V7 E1 j9 l, t% Z8 n/ E" b
' O6 H( \! X2 q! e( F. |<?php3 ~1 [. T- Q7 x2 f& t
break;6 d/ |3 S% O5 e/ `8 L! D
case 'close':6 L9 W! F$ k. _+ E+ W# q9 R
?>
5 D6 g" Q- z- Z( K r
- y B' Z4 {+ u2 W<div class="clearfix"></div>
# z5 i7 R3 J% m' E0 @</div><!-- OPTION SAVE END -->) ]) A- {, ]# e: E: l- v
2 C9 ~' R; c1 N' W$ [: e<div class="clearfix"></div>
0 X1 o9 v. B; J& [6 N& z! l</div><!-- GET OPTION END -->
0 F' I6 ?% p/ a
. d) _4 Q& G0 h2 v) a, P* s) v<?php
) d W9 k; {$ P% l7 Jbreak;& g+ V( d8 e j! h+ V% H5 b7 {; H
default;
( A% D7 J z& v?>
5 ~7 N$ N. E% M. s
- x. g) m5 i. Q0 O
/ k$ h2 K9 u/ o7 a' V<?php; `5 p" P# r; e7 h) J0 a0 Y5 s
break; } ?>
4 e3 I! ^$ ?) i' n- S- S
& M4 F U; S" C5 d6 ^7 V3 `5 J<?php } ?>
* B4 q5 J$ m& { B0 j$ v5 z$ `) w. n9 b+ ^9 \0 X; n
<p class="save-p">7 e7 |) u9 H3 }6 V' i
<input name="save" type="submit" class="sbutton" value="Save Options" />
0 X3 L: m, I" v7 L<input type="hidden" name="action" value="save" />% [8 ~% S, y4 l( g! N. z$ K
</p> I; m( |7 [( n9 ~
</form>4 W- A. R& W9 `/ ? a. J" | f
# W z# G Z" `<form method="post">" V' E2 `/ V. n6 b& t
<p class="save-p">' y2 W- I7 U/ Y7 P: F4 S; }6 b
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
/ g# d) s/ T* n7 D5 _9 L<input type="hidden" name="action" value="reset" />$ H6 V; ^9 k! H
</p>
! r5 y2 H T6 ^! J1 T/ W</form>! |1 W5 n* j7 A
, F" F% f& u L* V2 o8 [2 C* j</div><!-- ADMIN OPTIONS END -->
! r( Y( `8 i1 J! S3 n; |! J- l- c1 X
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }5 h1 ?8 B; r7 @9 d$ ?
7 _) _4 }- A" d2 e4 p! c% q. Pfunction mytheme_admin_register() {& c; c% C* p' l. h) O
global $themename, $shortname, $options;; N0 A& y' _6 W9 p) i
if ( $_GET['page'] == basename(__FILE__) ) {
% s% P$ f, m2 J5 H2 @if ( 'save' == $_REQUEST['action'] ) {! S/ u4 W9 D9 F6 t+ e1 o
foreach ($options as $value) {
: r1 l: l% ~+ t. q f" T b8 n6 ]2 \& Uupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
( E# E* T* l( Eforeach ($options as $value) {, R$ j/ m% w" x* \# ` }
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
9 ~6 Q3 g c, p+ uheader("Location: themes.php?page=functions.php&saved=true");+ X% I! q2 {+ y* i; T1 m4 u
die;3 h9 p5 x7 ]6 ?! _0 ~: \
} else if( 'reset' == $_REQUEST['action'] ) {* ]+ V& _& P4 U: Q q
foreach ($options as $value) {
+ K7 d6 h( @1 _9 n+ U2 Cdelete_option( $value['id'] ); }0 z: h% Q7 e: Y5 `4 q
header("Location: themes.php?page=functions.php&reset=true");, f, [( F* m% c
die;1 R4 v! \' ^- [% p6 W1 u" E
}
! G0 j% e4 l5 ~}3 ^& f, u/ E, f5 Y$ F N# C# m
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
% x4 G. n7 A6 [' r} _% R' C0 H1 R3 U( N
# }* r, i" G, p; N* l: ]function mytheme_admin_head() { ?>
7 H; {9 P1 D$ S3 X t; n2 s$ u<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />" J+ _2 z* T- o& m. h
<?php }4 ^; n8 ~7 X3 ~% T
|
|