|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
//////////////////////////////////////////////////////////////////////////////// m5 y6 a0 Z7 e
// Theme Option
( ~* z! S% O! T) y# t) R////////////////////////////////////////////////////////////////////////////////" p$ S5 D1 C2 I( `! O
* I( D& @! ^5 y0 r$ u. W y
$themename = "Zenx";" p$ Z, k2 Q& _# j
$shortname = str_replace(' ', '_', strtolower($themename));
) p- n/ @7 V3 r
, M* k* `7 ?' t; q5 `/ Mfunction get_theme_option($option)
( _1 ]' `1 ^; d% C, U{5 Q4 Q( a% c g7 y/ |7 W2 A
global $shortname;
# R3 r$ i3 U) k: T return stripslashes(get_option($shortname . '_' . $option));2 G) A( ~6 G+ G# F
}1 K5 X0 T, u) H- ~+ B7 S1 a! _/ x, X7 l
; c' U3 `% O [/ W6 F' T& S
function get_theme_settings($option)! A* n, h0 e0 ^5 Z n9 f6 {' ~
{, f5 F/ m5 W6 R. k! ?" U
return stripslashes(get_option($option));5 ~4 b) T) [, H( m* A
}! z$ Y# j& _" W' w
$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");
/ X- f, C) w$ B0 n& S$ r$wp_getcat = array();
+ I) S0 _; e3 S# O! |4 Wforeach ($wp_dropdown_rd_admin as $category_list) {
. l ^$ L5 w. ^# P& E9 x7 E1 H: C% X$wp_getcat[$category_list->term_id] = $category_list->name;
; R/ ?) R: x4 d- k! ~}
, i, |' k+ d2 f) _$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
! x; F r7 {( }8 x5 r' }$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
: \; B* Q ~& v% H3 i* { E$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");( v3 M) B8 m/ H( x7 t. k( ~
" G* ]" z4 k( ^+ @. g0 ^+ ?
$options = array (
7 D% a4 L' Q% b- [1 t( P2 ^7 s+ C2 ~0 S- u
% p, b* R4 _, S6 b
array( "name" => "Blog Header Settings",4 g* W9 T/ q: n5 P8 Y$ w) A
"type" => "heading",
- d. J R! F" A3 \7 i2 v+ s ),
( t9 n L: @2 ^$ i7 r5 i; [' b; ~$ \) ]1 Y/ i* \2 S
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
3 ?* B4 b2 p$ O "id" => $shortname."_header_logo_activate",
( T! `% P5 a( V5 r$ V& M# u "type" => "select",
4 O& @$ D# e6 f0 A "std" => "No",
" c! K! Z J3 |. A. V- L I "options" => array("No", "Yes")),
; w& [, W6 q, {! x k2 T, U d
* w4 x; c, A4 V2 S0 j' g array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",: Y# `# g7 m% u8 E
"id" => $shortname."_logo_url",4 |- S( c8 K9 X" L& {
"type" => "text",
* K& n0 |# C1 }: q "box" => "social",
3 ^1 X2 u$ K) K' W4 ^ "std" => "",
& P8 d4 t4 d7 A9 k1 x; T d; z ), A4 U; P9 n8 U7 h( s+ H2 k
" k2 P, b4 D6 t9 U5 Z array( "name" => "Insert Header Banner HTML Code (Header); r1 L$ Z L( U
<br /><em>*Recommended Size 468 x 60</em>
1 x. K2 X8 w6 G8 z. R <br /><em>*leave blank if not use</em>",, r3 A7 e" ?# g/ T) F* u" i
"id" => $shortname."_header_banner"," H1 r9 C2 n# e9 U" d
"type" => "textarea",
8 P+ A( K) f5 D8 l4 Q2 z- L "std" => "",
Z* }/ [. r8 z; {# p ),
, d/ _! S6 `, v# X$ h8 D1 ~" J% C7 q
array( "name" => "</div></div>",' W) u2 L! z- D. o
"type" => "close",
/ I( H1 |# R2 n* v ),2 b7 i+ n+ n5 K
& C% s" n: i( ?8 W+ Q
5 q8 a# R8 ?8 U$ ^& Z9 V# l
array( "name" => "Header Navigation Settings",3 T g! ~+ d# a3 L) m
"type" => "heading",
" {4 t5 x% D% J& w ),
! d$ X$ `% q0 m2 Z8 e& p! c) P9 [6 m9 `: Y1 W4 O
array( "name" => "Insert Page ID To Exclude On Header Navigation<br /># x7 g; z/ U/ m' Z) S
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br /> ~! m5 i* ^) u2 z* `3 l
<em>*Enter the page post ID number only</em><br />; x7 x3 @" e% q' {4 }
<em>*separate by comma</em><br />
4 O$ B& l8 o/ e: @' y3 v <em>*Exclude pages which you don't want to show on the header navigation</em>",; `; r2 j* @5 h# H
"id" => $shortname."_header_page_navigation",
+ `- j/ }# V5 g: q' m2 o# ~ "type" => "text",
. H5 P8 ]$ a! G: l( G "std" => "",
7 i- a. x1 B0 f9 p9 o ), k @: I$ G( @5 i2 @0 E, u
, o w4 A3 w% ]$ x4 } array( "name" => "</div></div>",0 G- ?) W* C! k
"type" => "close",
0 P4 f. S2 i" E s+ _! w( a ),% B% [2 F4 L6 X9 z4 |) k0 Q
7 A# Y% W- C* `" i# h
3 o5 }+ M a1 d* h7 ^6 e% Q array( "name" => "Post Auto Thumbnails Settings",
$ q* W2 |8 ~) L1 p7 c "type" => "heading",, A/ S: W1 x0 F
),
" V- E W* m( `. [4 | # ^0 A9 A% c# k* B; |8 J
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",5 o0 w% f; O2 V& Z" R4 j
"id" => $shortname."_timthumb_activate",
2 H+ m" `$ M3 d1 I4 k) J "type" => "select",
4 H- `! u1 X: X1 T: _) s, c "std" => "No",9 T6 e" d8 T! |1 V5 R
"options" => array("No", "Yes")),
' \& h& h a5 ^3 Y- r/ G) X9 w9 B3 ?6 @ * N. F- D' j- s
array( "name" => "If Timthumb is enabled, Please choose its cropping method",3 [. }+ w4 J. |9 ~
"id" => $shortname."_timthumb_cropping",
$ K. H5 [. |" L5 y "type" => "select",
% r3 c4 [% ?' W6 M4 ` "std" => "",
# K/ L! m6 u, t; o "options" => $crop_position),
! b2 z( U& N/ k
# B+ i$ ^. H4 a0 Z& y* s* S array( "name" => "Insert Width Of Thumbnail Image<br /> V5 @/ f7 r2 I$ c& g
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br /> y. @/ g2 e0 \8 K s8 F' B( V
<em>*Leave Blank To Use Default: 250</em><br />",9 Y& J5 G( p( I, G& B
"id" => $shortname."_thumb_width",5 W+ |3 I( j1 x9 O; W
"type" => "text",
6 c5 }# j( n7 T4 l! f" }/ Y3 J5 k "std" => "",
" { F: D V3 @ ~, W% _2 f ),
& Z2 i) W/ ]# H8 Q% Q7 q. S; D$ c- Z; D# M6 N# q
array( "name" => "Insert Height Of Thumbnail Image<br />
" W& C5 {: X4 I! a4 l, R <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
# G4 i; g2 G' O! T- h0 H5 O9 F <em>*Leave Blank To Use Default: 200</em><br />",
) ^. h6 o# [4 ?" R, g7 @ "id" => $shortname."_thumb_height",
2 u) L- D) @$ ?8 u9 ^5 \ "type" => "text",
; U" w9 \: x, r7 T/ B; C "std" => "",! V; S- k" [ Q$ K
),2 ], i# l& t" q. Z* W- R
6 y9 o! n6 v* _- _+ }* Y array( "name" => "</div></div>",
6 {2 L. r+ F0 G9 z; j$ A "type" => "close",
: ]9 `& ]8 w; |" H* B" l ),
' X3 x$ J! b) e* l$ p
0 O, I S4 \ \8 z array( "name" => "Featured Content Slider Settings",
7 P) h8 E# q b8 @- v; U "type" => "heading",* u; {; X7 L' ]- e7 B* O. l6 }
),* p6 u* Z3 W% B1 R5 W& C
+ p; L3 i3 L2 q. D
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",' i; X' C! K0 W. w4 U8 q* |+ K
"id" => $shortname."_featured_activate",3 c. h2 G% f# b5 j h8 M+ r5 X+ J
"type" => "select",
$ D, @7 M; {1 K5 X% j! |2 j1 x "std" => "No",
; S t3 t; O8 ?" R( t' I "options" => array("No", "Yes")),
: A" g$ K2 Z) ?' t* g3 C8 R
" X8 F5 ^0 E" b! m* J% m% P/ I* i0 `4 d! i& L4 x0 k0 l0 L
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
8 }5 y0 H9 W5 S0 p" t! X1 \ "id" => $shortname."_featured_category",
T1 T5 h0 l( l- }& }/ E3 H X$ {% E "type" => "select",
+ @0 d3 F) w: q7 V o "std" => "Choose a category:",
: L8 T1 Q9 E9 l* j, r" W- T0 B "options" => $wp_getcat),* w2 X3 R7 M" }4 Z j
( r! O) V+ C6 V% Y array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
+ f; L( I. F x3 e2 |6 k+ J' L1 [ "id" => $shortname."_featured_number",
- k1 n/ t! d- c9 t# O/ t "type" => "select",
2 y6 n% |5 g/ Q! Y- N' ~% x& n "std" => "Number of post:",
0 ~& d& c6 X4 I "options" => $number_entries),+ a+ w9 o* A5 L1 i$ k' J
9 Z& K5 D: T( a
array( "name" => "</div></div>",
% [" v" W" m3 V "type" => "close",8 X3 o" K z% V! m
),
& h# b1 w2 _1 t* Q
B2 C$ X! x+ B( P& ^& E' o7 ^6 M array( "name" => "Featured Category Settings",. @% C% v% e$ }6 W) H( ~
"type" => "heading",
7 h: F. O% ~" z2 R ),
! f* r, v- W+ b5 F6 e
6 f% ?/ O0 L7 F3 c; f6 E array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",1 ~/ |# v* ]3 r" ]+ d& {2 a; P
"id" => $shortname."_featured_category_activate",9 s+ D( t1 V3 f5 m1 K; a4 r
"type" => "select",
3 P) _* G2 m3 U4 [ A6 C3 t "std" => "No",; b- T& F5 u9 e4 u7 k$ K
"options" => array("No", "Yes")),
$ u. e d; r" r% w8 N+ ^, @. e% e
0 _" ?% Y2 J3 Q array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",: B; ]: m* e) W \
"id" => $shortname."_featured_category_id1",+ c- } b/ Z/ q, A+ U; N2 x
"type" => "select",: @5 l4 l5 x0 k
"std" => "Choose a category:",( I% n: |; m; t% Q- U$ D
"options" => $wp_getcat),
- W# Q3 f4 w0 Z4 e; w5 t8 l * `9 S+ C1 G" q# z% c" x' i3 {
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",' i% Y- {3 Z9 @& d& q# B
"id" => $shortname."_featured_number1",& Y' \% `+ x# {+ e' f8 A
"type" => "select",0 D/ b8 |0 \+ U1 b1 a7 I1 n
"std" => "Number of post:",
7 T) O& Y/ `" I "options" => $number_entries),
1 D% U' M2 P" Q( v S 2 i( @ y0 L" r
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",, X2 k* Q5 n3 W, D" I, @0 e. Q* m5 F
"id" => $shortname."_featured_category_id2",
9 I) M6 o7 k g: I "type" => "select",3 s/ x% v2 Z: H5 M# O. H! C
"std" => "Choose a category:",
+ x; Z$ e+ I( e; r" @ "options" => $wp_getcat),
# W& }; f8 {& ^3 j( N) ?# s) | 1 c- N9 C$ C: U6 Z4 J
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
) z& P3 [3 z1 Y+ i- y$ U6 x "id" => $shortname."_featured_number2",7 x+ h3 ]( i& d9 d$ M" n3 s3 C
"type" => "select",
9 m u9 i. }# v4 d! r- E "std" => "Number of post:",! @. Y; }0 u$ K' b6 ?
"options" => $number_entries),- j6 v8 S5 B/ |' d0 M
' d, b& i8 ~% e* }+ p! N7 Y
# q: R9 [, }( W array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",* s8 Y# W' L6 u( p9 o1 q
"id" => $shortname."_featured_category_id3",- t+ C/ m* B+ V+ |2 l& ?( L
"type" => "select",$ W, u5 ~3 o0 F$ v# P% m8 v/ [
"std" => "Choose a category:",5 E/ m |3 R5 p, k6 ^$ g
"options" => $wp_getcat),, ~! z" F5 n/ K% m
' G- @( ]* j$ b4 Z array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
7 i, k% x! _/ X* R+ T3 V! K "id" => $shortname."_featured_number3",
& Z* l7 ~6 ?: s( [; u2 ?. U "type" => "select",7 @* ^, [. B U; F" P
"std" => "Number of post:",
5 H- x: L1 B; C/ @% w' {, ? "options" => $number_entries),
, X' c. R% K2 n) P. r0 o3 g( V! }1 W6 g# U8 N ?' s
1 b8 ^5 s9 Z2 n2 Q9 b M# E array( "name" => "</div></div>",
8 f1 ?9 Y% p" `! J- J% Y$ K4 v/ I "type" => "close",
4 J- t" p4 f7 r2 N. y% s4 M ),
" U- F/ B& Q% h% ~/ q M6 m6 P0 h" C( C" [) Q; L% t$ K& J6 I
+ ?7 M5 p5 f9 _5 {2 F9 R
array( "name" => "Google Adsense & Analytics Settings",$ [: f( _+ _* @
"type" => "heading",& J. p/ A; T9 E
),# B+ B5 {0 C u& A" v% W
( V6 B% R% B! e" C
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",) E3 E! Y! h- P1 ?7 }" i E
"id" => $shortname."_adsense_loop_activate",
$ \ i# k1 e8 `$ U- W1 z "type" => "select",2 i( O0 J1 A+ z O
"std" => "Disable",) m! F8 V- d9 ~* S. O# [2 c! ~$ A
"options" => array("Disable", "Enable")),6 `. O: Z8 P5 w
0 s* I2 H6 G4 O, h2 H
array( "name" => "Insert Google Adsense Code For Loops Here<br />$ [/ k4 l( ] \% a
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",* c/ M$ t- `0 P* H3 N5 m
"id" => $shortname."_adsense_loop",1 P; z* o2 p2 x* d6 C. l3 S
"type" => "textarea",
7 B( r" O9 Y# c. [( | "std" => "",
, _& m& J6 u1 Z9 @+ o ),
1 w# P+ {$ g8 a+ j1 h! T3 {( o
2 `8 e/ P5 ]% ~# P* \9 Y6 u4 I: r array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
- r2 D9 r% Y4 a+ ]% A7 }: U "id" => $shortname."_adsense_single_activate",
1 {8 I- k- g3 E" G+ v- l) f "type" => "select",5 C K, u5 W0 n
"std" => "Disable",
3 B2 U7 |6 j7 d" Q- p; f "options" => array("Disable", "Enable")),
( ]! I D' U) j1 g2 |. |- [7 |
* b6 \. E! P* v7 F6 N array( "name" => "Insert Google Adsense Code For Single Page Here<br />- M$ A9 S+ `7 H' Z, t
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",% ^/ K0 {% d* k
"id" => $shortname."_adsense_single",/ z" }6 `! m+ t" H: v+ Q# p( k! g
"type" => "textarea",
. }# U4 ~# y! R "std" => "",
8 t: ~' U! e' J ),
: G1 {; J# _* c3 j, k1 }
; R* u1 P. f1 L* u% k% M
! u) y3 }4 y3 |. w# e: f- [ array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",
/ x4 E _+ J/ H- Q8 G% P! w5 v' H "id" => $shortname."_google_analytics",
- b7 Y* d" o- O1 [& O "type" => "textarea",1 M" k5 c, k' u+ v9 R& d! q: M' o
"std" => "",
a0 J0 f+ R* x# i/ b% ?$ R# K3 S2 ^ ),; G) Y1 A; g6 n
8 d8 ? R. G9 F9 e array( "name" => "</div></div>",* o( B1 z6 ]- D, C4 W' r- c
"type" => "close",/ M( C3 V+ U( P: e9 S9 g. u
),$ a0 D/ f% J, K% c* r
6 d; b- a, F, x6 j% n& S - ~: M) z4 R0 s; @5 v' E8 g
array( "name" => "AddThis Social Bookmarking Settings",$ A7 {" m3 z2 }( \; [: |
"type" => "heading",
+ U. F9 @+ e( H$ t: }. \ ),
# B% p: m1 ~$ {3 l2 x. y% w! o% P% Z+ f6 y9 `! |7 o' l
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
4 ]5 s0 m! k+ {0 I, W3 Y <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",8 v! \1 j6 g3 p, t
"id" => $shortname."_addthis",
, R( M$ X: b' ?: P8 J "type" => "text",
0 }5 K4 E% Y0 \! h "box" => "social",
5 d6 S5 B0 V2 K" z; _' o "std" => "",+ R t/ M* g/ Z- I8 G0 B: ]7 `
),0 z% c9 [% c1 G* R/ g, D
% v6 O0 v: M$ V. E7 b array( "name" => "</div></div>",
' |/ f* E0 r: R7 j' B "type" => "close",
( p* j! g1 G5 C+ P ),$ U S( }5 [2 u' `, O& c" M
1 j/ S1 B I) h0 k5 g
3 ]+ k( h a1 z; ^0 e, I3 }2 y
$ L7 ?4 P: U5 n* M+ f! n
array( "name" => "YouTube Video Settings",6 D( i2 x' x0 I2 n. T
"type" => "heading",5 v6 s. ~, O$ Z9 |1 J
),
% s8 N. K3 A! h3 a; V# [% M
( ~3 L+ b5 V+ B% h+ \2 s8 j6 A1 `: } array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",2 S. J1 O+ C, C" N: T5 T
"id" => $shortname."_emvideo_activate",
. o5 n* \) ?6 }5 E" ^7 a "type" => "select",, n; b2 l' t! f% ~' o# u
"std" => "No",
- C3 |3 {9 E) x "options" => array("No", "Yes")),
) J$ J# W, E# z" E0 z! |' Y- S9 f. W
, }6 ^8 Y, q! |( l# |5 F 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>",
! u. k! @: P1 s+ E8 c" R5 E& B "id" => $shortname."_emvideo",: k& L7 w4 j$ t2 l3 x: z8 O7 }& a
"std" => "",
2 C8 C" e3 u; k4 C: O2 i: I "type" => "text"),
- \# o6 V4 H, V" @) q1 f* |9 ^% `* {* q0 M$ R, D
array( "name" => "</div></div>",# ^' V/ h1 C- f
"type" => "close",
3 R# i0 O% B' L% w$ `1 R ),5 a% g6 g2 w) J; s, D
5 k3 P D) r; x( P& ]$ j array( "name" => "Twitter Settings",- u, L) i4 f" e# O
"type" => "heading",0 }) k0 m- @7 Y4 Y" J; W
),9 i! s6 K& W( Q/ P2 K7 w3 ^5 D
3 B5 L* D) w/ e4 K8 H5 S. X0 ?, v
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",. D% t* R6 J% {9 O
"id" => $shortname."_twitter_activate",/ T+ `3 r9 v# v# m( y
"type" => "select",$ U9 I V6 V9 j+ g4 K
"std" => "No",
* W8 I1 a1 E# q- y3 |. i8 h "options" => array("No", "Yes")),
; g; `8 C9 U \4 k
/ r) T3 T# P% Z3 @9 h- v& u array( "name" => "Insert Your Twitter ID here
" t& D6 ~+ ~2 O4 g2 X( P! p6 \ <br /><em>*leave blank if not necessary</em>9 E+ r6 g1 i$ E/ C% _- ]
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
d* ?6 K: f* e' S9 i( ]0 E "id" => $shortname."_twitter",
/ B5 F7 x' J m" J* N$ R' A "type" => "text",
% v5 q6 N' q" e, C2 n4 O/ x "box" => "social",% Z6 K7 [$ l% `* B
"std" => "",2 [8 H" _- T# L" N: l. x
),
3 z T& q5 A2 `' p7 Y, M4 i6 Y1 Z
) e6 o: ]/ ^6 B4 H+ @( I array( "name" => "Enter Twitter Feed Count here( r4 |# K4 _; E! M9 s+ K- V5 e
<br /><em>*leave blank if not necessary</em>
4 ~$ v* B$ @3 x <br /><em>*Enter How Many Twitter Feed To Display</em>",
% K7 B0 t) T# R' B' ~* T "id" => $shortname."_twitter_count",5 m( H. V5 d5 f
"type" => "text",
' G/ M9 b- a: d, B "box" => "social",
9 l* P# f# M9 ~2 P, Y: X* R; ?' | "std" => "",
3 t1 x: Z, D" N8 ?/ Y ),
% `' z. q. g6 V8 `4 b( z- x0 G6 r7 e1 D* U0 K/ t
array( "name" => "</div></div>",
4 k4 Z: q B4 m& E; ]3 N" x# [" \ "type" => "close",. y" n1 s7 ]3 [1 O( Y3 U
),: y c- J8 O: r
) b: u. ?2 E- E! ~7 b1 q/ O. A
0 w+ ~7 X" b* _+ N. j, k4 e array( "name" => "125 x 125 Banners Advertisement Settings",4 S# u, ?& c# d+ E6 z1 L
"type" => "heading",
2 }* v' x/ @5 }- d3 x) l ),+ W" E; y, O3 H5 a% i- c9 }/ v
4 y% Q& P7 q3 D d) i
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",% P) f) [, q+ N3 Y
"id" => $shortname."_sponsor_activate",
0 Z: M% Z/ z& ~ "type" => "select",- E' Z8 p5 W6 O5 A: c! e
"std" => "No",; Z6 [( V$ x( C4 ^% k$ L. _' L; o
"options" => array("No", "Yes")),
# D! m3 a9 `. `" m, X
' I- c' J! n$ f3 A# i7 w/ F; y" r% N7 ]
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",* ]2 e9 E" ^5 ?( i
"id" => $shortname."_sponsor_banner_one",$ _+ F5 [7 J! i4 t) M
"type" => "textarea",
* r. z& w5 [1 W' Y0 u "std" => "",
( T8 Y2 m; s) \5 n ),
% ~! J$ @* O* G7 g" f; ~, e) C. s9 R7 w f% `( ]# l0 I% I( Y
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",/ {' z: h$ Z3 Y- k
"id" => $shortname."_sponsor_banner_two",
: h7 O+ M C% a8 e "type" => "textarea",8 B0 g& T5 Y j
"std" => "",4 ?2 c$ _: V: y
),
, G5 U2 b. P4 K* z; [) i% }3 N, H" g- f
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
/ {. U" A( |0 L" }1 j3 R* u "id" => $shortname."_sponsor_banner_three",6 i0 ^2 R: W8 `* A3 B3 L# ^, L& _
"type" => "textarea",4 D9 e3 X- W8 W' a
"std" => "",3 J2 Z+ P& k- K9 o; q
),
# j7 h; ^1 r- b7 t3 S) Y) m$ W6 \" K( E9 K1 b
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",% D l0 i# d/ \5 P/ a% p/ U. T% w' Y
"id" => $shortname."_sponsor_banner_four",
* h2 q2 F4 z0 G) h2 q2 F s3 E "type" => "textarea", W _2 P7 a3 M8 B
"std" => "",- R7 u; k1 s* W2 |: q9 u
),
4 X6 G* {9 p2 g2 p+ K v+ A' k' e3 ? V& ^, b: ]
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
4 t3 h4 f# s# u+ T) r P: Q "id" => $shortname."_sponsor_banner_five",
% K: }3 i+ d5 z7 O" B "type" => "textarea",) Y# x4 o" w; L( \0 }. b
"std" => "",
. J3 C N+ v" Q( j. U7 v# B! l ),6 ~; ~7 k4 ]9 A4 W- y+ R; A* Z& `
& r. c, d% W. b$ I. {" n' S6 i& H' v array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
$ Y4 O9 T) v0 j& Z* `& Q7 X& u "id" => $shortname."_sponsor_banner_six",9 |5 j" r. H, o# V
"type" => "textarea",
: d2 U) P: X+ ?" }6 J1 y "std" => "",
" T' N& D: s4 ~. M' q ),( I7 [" R& O0 K& F* Z8 o$ B
$ S+ d' a" o, Y
array( "name" => "</div></div>",5 g2 O/ I1 X1 E2 F9 C# b% M3 f
"type" => "close",9 b( ?* e6 _& {) V$ ~' E
),, K v8 d' x2 n* v- \* w! n; z
2 ~/ J) A s" P9 ]8 p! y6 B$ s
7 a$ f3 E5 N! ?/ \, K* K2 B7 W
# E; N: |9 F+ R2 ]3 I9 a);
9 H" t( W) X8 v& }6 m7 c
4 E# J6 M& w* V9 i4 |function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {" ]0 q+ n- t7 ~/ @
- {8 h- I& W9 I; U3 a, g5 qecho "<div id=\"admin-options\"> ";
: D7 J. M- F( K* x3 B
3 o) |* a/ Q$ B' E% ~# Qglobal $themename, $shortname, $options;- r( \6 D6 A7 | E
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';; W* T) ?: ~9 M- l
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';5 l# y" T" W2 X
?>
4 D _0 R8 o5 D$ w0 Z
4 B7 J$ P/ V' C" T2 x/ Z<h4><?php echo "$themename"; ?> Theme Options</h4>
# }1 l$ t/ z2 h$ N0 O
: R) K; H' Q+ y, G4 _$ @<div class="annouce">2 A+ z5 H/ P" ]& b2 C
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
- L: z7 F6 z- @$ v$ d<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>
+ z$ X& e1 o$ g( Q" v5 T</div>8 V& M. N3 h6 W+ \
& A, r2 _) b$ f; V<form action="" method="post">4 ?. G. M# A; V$ D8 b% l Y3 o2 _
" }8 z: c4 R" h7 |4 p
<?php foreach ($options as $value) { ?>& d* l/ u% J/ d4 w
/ u; Y8 r" ]: u0 _! n* O3 H- R<?php switch ( $value['type'] ) { case 'heading': ?>
& F7 w9 g! W9 H) z6 N3 X4 C
+ i' W- O: B( \<div class="get-option">0 w8 _/ O+ ~# T2 u
) E( r, H# e3 r: x& I
<h2><?php echo $value['name']; ?></h2>/ a0 @0 |; Z2 e9 O) L- r
7 z( f- e+ ?0 {4 _6 f9 s
<div class="option-save">/ W8 b3 f) M9 a; W
( d* X; `" e" e3 A/ F
<?php
$ V7 V. ^$ D* _$ cbreak;
( |8 r8 s) a: {case 'text':) G3 x8 J5 e7 W9 H
?>
1 p' a. @" R4 I& i2 \4 v9 [# p; p
1 D0 k( N' ^0 @4 g6 ?<div class="description"><?php echo $value['name']; ?></div>- W" Y, B1 e% B" W+ _
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ($ f4 }7 u7 v+ o3 g
; `1 j; s, v) T: J) |get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
9 u4 k- ~* ^7 S } M% Q+ C5 s/ C
<?php
' l" ~& ?. d2 _break;7 ^3 ^& ]/ ]% n8 Q/ e8 d* i
case 'select':
$ Q* A- m( s* s6 {& n1 r1 |3 m?> N& m. |3 N9 o# d) Y
: g3 h: Z, n) |3 D3 W# }<div class="description"><?php echo $value['name']; ?></div>
+ H. e1 Z y. j$ w& S5 e<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">% z9 }/ `% A8 o9 E, w; W
<?php foreach ($value['options'] as $option) { ?>
+ y9 t5 m6 Y0 T: {3 z7 f3 H4 g8 P<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>% ?( y. L2 O0 i6 M; V
<?php } ?> ~2 A/ i1 T) \$ C; U
</select>8 b' T+ g7 M1 ]" R" z! i6 w' k4 ?
</p>
' n: {. i: `& I& D* L/ I6 G$ d6 K* H0 b: `- T6 M! F
<?php
2 f& c: y, \! b, [break;
; r( X1 q9 u- r$ r+ Rcase 'textarea':
' a- e8 h9 U' J) [/ r ?$valuex = $value['id'];
7 c: {5 V1 j9 p6 e$ B& z$ G& q( g$valuey = stripslashes($valuex);
( j: p; A# N7 g$ ^0 D' w$video_code = get_settings($valuey);& a1 H: A3 D5 C' J, ^6 G
?>
0 s( o2 D3 W4 Z- W: A
8 ^( n4 b- t& C$ J<div class="description"><?php echo $value['name']; ?></div>+ M, z( O7 n3 @( X m3 i) K
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }9 p' s/ p$ ?, \6 k3 [8 R: V
" T6 Y1 p3 R+ f5 J# s5 E$ }else { echo $value['std']; } ?></textarea></p>' L$ p) r$ Z; U- {
9 U+ j( ]# A2 L<?php
) e# x" g7 q6 Q+ pbreak;
$ }" [& r! Y. M, E$ S! P- [' Tcase 'close':2 v! L+ J) {" H. K( }
?>, T4 v4 u* n e2 |
1 E; @+ N! d3 \
<div class="clearfix"></div>
' n! q" m- ~$ c# i0 \</div><!-- OPTION SAVE END -->" x- Z0 N6 g& Y- N/ {( d
7 W- I8 r7 g U
<div class="clearfix"></div>
9 N2 @1 ^5 x. z: C8 z9 S* o</div><!-- GET OPTION END -->
7 o9 \6 J( x; V. `9 n& b# K3 E- d5 m3 Y
+ h0 Y: b' O- J+ |0 G! @<?php: j3 n) k+ \) k. Q A) S/ w
break;
( V | q; a4 P Y- n8 k0 v/ w( Edefault;
8 q( p7 y! A9 R9 n1 E4 A?>6 ?" C" J d- Z6 G; r" _- ?4 H
( O" S4 O) o+ a9 U
* J! y- j0 \% i e3 o. N: `8 N2 m<?php
) ^/ ~, W8 ^. V& @! K' A% N. Bbreak; } ?>
4 Y: ? C" Y! |6 n3 a. s
& v- X) {- E$ L# |<?php } ?>
8 b6 \+ h2 ]% k% A. w6 [5 _% h9 i; t( z% m
<p class="save-p"># I$ N! T$ o) x8 ~( U: x
<input name="save" type="submit" class="sbutton" value="Save Options" />
' w- f4 V( p% G; d0 ^- X; T<input type="hidden" name="action" value="save" />
! P7 {5 O' [8 ?) }</p>
: k4 J: c6 Z8 I4 M, P7 u/ Z1 i</form>
. D; L' S* T) o* R( Q% e
! D1 v* w+ ~4 W" v0 z7 u# _8 p<form method="post">1 y/ D% c% N7 O5 V0 m l/ j0 g$ M
<p class="save-p">& E; J6 K1 x0 m
<input name="reset" type="submit" class="sbutton" value="Reset Options" />
7 @7 D$ L3 z, G! y<input type="hidden" name="action" value="reset" />
) C) O2 n/ p6 z# q</p>
8 E, b1 l( D8 x* E+ P/ f$ O</form>
( Q; }; ]6 y- a& U ~: X
* _+ V1 B- [2 |# \: ?</div><!-- ADMIN OPTIONS END -->$ B5 M) `2 }0 D7 S
$ n! }. S# O# H; q<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }- J5 B) Y& E. o* Z4 r
E3 y- T) P1 a/ Ffunction mytheme_admin_register() {
/ S& {9 e" ?. k! K* Fglobal $themename, $shortname, $options;
- W) G/ e3 K# q; o' T% zif ( $_GET['page'] == basename(__FILE__) ) {
0 p0 q9 c1 m6 E$ r4 x6 Jif ( 'save' == $_REQUEST['action'] ) {7 z( D6 m0 ^( e5 q3 S) L6 @
foreach ($options as $value) {! ]1 X8 }: {. b, f
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }' g, }* r. b8 i1 ^
foreach ($options as $value) {
2 T3 L; g5 q. a$ T0 h' @. M* zif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
. S/ L4 q- A s! b- ]% E( Mheader("Location: themes.php?page=functions.php&saved=true");3 K5 a% x$ h8 W) T
die;+ k. c7 |7 F3 H3 X& ]
} else if( 'reset' == $_REQUEST['action'] ) {; D/ C n) F$ @' [- `
foreach ($options as $value) {1 i- b6 e$ X8 b2 J0 B
delete_option( $value['id'] ); }
' {3 J4 m( B/ Y3 Bheader("Location: themes.php?page=functions.php&reset=true");
( z- x; Q) u! j; K. Ddie;* H1 V% p+ D: _" X& r
}6 b5 q+ a4 a5 T4 h
}6 {( b( ]+ |! G4 U% E$ H9 R+ M
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');8 Y* L$ T+ f* V2 Q3 d' j* H
}; Y9 ~, X! q! |+ G" O$ Q" [- h% {
. A' w8 K! f! q- ]! E w
function mytheme_admin_head() { ?>
r! k$ L$ A. x) q i- C) @<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
y* W( \% n% [1 M1 V0 h2 t7 R<?php }
0 `7 F' s$ p' F+ Q |
|