|
|

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