|
|

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