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