|
|

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