|
|

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