|
|

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