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