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