|

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