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