|
|

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