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