|
|

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