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